Allow to create new team (#2375)

Signed-off-by: muhtimur <timur.mukhamedishin@xored.com>
This commit is contained in:
Timur Mukhamedishin
2022-11-17 11:31:42 +07:00
committed by GitHub
parent 7e03e8f59d
commit 2cd894e7ad
14 changed files with 233 additions and 32 deletions
@@ -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>