Skip to content

Commit 107d5cf

Browse files
committed
Show notification when changing permission in share modal
1 parent bdbb2dd commit 107d5cf

File tree

5 files changed

+26
-20
lines changed

5 files changed

+26
-20
lines changed

.github/config/.finnishwords.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ mutta
238238
muussa
239239
muutaman
240240
muutamia
241+
muutettiin
241242
muuttaa
242243
muuttaaksesi
243244
näkyvissä

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111

12+
- Show notification when changing permission in share modal
1213
- Use OIDC as the default Keystone login provider for SSO
1314
- (GH #864) Vault c4ghtransit integration - Uploads object headers to Vault in addition to Object Storage
1415
- (GH #781) Render full details of Folders you have shared and Folders shared with you

swift_browser_ui_frontend/src/common/lang.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ let default_translations = {
203203
write_perm: "Read and write",
204204
shared_successfully: "Folder was shared successfully!",
205205
remove_permission: "Permission was removed successfully!",
206+
update_permission: "Permission was changed successfully.",
206207
shared_table_title: "Project's folder has been shared with",
207208
field_label: "Project Identifiers to share with",
208209
field_placeholder: "Add Share IDs",
@@ -663,6 +664,7 @@ let default_translations = {
663664
write_perm: "Salli säiliöön kirjoitus",
664665
shared_successfully: "Kansion jakaminen onnistui!",
665666
remove_permission: "Lupa poistettiin onnistuneesti!",
667+
update_permission: "Lupa muutettiin onnistuneesti.",
666668
shared_table_title: "Projektin kansio on jaettu",
667669
project_id: "Projektin tunnus",
668670
field_label: "Jaa projektitunnisteille",

swift_browser_ui_frontend/src/components/ShareModal.vue

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,13 @@
8686
</c-flex>
8787
</c-container>
8888
<c-alert
89-
v-show="isShared || isPermissionRemoved"
89+
v-show="isShared || isPermissionRemoved || isPermissionUpdated"
9090
type="success"
9191
>
9292
<div class="shared-notification">
9393
{{ isShared ? $t('message.share.shared_successfully')
94-
: $t('message.share.remove_permission')
94+
: isPermissionUpdated ? $t('message.share.update_permission')
95+
: $t('message.share.remove_permission')
9596
}}
9697
<c-button
9798
text
@@ -111,6 +112,7 @@
111112
:folder-name="folderName"
112113
:access-rights="accessRights"
113114
@removeSharedFolder="removeSharedFolder"
115+
@updateSharedFolder="updateSharedFolder"
114116
/>
115117
</c-container>
116118
</c-card-content>
@@ -143,6 +145,7 @@ export default {
143145
isShared: false,
144146
sharedDetails: [],
145147
isPermissionRemoved: false,
148+
isPermissionUpdated: false,
146149
timeout: null,
147150
};
148151
},
@@ -207,16 +210,9 @@ export default {
207210
(ret) => {
208211
this.loading = false;
209212
if (ret) {
210-
this.isShared = true;
211213
this.getSharedDetails();
212-
213-
if (this.timeout !== null) {
214-
clearTimeout(this.timeout);
215-
this.timeout = null;
216-
if(this.isPermissionRemoved) {
217-
this.isPermissionRemoved = false;
218-
}
219-
}
214+
this.closeSharedNotification();
215+
this.isShared = true;
220216
this.timeout = setTimeout(
221217
() => this.closeSharedNotification(), 3000);
222218
}
@@ -303,7 +299,13 @@ export default {
303299
this.isPermissionRemoved = false;
304300
},
305301
closeSharedNotification: function () {
306-
this.isShared ? this.isShared = false : this.isPermissionRemoved = false;
302+
if (this.timeout !== null) {
303+
clearTimeout(this.timeout);
304+
}
305+
306+
this.isShared = false;
307+
this.isPermissionRemoved = false;
308+
this.isPermissionUpdated = false;
307309
},
308310
getSharedDetails: function () {
309311
this.$store.state.client.getShareDetails(
@@ -314,21 +316,20 @@ export default {
314316
this.tags = [];
315317
});
316318
},
319+
updateSharedFolder: function () {
320+
this.closeSharedNotification();
321+
this.isPermissionUpdated = true;
322+
this.timeout = setTimeout(() => this.closeSharedNotification(), 3000);
323+
},
317324
removeSharedFolder: function (folderData) {
325+
this.closeSharedNotification();
318326
this.sharedDetails = this.sharedDetails.filter(
319327
item => {
320328
return item.sharedTo !== folderData.projectId.value;
321329
});
322330
this.isPermissionRemoved = true;
323331
324-
if (this.timeout !== null) {
325-
clearTimeout(this.timeout);
326-
this.timeout = null;
327-
if (this.isShared) {
328-
this.isShared = false;
329-
}
330-
}
331-
this.timeout = setTimeout(() => this.isPermissionRemoved = false, 3000);
332+
this.timeout = setTimeout(() => this.closeSharedNotification(), 3000);
332333
},
333334
},
334335
};

swift_browser_ui_frontend/src/components/ShareModalTable.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ export default {
133133
[sharedProjectId],
134134
rights,
135135
);
136+
this.$emit("updateSharedFolder");
136137
},
137138
deleteFolderShare: function (folderData) {
138139
removeAccessControlMeta(

0 commit comments

Comments
 (0)