-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1221 from ds-wizard/release/4.10.0
Release 4.10.0
- Loading branch information
Showing
95 changed files
with
2,791 additions
and
511 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
engine-shared/elm/Shared/Data/Event/AddQuestionItemSelectEventData.elm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
module Shared.Data.Event.AddQuestionItemSelectEventData exposing | ||
( AddQuestionItemSelectEventData | ||
, decoder | ||
, encode | ||
, toQuestion | ||
) | ||
|
||
import Json.Decode as D exposing (Decoder) | ||
import Json.Decode.Pipeline as D | ||
import Json.Encode as E | ||
import Json.Encode.Extra as E | ||
import Shared.Data.KnowledgeModel.Annotation as Annotation exposing (Annotation) | ||
import Shared.Data.KnowledgeModel.Question exposing (Question(..)) | ||
|
||
|
||
type alias AddQuestionItemSelectEventData = | ||
{ title : String | ||
, text : Maybe String | ||
, requiredPhaseUuid : Maybe String | ||
, tagUuids : List String | ||
, listQuestionUuid : Maybe String | ||
, annotations : List Annotation | ||
} | ||
|
||
|
||
decoder : Decoder AddQuestionItemSelectEventData | ||
decoder = | ||
D.succeed AddQuestionItemSelectEventData | ||
|> D.required "title" D.string | ||
|> D.required "text" (D.nullable D.string) | ||
|> D.required "requiredPhaseUuid" (D.nullable D.string) | ||
|> D.required "tagUuids" (D.list D.string) | ||
|> D.required "listQuestionUuid" (D.nullable D.string) | ||
|> D.required "annotations" (D.list Annotation.decoder) | ||
|
||
|
||
encode : AddQuestionItemSelectEventData -> List ( String, E.Value ) | ||
encode data = | ||
[ ( "questionType", E.string "IntegrationQuestion" ) | ||
, ( "title", E.string data.title ) | ||
, ( "text", E.maybe E.string data.text ) | ||
, ( "requiredPhaseUuid", E.maybe E.string data.requiredPhaseUuid ) | ||
, ( "tagUuids", E.list E.string data.tagUuids ) | ||
, ( "listQuestionUuid", E.maybe E.string data.listQuestionUuid ) | ||
, ( "annotations", E.list Annotation.encode data.annotations ) | ||
] | ||
|
||
|
||
toQuestion : String -> AddQuestionItemSelectEventData -> Question | ||
toQuestion uuid data = | ||
ItemSelectQuestion | ||
{ uuid = uuid | ||
, title = data.title | ||
, text = data.text | ||
, requiredPhaseUuid = data.requiredPhaseUuid | ||
, tagUuids = data.tagUuids | ||
, referenceUuids = [] | ||
, expertUuids = [] | ||
, annotations = data.annotations | ||
} | ||
{ listQuestionUuid = Nothing | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.