3535 </template >
3636 {{ t('tables', 'Delete application') }}
3737 </NcActionButton >
38+ <!-- ARCHIVE -->
39+ <NcActionButton v-if =" !context.archived" :close-after-click =" true" @click =" toggleArchiveContext(true)" >
40+ <template #icon >
41+ <ArchiveArrowDown :size =" 20" />
42+ </template >
43+ {{ t('tables', 'Archive application') }}
44+ </NcActionButton >
45+
46+ <!-- UNARCHIVE -->
47+ <NcActionButton v-if =" context.archived" :close-after-click =" true" @click =" toggleArchiveContext(false)" >
48+ <template #icon >
49+ <ArchiveArrowUpOutline :size =" 20" />
50+ </template >
51+ {{ t('tables', 'Unarchive application') }}
52+ </NcActionButton >
53+
3854 <NcActionCheckbox :checked =" showInNavigation" data-cy =" navigationContextShowInNavSwitch" @change =" changeDisplayMode" >
3955 {{ t('tables', 'Show in app list') }}
4056 </NcActionCheckbox >
@@ -50,6 +66,8 @@ import { emit } from '@nextcloud/event-bus'
5066import PlaylistEdit from ' vue-material-design-icons/PlaylistEdit.vue'
5167import FileSwapOutline from ' vue-material-design-icons/FileSwapOutline.vue'
5268import DeleteOutline from ' vue-material-design-icons/TrashCanOutline.vue'
69+ import ArchiveArrowDown from ' vue-material-design-icons/ArchiveArrowDown.vue'
70+ import ArchiveArrowUpOutline from ' vue-material-design-icons/ArchiveArrowUpOutline.vue'
5371import permissionsMixin from ' ../../../shared/components/ncTable/mixins/permissionsMixin.js'
5472import svgHelper from ' ../../../shared/components/ncIconPicker/mixins/svgHelper.js'
5573import { NAV_ENTRY_MODE } from ' ../../../shared/constants.ts'
@@ -64,6 +82,8 @@ export default {
6482 FileSwapOutline,
6583 TableIcon,
6684 DeleteOutline,
85+ ArchiveArrowDown,
86+ ArchiveArrowUpOutline,
6787 NcIconSvgWrapper,
6888 NcAppNavigationItem,
6989 NcActionButton,
@@ -99,7 +119,7 @@ export default {
99119 },
100120
101121 methods: {
102- ... mapActions (useTablesStore, [' updateDisplayMode' ]),
122+ ... mapActions (useTablesStore, [' updateDisplayMode' , ' archiveContext ' , ' unarchiveContext ' ]),
103123 emit,
104124 async editContext () {
105125 emit (' tables:context:edit' , this .context .id )
@@ -118,6 +138,13 @@ export default {
118138 }
119139 return false
120140 },
141+ async toggleArchiveContext (archived ) {
142+ if (archived) {
143+ await this .archiveContext ({ id: this .context .id })
144+ } else {
145+ await this .unarchiveContext ({ id: this .context .id })
146+ }
147+ },
121148 async changeDisplayMode () {
122149 const value = ! this .showInNavigation
123150 const displayMode = value ? NAV_ENTRY_MODE .NAV_ENTRY_MODE_ALL : NAV_ENTRY_MODE .NAV_ENTRY_MODE_HIDDEN
0 commit comments