Skip to content

Commit

Permalink
fix: revoke shared folder permission doesn't work
Browse files Browse the repository at this point in the history
  • Loading branch information
agatha197 committed Aug 20, 2024
1 parent 01c9e65 commit b6052e3
Showing 1 changed file with 23 additions and 13 deletions.
36 changes: 23 additions & 13 deletions src/components/backend-ai-storage-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ export default class BackendAiStorageList extends BackendAIPage {
</backend-ai-dialog>
<backend-ai-dialog id="modify-folder-name-dialog" fixed backdrop>
<span slot="title">${_t('data.folders.RenameAFolder')}</span>
<span slot="title">${_t('data.explorer.RenameAFolder')}</span>
<div slot="content" class="vertical layout flex">
<mwc-textfield
id="clone-folder-src"
Expand Down Expand Up @@ -1098,17 +1098,27 @@ export default class BackendAiStorageList extends BackendAIPage {
const selectNodeList = this.shadowRoot?.querySelectorAll(
'#modify-permission-dialog mwc-select',
);
const inputList = Array.prototype.filter
.call(
selectNodeList,
(pulldown, idx) =>
pulldown.value !== (this.invitees as inviteeData[])[idx].perm,
)
.map((pulldown, idx) => ({
perm: pulldown.value === 'kickout' ? null : pulldown.value,
user: this.invitees[idx].shared_to.uuid,
vfolder: this.invitees[idx].vfolder_id,
}));
const inputList: Array<{
perm: string | null;
user: string;
vfolder: string;
}> = [];
selectNodeList?.forEach((pulldown, idx) => {
if (
(pulldown as HTMLSelectElement).value !==
(this.invitees as inviteeData[])[idx].perm
) {
const invitee = this.invitees[idx];
inputList.push({
perm:
(pulldown as HTMLSelectElement).value === 'kickout'
? null
: (pulldown as HTMLSelectElement).value,
user: invitee.shared_to.uuid,
vfolder: invitee.vfolder_id,
});
}
});
const promiseArray = inputList.map((input) =>
globalThis.backendaiclient.vfolder.modify_invitee_permission(input),
);
Expand Down Expand Up @@ -1184,7 +1194,7 @@ export default class BackendAiStorageList extends BackendAIPage {
<mwc-list-item value="wd" ?selected="${rowData.item.perm === 'wd'}">
${_t('data.folders.EditDelete')}
</mwc-list-item>
<mwc-list-item value="kickout"">
<mwc-list-item value="kickout">
${_t('data.folders.KickOut')}
</mwc-list-item>
</mwc-select>
Expand Down

0 comments on commit b6052e3

Please sign in to comment.