mirror of
https://github.com/hcengineering/platform.git
synced 2025-05-12 02:11:57 +00:00
Add parent label in navigator
Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
parent
fe08287484
commit
fa4a2ff430
@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
export let label: string | undefined = undefined
|
export let label: string | undefined = undefined
|
||||||
export let labelIntl: IntlString | undefined = undefined
|
export let labelIntl: IntlString | undefined = undefined
|
||||||
|
export let secondLabel: string | undefined = undefined
|
||||||
export let icon: IconComponent
|
export let icon: IconComponent
|
||||||
export let selected: boolean = false
|
export let selected: boolean = false
|
||||||
export let notify: boolean = false
|
export let notify: boolean = false
|
||||||
@ -39,6 +40,9 @@
|
|||||||
{:else if labelIntl}
|
{:else if labelIntl}
|
||||||
<Label label={labelIntl} />
|
<Label label={labelIntl} />
|
||||||
{/if}
|
{/if}
|
||||||
|
{#if secondLabel}
|
||||||
|
({secondLabel})
|
||||||
|
{/if}
|
||||||
</span>
|
</span>
|
||||||
{#if notify && notificationsCount > 0}
|
{#if notify && notificationsCount > 0}
|
||||||
<span class="nav-item__notifications-count">
|
<span class="nav-item__notifications-count">
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Card, CardSpace, MasterTag } from '@hcengineering/card'
|
import { Card, CardSpace, MasterTag } from '@hcengineering/card'
|
||||||
import { Ref, SortingOrder } from '@hcengineering/core'
|
import { Ref, SortingOrder, WithLookup } from '@hcengineering/core'
|
||||||
import { createLabelsQuery, createNotificationContextsQuery, createQuery, getClient } from '@hcengineering/presentation'
|
import { createLabelsQuery, createNotificationContextsQuery, createQuery, getClient } from '@hcengineering/presentation'
|
||||||
import uiNext, { Button, ButtonVariant, NavItem } from '@hcengineering/ui-next'
|
import uiNext, { Button, ButtonVariant, NavItem } from '@hcengineering/ui-next'
|
||||||
import { createEventDispatcher } from 'svelte'
|
import { createEventDispatcher } from 'svelte'
|
||||||
@ -39,8 +39,8 @@
|
|||||||
const labelsQuery = createLabelsQuery()
|
const labelsQuery = createLabelsQuery()
|
||||||
const notificationContextsQuery = createNotificationContextsQuery()
|
const notificationContextsQuery = createNotificationContextsQuery()
|
||||||
|
|
||||||
let cards: Card[] = []
|
let cards: WithLookup<Card>[] = []
|
||||||
let sortedCards: Card[] = []
|
let sortedCards: WithLookup<Card>[] = []
|
||||||
let total = -1
|
let total = -1
|
||||||
let contextByCard = new Map<Ref<Card>, NotificationContext>()
|
let contextByCard = new Map<Ref<Card>, NotificationContext>()
|
||||||
let labels: Label[] = []
|
let labels: Label[] = []
|
||||||
@ -84,7 +84,14 @@
|
|||||||
total = res.total
|
total = res.total
|
||||||
isLoading = false
|
isLoading = false
|
||||||
},
|
},
|
||||||
{ total: true, limit, sort: sort === 'alphabetical' ? { title: SortingOrder.Ascending } : { modifiedOn: SortingOrder.Descending } }
|
{
|
||||||
|
total: true,
|
||||||
|
limit,
|
||||||
|
sort: sort === 'alphabetical' ? { title: SortingOrder.Ascending } : { modifiedOn: SortingOrder.Descending },
|
||||||
|
lookup: {
|
||||||
|
parent: cardPlugin.class.Card
|
||||||
|
}
|
||||||
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -138,6 +145,7 @@
|
|||||||
{@const context = contextByCard.get(card._id)}
|
{@const context = contextByCard.get(card._id)}
|
||||||
<NavItem
|
<NavItem
|
||||||
label={card.title}
|
label={card.title}
|
||||||
|
secondLabel={card.$lookup?.parent?.title}
|
||||||
icon={clazz.icon ?? cardPlugin.icon.Card}
|
icon={clazz.icon ?? cardPlugin.icon.Card}
|
||||||
selected={selectedCard === card._id}
|
selected={selectedCard === card._id}
|
||||||
paddingLeft="1.75rem"
|
paddingLeft="1.75rem"
|
||||||
|
Loading…
Reference in New Issue
Block a user