Skip to content

Enable org creation with "contact sales" info #83

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion elm-git.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"git-dependencies": {
"direct": {
"https://github.com/unisonweb/ui-core": "370a0dad78e156e5604b1d34c7acaadbb1016bff"
"https://github.com/unisonweb/ui-core": "2e050b11e00a332b8f7a41db78d1f61169e9898f"
},
"indirect": {}
}
Expand Down
13 changes: 4 additions & 9 deletions src/UnisonShare/AppHeader.elm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import Html.Attributes exposing (class, classList)
import Lib.HttpApi exposing (HttpApi)
import Lib.UserHandle as UserHandle exposing (UserHandle)
import Time
import UI
import UI.ActionMenu as ActionMenu
import UI.AnchoredOverlay as AnchoredOverlay
import UI.AppHeader exposing (AppHeader, AppTitle(..))
Expand Down Expand Up @@ -270,14 +269,10 @@ view ctx appHeader_ =
[ avatar, Icon.view chevron ]

newOrgButton =
if account.isSuperAdmin then
Button.iconThenLabel ctx.showNewOrgModal Icon.largePlus "New Org"
|> Button.small
|> Button.positive
|> Button.view

else
UI.nothing
Button.iconThenLabel ctx.showNewOrgModal Icon.largePlus "New Org"
|> Button.small
|> Button.positive
|> Button.view

accountMenu =
ActionMenu.items
Expand Down
5 changes: 5 additions & 0 deletions src/UnisonShare/Link.elm
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ link url =
Click.externalHref url


salesEmail : Click msg
salesEmail =
Click.externalHref "mailto:hello@unison.cloud"


unisonCloudWebsite : Click msg
unisonCloudWebsite =
Click.externalHref "https://unison.cloud"
Expand Down
37 changes: 22 additions & 15 deletions src/UnisonShare/NewOrgModal.elm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module UnisonShare.NewOrgModal exposing (..)

import Html exposing (Html, div, form)
import Html exposing (Html, br, div, form, span, strong, text)
import Http
import Json.Decode as Decode
import Lib.HttpApi as HttpApi exposing (HttpResult)
Expand All @@ -9,7 +9,6 @@ import Lib.Util as Util
import RemoteData exposing (RemoteData(..), WebData)
import String.Normalize as StringN
import UI.Button as Button
import UI.Form.RadioField as RadioField
import UI.Form.TextField as TextField
import UI.Icon as Icon
import UI.Modal as Modal
Expand All @@ -18,6 +17,7 @@ import UI.StatusIndicator as StatusIndicator
import UnisonShare.Account exposing (AccountSummary)
import UnisonShare.Api as ShareApi
import UnisonShare.AppContext exposing (AppContext)
import UnisonShare.Link as Link
import UnisonShare.Org as Org exposing (OrgSummary)


Expand Down Expand Up @@ -221,7 +221,7 @@ update appContext account msg model =
SaveFinished res ->
case res of
Ok org ->
( { model | save = Success org }, Util.delayMsg 1500 CloseModal, NoOutMsg )
( { model | save = Success org }, Cmd.none, AddedOrg org )

Err e ->
( { model | save = Failure e }, Cmd.none, NoOutMsg )
Expand Down Expand Up @@ -327,17 +327,20 @@ handleToString orgHandle =
view : Model -> Html Msg
view model =
let
orgTypeOptions =
RadioField.options2
(RadioField.option "Public Org"
"Only allows public projects."
PublicOrg
)
(RadioField.option "Commercial Org"
"Supports both public and private projects. Selecting this will open a support ticket to enable private projects."
CommercialOrg
)

