Skip to content

Commit dd2315e

Browse files
Joonatan Mäkinenmradavi
andcommitted
Update shared status in container table after adding / deleting share (merge commit)
Merge branch 'bugfix/new-shares-in-container-table' into 'main' * Update shared status in container table after adding or deleting share Closes #1243 See merge request https://gitlab.ci.csc.fi/sds-dev/sd-connect/swift-browser-ui/-/merge_requests/360 Approved-by: Sampsa Penna <sapenna@csc.fi> Co-authored-by: Monika Radaviciute <mradavic@csc.fi> Merged by Joonatan Mäkinen <jmakine@csc.fi>
2 parents 0c5a4fb + f042baa commit dd2315e

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

swift_browser_ui_frontend/src/common/store.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ const store = createStore({
7474
isLoaderVisible: false,
7575
prevActiveEl: null,
7676
newFolder: "",
77+
sharingUpdated: false,
7778
},
7879
mutations: {
7980
setProjects(state, newProjects) {
@@ -248,6 +249,9 @@ const store = createStore({
248249
setNewFolder(state, payload) {
249250
state.newFolder = payload;
250251
},
252+
setSharingUpdated(state, payload) {
253+
state.sharingUpdated = payload;
254+
},
251255
},
252256
actions: {
253257
updateContainers: async function (

swift_browser_ui_frontend/src/components/ContainerTable.vue

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,8 @@ export default {
9898
active() {
9999
return this.$store.state.active;
100100
},
101-
openShareModal: {
102-
get() {
103-
return this.$store.state.openShareModal;
104-
},
105-
set() {},
101+
sharingUpdated () {
102+
return this.$store.state.sharingUpdated;
106103
},
107104
},
108105
watch: {
@@ -124,11 +121,10 @@ export default {
124121
this.getPage();
125122
this.setPagination();
126123
},
127-
openShareModal: function () {
128-
if(!this.openShareModal) {
129-
setTimeout(() => {
130-
this.getSharingContainers().then(() => this.getPage());
131-
}, 3000);
124+
sharingUpdated() {
125+
if (this.sharingUpdated) {
126+
this.getSharingContainers().then(() => this.getPage());
127+
this.$store.commit("setSharingUpdated", false);
132128
}
133129
},
134130
},

swift_browser_ui_frontend/src/components/ShareModal.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,8 @@ export default {
482482
);
483483
}
484484
485+
// signal to update sharing containers in container table
486+
this.$store.commit("setSharingUpdated", true);
485487
return true;
486488
},
487489
toggleShareGuide: function () {

swift_browser_ui_frontend/src/components/ShareModalTable.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,7 @@ export default {
348348
this.$emit("removeSharedFolder", this.toDelete);
349349
await this.deleteFolderShare(this.toDelete);
350350
this.clearDelete();
351+
this.$store.commit("setSharingUpdated", true);
351352
},
352353
clearDelete: function () {
353354
this.clickedDelete = false;

0 commit comments

Comments
 (0)