mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-10 03:37:43 +02:00
Allow to create new team (#2375)
Signed-off-by: muhtimur <timur.mukhamedishin@xored.com>
This commit is contained in:
@@ -21,12 +21,11 @@
|
||||
import preference from '@hcengineering/preference'
|
||||
import { getClient } from '@hcengineering/presentation'
|
||||
import { Action, getCurrentLocation, IconAdd, IconEdit, IconSearch, navigate, showPopup } from '@hcengineering/ui'
|
||||
import { getActions as getContributedActions } from '@hcengineering/view-resources'
|
||||
import { getActions as getContributedActions, getObjectPresenter } from '@hcengineering/view-resources'
|
||||
import { SpacesNavModel } from '@hcengineering/workbench'
|
||||
import { createEventDispatcher } from 'svelte'
|
||||
import plugin from '../../plugin'
|
||||
import { classIcon, getSpaceName } from '../../utils'
|
||||
import SpecialElement from './SpecialElement.svelte'
|
||||
import TreeItem from './TreeItem.svelte'
|
||||
import TreeNode from './TreeNode.svelte'
|
||||
|
||||
@@ -113,36 +112,33 @@
|
||||
|
||||
<TreeNode label={model.label} parent actions={async () => getParentActions()} indent={'ml-2'}>
|
||||
{#each spaces as space (space._id)}
|
||||
{#if model.specials}
|
||||
<TreeNode icon={model.icon} title={space.name} indent={'ml-2'} actions={() => getActions(space)}>
|
||||
{#each model.specials as special}
|
||||
<SpecialElement
|
||||
{#await getObjectPresenter(client, space._class, { key: '' }) then presenter}
|
||||
{#if model.specials && presenter}
|
||||
<svelte:component
|
||||
this={presenter.presenter}
|
||||
{space}
|
||||
{model}
|
||||
{currentSpace}
|
||||
{currentSpecial}
|
||||
{getActions}
|
||||
{selectSpace}
|
||||
/>
|
||||
{:else}
|
||||
{#await getSpaceName(client, space) then name}
|
||||
<TreeItem
|
||||
indent={'ml-4'}
|
||||
label={special.label}
|
||||
icon={special.icon}
|
||||
on:click={() => dispatch('special', special.id)}
|
||||
selected={currentSpace === space._id && special.id === currentSpecial}
|
||||
_id={space._id}
|
||||
title={name}
|
||||
icon={classIcon(client, space._class)}
|
||||
selected={currentSpace === space._id}
|
||||
actions={() => getActions(space)}
|
||||
bold={isChanged(space, $lastViews)}
|
||||
on:click={() => {
|
||||
selectSpace(space._id, special.id)
|
||||
selectSpace(space._id)
|
||||
}}
|
||||
/>
|
||||
{/each}
|
||||
</TreeNode>
|
||||
{:else}
|
||||
{#await getSpaceName(client, space) then name}
|
||||
<TreeItem
|
||||
indent={'ml-4'}
|
||||
_id={space._id}
|
||||
title={name}
|
||||
icon={classIcon(client, space._class)}
|
||||
selected={currentSpace === space._id}
|
||||
actions={() => getActions(space)}
|
||||
bold={isChanged(space, $lastViews)}
|
||||
on:click={() => {
|
||||
selectSpace(space._id)
|
||||
}}
|
||||
/>
|
||||
{/await}
|
||||
{/if}
|
||||
{/await}
|
||||
{/if}
|
||||
{/await}
|
||||
{/each}
|
||||
</TreeNode>
|
||||
|
||||
Reference in New Issue
Block a user