diff --git a/models/workbench/package.json b/models/workbench/package.json index 5f1b5de7fb..a912de8c0f 100644 --- a/models/workbench/package.json +++ b/models/workbench/package.json @@ -33,6 +33,7 @@ "@hcengineering/ui": "^0.6.2", "@hcengineering/view": "^0.6.1", "@hcengineering/model-view": "~0.6.0", - "@hcengineering/workbench-resources": "~0.6.1" + "@hcengineering/workbench-resources": "~0.6.1", + "@hcengineering/model-preference": "~0.6.0" } } diff --git a/models/workbench/src/index.ts b/models/workbench/src/index.ts index 0873af62d8..d01de9309c 100644 --- a/models/workbench/src/index.ts +++ b/models/workbench/src/index.ts @@ -15,10 +15,11 @@ import type { IntlString, Asset } from '@hcengineering/platform' import { Class, DOMAIN_MODEL, Ref, Space } from '@hcengineering/core' -import { Model, Mixin, Builder, UX } from '@hcengineering/model' -import type { Application, SpaceView, ViewConfiguration } from '@hcengineering/workbench' +import { Model, Mixin, Builder, UX, Prop, TypeRef } from '@hcengineering/model' +import type { Application, SpaceView, ViewConfiguration, HiddenApplication } from '@hcengineering/workbench' import view, { KeyBinding } from '@hcengineering/view' import { createAction } from '@hcengineering/model-view' +import preference, { TPreference } from '@hcengineering/model-preference' import core, { TDoc, TClass } from '@hcengineering/model-core' import workbench from './plugin' @@ -34,13 +35,19 @@ export class TApplication extends TDoc implements Application { hidden!: boolean } +@Model(workbench.class.HiddenApplication, preference.class.Preference) +export class THiddenApplication extends TPreference implements HiddenApplication { + @Prop(TypeRef(workbench.class.Application), workbench.string.HiddenApplication) + attachedTo!: Ref +} + @Mixin(workbench.mixin.SpaceView, core.class.Class) export class TSpaceView extends TClass implements SpaceView { view!: ViewConfiguration } export function createModel (builder: Builder): void { - builder.createModel(TApplication, TSpaceView) + builder.createModel(TApplication, TSpaceView, THiddenApplication) builder.mixin(workbench.class.Application, core.class.Class, view.mixin.AttributePresenter, { presenter: workbench.component.ApplicationPresenter }) diff --git a/models/workbench/src/plugin.ts b/models/workbench/src/plugin.ts index 799aef7a74..8b44c73fa7 100644 --- a/models/workbench/src/plugin.ts +++ b/models/workbench/src/plugin.ts @@ -28,7 +28,8 @@ export default mergeIds(workbenchId, workbench, { }, string: { Application: '' as IntlString, - SpaceBrowser: '' as IntlString + SpaceBrowser: '' as IntlString, + HiddenApplication: '' as IntlString }, function: { HasArchiveSpaces: '' as Resource<(spaces: Space[]) => boolean> diff --git a/packages/theme/styles/panel.scss b/packages/theme/styles/panel.scss index 743c8be9e1..f855b60a90 100644 --- a/packages/theme/styles/panel.scss +++ b/packages/theme/styles/panel.scss @@ -232,13 +232,9 @@ } } - &.asideShown { - border: none; - - .popupPanel-body__main { - border: 1px solid var(--divider-color); - border-radius: 0 0 .5rem .5rem; - } + &.asideShown .popupPanel-body__main { + border: 1px solid var(--divider-color); + border-radius: 0 0 .5rem .5rem; } } } diff --git a/packages/ui/src/components/Scroller.svelte b/packages/ui/src/components/Scroller.svelte index 3e49c66246..6867a13c7a 100644 --- a/packages/ui/src/components/Scroller.svelte +++ b/packages/ui/src/components/Scroller.svelte @@ -254,6 +254,7 @@
+ + + + + + diff --git a/packages/ui/src/index.ts b/packages/ui/src/index.ts index 15553ed999..b61b70e9f8 100644 --- a/packages/ui/src/index.ts +++ b/packages/ui/src/index.ts @@ -136,6 +136,7 @@ export { default as IconScale } from './components/icons/Scale.svelte' export { default as IconScaleFull } from './components/icons/ScaleFull.svelte' export { default as IconOpen } from './components/icons/Open.svelte' export { default as IconCheckCircle } from './components/icons/CheckCircle.svelte' +export { default as IconColStar } from './components/icons/ColStar.svelte' export { default as PanelInstance } from './components/PanelInstance.svelte' export { default as Panel } from './components/Panel.svelte' diff --git a/plugins/workbench-assets/lang/en.json b/plugins/workbench-assets/lang/en.json index 005a628ff2..f842a4d5fb 100644 --- a/plugins/workbench-assets/lang/en.json +++ b/plugins/workbench-assets/lang/en.json @@ -24,6 +24,7 @@ "ContactUs": "Contact us", "OpenPlatformGuide": "Open Platform Guide", "AccessWorkspaceSettings": "Access your workspace settings", - "HowToWorkFaster": "Learn how to work faster" + "HowToWorkFaster": "Learn how to work faster", + "HiddenApplication": "Hidden application" } } \ No newline at end of file diff --git a/plugins/workbench-assets/lang/ru.json b/plugins/workbench-assets/lang/ru.json index 7141fde7f9..a3f2dc8c4c 100644 --- a/plugins/workbench-assets/lang/ru.json +++ b/plugins/workbench-assets/lang/ru.json @@ -24,6 +24,7 @@ "ContactUs": "Связаться с нами", "OpenPlatformGuide": "Открыть руководство пользователя", "AccessWorkspaceSettings": "Открыть настройки рабочего пространства", - "HowToWorkFaster": "Узнайте как работать эффективнее" + "HowToWorkFaster": "Узнайте как работать эффективнее", + "HiddenApplication": "Скрытое приложение" } } \ No newline at end of file diff --git a/plugins/workbench-resources/src/components/AppItem.svelte b/plugins/workbench-resources/src/components/AppItem.svelte index 9377752844..30bd33d4bf 100644 --- a/plugins/workbench-resources/src/components/AppItem.svelte +++ b/plugins/workbench-resources/src/components/AppItem.svelte @@ -15,7 +15,8 @@
{#if notify}
{/if} + {#if editable} +
{ + hidden = !hidden + dispatch('visible', !hidden) + }} + > + +
+ {/if} diff --git a/plugins/workbench-resources/src/components/Applications.svelte b/plugins/workbench-resources/src/components/Applications.svelte index 6691fca5d9..e1ed72f15b 100644 --- a/plugins/workbench-resources/src/components/Applications.svelte +++ b/plugins/workbench-resources/src/components/Applications.svelte @@ -17,38 +17,143 @@ import type { Application } from '@hcengineering/workbench' import { createEventDispatcher } from 'svelte' import AppItem from './AppItem.svelte' - import { Scroller } from '@hcengineering/ui' + import { Scroller, IconDownOutline } from '@hcengineering/ui' + import { showApplication, hideApplication } from '../utils' + import { createQuery } from '@hcengineering/presentation' + import workbench from '@hcengineering/workbench' export let active: Ref | undefined export let apps: Application[] = [] export let direction: 'vertical' | 'horizontal' = 'vertical' const dispatch = createEventDispatcher() + + let hiddenAppsIds: Ref[] = [] + const hiddenAppsIdsQuery = createQuery() + hiddenAppsIdsQuery.query(workbench.class.HiddenApplication, {}, (res) => { + hiddenAppsIds = res.map((r) => r.attachedTo) + }) + + let shown: boolean = false -
- - {#each apps as app} +
+ +
+ {#each apps.filter((it) => (shown ? true : !hiddenAppsIds.includes(it._id))) as app}