Skip to content

Commit

Permalink
UBERF-8063 Unarchive action for wiki and drive (#6522)
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
  • Loading branch information
aonnikov authored Sep 11, 2024
1 parent e497946 commit 581e003
Show file tree
Hide file tree
Showing 16 changed files with 84 additions and 16 deletions.
26 changes: 25 additions & 1 deletion models/document/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import { generateClassNotificationTypes } from '@hcengineering/model-notificatio
import preference, { TPreference } from '@hcengineering/model-preference'
import presentation from '@hcengineering/model-presentation'
import tracker from '@hcengineering/model-tracker'
import view, { actionTemplates, createAction } from '@hcengineering/model-view'
import view, { actionTemplates, createAction, type ViewAction } from '@hcengineering/model-view'
import workbench from '@hcengineering/model-workbench'
import notification from '@hcengineering/notification'
import { getEmbeddedLabel, type Asset } from '@hcengineering/platform'
Expand Down Expand Up @@ -233,6 +233,30 @@ function defineTeamspace (builder: Builder): void {
actions: [tracker.action.EditRelatedTargets, tracker.action.NewRelatedIssue]
})

createAction(builder, {
label: view.string.UnArchive,
icon: view.icon.Archive,
action: view.actionImpl.UpdateDocument as ViewAction,
actionProps: {
key: 'archived',
ask: true,
value: false,
label: view.string.UnArchive,
message: document.string.UnarchiveConfirm
},
input: 'any',
category: view.category.General,
target: document.class.Teamspace,
visibilityTester: view.function.CanArchiveSpace,
query: {
archived: true
},
context: {
mode: ['context', 'browser'],
group: 'tools'
}
})

createAction(
builder,
{
Expand Down
3 changes: 2 additions & 1 deletion models/document/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export default mergeIds(documentId, document, {
ConfigDescription: '' as IntlString,
ParentDocument: '' as IntlString,
ChildDocument: '' as IntlString,
LockedBy: '' as IntlString
LockedBy: '' as IntlString,
UnarchiveConfirm: '' as IntlString
}
})
32 changes: 31 additions & 1 deletion models/drive/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,13 @@ import { TAttachedDoc, TDoc, TType, TTypedSpace } from '@hcengineering/model-cor
import presentation from '@hcengineering/model-presentation'
import print from '@hcengineering/model-print'
import tracker from '@hcengineering/model-tracker'
import view, { type Viewlet, actionTemplates, classPresenter, createAction } from '@hcengineering/model-view'
import view, {
type ViewAction,
type Viewlet,
actionTemplates,
classPresenter,
createAction
} from '@hcengineering/model-view'
import workbench from '@hcengineering/model-workbench'
import { getEmbeddedLabel } from '@hcengineering/platform'

Expand Down Expand Up @@ -279,6 +285,30 @@ function defineDrive (builder: Builder): void {
actions: [tracker.action.EditRelatedTargets, print.action.Print, tracker.action.NewRelatedIssue]
})

createAction(builder, {
label: view.string.UnArchive,
icon: view.icon.Archive,
action: view.actionImpl.UpdateDocument as ViewAction,
actionProps: {
key: 'archived',
ask: true,
value: false,
label: view.string.UnArchive,
message: drive.string.UnarchiveConfirm
},
input: 'any',
category: view.category.General,
target: drive.class.Drive,
visibilityTester: view.function.CanArchiveSpace,
query: {
archived: true
},
context: {
mode: ['context', 'browser'],
group: 'tools'
}
})

