selectSpecial(evt.detail)}
+ on:space={(evt) => updateSpace(evt.detail)}
+ on:archive={(evt) => selectArchive()}
+ />
+
{/if}
{#if currentApplication && currentApplication.component}
-
+
+ {:else if specialComponent}
+
{:else}
- {#if ownSpecialComponent}
-
- {:else if specialComponent}
-
- {:else}
-
- {/if}
+
{/if}
diff --git a/plugins/workbench-resources/src/components/navigator/SpacesNav.svelte b/plugins/workbench-resources/src/components/navigator/SpacesNav.svelte
index ba98365580..557329a88a 100644
--- a/plugins/workbench-resources/src/components/navigator/SpacesNav.svelte
+++ b/plugins/workbench-resources/src/components/navigator/SpacesNav.svelte
@@ -12,30 +12,25 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-->
-
{
dispatch('click')
}}
@@ -88,6 +89,10 @@
line-height: 100%;
}
+ &.selected {
+ background-color: var(--theme-button-bg-enabled);
+ }
+
&:hover {
background-color: var(--theme-button-bg-enabled);
.tool {
diff --git a/plugins/workbench-resources/src/index.ts b/plugins/workbench-resources/src/index.ts
index 57aa737548..5c6b719192 100644
--- a/plugins/workbench-resources/src/index.ts
+++ b/plugins/workbench-resources/src/index.ts
@@ -16,15 +16,20 @@
import WorkbenchApp from './components/WorkbenchApp.svelte'
import ApplicationPresenter from './components/ApplicationPresenter.svelte'
import { Resources } from '@anticrm/platform'
+import Archive from './components/Archive.svelte'
+import { Space } from '@anticrm/core'
+
+function hasArchiveSpaces (spaces: Space[]): boolean {
+ return spaces.find(sp => sp.archived) !== undefined
+}
-/*!
- * Anticrm Platform™ Workbench Plugin
- * © 2020 Anticrm Platform Contributors. All Rights Reserved.
- * Licensed under the Eclipse Public License, Version 2.0
- */
export default async (): Promise => ({
component: {
WorkbenchApp,
- ApplicationPresenter
+ ApplicationPresenter,
+ Archive
+ },
+ function: {
+ HasArchiveSpaces: hasArchiveSpaces
}
})
diff --git a/plugins/workbench-resources/src/utils.ts b/plugins/workbench-resources/src/utils.ts
index 8f898533fe..34dd56c449 100644
--- a/plugins/workbench-resources/src/utils.ts
+++ b/plugins/workbench-resources/src/utils.ts
@@ -1,24 +1,22 @@
//
// Copyright © 2020, 2021 Anticrm Platform Contributors.
// Copyright © 2021 Hardcore Engineering Inc.
-//
+//
// Licensed under the Eclipse Public License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. You may
// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0
-//
+//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//
+//
// See the License for the specific language governing permissions and
// limitations under the License.
//
-import type { Ref, Obj, Class } from '@anticrm/core'
+import type { Class, Client, Obj, Ref } from '@anticrm/core'
import type { Asset } from '@anticrm/platform'
-import type { Client } from '@anticrm/core'
-import type { EmployeeAccount } from '@anticrm/contact'
-export function classIcon(client: Client, _class: Ref>): Asset | undefined {
+export function classIcon (client: Client, _class: Ref>): Asset | undefined {
return client.getHierarchy().getClass(_class).icon
}
diff --git a/plugins/workbench/src/index.ts b/plugins/workbench/src/index.ts
index 2e944199fb..feb07b5598 100644
--- a/plugins/workbench/src/index.ts
+++ b/plugins/workbench/src/index.ts
@@ -14,7 +14,7 @@
//
import type { Class, Doc, Mixin, Obj, Ref, Space } from '@anticrm/core'
-import type { Asset, IntlString, Metadata, Plugin } from '@anticrm/platform'
+import type { Asset, IntlString, Metadata, Plugin, Resource } from '@anticrm/platform'
import { plugin } from '@anticrm/platform'
import type { AnyComponent } from '@anticrm/ui'
@@ -59,6 +59,7 @@ export interface SpecialNavModel {
icon: Asset
component: AnyComponent
position?: 'top'|'bottom' // undefined == 'top
+ visibleIf?: Resource<(spaces: Space[]) => boolean>
}
/**