Skip to content

Commit

Permalink
Merge pull request #1254 from ds-wizard/hotfix/4.11.2
Browse files Browse the repository at this point in the history
Hotfix 4.11.2
  • Loading branch information
janslifka authored Oct 22, 2024
2 parents 83a636e + 312a172 commit 6d64050
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 8 deletions.
4 changes: 4 additions & 0 deletions engine-shared/elm/Shared/Data/BootstrapConfig.elm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module Shared.Data.BootstrapConfig exposing

import Json.Decode as D exposing (Decoder)
import Json.Decode.Pipeline as D
import Shared.Data.BootstrapConfig.AIAssistantConfig as AIAssistantConfig exposing (AIAssistantConfig)
import Shared.Data.BootstrapConfig.Admin as AdminConfig exposing (Admin)
import Shared.Data.BootstrapConfig.AppSwitcherItem as AppSwitcherItem exposing (AppSwitcherItem)
import Shared.Data.BootstrapConfig.AuthenticationConfig as AuthenticationConfig exposing (AuthenticationConfig)
Expand All @@ -25,6 +26,7 @@ import Shared.Data.UserInfo as UserInfo exposing (UserInfo)

type alias BootstrapConfig =
{ admin : Admin
, aiAssistant : AIAssistantConfig
, authentication : AuthenticationConfig
, dashboardAndLoginScreen : DashboardAndLoginScreenConfig
, registry : RegistryConfig
Expand All @@ -45,6 +47,7 @@ type alias BootstrapConfig =
default : BootstrapConfig
default =
{ admin = AdminConfig.default
, aiAssistant = AIAssistantConfig.default
, authentication = AuthenticationConfig.default
, dashboardAndLoginScreen = DashboardAndLoginScreenConfig.default
, registry = RegistryConfig.default
Expand All @@ -66,6 +69,7 @@ decoder : Decoder BootstrapConfig
decoder =
D.succeed BootstrapConfig
|> D.required "admin" AdminConfig.decoder
|> D.required "aiAssistant" AIAssistantConfig.decoder
|> D.required "authentication" AuthenticationConfig.decoder
|> D.required "dashboardAndLoginScreen" DashboardAndLoginScreenConfig.decoder
|> D.required "registry" RegistryConfig.decoder
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
module Shared.Data.BootstrapConfig.AIAssistantConfig exposing
( AIAssistantConfig
, decoder
, default
)

import Json.Decode as D exposing (Decoder)
import Json.Decode.Pipeline as D


type alias AIAssistantConfig =
{ enabled : Bool
}


default : AIAssistantConfig
default =
{ enabled = False }


decoder : Decoder AIAssistantConfig
decoder =
D.succeed AIAssistantConfig
|> D.required "enabled" D.bool
5 changes: 3 additions & 2 deletions engine-wizard/elm/Wizard/Common/Components/AIAssistant.elm
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,9 @@ viewNewConversation cfg =
in
div [ class "flex-grow-1 px-3 py-3 overflow-auto" ]
([ h5 [] [ text "👋 Hello!" ]
, p [] [ text "I'm AI Assistant, here to help you navigate and make the most of FAIR Wizard." ]
, p [] [ text "Ask me anything about FAIR Wizard’s features, capabilities, or best practices, or choose a sample question below to start a conversation." ]
, p [] [ text "I'm the AI Assistant, here to help you understand and get the most out of FAIR Wizard." ]
, p [] [ text "I don’t have access to your data but can assist you using information from official guides and web resources." ]
, p [] [ text "Feel free to ask me anything about FAIR Wizard’s features, capabilities, or best practices, or choose a sample question below to get started." ]
]
++ List.map viewSampleMessage sampleMessages
)
Expand Down
2 changes: 1 addition & 1 deletion engine-wizard/elm/Wizard/Common/Menu/View.elm
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ view : Model -> Html Wizard.Msgs.Msg
view model =
let
viewAiAssistant =
if Admin.isEnabled model.appState.config.admin then
if model.appState.config.aiAssistant.enabled then
div []
[ a
[ class "sidebar-ai-assistant"
Expand Down
7 changes: 5 additions & 2 deletions engine-wizard/elm/Wizard/Common/View/Layout.elm
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,11 @@ publicHeader fluidFull model =
app : Model -> Html Msg -> Document Msg
app model content =
let
rightPanelVisible =
not model.appState.session.rightPanelCollapsed && model.appState.config.aiAssistant.enabled

rightPanel =
if not model.appState.session.rightPanelCollapsed then
if rightPanelVisible then
div [ class "right-panel" ]
[ div [ class "right-panel-content" ]
[ AIAssistant.view
Expand All @@ -162,7 +165,7 @@ app model content =
, classList
[ ( "side-navigation-collapsed", model.appState.session.sidebarCollapsed )
, ( "app-fullscreen", AppState.isFullscreen model.appState )
, ( "app-right-panel", not model.appState.session.rightPanelCollapsed )
, ( "app-right-panel", rightPanelVisible )
]
]
[ Menu.view model
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "engine-frontend",
"version": "4.11.1",
"version": "4.11.2",
"repository": "https://github.com/ds-wizard/engine-frontend",
"license": "Apache-2.0",
"scripts": {
Expand Down

0 comments on commit 6d64050

Please sign in to comment.