createAction(
builder,
{
Expand Down
3 changes: 2 additions & 1 deletion models/drive/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export default mergeIds(driveId, drive, {
Files: '' as IntlString,
Folders: '' as IntlString,
Version: '' as IntlString,
Restore: '' as IntlString
Restore: '' as IntlString,
UnarchiveConfirm: '' as IntlString
}
})
3 changes: 2 additions & 1 deletion plugins/document-assets/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"Icon": "Icon",
"Color": "Color",
"RoleLabel": "Role: {role}",
"Embeddings": "Embeddings"
"Embeddings": "Embeddings",
"UnarchiveConfirm": "Do you want to unarchive teamspace?"
}
}
3 changes: 2 additions & 1 deletion plugins/document-assets/lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"Icon": "Icono",
"Color": "Color",
"RoleLabel": "Role: {role}",
"Embeddings": "Incrustaciones"
"Embeddings": "Incrustaciones",
"UnarchiveConfirm": "¿Quieres desarchivar el trabajo?"
}
}
3 changes: 2 additions & 1 deletion plugins/document-assets/lang/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"Icon": "Icône",
"Color": "Couleur",
"RoleLabel": "Rôle : {role}",
"Embeddings": "Intégrations"
"Embeddings": "Intégrations",
"UnarchiveConfirm": "Voulez-vous désarchiver le l'espace d'équipe ?"
}
}
3 changes: 2 additions & 1 deletion plugins/document-assets/lang/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"Icon": "Ícone",
"Color": "Cor",
"RoleLabel": "Papel: {role}",
"Embeddings": "Incorporações"
"Embeddings": "Incorporações",
"UnarchiveConfirm": "Você deseja desarquivar o trabalho?"
}
}
3 changes: 2 additions & 1 deletion plugins/document-assets/lang/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"Icon": "Иконка",
"Color": "Цвет",
"RoleLabel": "Роль: {role}",
"Embeddings": "Вложения"
"Embeddings": "Вложения",
"UnarchiveConfirm": "Вы уверены, что хотите разархивировать пространство?"
}
}
3 changes: 2 additions & 1 deletion plugins/document-assets/lang/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"Icon": "图标",
"Color": "颜色",
"RoleLabel": "角色:{role}",
"Embeddings": "嵌入"
"Embeddings": "嵌入",
"UnarchiveConfirm": "您确定要取消存档吗?"
}
}
3 changes: 2 additions & 1 deletion plugins/drive-assets/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"Rename": "Rename",
"Restore": "Restore",
"RoleLabel": "Role",
"Root": "/"
"Root": "/",
"UnarchiveConfirm": "Are you sure you want to unarchive the drive?"
}
}
3 changes: 2 additions & 1 deletion plugins/drive-assets/lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"Rename": "Renombrar",
"Restore": "Restaurar",
"RoleLabel": "Rol",
"Root": "/"
"Root": "/",
"UnarchiveConfirm": "¿Estás seguro de que deseas desarchivar la unidad?"
}
}
3 changes: 2 additions & 1 deletion plugins/drive-assets/lang/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"Rename": "Renommer",
"Restore": "Restaurer",
"RoleLabel": "Rôle",
"Root": "/"
"Root": "/",
"UnarchiveConfirm": "Êtes-vous sûr de vouloir désarchiver le disque?"
}
}
3 changes: 2 additions & 1 deletion plugins/drive-assets/lang/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"Rename": "Renomear",
"Restore": "Restaurar",
"RoleLabel": "Papel",
"Root": "/"
"Root": "/",
"UnarchiveConfirm": "Tem a certeza de que deseja desarquivar a unidade?"
}
}
3 changes: 2 additions & 1 deletion plugins/drive-assets/lang/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"Rename": "Переименовать",
"Restore": "Восстановить",
"RoleLabel": "Роль",
"Root": "/"
"Root": "/",
"UnarchiveConfirm": "Вы уверены, что хотите разархивировать диск?"
}
}
3 changes: 2 additions & 1 deletion plugins/drive-assets/lang/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"Rename": "重命名",
"Restore": "恢复",
"RoleLabel": "角色",
"Root": "/"
"Root": "/",
"UnarchiveConfirm": "您确定要取消存档磁盘吗?"
}
}

0 comments on commit 581e003

Please sign in to comment.