+
+
+
diff --git a/apps/files_sharing/src/files_sharing_tab.js b/apps/files_sharing/src/files_sharing_tab.js
index 2c12703ab83f2..ecc51a061c9a2 100644
--- a/apps/files_sharing/src/files_sharing_tab.js
+++ b/apps/files_sharing/src/files_sharing_tab.js
@@ -29,6 +29,7 @@ import SharingTab from './views/SharingTab'
import ShareSearch from './services/ShareSearch'
import ExternalLinkActions from './services/ExternalLinkActions'
import TabSections from './services/TabSections'
+import store from './store'
// Init Sharing Tab Service
if (!window.OCA.Sharing) {
@@ -60,6 +61,7 @@ window.addEventListener('DOMContentLoaded', function() {
TabInstance = new View({
// Better integration with vue parent component
parent: context,
+ store,
})
// Only mount after we have all the info we need
await TabInstance.update(fileInfo)
@@ -67,6 +69,7 @@ window.addEventListener('DOMContentLoaded', function() {
},
update(fileInfo) {
TabInstance.update(fileInfo)
+ store.commit('addCurrentTab', 'default')
},
destroy() {
TabInstance.$destroy()
diff --git a/apps/files_sharing/src/mixins/SharesMixin.js b/apps/files_sharing/src/mixins/SharesMixin.js
index b4da09c1b1c06..9170a35bc8d5b 100644
--- a/apps/files_sharing/src/mixins/SharesMixin.js
+++ b/apps/files_sharing/src/mixins/SharesMixin.js
@@ -188,7 +188,7 @@ export default {
*/
onExpirationDisable() {
this.share.expireDate = ''
- this.queueUpdate('expireDate')
+ // this.queueUpdate('expireDate')
},
/**
diff --git a/apps/files_sharing/src/store.js b/apps/files_sharing/src/store.js
new file mode 100644
index 0000000000000..cc6d643c2b2cd
--- /dev/null
+++ b/apps/files_sharing/src/store.js
@@ -0,0 +1,78 @@
+/**
+ * @copyright Copyright (c) 2021 Yogesh Shejwadkar
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+import Vue from 'vue'
+import Vuex from 'vuex'
+import Share from './models/Share'
+
+Vue.use(Vuex)
+
+const store = new Vuex.Store({
+ state: {
+ share: {
+ type: Share,
+ default: null,
+ },
+ option: {},
+ fromInput: Boolean,
+ currentTab: 'default',
+ },
+ mutations: {
+ addShare(state, share) {
+ state.share = share
+ console.debug('this is addShare mutation', share)
+ },
+ addOption(state, option) {
+ state.option = option
+ console.debug('this is addOptions mutation', option)
+ },
+ addFromInput(state, fromInput) {
+ state.fromInput = fromInput
+ console.debug('this is addFromInput mutation', fromInput)
+ },
+ addCurrentTab(state, currentTab) {
+ state.currentTab = currentTab
+ console.debug('this is addCurrentTab mutation', currentTab)
+ },
+ },
+ actions: {
+
+ },
+ getters: {
+ getShare(state) {
+ console.debug('this is getter getShare', state.share)
+ return state.share
+ },
+ getOption(state) {
+ console.debug('this is getter getOption', state.option)
+ return state.option
+ },
+ getFromInput(state) {
+ console.debug('this is getter getFromInput', state.fromInput)
+ return state.fromInput
+ },
+ getCurrentTab(state) {
+ console.debug('this is getter getCurrentTab', state.currentTab)
+ return state.currentTab
+ },
+ },
+})
+
+export default store
diff --git a/apps/files_sharing/src/views/SharingTab.vue b/apps/files_sharing/src/views/SharingTab.vue
index e08ce261522e1..f1e3f43ef9505 100644
--- a/apps/files_sharing/src/views/SharingTab.vue
+++ b/apps/files_sharing/src/views/SharingTab.vue
@@ -30,57 +30,71 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-