Skip to content

Commit e72db76

Browse files
committed
Add Plugin, remove ApiLegacy and Widget integration
1 parent ae10169 commit e72db76

File tree

58 files changed

+259
-1313
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+259
-1313
lines changed

registry-server/package.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ tests:
106106
- case-insensitive
107107
- containers
108108
- data-default
109-
- ginger
110109
- http-types
111110
- mtl
112111
- monad-control

shared-common/package.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ library:
4141
- directory
4242
- exceptions
4343
- fsutils
44-
- ginger
4544
- hashable
4645
- http-client
4746
- http-client-tls

shared-common/src/Shared/Common/Util/Ginger.hs

Lines changed: 0 additions & 167 deletions
This file was deleted.
Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,3 @@
1-
{-# LANGUAGE StandaloneDeriving #-}
2-
31
module Shared.Common.Util.Hashable where
42

5-
import Data.Hashable
6-
import Data.Time
7-
import GHC.Generics
8-
9-
deriving instance Generic Day
10-
11-
instance Hashable Day
12-
13-
deriving instance Generic LocalTime
14-
15-
instance Hashable LocalTime
16-
17-
deriving instance Generic TimeOfDay
18-
19-
instance Hashable TimeOfDay
20-
21-
deriving instance Generic TimeZone
22-
23-
instance Hashable TimeZone
24-
25-
instance Hashable DiffTime where
26-
hashWithSalt s = (hashWithSalt s :: Double -> Int) . realToFrac
27-
28-
deriving instance Generic UTCTime
29-
30-
instance Hashable UTCTime
31-
32-
deriving instance Eq ZonedTime
33-
34-
deriving instance Generic ZonedTime
35-
36-
instance Hashable ZonedTime
3+
import Data.Aeson ()

shared-common/src/Shared/KnowledgeModel/Api/Resource/KnowledgeModel/Event/Integration/IntegrationEventJM.hs

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ instance FromJSON AddIntegrationEvent where
1717
integrationType <- o .: "integrationType"
1818
case integrationType of
1919
"ApiIntegration" -> parseJSON (Object o) >>= \event -> return (AddApiIntegrationEvent' event)
20-
"ApiLegacyIntegration" -> parseJSON (Object o) >>= \event -> return (AddApiLegacyIntegrationEvent' event)
21-
"WidgetIntegration" -> parseJSON (Object o) >>= \event -> return (AddWidgetIntegrationEvent' event)
20+
"PluginIntegration" -> parseJSON (Object o) >>= \event -> return (AddPluginIntegrationEvent' event)
2221
_ -> fail "One of the events has unsupported integrationType"
2322
parseJSON _ = mzero
2423

@@ -30,18 +29,11 @@ instance ToJSON AddApiIntegrationEvent where
3029
toJSON = toJSONWithAdditionalData [("integrationType", "ApiIntegration")]
3130

3231
-- --------------------------------------------
33-
instance FromJSON AddApiLegacyIntegrationEvent where
32+
instance FromJSON AddPluginIntegrationEvent where
3433
parseJSON = genericParseJSON jsonOptions
3534

36-
instance ToJSON AddApiLegacyIntegrationEvent where
37-
toJSON = toJSONWithAdditionalData [("integrationType", "ApiLegacyIntegration")]
38-
39-
-- --------------------------------------------
40-
instance FromJSON AddWidgetIntegrationEvent where
41-
parseJSON = genericParseJSON jsonOptions
42-
43-
instance ToJSON AddWidgetIntegrationEvent where
44-
toJSON = toJSONWithAdditionalData [("integrationType", "WidgetIntegration")]
35+
instance ToJSON AddPluginIntegrationEvent where
36+
toJSON = toJSONWithAdditionalData [("integrationType", "PluginIntegration")]
4537

4638
-- --------------------------------------------
4739
-- --------------------------------------------
@@ -53,8 +45,7 @@ instance FromJSON EditIntegrationEvent where
5345
integrationType <- o .: "integrationType"
5446
case integrationType of
5547
"ApiIntegration" -> parseJSON (Object o) >>= \event -> return (EditApiIntegrationEvent' event)
56-
"ApiLegacyIntegration" -> parseJSON (Object o) >>= \event -> return (EditApiLegacyIntegrationEvent' event)
57-
"WidgetIntegration" -> parseJSON (Object o) >>= \event -> return (EditWidgetIntegrationEvent' event)
48+
"PluginIntegration" -> parseJSON (Object o) >>= \event -> return (EditPluginIntegrationEvent' event)
5849
_ -> fail "One of the events has unsupported integrationType"
5950
parseJSON _ = mzero
6051

@@ -66,15 +57,8 @@ instance ToJSON EditApiIntegrationEvent where
6657
toJSON = toJSONWithAdditionalData [("integrationType", "ApiIntegration")]
6758

6859
-- --------------------------------------------
69-
instance FromJSON EditApiLegacyIntegrationEvent where
70-
parseJSON = genericParseJSON jsonOptions
71-
72-
instance ToJSON EditApiLegacyIntegrationEvent where
73-
toJSON = toJSONWithAdditionalData [("integrationType", "ApiLegacyIntegration")]
74-
75-
-- --------------------------------------------
76-
instance FromJSON EditWidgetIntegrationEvent where
60+
instance FromJSON EditPluginIntegrationEvent where
7761
parseJSON = genericParseJSON jsonOptions
7862

79-
instance ToJSON EditWidgetIntegrationEvent where
80-
toJSON = toJSONWithAdditionalData [("integrationType", "WidgetIntegration")]
63+
instance ToJSON EditPluginIntegrationEvent where
64+
toJSON = toJSONWithAdditionalData [("integrationType", "PluginIntegration")]

shared-common/src/Shared/KnowledgeModel/Api/Resource/KnowledgeModel/Event/Integration/IntegrationEventSM.hs

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,8 @@ instance ToSchema AddIntegrationEvent
1515
instance ToSchema AddApiIntegrationEvent where
1616
declareNamedSchema = toSwaggerWithType "eventType" a_km1_ir
1717

18-
instance ToSchema AddApiLegacyIntegrationEvent where
19-
declareNamedSchema = toSwaggerWithType "eventType" a_km1_iop
20-
21-
instance ToSchema AddWidgetIntegrationEvent where
22-
declareNamedSchema = toSwaggerWithType "eventType" a_km1_iwp
18+
instance ToSchema AddPluginIntegrationEvent where
19+
declareNamedSchema = toSwaggerWithType "eventType" a_km1_io
2320

2421
-- --------------------------------------------
2522
-- --------------------------------------------
@@ -28,13 +25,10 @@ instance ToSchema EditIntegrationEvent
2825
instance ToSchema EditApiIntegrationEvent where
2926
declareNamedSchema = toSwaggerWithType "eventType" e_km1_ir
3027

31-
instance ToSchema EditApiLegacyIntegrationEvent where
32-
declareNamedSchema = toSwaggerWithType "eventType" e_km1_iop
33-
34-
instance ToSchema EditWidgetIntegrationEvent where
35-
declareNamedSchema = toSwaggerWithType "eventType" e_km1_iwp
28+
instance ToSchema EditPluginIntegrationEvent where
29+
declareNamedSchema = toSwaggerWithType "eventType" e_km1_io
3630

3731
-- --------------------------------------------
3832
-- --------------------------------------------
3933
instance ToSchema DeleteIntegrationEvent where
40-
declareNamedSchema = toSwaggerWithType "eventType" d_km1_iop
34+
declareNamedSchema = toSwaggerWithType "eventType" d_km1_ir

shared-common/src/Shared/KnowledgeModel/Api/Resource/KnowledgeModel/KnowledgeModelJM.hs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,7 @@ instance FromJSON Integration where
222222
referenceType <- o .: "integrationType"
223223
case referenceType of
224224
"ApiIntegration" -> parseJSON (Object o) >>= \event -> return (ApiIntegration' event)
225-
"ApiLegacyIntegration" -> parseJSON (Object o) >>= \event -> return (ApiLegacyIntegration' event)
226-
"WidgetIntegration" -> parseJSON (Object o) >>= \event -> return (WidgetIntegration' event)
225+
"PluginIntegration" -> parseJSON (Object o) >>= \event -> return (PluginIntegration' event)
227226
_ -> fail "One of the integrations has unsupported integrationType"
228227
parseJSON _ = mzero
229228

@@ -278,15 +277,8 @@ instance FromJSON RequestFailedTypeHintResponse where
278277
parseJSON = genericParseJSON (jsonOptionsWithTypeField "responseType")
279278

280279
-- --------------------------------------------------------------------
281-
instance ToJSON ApiLegacyIntegration where
280+
instance ToJSON PluginIntegration where
282281
toJSON = genericToJSON (jsonOptionsWithTypeField "integrationType")
283282

284-
instance FromJSON ApiLegacyIntegration where
285-
parseJSON = genericParseJSON (jsonOptionsWithTypeField "integrationType")
286-
287-
-- --------------------------------------------------------------------
288-
instance ToJSON WidgetIntegration where
289-
toJSON = genericToJSON (jsonOptionsWithTypeField "integrationType")
290-
291-
instance FromJSON WidgetIntegration where
283+
instance FromJSON PluginIntegration where
292284
parseJSON = genericParseJSON (jsonOptionsWithTypeField "integrationType")

shared-common/src/Shared/KnowledgeModel/Api/Resource/KnowledgeModel/KnowledgeModelSM.hs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ module Shared.KnowledgeModel.Api.Resource.KnowledgeModel.KnowledgeModelSM where
22

33
import Data.Swagger hiding (Reference, Tag)
44

5+
import Shared.Common.Api.Resource.Common.AesonSM ()
56
import Shared.Common.Api.Resource.Common.MapEntrySM ()
67
import Shared.Common.Util.Swagger
78
import Shared.KnowledgeModel.Api.Resource.KnowledgeModel.KnowledgeModelJM ()
@@ -154,9 +155,5 @@ instance ToSchema RequestFailedTypeHintResponse where
154155
declareNamedSchema = toSwagger requestFailedTypeHintResponse1
155156

156157
-- --------------------------------------------------------------------
157-
instance ToSchema ApiLegacyIntegration where
158-
declareNamedSchema = toSwaggerWithType "integrationType" bioPortal
159-
160-
-- --------------------------------------------------------------------
161-
instance ToSchema WidgetIntegration where
162-
declareNamedSchema = toSwaggerWithType "integrationType" widgetPortal
158+
instance ToSchema PluginIntegration where
159+
declareNamedSchema = toSwaggerWithType "integrationType" orcidPluginIntegration

shared-common/src/Shared/KnowledgeModel/Database/Migration/Development/KnowledgeModel/Data/AnswersAndFollowUpQuestions.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ q4_it1_q6_aYes_followUpQuestion5 =
334334
, tagUuids = []
335335
, referenceUuids = []
336336
, expertUuids = []
337-
, integrationUuid = FI.ontologyPortal.uuid
337+
, integrationUuid = FI.repositoryApi.uuid
338338
, variables = Map.fromList [("domain", "biology"), ("country", "be")]
339339
}
340340

@@ -353,7 +353,7 @@ q4_it1_q6_aYes_fuq5VariablesEdited =
353353
, referenceUuids = q4_it1_q6_aYes_followUpQuestion5.referenceUuids
354354
, expertUuids = q4_it1_q6_aYes_followUpQuestion5.expertUuids
355355
, integrationUuid = q4_it1_q6_aYes_followUpQuestion5.integrationUuid
356-
, variables = Map.fromList [("domain", "biology"), ("language", "")]
356+
, variables = Map.fromList [("country", "be"), ("domain", "biology"), ("language", "")]
357357
}
358358

359359
q4_it1_q6_aYes_fuq5ConvertedToValue' :: Question

0 commit comments

Comments
 (0)