{-
orgTypeOptions =
RadioField.options2
(RadioField.option "Public Org"
"Only allows public projects."
PublicOrg
)
(RadioField.option "Commercial Org"
"Supports both public and private projects. Selecting this will open a support ticket to enable private projects."
CommercialOrg
)
|> RadioField.field "org-type" UpdateOrgType orgTypeOptions model.orgType |> RadioField.view
orgTypeOptions =
-}
handleField =
TextField.fieldWithoutLabel UpdateHandle "Handle, e.g. @unison" (handleToString model.potentialHandle)
|> TextField.withHelpText "The unique identifier of the organization and used in URLs and project references like @unison/base."
Expand Down Expand Up @@ -381,7 +384,11 @@ view model =
|> TextField.withAutofocus
|> TextField.view
, TextField.view handleField_
, RadioField.field "org-type" UpdateOrgType orgTypeOptions model.orgType |> RadioField.view
, StatusBanner.info_
(span
[]
[ 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." ]
)
]
]

Expand Down
25 changes: 15 additions & 10 deletions src/UnisonShare/Page/OrgProfilePage.elm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module UnisonShare.Page.OrgProfilePage exposing (..)

import Html exposing (Html, div, text)
import Html exposing (Html, div, h2, text)
import Html.Attributes exposing (class)
import Http
import Json.Decode as Decode
Expand All @@ -12,15 +12,19 @@ import Set
import UI
import UI.Card as Card
import UI.Divider as Divider
import UI.EmptyState as EmptyState
import UI.EmptyStateCard as EmptyStateCard
import UI.Icon as Icon
import UI.PageContent as PageContent exposing (PageContent)
import UI.PageLayout as PageLayout
import UI.PageTitle as PageTitle
import UI.Placeholder as Placeholder
import UI.ProfileSnippet as ProfileSnippet
import UI.Tag as Tag
import UnisonShare.Api as ShareApi
import UnisonShare.AppContext exposing (AppContext)
import UnisonShare.Link as Link
import UnisonShare.Org exposing (OrgDetails)
import UnisonShare.Org as Org exposing (OrgDetails)
import UnisonShare.PageFooter as PageFooter
import UnisonShare.Project as Project exposing (ProjectSummary)
import UnisonShare.Project.ProjectListing as ProjectListing
Expand Down Expand Up @@ -99,11 +103,13 @@ fetchProjects appContext handle =
-- VIEW


viewProjects : List ProjectSummary -> Html msg
viewProjects projects_ =
viewProjects : OrgDetails -> List ProjectSummary -> Html msg
viewProjects org projects_ =
case projects_ of
[] ->
UI.nothing
EmptyState.iconCloud (EmptyState.IconCenterPiece Icon.pencilRuler)
|> EmptyState.withContent [ h2 [] [ text (Org.name org ++ " doesn't have any projects yet.") ] ]
|> EmptyStateCard.view

projects ->
let
Expand Down Expand Up @@ -147,7 +153,7 @@ view_ org projects =
let
pageContent =
[ projects
|> RemoteData.map viewProjects
|> RemoteData.map (viewProjects org)
|> RemoteData.withDefault UI.nothing
]

Expand All @@ -168,10 +174,9 @@ viewLoadingPage =
let
content =
PageContent.oneColumn
[ div [ class "org-profile-page_page-content" ]
[ div [ class "org-profile_main-content" ]
[ text "" ]
]
[ Card.card (Placeholder.texts5 |> List.map Placeholder.view)
|> Card.asContainedWithFade
|> Card.view
]
in
PageLayout.centeredNarrowLayout content PageFooter.pageFooter
Expand Down
8 changes: 2 additions & 6 deletions src/css/unison-share/page/org-profile-page.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,8 @@
flex-direction: column;
}

.org-profile-page .org-profile_main-content {
display: flex;
flex-direction: column;
gap: 1.5rem;
flex: 1;
flex-grow: 1;
.org-profile-page .avatar.avatar_blank {
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.org-profile-page .projects {
Expand Down
4 changes: 4 additions & 0 deletions src/css/unison-share/page/user-profile-page.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
flex-grow: 1;
}

.user-profile-page .avatar.avatar_blank {
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.user-profile-empty-state_instructions-banner {
display: flex;
flex-direction: column;
Expand Down
Loading