Skip to content

Commit

Permalink
Merge pull request #1068 from ds-wizard/release/4.3.0
Browse files Browse the repository at this point in the history
Release 4.3.0
  • Loading branch information
janslifka committed Feb 6, 2024
2 parents 616cc9a + 8d3a4ba commit 5aeed37
Show file tree
Hide file tree
Showing 38 changed files with 955 additions and 952 deletions.
2 changes: 1 addition & 1 deletion elm.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
},
"test-dependencies": {
"direct": {
"elm-explorations/test": "2.1.2"
"elm-explorations/test": "2.2.0"
},
"indirect": {
"BrianHicks/elm-trend": "2.1.3",
Expand Down
2 changes: 1 addition & 1 deletion engine-shared/elm/Shared/Api/DocumentTemplates.elm
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ getOutdatedTemplates =
queryString =
PaginationQueryString.empty
|> PaginationQueryString.withSize (Just 5)
|> PaginationQueryString.toApiUrlWith [ ( "state", "OutdatedTemplateState" ) ]
|> PaginationQueryString.toApiUrlWith [ ( "outdated", "true" ) ]

url =
"/document-templates" ++ queryString
Expand Down
4 changes: 2 additions & 2 deletions engine-shared/elm/Shared/Api/Feedbacks.elm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Shared.Api.Feedbacks exposing (getFeedbacks, postFeedback)
import Json.Decode as D
import Json.Encode exposing (Value)
import Shared.AbstractAppState exposing (AbstractAppState)
import Shared.Api exposing (ToMsg, httpFetch, httpGet)
import Shared.Api exposing (ToMsg, httpGet, jwtOrHttpFetch)
import Shared.Data.Feedback as Feedback exposing (Feedback)


Expand All @@ -14,4 +14,4 @@ getFeedbacks packageId questionUuid =

postFeedback : Value -> AbstractAppState a -> ToMsg Feedback msg -> Cmd msg
postFeedback =
httpFetch "/feedbacks" Feedback.decoder
jwtOrHttpFetch "/feedbacks" Feedback.decoder
2 changes: 1 addition & 1 deletion engine-shared/elm/Shared/Api/Packages.elm
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ getOutdatedPackages =
queryString =
PaginationQueryString.empty
|> PaginationQueryString.withSize (Just 5)
|> PaginationQueryString.toApiUrlWith [ ( "state", "OutdatedPackageState" ) ]
|> PaginationQueryString.toApiUrlWith [ ( "outdated", "true" ) ]

url =
"/packages" ++ queryString
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ module Shared.Data.BootstrapConfig.LookAndFeelConfig exposing
, defaultAppTitle
, defaultAppTitleShort
, defaultLogoUrl
, defaultMenuTitle
, defaultRegistryName
, defaultRegistryUrl
, getAppTitle
, getAppTitleShort
, getIllustrationsColor
Expand Down Expand Up @@ -106,6 +109,21 @@ getLogoUrl config =
Maybe.withDefault defaultLogoUrl config.logoUrl


defaultRegistryName : String
defaultRegistryName =
"{defaultRegistryName}"


defaultRegistryUrl : String
defaultRegistryUrl =
"{defaultRegistryUrl}"


defaultMenuTitle : String
defaultMenuTitle =
"{defaultMenuTitle}"



-- JSON

Expand Down
15 changes: 13 additions & 2 deletions engine-shared/elm/Shared/Data/DocumentTemplate.elm
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module Shared.Data.DocumentTemplate exposing
( DocumentTemplate
, decoder
, isOutdated
)

import Json.Decode as D exposing (Decoder)
Expand All @@ -21,7 +22,7 @@ type alias DocumentTemplate =
, organization : Maybe OrganizationInfo
, organizationId : String
, phase : DocumentTemplatePhase
, remoteLatestVersion : Maybe String
, remoteLatestVersion : Maybe Version
, state : DocumentTemplateState
, templateId : String
, version : Version
Expand All @@ -39,8 +40,18 @@ decoder =
|> D.optional "organization" (D.maybe OrganizationInfo.decoder) Nothing
|> D.required "organizationId" D.string
|> D.required "phase" DocumentTemplatePhase.decoder
|> D.required "remoteLatestVersion" (D.maybe D.string)
|> D.required "remoteLatestVersion" (D.maybe Version.decoder)
|> D.required "state" DocumentTemplateState.decoder
|> D.required "templateId" D.string
|> D.required "version" Version.decoder
|> D.required "nonEditable" D.bool


isOutdated : { a | remoteLatestVersion : Maybe Version, version : Version } -> Bool
isOutdated template =
case template.remoteLatestVersion of
Just remoteLatestVersion ->
Version.greaterThan template.version remoteLatestVersion

Nothing ->
False
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ import Json.Decode as D exposing (Decoder)


type DocumentTemplateState
= Unknown
| Outdated
| UpToDate
| Unpublished
= Default
| UnsupportedMetamodelVersion


Expand All @@ -20,17 +17,8 @@ decoder =
|> D.andThen
(\str ->
case str of
"UnknownDocumentTemplateState" ->
D.succeed Unknown

"OutdatedDocumentTemplateState" ->
D.succeed Outdated

"UpToDateDocumentTemplateState" ->
D.succeed UpToDate

"UnpublishedDocumentTemplateState" ->
D.succeed Unpublished
"DefaultDocumentTemplateState" ->
D.succeed Default

"UnsupportedMetamodelVersionDocumentTemplateState" ->
D.succeed UnsupportedMetamodelVersion
Expand Down
14 changes: 11 additions & 3 deletions engine-shared/elm/Shared/Data/Locale.elm
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
module Shared.Data.Locale exposing
( Locale
, decoder
, isOutdated
)

import Json.Decode as D exposing (Decoder)
import Json.Decode.Extra as D
import Json.Decode.Pipeline as D
import Shared.Data.Locale.LocaleState as LocaleState exposing (LocaleState)
import Shared.Data.OrganizationInfo as OrganizationInfo exposing (OrganizationInfo)
import Time
import Version exposing (Version)
Expand All @@ -23,7 +23,6 @@ type alias Locale =
, defaultLocale : Bool
, enabled : Bool
, createdAt : Time.Posix
, state : LocaleState
, remoteLatestVersion : Maybe Version
, organization : Maybe OrganizationInfo
}
Expand All @@ -42,6 +41,15 @@ decoder =
|> D.required "defaultLocale" D.bool
|> D.required "enabled" D.bool
|> D.required "createdAt" D.datetime
|> D.required "state" LocaleState.decoder
|> D.required "remoteLatestVersion" (D.maybe Version.decoder)
|> D.optional "organization" (D.maybe OrganizationInfo.decoder) Nothing


isOutdated : { a | remoteLatestVersion : Maybe Version, version : Version } -> Bool
isOutdated template =
case template.remoteLatestVersion of
Just remoteLatestVersion ->
Version.greaterThan template.version remoteLatestVersion

Nothing ->
False
36 changes: 0 additions & 36 deletions engine-shared/elm/Shared/Data/Locale/LocaleState.elm

This file was deleted.

3 changes: 0 additions & 3 deletions engine-shared/elm/Shared/Data/LocaleDetail.elm
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ 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 Shared.Data.Locale.LocaleState as LocaleState exposing (LocaleState)
import Shared.Data.OrganizationInfo as OrganizationInfo exposing (OrganizationInfo)
import Time
import Version exposing (Version)
Expand All @@ -26,7 +25,6 @@ type alias LocaleDetail =
, defaultLocale : Bool
, enabled : Bool
, createdAt : Time.Posix
, state : LocaleState
, remoteLatestVersion : Maybe Version
, organization : Maybe OrganizationInfo
, registryLink : Maybe String
Expand All @@ -50,7 +48,6 @@ decoder =
|> D.required "defaultLocale" D.bool
|> D.required "enabled" D.bool
|> D.required "createdAt" D.datetime
|> D.required "state" LocaleState.decoder
|> D.required "remoteLatestVersion" (D.maybe Version.decoder)
|> D.optional "organization" (D.maybe OrganizationInfo.decoder) Nothing
|> D.required "registryLink" (D.maybe D.string)
Expand Down
19 changes: 13 additions & 6 deletions engine-shared/elm/Shared/Data/Package.elm
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ module Shared.Data.Package exposing
( Package
, decoder
, dummy
, isOutdated
)

import Json.Decode as D exposing (Decoder)
import Json.Decode.Extra as D
import Json.Decode.Pipeline as D
import Shared.Data.OrganizationInfo as OrganizationInfo exposing (OrganizationInfo)
import Shared.Data.Package.PackagePhase as PackagePhase exposing (PackagePhase)
import Shared.Data.Package.PackageState as PackageState exposing (PackageState)
import Time
import Version exposing (Version)

Expand All @@ -22,8 +22,7 @@ type alias Package =
, version : Version
, description : String
, organization : Maybe OrganizationInfo
, remoteLatestVersion : Maybe String
, state : PackageState
, remoteLatestVersion : Maybe Version
, phase : PackagePhase
, createdAt : Time.Posix
, nonEditable : Bool
Expand All @@ -40,8 +39,7 @@ decoder =
|> D.required "version" Version.decoder
|> D.required "description" D.string
|> D.required "organization" (D.maybe OrganizationInfo.decoder)
|> D.required "remoteLatestVersion" (D.maybe D.string)
|> D.required "state" PackageState.decoder
|> D.required "remoteLatestVersion" (D.maybe Version.decoder)
|> D.required "phase" PackagePhase.decoder
|> D.required "createdAt" D.datetime
|> D.required "nonEditable" D.bool
Expand All @@ -57,8 +55,17 @@ dummy =
, description = ""
, organization = Nothing
, remoteLatestVersion = Nothing
, state = PackageState.unknown
, phase = PackagePhase.Released
, createdAt = Time.millisToPosix 0
, nonEditable = True
}


isOutdated : { a | remoteLatestVersion : Maybe Version, version : Version } -> Bool
isOutdated template =
case template.remoteLatestVersion of
Just remoteLatestVersion ->
Version.greaterThan template.version remoteLatestVersion

Nothing ->
False
48 changes: 0 additions & 48 deletions engine-shared/elm/Shared/Data/Package/PackageState.elm

This file was deleted.

6 changes: 1 addition & 5 deletions engine-shared/elm/Shared/Data/PackageDetail.elm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import List.Extra as List
import Shared.Data.OrganizationInfo as OrganizationInfo exposing (OrganizationInfo)
import Shared.Data.Package exposing (Package)
import Shared.Data.Package.PackagePhase as PackagePhase exposing (PackagePhase)
import Shared.Data.Package.PackageState as PackageState exposing (PackageState)
import Shared.Data.PackageSuggestion exposing (PackageSuggestion)
import Time
import Version exposing (Version)
Expand All @@ -37,7 +36,6 @@ type alias PackageDetail =
, organization : Maybe OrganizationInfo
, registryLink : Maybe String
, remoteLatestVersion : Maybe Version
, state : PackageState
, phase : PackagePhase
, nonEditable : Bool
}
Expand All @@ -61,7 +59,6 @@ decoder =
|> D.required "organization" (D.maybe OrganizationInfo.decoder)
|> D.required "registryLink" (D.maybe D.string)
|> D.required "remoteLatestVersion" (D.maybe Version.decoder)
|> D.required "state" PackageState.decoder
|> D.required "phase" PackagePhase.decoder
|> D.required "nonEditable" D.bool

