Skip to content

Commit

Permalink
Merge pull request #1201 from ds-wizard/release/4.9.0
Browse files Browse the repository at this point in the history
Release 4.9.0
  • Loading branch information
janslifka authored Aug 6, 2024
2 parents 701cabd + 711564a commit 306b8f0
Show file tree
Hide file tree
Showing 77 changed files with 1,773 additions and 370 deletions.
1 change: 1 addition & 0 deletions .github/workflows/registry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ jobs:
with:
images: |
${{ env.PUBLIC_IMAGE_PREFIX }}/${{ env.IMAGE_NAME }}
${{ secrets.DOCKER_HUB_USERNAME }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
type=semver,pattern={{version}}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/wizard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ jobs:
with:
images: |
${{ env.PUBLIC_IMAGE_PREFIX }}/${{ env.IMAGE_NAME }}
${{ secrets.DOCKER_HUB_USERNAME }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
type=semver,pattern={{version}}
Expand Down
15 changes: 11 additions & 4 deletions engine-registry/elm/Registry/Components/AboutModal.elm
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,21 @@ viewAboutModalContent appState serverBuildInfo =
[ text swaggerUrl ]
)
]

viewComponentVersion component =
viewBuildInfo appState component.name component []

componentVersions =
List.map viewComponentVersion (List.sortBy .name serverBuildInfo.components)
in
div []
[ viewBuildInfo appState (gettext "Client" appState.locale) BuildInfo.client []
, viewBuildInfo appState (gettext "Server" appState.locale) serverBuildInfo extraServerInfo
]
(viewBuildInfo appState (gettext "Client" appState.locale) BuildInfo.client []
:: viewBuildInfo appState (gettext "Server" appState.locale) serverBuildInfo extraServerInfo
:: componentVersions
)


viewBuildInfo : AppState -> String -> BuildInfo -> List ( String, Html msg ) -> Html msg
viewBuildInfo : AppState -> String -> { a | version : String, builtAt : String } -> List ( String, Html msg ) -> Html msg
viewBuildInfo appState name buildInfo extra =
let
viewExtraRow ( title, value ) =
Expand Down
4 changes: 2 additions & 2 deletions engine-registry/scss/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ a:not([class]) {
}

&:hover {
color: var(--bs-primary);

.fas {
color: var(--bs-primary);
}

color: var(--bs-primary);
}
}
}
Expand Down
25 changes: 25 additions & 0 deletions engine-shared/elm/Shared/Api/CommentThreads.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module Shared.Api.CommentThreads exposing (getCommentThreads)

import Shared.AbstractAppState exposing (AbstractAppState)
import Shared.Api exposing (ToMsg, jwtGet)
import Shared.Data.Pagination as Pagination exposing (Pagination)
import Shared.Data.PaginationQueryFilters as PaginationQueryFilters exposing (PaginationQueryFilters)
import Shared.Data.PaginationQueryString as PaginationQueryString exposing (PaginationQueryString)
import Shared.Data.QuestionnaireCommentThreadAssigned as QuestionnaireCommentThreadAssigned exposing (QuestionnaireCommentThreadAssigned)


getCommentThreads : PaginationQueryFilters -> PaginationQueryString -> AbstractAppState a -> ToMsg (Pagination QuestionnaireCommentThreadAssigned) msg -> Cmd msg
getCommentThreads filters qs =
let
extraParams =
PaginationQueryString.filterParams
[ ( "resolved", PaginationQueryFilters.getValue "resolved" filters )
]

queryString =
PaginationQueryString.toApiUrlWith extraParams qs

