UBERF-8063 Generic space archive/unarchive actions (#6530)

Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
Alexander Onnikov
2024-09-12 14:06:05 +07:00
committed by GitHub
parent 04ce0d70ef
commit ba821dd5d2
53 changed files with 69 additions and 243 deletions
-46
View File
@@ -79,7 +79,6 @@ import {
} from '@hcengineering/task'
import type { AnyComponent } from '@hcengineering/ui'
import { PaletteColorIndexes } from '@hcengineering/ui/src/colors'
import { type ViewAction } from '@hcengineering/view'
import { createPublicLinkAction } from '@hcengineering/model-guest'
import task from './plugin'
@@ -254,51 +253,6 @@ export const actionTemplates = template({
action: task.actionImpl.EditStatuses,
input: 'focus',
category: task.category.Task
},
archiveSpace: {
label: task.string.Archive,
icon: view.icon.Archive,
action: view.actionImpl.UpdateDocument as ViewAction,
actionProps: {
key: 'archived',
value: true,
ask: true,
label: task.string.Archive,
message: task.string.ArchiveConfirm
},
visibilityTester: view.function.CanArchiveSpace,
input: 'any',
category: task.category.Task,
query: {
archived: false
},
context: {
mode: ['context', 'browser'],
group: 'tools'
},
override: [view.action.Archive, view.action.Delete]
},
unarchiveSpace: {
label: task.string.Unarchive,
icon: view.icon.Archive,
action: view.actionImpl.UpdateDocument as ViewAction,
actionProps: {
key: 'archived',
ask: true,
value: false,
label: task.string.Unarchive,
message: task.string.UnarchiveConfirm
},
visibilityTester: view.function.CanArchiveSpace,
input: 'any',
category: task.category.Task,
query: {
archived: true
},
context: {
mode: ['context', 'browser'],
group: 'tools'
}
}
})
-4
View File
@@ -26,16 +26,12 @@ import type { Action, ActionCategory, ViewAction, Viewlet } from '@hcengineering
export default mergeIds(taskId, task, {
action: {
EditStatuses: '' as Ref<Action>,
ArchiveSpace: '' as Ref<Action>,
UnarchiveSpace: '' as Ref<Action>,
ArchiveState: '' as Ref<Action>,
PublicLink: '' as Ref<Action<Doc, any>>,
ExportTasks: '' as Ref<Action>
},
actionImpl: {
EditStatuses: '' as ViewAction,
ArchiveSpace: '' as ViewAction,
UnarchiveSpace: '' as ViewAction,
SelectStatus: '' as ViewAction,
ExportTasks: '' as ViewAction
},