From d95d100d8caf9bc164cd167e0a25f1db37332397 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Wed, 7 Jun 2023 15:39:44 -0700 Subject: [PATCH] Fix boards share dialog (#4761) --- .../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 = (