url =
"/comment-threads" ++ queryString
in
jwtGet url (Pagination.decoder "commentThreads" QuestionnaireCommentThreadAssigned.decoder)
14 changes: 14 additions & 0 deletions engine-shared/elm/Shared/Api/Questionnaires.elm
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ module Shared.Api.Questionnaires exposing
, getQuestionnaireQuestionnaire
, getQuestionnaireSettings
, getQuestionnaireSuggestions
, getQuestionnaireUserSuggestions
, getQuestionnaireVersions
, getQuestionnaires
, getSummaryReport
Expand Down Expand Up @@ -58,6 +59,8 @@ import Shared.Data.QuestionnaireSuggestion as QuestionnaireSuggestion exposing (
import Shared.Data.QuestionnaireVersion as QuestionnaireVersion exposing (QuestionnaireVersion)
import Shared.Data.SummaryReport as SummaryReport exposing (SummaryReport)
import Shared.Data.UrlResponse as UrlResponse exposing (UrlResponse)
import Shared.Data.UserSuggestion as UserSuggestion exposing (UserSuggestion)
import Shared.Utils exposing (boolToString)
import String.Extra as String
import Uuid exposing (Uuid)

Expand Down Expand Up @@ -141,6 +144,17 @@ putQuestionnaireShare uuid =
jwtPut ("/questionnaires/" ++ Uuid.toString uuid ++ "/share")


getQuestionnaireUserSuggestions : Uuid -> Bool -> String -> AbstractAppState a -> ToMsg (Pagination UserSuggestion) msg -> Cmd msg
getQuestionnaireUserSuggestions questionnaireUuid editor query =
let
queryString =
PaginationQueryString.fromQ query
|> PaginationQueryString.withSize (Just 10)
|> PaginationQueryString.toApiUrlWith [ ( "editor", boolToString editor ) ]
in
jwtGet ("/questionnaires/" ++ Uuid.toString questionnaireUuid ++ "/users/suggestions" ++ queryString) (Pagination.decoder "users" UserSuggestion.decoder)


getQuestionnaireMigration : Uuid -> AbstractAppState a -> ToMsg QuestionnaireMigration msg -> Cmd msg
getQuestionnaireMigration uuid =
jwtGet ("/questionnaires/" ++ Uuid.toString uuid ++ "/migrations/current") QuestionnaireMigration.decoder
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
module Shared.Data.QuestionnaireCommentThreadAssigned exposing
( QuestionnaireCommentThreadAssigned
, decoder
)

import Json.Decode as D exposing (Decoder)
import Json.Decode.Extra as D
import Json.Decode.Pipeline as D
import Shared.Data.UserSuggestion as UserSuggestion exposing (UserSuggestion)
import Time
import Uuid exposing (Uuid)


type alias QuestionnaireCommentThreadAssigned =
{ commentThreadUuid : Uuid
, createdBy : Maybe UserSuggestion
, path : String
, private : Bool
, questionnaireName : String
, questionnaireUuid : Uuid
, resolved : Bool
, text : String
, updatedAt : Time.Posix
}


decoder : Decoder QuestionnaireCommentThreadAssigned
decoder =
D.succeed QuestionnaireCommentThreadAssigned
|> D.required "commentThreadUuid" Uuid.decoder
|> D.required "createdBy" (D.maybe UserSuggestion.decoder)
|> D.required "path" D.string
|> D.required "private" D.bool
|> D.required "questionnaireName" D.string
|> D.required "questionnaireUuid" Uuid.decoder
|> D.required "resolved" D.bool
|> D.required "text" D.string
|> D.required "updatedAt" D.datetime
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Shared.Data.QuestionnaireDetail.CommentThread exposing (CommentThread, compare, decoder, isAuthor)
module Shared.Data.QuestionnaireDetail.CommentThread exposing (CommentThread, commentCount, compare, decoder, isAssigned, isAuthor)

import Json.Decode as D exposing (Decoder)
import Json.Decode.Extra as D
Expand All @@ -18,6 +18,7 @@ type alias CommentThread =
, private : Bool
, createdAt : Time.Posix
, createdBy : Maybe UserSuggestion
, assignedTo : Maybe UserSuggestion
}


