Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
remove bugged check for number of owners in team
Browse files Browse the repository at this point in the history
  • Loading branch information
sechmann committed Jan 2, 2024
1 parent 143e81c commit 92c99f8
Showing 1 changed file with 4 additions and 24 deletions.
28 changes: 4 additions & 24 deletions src/Page/Team/Members.elm
Original file line number Diff line number Diff line change
Expand Up @@ -369,10 +369,6 @@ viewReconcilerOption model r =

viewEditMembers : Model -> Html Msg
viewEditMembers model =
let
hasLessThanTwoOwners =
countOwners model <= 1
in
Card.new "Members"
|> Card.withButtons (viewAddMemberModal model ++ [ smallButton ClickedViewMode "edit" "View" ])
|> Card.withContents
Expand All @@ -398,7 +394,7 @@ viewEditMembers model =
]
)
]
, tbody [] (List.map (viewEditRow hasLessThanTwoOwners model.reconcilers) model.members)
, tbody [] (List.map (viewEditRow model.reconcilers) model.members)
]
]
|> Card.render
Expand All @@ -419,8 +415,8 @@ candidates model =
|> List.map (\email -> option [] [ text email ])


viewEditRow : Bool -> List Reconciler -> Row -> Html Msg
viewEditRow hasLessThan2Owners reconcilers row =
viewEditRow : List Reconciler -> Row -> Html Msg
viewEditRow reconcilers row =
let
roleSelector : Html Msg
roleSelector =
Expand Down Expand Up @@ -454,7 +450,7 @@ viewEditRow hasLessThan2Owners reconcilers row =
smallButton (ClickedMemberRemoveConfirm row) "delete" "Confirm"

Unchanged ->
smallButtonWithAttrs (ClickedMemberRemove row) "delete" "Remove" [ disabled hasLessThan2Owners ]
smallButton (ClickedMemberRemove row) "delete" "Remove"

Updated ->
smallButton (ClickedMemberRemove row) "delete" "Remove"
Expand Down Expand Up @@ -661,19 +657,3 @@ updateRows expandableMembers allRows =
rec members tail
in
rec (expandableAll expandableMembers) allRows


countOwners : Model -> Int
countOwners model =
List.filter isOwner model.members |> List.length


isOwner : Row -> Bool
isOwner row =
case row.member of
TeamMember _ _ Owner _ ->
True

_ ->
False

0 comments on commit 92c99f8

Please sign in to comment.