16
16
{{ $t("message.share.close") }}
17
17
</c-button >
18
18
</header >
19
- <c-card-content >
19
+ <c-card-content id = " share-card-modal-content " >
20
20
<h6 class =" subtitle is-6 has-text-dark" >
21
21
{{ $t("message.share.share_subtitle") }}
22
22
</h6 >
86
86
</c-flex >
87
87
</c-container >
88
88
<c-alert
89
- v-show =" isShared || isPermissionRemoved"
89
+ v-show =" isShared || isPermissionRemoved || isPermissionUpdated "
90
90
type =" success"
91
91
>
92
92
<div class =" shared-notification" >
93
93
{{ 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')
95
96
}}
96
97
<c-button
97
98
text
111
112
:folder-name =" folderName"
112
113
:access-rights =" accessRights"
113
114
@removeSharedFolder =" removeSharedFolder"
115
+ @updateSharedFolder =" updateSharedFolder"
114
116
/>
115
117
</c-container >
116
118
</c-card-content >
@@ -143,6 +145,7 @@ export default {
143
145
isShared: false ,
144
146
sharedDetails: [],
145
147
isPermissionRemoved: false ,
148
+ isPermissionUpdated: false ,
146
149
timeout: null ,
147
150
};
148
151
},
@@ -207,18 +210,10 @@ export default {
207
210
(ret ) => {
208
211
this .loading = false ;
209
212
if (ret) {
210
- this .isShared = true ;
211
213
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
- }
220
- this .timeout = setTimeout (
221
- () => this .closeSharedNotification (), 3000 );
214
+ this .closeSharedNotification ();
215
+ this .isShared = true ;
216
+ this .closeSharedNotificationWithTimeout ();
222
217
}
223
218
},
224
219
);
@@ -302,8 +297,18 @@ export default {
302
297
this .isShared = false ;
303
298
this .isPermissionRemoved = false ;
304
299
},
300
+ closeSharedNotificationWithTimeout () {
301
+ document .getElementById (" share-card-modal-content" ).scrollTo (0 , 0 );
302
+ this .timeout = setTimeout (() => this .closeSharedNotification (), 3000 );
303
+ },
305
304
closeSharedNotification : function () {
306
- this .isShared ? this .isShared = false : this .isPermissionRemoved = false ;
305
+ if (this .timeout !== null ) {
306
+ clearTimeout (this .timeout );
307
+ }
308
+
309
+ this .isShared = false ;
310
+ this .isPermissionRemoved = false ;
311
+ this .isPermissionUpdated = false ;
307
312
},
308
313
getSharedDetails : function () {
309
314
this .$store .state .client .getShareDetails (
@@ -314,21 +319,19 @@ export default {
314
319
this .tags = [];
315
320
});
316
321
},
322
+ updateSharedFolder : function () {
323
+ this .closeSharedNotification ();
324
+ this .isPermissionUpdated = true ;
325
+ this .closeSharedNotificationWithTimeout ();
326
+ },
317
327
removeSharedFolder : function (folderData ) {
328
+ this .closeSharedNotification ();
318
329
this .sharedDetails = this .sharedDetails .filter (
319
330
item => {
320
331
return item .sharedTo !== folderData .projectId .value ;
321
332
});
322
333
this .isPermissionRemoved = true ;
323
-
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 );
334
+ this .closeSharedNotificationWithTimeout ();
332
335
},
333
336
},
334
337
};
0 commit comments