11module UnisonShare.NewOrgModal exposing (..)
22
3- import Html exposing (Html , div , form )
3+ import Html exposing (Html , br , div , form , span , strong , text )
44import Http
55import Json.Decode as Decode
66import Lib.HttpApi as HttpApi exposing (HttpResult )
@@ -9,7 +9,6 @@ import Lib.Util as Util
99import RemoteData exposing (RemoteData (..) , WebData )
1010import String.Normalize as StringN
1111import UI.Button as Button
12- import UI.Form.RadioField as RadioField
1312import UI.Form.TextField as TextField
1413import UI.Icon as Icon
1514import UI.Modal as Modal
@@ -18,6 +17,7 @@ import UI.StatusIndicator as StatusIndicator
1817import UnisonShare.Account exposing (AccountSummary )
1918import UnisonShare.Api as ShareApi
2019import UnisonShare.AppContext exposing (AppContext )
20+ import UnisonShare.Link as Link
2121import UnisonShare.Org as Org exposing (OrgSummary )
2222
2323
@@ -221,7 +221,7 @@ update appContext account msg model =
221221 SaveFinished res ->
222222 case res of
223223 Ok org ->
224- ( { model | save = Success org }, Util . delayMsg 1500 CloseModal , NoOutMsg )
224+ ( { model | save = Success org }, Cmd . none , AddedOrg org )
225225
226226 Err e ->
227227 ( { model | save = Failure e }, Cmd . none, NoOutMsg )
@@ -327,17 +327,20 @@ handleToString orgHandle =
327327view : Model -> Html Msg
328328view model =
329329 let
330- orgTypeOptions =
331- RadioField . options2
332- ( RadioField . option " Public Org"
333- " Only allows public projects."
334- PublicOrg
335- )
336- ( RadioField . option " Commercial Org"
337- " Supports both public and private projects. Selecting this will open a support ticket to enable private projects."
338- CommercialOrg
339- )
340-
330+ {-
331+ orgTypeOptions =
332+ RadioField.options2
333+ (RadioField.option "Public Org"
334+ "Only allows public projects."
335+ PublicOrg
336+ )
337+ (RadioField.option "Commercial Org"
338+ "Supports both public and private projects. Selecting this will open a support ticket to enable private projects."
339+ CommercialOrg
340+ )
341+ |> RadioField.field "org-type" UpdateOrgType orgTypeOptions model.orgType |> RadioField.view
342+ orgTypeOptions =
343+ -}
341344 handleField =
342345 TextField . fieldWithoutLabel UpdateHandle " Handle, e.g. @unison" ( handleToString model. potentialHandle)
343346 |> TextField . withHelpText " The unique identifier of the organization and used in URLs and project references like @unison/base."
@@ -381,7 +384,11 @@ view model =
381384 |> TextField . withAutofocus
382385 |> TextField . view
383386 , TextField . view handleField_
384- , RadioField . field " org-type" UpdateOrgType orgTypeOptions model. orgType |> RadioField . view
387+ , StatusBanner . info_
388+ ( span
389+ []
390+ [ strong [] [ text " Organizations by default only allow for public projects." ], br [] [], text " To enable private projects, please reach out to Unison sales (" , Link . salesEmail |> Link . view " hello@unison.cloud" , text " or on " , Link . discord |> Link . view " Discord" , text " ) after creating the Organization." ]
391+ )
385392 ]
386393 ]
387394
0 commit comments