Expand Down Expand Up @@ -89,8 +86,7 @@ toPackage package =
, version = package.version
, description = package.description
, organization = package.organization
, remoteLatestVersion = Maybe.map Version.toString package.remoteLatestVersion
, state = package.state
, remoteLatestVersion = package.remoteLatestVersion
, phase = package.phase
, createdAt = Time.millisToPosix 0
, nonEditable = True
Expand Down
3 changes: 3 additions & 0 deletions engine-wizard/docker/profile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@ DEFAULT_APP_TITLE_SHORT="DS Wizard"
DEFAULT_SUPPORT_EMAIL="support@ds-wizard.org"
DEFAULT_SUPPORT_REPOSITORY_NAME="ds-wizard/ds-wizard"
DEFAULT_SUPPORT_REPOSITORY_URL="https://github.com/ds-wizard/ds-wizard"
DEFAULT_REGISTRY_NAME="DSW Registry"
DEFAULT_REGISTRY_URL="https://registry.ds-wizard.org"
DEFAULT_MENU_TITLE="Wizard"
DEFAULT_PRIMARY_COLOR=""
DEFAULT_ILLUSTRATIONS_COLOR=""
3 changes: 3 additions & 0 deletions engine-wizard/docker/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ sed -i "s#{defaultAppTitleShort}#$DEFAULT_APP_TITLE_SHORT#g" $file
sed -i "s#{defaultSupportEmail}#$DEFAULT_SUPPORT_EMAIL#g" $file
sed -i "s#{defaultSupportRepositoryName}#$DEFAULT_SUPPORT_REPOSITORY_NAME#g" $file
sed -i "s#{defaultSupportRepositoryUrl}#$DEFAULT_SUPPORT_REPOSITORY_URL#g" $file
sed -i "s#{defaultRegistryName}#$DEFAULT_REGISTRY_NAME#g" $file
sed -i "s#{defaultRegistryUrl}#$DEFAULT_REGISTRY_URL#g" $file
sed -i "s#{defaultMenuTitle}#$DEFAULT_MENU_TITLE#g" $file
sed -i "s/{defaultPrimaryColor}/$DEFAULT_PRIMARY_COLOR/g" $file
sed -i "s/{defaultIllustrationsColor}/$DEFAULT_ILLUSTRATIONS_COLOR/g" $file

Expand Down

0 comments on commit 5aeed37

Please sign in to comment.