TSK-976: Hide preview action (#2847)

Signed-off-by: Denis Maslennikov <denis.maslennikov@gmail.com>
This commit is contained in:
Denis Maslennikov 2023-03-29 11:25:26 +07:00 committed by GitHub
parent a95242f740
commit b7f8fb68ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 18 deletions

View File

@ -18,7 +18,6 @@ import { DOMAIN_MODEL } from '@hcengineering/core'
import { Builder, Mixin, Model } from '@hcengineering/model'
import core, { TClass, TDoc } from '@hcengineering/model-core'
import preference, { TPreference } from '@hcengineering/model-preference'
import presenation from '@hcengineering/model-presentation'
import type { Asset, IntlString, Resource, Status } from '@hcengineering/platform'
import { DOMAIN_PREFERENCE } from '@hcengineering/preference'
import type { AnyComponent, Location } from '@hcengineering/ui'
@ -744,22 +743,26 @@ export function createModel (builder: Builder): void {
classPresenter(builder, core.class.EnumOf, view.component.EnumPresenter, view.component.EnumEditor)
createAction(builder, {
action: view.actionImpl.ShowPopup,
actionProps: {
component: view.component.IndexedDocumentPreview,
fillProps: {
_id: 'objectId'
}
},
label: presenation.string.DocumentPreview,
keyBinding: [''],
input: 'focus',
icon: view.icon.Open,
category: view.category.GeneralNavigation,
target: core.class.Doc,
context: { mode: ['context', 'browser', 'editor'] }
})
// createAction(
// builder,
// {
// action: view.actionImpl.ShowPopup,
// actionProps: {
// component: view.component.IndexedDocumentPreview,
// fillProps: {
// _id: 'objectId'
// }
// },
// label: presenation.string.DocumentPreview,
// keyBinding: [''],
// input: 'focus',
// icon: view.icon.Open,
// category: view.category.GeneralNavigation,
// target: core.class.Doc,
// context: { mode: ['context', 'browser', 'editor'] }
// },
// view.action.Preview
// )
createAction(
builder,

View File

@ -35,6 +35,7 @@ export default mergeIds(viewId, view, {
ShowPreview: '' as ViewAction,
ShowActions: '' as ViewAction,
Preview: '' as ViewAction,
Open: '' as ViewAction
},

View File

@ -54,7 +54,9 @@
resActions = [...newActions, ...actions].sort(
(a, b) => (order as any)[a.group ?? 'other'] - (order as any)[b.group ?? 'other']
)
loaded = true
if (resActions.length > 0) {
loaded = true
}
})
</script>

View File

@ -629,6 +629,7 @@ const view = plugin(viewId, {
ShowPreview: '' as Ref<Action>,
ShowActions: '' as Ref<Action>,
Preview: '' as Ref<Action>,
// Edit document
Open: '' as Ref<Action>