mirror of
https://github.com/hcengineering/platform.git
synced 2026-10-01 22:15:04 +02:00
Space presenter (#3100)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
// Copyright © 2022 Hardcore Engineering Inc.
|
||||
// Copyright © 2023 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
|
||||
@@ -13,31 +13,17 @@
|
||||
// limitations under the License.
|
||||
-->
|
||||
<script lang="ts">
|
||||
import { Ref, Space } from '@hcengineering/core'
|
||||
import { Project } from '@hcengineering/tracker'
|
||||
import { TreeNode, NavLink } from '@hcengineering/view-resources'
|
||||
import { SpacesNavModel } from '@hcengineering/workbench'
|
||||
import { SpecialElement } from '@hcengineering/workbench-resources'
|
||||
import tracker, { Project } from '@hcengineering/tracker'
|
||||
import { Icon } from '@hcengineering/ui'
|
||||
|
||||
export let space: Project
|
||||
export let model: SpacesNavModel
|
||||
export let currentSpace: Ref<Space> | undefined
|
||||
export let currentSpecial: string | undefined
|
||||
export let getActions: Function
|
||||
export let deselect: boolean = false
|
||||
export let value: Project
|
||||
</script>
|
||||
|
||||
{#if model?.specials}
|
||||
<TreeNode icon={space?.icon ?? model.icon} title={space.name} actions={() => getActions(space)}>
|
||||
{#each model.specials as special}
|
||||
<NavLink space={space._id} special={special.id}>
|
||||
<SpecialElement
|
||||
indent={'ml-2'}
|
||||
label={special.label}
|
||||
icon={special.icon}
|
||||
selected={deselect ? false : currentSpace === space._id && special.id === currentSpecial}
|
||||
/>
|
||||
</NavLink>
|
||||
{/each}
|
||||
</TreeNode>
|
||||
{/if}
|
||||
<div class="flex-presenter cursor-default inline-presenter">
|
||||
<div class="icon">
|
||||
<Icon icon={value.icon ?? tracker.icon.Home} size="small" />
|
||||
</div>
|
||||
<span class="label no-underline nowrap">
|
||||
{value.name}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
<!--
|
||||
// Copyright © 2022 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.
|
||||
-->
|
||||
<script lang="ts">
|
||||
import { Ref, Space } from '@hcengineering/core'
|
||||
import { Project } from '@hcengineering/tracker'
|
||||
import { TreeNode, NavLink } from '@hcengineering/view-resources'
|
||||
import { SpacesNavModel } from '@hcengineering/workbench'
|
||||
import { SpecialElement } from '@hcengineering/workbench-resources'
|
||||
|
||||
export let space: Project
|
||||
export let model: SpacesNavModel
|
||||
export let currentSpace: Ref<Space> | undefined
|
||||
export let currentSpecial: string | undefined
|
||||
export let getActions: Function
|
||||
export let deselect: boolean = false
|
||||
</script>
|
||||
|
||||
{#if model.specials}
|
||||
<TreeNode icon={space?.icon ?? model.icon} title={space.name} actions={() => getActions(space)}>
|
||||
{#each model.specials as special}
|
||||
<NavLink space={space._id} special={special.id}>
|
||||
<SpecialElement
|
||||
indent={'ml-2'}
|
||||
label={special.label}
|
||||
icon={special.icon}
|
||||
selected={deselect ? false : currentSpace === space._id && special.id === currentSpecial}
|
||||
/>
|
||||
</NavLink>
|
||||
{/each}
|
||||
</TreeNode>
|
||||
{/if}
|
||||
@@ -128,6 +128,7 @@ import StatusRefPresenter from './components/issues/StatusRefPresenter.svelte'
|
||||
import TimeSpendReportPopup from './components/issues/timereport/TimeSpendReportPopup.svelte'
|
||||
import CreateProject from './components/projects/CreateProject.svelte'
|
||||
import ProjectPresenter from './components/projects/ProjectPresenter.svelte'
|
||||
import ProjectSpacePresenter from './components/projects/ProjectSpacePresenter.svelte'
|
||||
import MoveIssues from './components/issues/Move.svelte'
|
||||
import IssueStatistics from './components/sprints/IssueStatistics.svelte'
|
||||
import SprintRefPresenter from './components/sprints/SprintRefPresenter.svelte'
|
||||
@@ -433,6 +434,7 @@ export default async (): Promise<Resources> => ({
|
||||
TemplateEstimationEditor,
|
||||
CreateProject,
|
||||
ProjectPresenter,
|
||||
ProjectSpacePresenter,
|
||||
IssueStatistics,
|
||||
StatusRefPresenter,
|
||||
RelatedIssuesSection,
|
||||
|
||||
@@ -336,6 +336,7 @@ export default mergeIds(trackerId, tracker, {
|
||||
DueDatePresenter: '' as AnyComponent,
|
||||
EditIssueTemplate: '' as AnyComponent,
|
||||
CreateProject: '' as AnyComponent,
|
||||
ProjectSpacePresenter: '' as AnyComponent,
|
||||
ProjectPresenter: '' as AnyComponent,
|
||||
NewIssueHeader: '' as AnyComponent,
|
||||
IconPresenter: '' as AnyComponent,
|
||||
|
||||
Reference in New Issue
Block a user