Expand All @@ -30,6 +31,7 @@ decoder =
|> D.required "private" D.bool
|> D.required "createdAt" D.datetime
|> D.required "createdBy" (D.maybe UserSuggestion.decoder)
|> D.required "assignedTo" (D.maybe UserSuggestion.decoder)


isAuthor : Maybe { u | uuid : Uuid } -> CommentThread -> Bool
Expand All @@ -44,3 +46,13 @@ isAuthor user commentThread =
compare : CommentThread -> CommentThread -> Order
compare a b =
Time.compare a.createdAt b.createdAt


commentCount : CommentThread -> Int
commentCount =
List.length << .comments


isAssigned : CommentThread -> Bool
isAssigned =
Maybe.isJust << .assignedTo
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import Json.Decode as D exposing (Decoder)
import Json.Encode as E
import List.Extra as List
import Shared.Data.QuestionnaireDetail.QuestionnaireEvent.AddCommentData as AddCommentData exposing (AddCommentData)
import Shared.Data.QuestionnaireDetail.QuestionnaireEvent.AssignCommentThreadData as AssignCommentThreadData exposing (AssignCommentThreadData)
import Shared.Data.QuestionnaireDetail.QuestionnaireEvent.ClearReplyData as ClearReplyData exposing (ClearReplyData)
import Shared.Data.QuestionnaireDetail.QuestionnaireEvent.DeleteCommentData as DeleteCommentData exposing (DeleteCommentData)
import Shared.Data.QuestionnaireDetail.QuestionnaireEvent.DeleteCommentThreadData as DeleteCommentThreadData exposing (DeleteCommentThreadData)
Expand All @@ -37,6 +38,7 @@ type QuestionnaireEvent
| ResolveCommentThread ResolveCommentThreadData
| ReopenCommentThread ReopenCommentThreadData
| DeleteCommentThread DeleteCommentThreadData
| AssignCommentThread AssignCommentThreadData
| AddComment AddCommentData
| EditComment EditCommentData
| DeleteComment DeleteCommentData
Expand Down Expand Up @@ -72,6 +74,9 @@ decoderByType actionType =
"DeleteCommentThreadEvent" ->
D.map DeleteCommentThread DeleteCommentThreadData.decoder

"AssignCommentThreadEvent" ->
D.map AssignCommentThread AssignCommentThreadData.decoder

"AddCommentEvent" ->
D.map AddComment AddCommentData.decoder

Expand All @@ -95,6 +100,7 @@ encode =
ResolveCommentThreadData.encode
ReopenCommentThreadData.encode
DeleteCommentThreadData.encode
AssignCommentThreadData.encode
AddCommentData.encode
EditCommentData.encode
DeleteCommentData.encode
Expand Down Expand Up @@ -123,22 +129,22 @@ isInvisible event =

getUuid : QuestionnaireEvent -> Uuid
getUuid =
map .uuid .uuid .uuid .uuid .uuid .uuid .uuid .uuid .uuid .uuid
map .uuid .uuid .uuid .uuid .uuid .uuid .uuid .uuid .uuid .uuid .uuid


getPath : QuestionnaireEvent -> Maybe String
getPath =
map (.path >> Just) (.path >> Just) (always Nothing) (.path >> Just) (.path >> Just) (.path >> Just) (.path >> Just) (.path >> Just) (.path >> Just) (.path >> Just)
map (.path >> Just) (.path >> Just) (always Nothing) (.path >> Just) (.path >> Just) (.path >> Just) (.path >> Just) (.path >> Just) (.path >> Just) (.path >> Just) (.path >> Just)


getCreatedAt : QuestionnaireEvent -> Time.Posix
getCreatedAt =
map .createdAt .createdAt .createdAt .createdAt .createdAt .createdAt .createdAt .createdAt .createdAt .createdAt
map .createdAt .createdAt .createdAt .createdAt .createdAt .createdAt .createdAt .createdAt .createdAt .createdAt .createdAt


