Skip to content

Commit 474a1cc

Browse files
committed
✨ (ui) help the user understanding mix accesses if project manager while not a member or with read-only access only
1 parent ba29689 commit 474a1cc

File tree

5 files changed

+45
-2
lines changed

5 files changed

+45
-2
lines changed

client/src/components/BoardActions/BoardActions.jsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ const BoardActions = React.memo(
4343
onBoardUpdate,
4444
onSearchUsers,
4545
onClearUserSearch,
46+
isProjectManagerNotMember,
47+
isViewerOnly,
4648
}) => {
4749
const [t] = useTranslation();
4850

@@ -112,8 +114,21 @@ const BoardActions = React.memo(
112114
}
113115
}, [filterLabels, onLabelToFilterAdd]);
114116

117+
let warningMessage = null;
118+
if (isProjectManagerNotMember) {
119+
warningMessage = t('common.boardWarningProjectManagerNotMember');
120+
} else if (isViewerOnly) {
121+
warningMessage = t('common.boardWarningViewerOnly');
122+
}
123+
115124
return (
116125
<div className={styles.wrapper}>
126+
{warningMessage && (
127+
<div className={styles.warning}>
128+
<Icon name="info" type="outlined" size="small" />
129+
<span>{warningMessage}</span>
130+
</div>
131+
)}
117132
<h4 className={styles.boardName}>{currentBoardName}</h4>
118133
<div className={styles.actions}>
119134
<div className={styles.action}>
@@ -293,6 +308,8 @@ BoardActions.propTypes = {
293308
onBoardUpdate: PropTypes.func.isRequired,
294309
onSearchUsers: PropTypes.func.isRequired,
295310
onClearUserSearch: PropTypes.func.isRequired,
311+
isProjectManagerNotMember: PropTypes.bool.isRequired,
312+
isViewerOnly: PropTypes.bool.isRequired,
296313
};
297314

298315
export default BoardActions;

client/src/components/BoardActions/BoardActions.module.scss

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,19 @@
1010
justify-content: space-between;
1111
align-items: center;
1212
gap: 1rem;
13+
flex-wrap: wrap;
14+
}
15+
16+
.warning {
17+
width: 100%;
18+
display: flex;
19+
align-items: center;
20+
gap: 8px;
21+
padding: 8px 12px;
22+
border-radius: 4px;
23+
font-size: 13px;
24+
background-color: var(--c--contextuals--background--semantic--warning--secondary);
25+
color: var(--c--contextuals--content--semantic--warning--secondary);
1326
}
1427

1528
.boardName {

client/src/containers/BoardActionsContainer.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ const mapStateToProps = (state) => {
4444
canEdit: isCurrentUserEditor,
4545
canEditMemberships: isCurrentUserEditor || isCurrentUserManager,
4646
canSeeMemberships: isCurrentUserMember || isCurrentUserManager,
47+
isProjectManagerNotMember: isCurrentUserManager && !isCurrentUserMember,
48+
isViewerOnly:
49+
isCurrentUserMember &&
50+
!isCurrentUserEditor &&
51+
currentUserMembership.role === BoardMembershipRoles.VIEWER,
4752
isBoardPublic: currentBoard ? currentBoard.isPublic : false,
4853
searchedUsers,
4954
isSearchingUsers,

client/src/locales/en-US/core.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ export default {
4545
boardName: 'Board name',
4646
boardNotFound_title: 'Board Not Found',
4747
boardPermissions_title: 'Board permissions',
48+
boardWarningProjectManagerNotMember:
49+
'You are viewing this board as a project manager. You are not a member and have limited interactions.',
50+
boardWarningViewerOnly: 'You have read-only access to this board.',
4851
canComment: 'Can comment',
4952
canEditContentOfBoard: 'Can edit the content of the board.',
5053
canOnlyViewBoard: 'Can only view the board.',
@@ -168,7 +171,8 @@ export default {
168171
settings: 'Settings',
169172
setupReady: 'Everything is ready {{userName}}!',
170173
sharedBoardWorkspace: 'Shared workspace',
171-
sharedBoardWorkspaceDescription: 'Boards with at least one member who is not a project manager',
174+
sharedBoardWorkspaceDescription:
175+
'Boards with at least one member who is not a project manager',
172176
sortList_title: 'Sort List',
173177
startByCreatingProject: 'You can now <1>Create project</1>',
174178
stopwatch: 'Stopwatch',

client/src/locales/fr-FR/core.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ export default {
5050
boardName: 'Nom du tableau',
5151
boardNotFound_title: 'Carte non trouvée',
5252
boardPermissions_title: 'Permissions du tableau',
53+
boardWarningProjectManagerNotMember:
54+
"Vous consultez ce tableau en tant que gestionnaire de projet. Vous n'êtes pas membre et avez des interactions limitées.",
55+
boardWarningViewerOnly: 'Vous avez un accès en lecture seule à ce tableau.',
5356
canComment: 'Peut commenter',
5457
canEditContentOfBoard: 'Peut éditer le contenu du tableau',
5558
canOnlyViewBoard: 'Peut uniquement voir le tableau',
@@ -115,7 +118,8 @@ export default {
115118
hours: 'Heures',
116119
importBoard_title: 'Importer un tableau',
117120
internalBoardWorkspace: 'Espace interne',
118-
internalBoardWorkspaceDescription: 'Tableaux dont les membres sont uniquement des gestionnaires du projet',
121+
internalBoardWorkspaceDescription:
122+
'Tableaux dont les membres sont uniquement des gestionnaires du projet',
119123
invalidCurrentPassword: 'Mot de passe actuel invalide',
120124
labels: 'Étiquettes',
121125
language: 'Langue',

0 commit comments

Comments
 (0)