From 211a527d4ddcd7506a56a2dbfa19ef5ca1ec2e8f Mon Sep 17 00:00:00 2001 From: Mattermost Build Date: Thu, 8 Jun 2023 19:33:34 +0300 Subject: [PATCH] Fix boards share dialog (#4761) (#4762) (cherry picked from commit d95d100d8caf9bc164cd167e0a25f1db37332397) Co-authored-by: Christopher Speller --- .../shareBoard/teamPermissionsRow.tsx | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/webapp/src/components/shareBoard/teamPermissionsRow.tsx b/webapp/src/components/shareBoard/teamPermissionsRow.tsx index 2650e7790..7f16f8e1d 100644 --- a/webapp/src/components/shareBoard/teamPermissionsRow.tsx +++ b/webapp/src/components/shareBoard/teamPermissionsRow.tsx @@ -47,19 +47,22 @@ const TeamPermissionsRow = (): JSX.Element => { } } - let currentRoleName = intl.formatMessage({id: 'BoardMember.schemeNone', defaultMessage: 'None'}) - if (board.type === BoardTypeOpen && board.minimumRole === MemberRole.Admin) { - currentRoleName = intl.formatMessage({id: 'BoardMember.schemeAdmin', defaultMessage: 'Admin'}) - } else if (board.type === BoardTypeOpen && board.minimumRole === MemberRole.Editor) { - if (board.isTemplate) { + let currentRoleName = intl.formatMessage({id: 'BoardMember.schemeAdmin', defaultMessage: 'Admin'}) + if (board.type === BoardTypeOpen) { + currentRoleName = intl.formatMessage({id: 'BoardMember.schemeEditor', defaultMessage: 'Editor'}) + if (board.minimumRole === MemberRole.Editor) { + if (board.isTemplate) { + currentRoleName = intl.formatMessage({id: 'BoardMember.schemeViewer', defaultMessage: 'Viewer'}) + } else { + currentRoleName = intl.formatMessage({id: 'BoardMember.schemeEditor', defaultMessage: 'Editor'}) + } + } else if (board.minimumRole === MemberRole.Commenter) { + currentRoleName = intl.formatMessage({id: 'BoardMember.schemeCommenter', defaultMessage: 'Commenter'}) + } else if (board.minimumRole === MemberRole.Viewer) { currentRoleName = intl.formatMessage({id: 'BoardMember.schemeViewer', defaultMessage: 'Viewer'}) - } else { - currentRoleName = intl.formatMessage({id: 'BoardMember.schemeEditor', defaultMessage: 'Editor'}) } - } else if (board.type === BoardTypeOpen && board.minimumRole === MemberRole.Commenter) { - currentRoleName = intl.formatMessage({id: 'BoardMember.schemeCommenter', defaultMessage: 'Commenter'}) - } else if (board.type === BoardTypeOpen && board.minimumRole === MemberRole.Viewer) { - currentRoleName = intl.formatMessage({id: 'BoardMember.schemeViewer', defaultMessage: 'Viewer'}) + } else { + currentRoleName = intl.formatMessage({id: 'BoardMember.schemeNone', defaultMessage: 'None'}) } const confirmationDialog = (