diff --git a/client/src/locales/en-US.json b/client/src/locales/en-US.json
index 64425baaaa5..95a91b75408 100644
--- a/client/src/locales/en-US.json
+++ b/client/src/locales/en-US.json
@@ -348,6 +348,7 @@
"reader": "Reader",
"buttonSelect": "Multiple selection",
"buttonFinish": "Finish",
+ "counter": "{count} user selected | {count} users selected",
"chooseRole": "Choose a role",
"noChanges": "Selected members were already {role}.",
"someFailed": "Some role assignments failed.",
diff --git a/client/src/locales/fr-FR.json b/client/src/locales/fr-FR.json
index 6bb432c6469..5db89b06d5a 100644
--- a/client/src/locales/fr-FR.json
+++ b/client/src/locales/fr-FR.json
@@ -348,6 +348,7 @@
"reader": "Lecteur",
"buttonSelect": "Sélection multiple",
"buttonFinish": "Terminer",
+ "counter": "{count} utilisateur sélectionné | {count} utilisateurs sélectionnés",
"chooseRole": "Choisir un rôle",
"noChanges": "Les membres sélectionnés étaient déjà {role}.",
"someFailed": "Certaines assignations de rôle ont échoué.",
diff --git a/client/src/theme/components/inputs.scss b/client/src/theme/components/inputs.scss
index d2278bd3789..b7591600433 100644
--- a/client/src/theme/components/inputs.scss
+++ b/client/src/theme/components/inputs.scss
@@ -5,11 +5,17 @@
bottom: -1.5rem;
}
-// Sharing Modal : remove currentUser icon in dropdown
+// Workspace Sharing Modal
.current-user {
+ // remove currentUser icon in dropdown
.ms-dropdown-icon {
display: none;
}
+
+ // set opacity to 1 for multiple selection
+ &.workspace-user-role .button-disabled {
+ opacity: 1;
+ }
}
.saas-login-content__input .input-content,
diff --git a/client/src/views/workspaces/WorkspaceSharingModal.vue b/client/src/views/workspaces/WorkspaceSharingModal.vue
index 5c972fbeefc..1a344f84f82 100644
--- a/client/src/views/workspaces/WorkspaceSharingModal.vue
+++ b/client/src/views/workspaces/WorkspaceSharingModal.vue
@@ -25,9 +25,14 @@
class="modal-head-content__search"
v-model="search"
:placeholder="'WorkspaceSharing.searchPlaceholder'"
- @change="updateSelectedUsers()"
/>
+
+ {{ $msTranslate({ key: 'WorkspaceSharing.batchSharing.counter', data: { count: selectedUsers.length } }) }}
+
{
});
});
-const filteredOutUserRoles = computed(() => {
- const searchString = search.value.toLocaleLowerCase();
- return userRoles.value.filter((userRole: UserRole) => {
- return (
- !userRole.user.humanHandle.email.toLocaleLowerCase().includes(searchString) &&
- !userRole.user.humanHandle.label.toLocaleLowerCase().includes(searchString)
- );
- });
-});
-
const filteredSharedUserRoles = computed(() => {
return filteredUserRoles.value
.filter((userRole: UserRole) => userRole.role !== null)
@@ -253,9 +250,8 @@ const filteredNotSharedUserRoles = computed(() => {
.sort((item1, item2) => item1.user.humanHandle.label.localeCompare(item2.user.humanHandle.label));
});
-const selectedUsers = computed(() => filteredUserRoles.value.filter((user) => user.isSelected === true));
+const selectedUsers = computed(() => userRoles.value.filter((user) => user.isSelected === true));
const countSharedUsers = computed(() => filteredSharedUserRoles.value.length + (clientInfo.value ? 1 : 0));
-const someUserSelected = computed(() => filteredUserRoles.value.some((user) => user.isSelected === true));
const selectableFilteredMembers = computed(() => {
return filteredSharedUserRoles.value.filter((user) => user.role && canSelectUser(user.user.profile, user.role));
});
@@ -268,6 +264,7 @@ const batchSharingEnabled = computed(() => {
filteredNotSharedUserRoles.value.length + selectableFilteredMembers.value.length > 1
);
});
+
function currentUserMatchSearch(): boolean {
const searchString = search.value.toLocaleLowerCase();
if (!clientInfo.value) {
@@ -296,15 +293,6 @@ function isSelectDisabled(role: WorkspaceRole | null): boolean {
return false;
}
-function updateSelectedUsers(): void {
- if (!showCheckboxes.value) {
- return;
- }
- for (const userRole of filteredOutUserRoles.value) {
- userRole.isSelected = false;
- }
-}
-
async function onBatchSharingActivate(): Promise {
if (showCheckboxes.value === true) {
for (const user of userRoles.value) {
@@ -621,6 +609,13 @@ async function onBatchRoleChange(newRoleOption: MsOption): Promise {
}
}
}
+
+ .selected-counter {
+ color: var(--parsec-color-light-secondary-grey);
+ font-size: 0.9em;
+ margin: auto;
+ text-align: center;
+ }
}
#profile-assign-info {
diff --git a/client/tests/e2e/specs/workspace_sharing.spec.ts b/client/tests/e2e/specs/workspace_sharing.spec.ts
index 64968acd66a..d3a30f83dac 100644
--- a/client/tests/e2e/specs/workspace_sharing.spec.ts
+++ b/client/tests/e2e/specs/workspace_sharing.spec.ts
@@ -148,17 +148,6 @@ msTest('Batch workspace sharing', async ({ workspaceSharingModal }) => {
await expect(batchDropdown).not.toBeVisible();
await expect(activateBatchButton).toContainText('Multiple selection');
await expect(membersCheckbox).not.toBeVisible();
-
- // Check user is unchecked when filtered out
- const searchInput = content.locator('.ms-search-input');
-
- await activateBatchButton.click();
- await content.locator('#member-checkbox').nth(0).click();
- await content.locator('#suggested-checkbox').nth(0).click();
- await expect(content.locator('#suggested-checkbox').nth(0)).toHaveState('checked');
- await fillIonInput(searchInput, 'or');
- await searchInput.getByRole('button', { name: 'reset' }).click();
- await expect(content.locator('#suggested-checkbox').nth(0)).toHaveState('unchecked');
});
msTest('Batch workspace sharing hidden when reader', async ({ connected }) => {