Skip to content

Commit

Permalink
Work in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
RaphaelGauthier committed May 15, 2024
1 parent 5837f51 commit 56cdfcd
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ update msg model =
( newModel, Cmd.batch [ successNotification ("Account '" ++ account.name ++ "' successfully " ++ action), getAccounts newModel ] )

SaveAccount (Err err) ->
processApiError "Saving account" err model
processApiError "Saving account" err model

ConfirmActionAccount actionType (Ok ( metadata, account )) ->
let
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ displayModals model =
Confirm Regenerate a call ->
( "Regenerate token of API account '" ++ a ++ "'", "Confirm", "primary" )

btnAttributes =
case model.ui.modalState of
NewAccount ->
[]

_ ->
[attribute "data-bs-dismiss" "modal", attribute "aria-label" "Close"]
modalUI =
case model.ui.modalState of
NoModal ->
Expand Down Expand Up @@ -223,8 +230,7 @@ displayModals model =
case model.ui.copyState of
NoCopy ->
div [ id accountsModalId, class ("modal modal-account fade " ++ modalClass), attribute "aria-modal" "true", attribute "role" "dialog" ]
[ div [ class "modal-backdrop fade show", onClick (ToggleEditPopup NoModal) ] []
, div [ class "modal-dialog" ]
[ div [ class "modal-dialog" ]
[ div [ class "modal-content" ]
[ div [ class "modal-header" ]
[ h5 [ class "modal-title" ] [ text modalTitle ]
Expand Down Expand Up @@ -272,8 +278,8 @@ displayModals model =
]
]
, div [ class "modal-footer" ]
[ button [ type_ "button", class "btn btn-default", onClick (ToggleEditPopup NoModal) ] [ text "Close" ]
, button [ type_ "button", class ("btn btn-" ++ btnClass), onClick modalUI.saveAction, disabled (checkEmptyBtn || checkAlreadyUsedName) ] [ text btnTxt ]
[ button [ type_ "button", class "btn btn-default", onClick (ToggleEditPopup NoModal), attribute "data-bs-dismiss" "modal", attribute "aria-label" "Close" ] [ text "Close" ]
, button (List.append [ type_ "button", class ("btn btn-" ++ btnClass), onClick modalUI.saveAction, disabled (checkEmptyBtn || checkAlreadyUsedName) ] btnAttributes) [ text btnTxt ]
]
]
]
Expand All @@ -282,8 +288,7 @@ displayModals model =
Token txt ->
-- Almost a modal as it is a notification that requires user interaction (copy)
div [ class "modal fade show", style "display" "block" ]
[ div [ class "modal-backdrop fade show", onClick CloseCopyPopup ] []
, div [ class "modal-dialog" ]
[ div [ class "modal-dialog" ]
[ div [ class "modal-content" ]
[ div [ class "modal-header" ]
[ h5 [ class "modal-title" ] [ text "Copy the token" ]
Expand All @@ -304,7 +309,7 @@ displayModals model =
]
]
, div [ class "modal-footer" ]
[ button [ type_ "button", class "btn btn-success", onClick CloseCopyPopup ] [ text "Close" ]
[ button [ type_ "button", class "btn btn-success", onClick CloseCopyPopup, attribute "data-bs-dismiss" "modal", attribute "aria-label" "Close" ] [ text "Close" ]
]
]
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ view model =
else
div [class "tags-container"]
( List.map (\t ->
div [class "btn-group btn-group-xs ng-scope"]
div [class "btn-group btn-group-xs"]
[ button [class "btn btn-default tags-label", onClick (UpdateRuleFilters {treeFilters | newTag = {newTag | key = t.key, value = t.value}})]
[ i [class "fa fa-tag"][]
, span [class "tag-key"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ modalDelete model =
[ div [class "modal-backdrop fade show", onClick (ClosePopup Ignore)][]
, div [ class "modal-dialog" ]
[ div [ class "modal-content" ]
[ div [ class "modal-header ng-scope" ]
[ div [ class "modal-header" ]
[ h5 [ class "modal-title" ] [ text "Delete property"]
, button [type_ "button", class "btn-close", onClick (ClosePopup Ignore), attribute "aria-label" "Close"][]
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ view model =
[ div [class "modal-backdrop fade show", onClick (ClosePopup Ignore)][]
, div [ class "modal-dialog" ] [
div [ class "modal-content" ] [
div [ class "modal-header ng-scope" ] [
div [ class "modal-header" ] [
h5 [ class "modal-title" ] [ text "Delete Rule"]
, button [type_ "button", class "btn-close", onClick (ClosePopup Ignore), attribute "aria-label" "Close"][]
]
Expand Down Expand Up @@ -208,7 +208,7 @@ view model =
[ div [class "modal-backdrop fade show", onClick (ClosePopup Ignore)][]
, div [ class "modal-dialog" ] [
div [ class "modal-content" ] [
div [ class "modal-header ng-scope" ] [
div [ class "modal-header" ] [
h5[ class "modal-title" ] [ text (txtDisable ++" Rule")]
, button [type_ "button", class "btn-close", onClick (ClosePopup Ignore), attribute "aria-label" "Close"][]
]
Expand All @@ -233,7 +233,7 @@ view model =
[ div [class "modal-backdrop fade show", onClick (ClosePopup Ignore)][]
, div [ class "modal-dialog" ] [
div [ class "modal-content" ] [
div [ class "modal-header ng-scope" ] [
div [ class "modal-header" ] [
h5 [ class "modal-title" ] [ text "Delete category"]
, button [type_ "button", class "btn-close", onClick (ClosePopup Ignore), attribute "aria-label" "Close"][]
]
Expand All @@ -259,7 +259,7 @@ view model =
[ div [class "modal-backdrop fade show", onClick (ClosePopup Ignore)][]
, div [ class "modal-dialog" ]
[ div [ class "modal-content" ]
[ div [ class "modal-header ng-scope" ]
[ div [ class "modal-header" ]
[ h5 [ class "modal-title" ] [ text (action ++" Rule")]
, button [type_ "button", class "btn-close", onClick (ClosePopup Ignore), attribute "aria-label" "Close"][]
]
Expand Down Expand Up @@ -345,7 +345,7 @@ view model =
else
div [class "tags-container"]
( List.map (\t ->
div [class "btn-group btn-group-xs ng-scope"]
div [class "btn-group btn-group-xs"]
[ button [class "btn btn-default tags-label", onClick (UpdateRuleFilters {ruleFilters | treeFilters = {treeFilters | newTag = {newTag | key = t.key, value = t.value}}})]
[ i [class "fa fa-tag"][]
, span [class "tag-key"]
Expand Down

0 comments on commit 56cdfcd

Please sign in to comment.