Skip to content

Commit

Permalink
Hide affiliations settings if admin app is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
janslifka committed Dec 15, 2023
1 parent 4e10d07 commit 246477e
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions engine-wizard/elm/Wizard/Settings/Organization/View.elm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module Wizard.Settings.Organization.View exposing (view)
import Form exposing (Form)
import Gettext exposing (gettext)
import Html exposing (Html, div)
import Shared.Data.BootstrapConfig.Admin as Admin
import Shared.Form.FormError exposing (FormError)
import Shared.Utils exposing (compose2)
import Wizard.Common.AppState exposing (AppState)
Expand Down Expand Up @@ -30,12 +31,22 @@ viewProps =

formView : AppState -> Form FormError OrganizationConfigForm -> Html Form.Msg
formView appState form =
let
affiliations =
if Admin.isEnabled appState.config.admin then
[]

else
[ FormGroup.resizableTextarea appState form "affiliations" (gettext "Affiliations" appState.locale)
, FormExtra.mdAfter (gettext "Affiliation options will be used to help users choose their affiliation while signing up or editing their profile. Write one affiliation option per line." appState.locale)
]
in
div []
[ FormGroup.input appState form "name" (gettext "Name" appState.locale)
, FormExtra.textAfter (gettext "Name of the organization running this instance." appState.locale)
, FormGroup.textarea appState form "description" (gettext "Description" appState.locale)
, FormGroup.input appState form "organizationId" (gettext "Organization ID" appState.locale)
, FormExtra.textAfter (gettext "Organization ID is used to identify Knowledge Models created in this instance. It can contain alphanumeric characters and dots but cannot start or end with a dot." appState.locale)
, FormGroup.resizableTextarea appState form "affiliations" (gettext "Affiliations" appState.locale)
, FormExtra.mdAfter (gettext "Affiliation options will be used to help users choose their affiliation while signing up or editing their profile. Write one affiliation option per line." appState.locale)
]
([ FormGroup.input appState form "name" (gettext "Name" appState.locale)
, FormExtra.textAfter (gettext "Name of the organization running this instance." appState.locale)
, FormGroup.textarea appState form "description" (gettext "Description" appState.locale)
, FormGroup.input appState form "organizationId" (gettext "Organization ID" appState.locale)
, FormExtra.textAfter (gettext "Organization ID is used to identify Knowledge Models created in this instance. It can contain alphanumeric characters and dots but cannot start or end with a dot." appState.locale)
]
++ affiliations
)

0 comments on commit 246477e

Please sign in to comment.