getCreatedBy : QuestionnaireEvent -> Maybe UserSuggestion
getCreatedBy =
map .createdBy .createdBy .createdBy .createdBy .createdBy .createdBy .createdBy .createdBy .createdBy .createdBy
map .createdBy .createdBy .createdBy .createdBy .createdBy .createdBy .createdBy .createdBy .createdBy .createdBy .createdBy


getQuestionUuid : QuestionnaireEvent -> Maybe String
Expand All @@ -154,12 +160,13 @@ map :
-> (ResolveCommentThreadData -> a)
-> (ReopenCommentThreadData -> a)
-> (DeleteCommentThreadData -> a)
-> (AssignCommentThreadData -> a)
-> (AddCommentData -> a)
-> (EditCommentData -> a)
-> (DeleteCommentData -> a)
-> QuestionnaireEvent
-> a
map mapSetReply mapClearReply mapSetLevel mapSetLabels mapResolveCommentThread mapReopenCommentThread mapDeleteCommentThread mapAddComment mapEditComment mapDeleteComment event =
map mapSetReply mapClearReply mapSetLevel mapSetLabels mapResolveCommentThread mapReopenCommentThread mapDeleteCommentThread mapAssignCommentThread mapAddComment mapEditComment mapDeleteComment event =
case event of
SetReply data ->
mapSetReply data
Expand All @@ -182,6 +189,9 @@ map mapSetReply mapClearReply mapSetLevel mapSetLabels mapResolveCommentThread m
DeleteCommentThread data ->
mapDeleteCommentThread data

AssignCommentThread data ->
mapAssignCommentThread data

AddComment data ->
mapAddComment data

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
module Shared.Data.QuestionnaireDetail.QuestionnaireEvent.AssignCommentThreadData exposing (AssignCommentThreadData, decoder, encode)

import Json.Decode as D exposing (Decoder)
import Json.Decode.Extra as D
import Json.Decode.Pipeline as D
import Json.Encode as E
import Json.Encode.Extra as E
import Shared.Data.UserSuggestion as UserSuggestion exposing (UserSuggestion)
import Time
import Uuid exposing (Uuid)


type alias AssignCommentThreadData =
{ uuid : Uuid
, path : String
, threadUuid : Uuid
, private : Bool
, assignedTo : Maybe UserSuggestion
, createdAt : Time.Posix
, createdBy : Maybe UserSuggestion
}


encode : AssignCommentThreadData -> E.Value
encode data =
E.object
[ ( "type", E.string "AssignCommentThreadEvent" )
, ( "uuid", Uuid.encode data.uuid )
, ( "path", E.string data.path )
, ( "threadUuid", Uuid.encode data.threadUuid )
, ( "private", E.bool data.private )
, ( "assignedTo", E.maybe UserSuggestion.encode data.assignedTo )
]


decoder : Decoder AssignCommentThreadData
decoder =
D.succeed AssignCommentThreadData
|> D.required "uuid" Uuid.decoder
|> D.required "path" D.string
|> D.required "threadUuid" Uuid.decoder
|> D.required "private" D.bool
|> D.required "assignedTo" (D.maybe UserSuggestion.decoder)
|> D.required "createdAt" D.datetime
|> D.required "createdBy" (D.maybe UserSuggestion.decoder)
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ type alias ResolveCommentThreadData =
, private : Bool
, createdAt : Time.Posix
, createdBy : Maybe UserSuggestion
, commentCount : Int
}


Expand All @@ -31,6 +32,7 @@ encode data =
, ( "path", E.string data.path )
, ( "threadUuid", Uuid.encode data.threadUuid )
, ( "private", E.bool data.private )
, ( "commentCount", E.int data.commentCount )
]


Expand All @@ -43,3 +45,4 @@ decoder =
|> D.hardcoded False
|> D.required "createdAt" D.datetime
|> D.required "createdBy" (D.maybe UserSuggestion.decoder)
|> D.required "commentCount" D.int
Loading

0 comments on commit 306b8f0

Please sign in to comment.