mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-23 01:55:00 +02:00
Cards fixes (#8278)
This commit is contained in:
@@ -48,7 +48,7 @@
|
||||
|
||||
const query = createQuery()
|
||||
|
||||
const viewletId = card.viewlet.CardList
|
||||
const viewletId = card.viewlet.CardChildList
|
||||
|
||||
let list: List
|
||||
const listProvider = new ListSelectionProvider(
|
||||
|
||||
@@ -13,13 +13,14 @@
|
||||
// limitations under the License.
|
||||
-->
|
||||
<script lang="ts">
|
||||
import { MasterTag, Tag } from '@hcengineering/card'
|
||||
import { CardEvents, MasterTag, Tag } from '@hcengineering/card'
|
||||
import core, { Class, ClassifierKind, Data, Ref } from '@hcengineering/core'
|
||||
import { getEmbeddedLabel } from '@hcengineering/platform'
|
||||
import { Card, getClient } from '@hcengineering/presentation'
|
||||
import { EditBox, Icon, Label } from '@hcengineering/ui'
|
||||
import { createEventDispatcher } from 'svelte'
|
||||
import card from '../plugin'
|
||||
import { Analytics } from '@hcengineering/analytics'
|
||||
|
||||
export let parent: MasterTag | Tag | undefined = undefined
|
||||
export let _class: Ref<Class<MasterTag>> | Ref<Class<Tag>>
|
||||
@@ -39,6 +40,7 @@
|
||||
}
|
||||
|
||||
await client.createDoc(_class, core.space.Model, data)
|
||||
Analytics.handleEvent(isMasterTag ? CardEvents.TypeCreated : CardEvents.TagCreated)
|
||||
|
||||
dispatch('close')
|
||||
}
|
||||
|
||||
@@ -90,7 +90,6 @@
|
||||
|
||||
{#if classes.length > 0}
|
||||
<div class="antiNav-divider line" />
|
||||
|
||||
<Scroller shrink>
|
||||
<TagHierarchy bind:_class deselect={menuSelection} {classes} {allClasses} on:select />
|
||||
</Scroller>
|
||||
|
||||
@@ -72,6 +72,6 @@
|
||||
/>
|
||||
</NavLink>
|
||||
{#if (descendants.get(clazz._id)?.length ?? 0) > 0}
|
||||
<svelte:self classes={descendants.get(clazz._id) ?? []} {_class} level={level + 1} on:select />
|
||||
<svelte:self classes={descendants.get(clazz._id) ?? []} {_class} {allClasses} level={level + 1} on:select />
|
||||
{/if}
|
||||
{/each}
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
import {
|
||||
Icon,
|
||||
IconOpenedArrow,
|
||||
IconWithEmoji,
|
||||
Label,
|
||||
Location,
|
||||
getCurrentResolvedLocation,
|
||||
@@ -28,6 +29,7 @@
|
||||
} from '@hcengineering/ui'
|
||||
import { onDestroy } from 'svelte'
|
||||
import card from '../../plugin'
|
||||
import view from '@hcengineering/view'
|
||||
|
||||
export let categoryName: string
|
||||
|
||||
@@ -64,9 +66,14 @@
|
||||
}}
|
||||
>
|
||||
<div class="hulyTaskNavLink-avatar">
|
||||
{#if tag?.icon}
|
||||
{#if tag.icon}
|
||||
<div class="hulyTaskNavLink-icon">
|
||||
<Icon icon={tag?.icon} size="small" fill="currentColor" />
|
||||
<Icon
|
||||
icon={tag.icon === view.ids.IconWithEmoji ? IconWithEmoji : tag.icon ?? card.icon.MasterTag}
|
||||
iconProps={tag.icon === view.ids.IconWithEmoji ? { icon: tag.color } : {}}
|
||||
size="small"
|
||||
fill="currentColor"
|
||||
/>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
@@ -3,12 +3,18 @@
|
||||
import { RelationSetting } from '@hcengineering/setting-resources'
|
||||
import contact from '@hcengineering/contact'
|
||||
import card from '../../plugin'
|
||||
import { Analytics } from '@hcengineering/analytics'
|
||||
import { CardEvents } from '@hcengineering/card'
|
||||
|
||||
const client = getClient()
|
||||
const hierarchy = client.getHierarchy()
|
||||
const _classes = [...hierarchy.getDescendants(card.class.Card), contact.class.Contact].filter(
|
||||
(c) => c !== card.class.Card
|
||||
)
|
||||
|
||||
function createHandler (): void {
|
||||
Analytics.handleEvent(CardEvents.RelationCreated)
|
||||
}
|
||||
</script>
|
||||
|
||||
<RelationSetting {_classes} exclude={[]} />
|
||||
<RelationSetting {_classes} exclude={[]} on:create={createHandler} />
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
// limitations under the License.
|
||||
-->
|
||||
<script lang="ts">
|
||||
import { MasterTag } from '@hcengineering/card'
|
||||
import { CardEvents, MasterTag } from '@hcengineering/card'
|
||||
import core, { Association, Class, Doc, Ref } from '@hcengineering/core'
|
||||
import { IntlString } from '@hcengineering/platform'
|
||||
import { createQuery, getClient } from '@hcengineering/presentation'
|
||||
@@ -22,6 +22,7 @@
|
||||
import { ButtonIcon, Icon, IconAdd, Label, showPopup } from '@hcengineering/ui'
|
||||
import { onDestroy } from 'svelte'
|
||||
import CreateRelation from './CreateRelation.svelte'
|
||||
import { Analytics } from '@hcengineering/analytics'
|
||||
|
||||
export let masterTag: MasterTag
|
||||
|
||||
@@ -48,9 +49,18 @@
|
||||
}
|
||||
|
||||
function addRelation (): void {
|
||||
showPopup(CreateRelation, {
|
||||
aClass: masterTag._id
|
||||
})
|
||||
showPopup(
|
||||
CreateRelation,
|
||||
{
|
||||
aClass: masterTag._id
|
||||
},
|
||||
undefined,
|
||||
(res) => {
|
||||
if (res !== undefined) {
|
||||
Analytics.handleEvent(CardEvents.RelationCreated)
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
const handleSelect = (association: Association): void => {
|
||||
|
||||
@@ -44,7 +44,8 @@ export default mergeIds(cardId, card, {
|
||||
},
|
||||
viewlet: {
|
||||
CardTable: '' as Ref<Viewlet>,
|
||||
CardList: '' as Ref<Viewlet>
|
||||
CardList: '' as Ref<Viewlet>,
|
||||
CardChildList: '' as Ref<Viewlet>
|
||||
},
|
||||
string: {
|
||||
CreateMasterTag: '' as IntlString,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
export enum CardEvents {
|
||||
NewCardButtonClicked = 'card.card.NewButtonClicked',
|
||||
MasterTagRemoved = 'card.card.MasterTagRemoved',
|
||||
TypeCreated = 'card.card.TypeCreated',
|
||||
TagCreated = 'card.card.TagCreated',
|
||||
RelationCreated = 'card.card.RelationCreated',
|
||||
CardCreated = 'card.card.Created',
|
||||
CardOpened = 'card.card.Opened'
|
||||
}
|
||||
|
||||
@@ -138,6 +138,7 @@
|
||||
nameA,
|
||||
nameB
|
||||
})
|
||||
dispatch('create')
|
||||
dispatch('close')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,14 +102,14 @@
|
||||
if (classBRef === undefined || classARef === undefined) {
|
||||
return
|
||||
}
|
||||
await client.createDoc(core.class.Association, core.space.Model, {
|
||||
const _id = await client.createDoc(core.class.Association, core.space.Model, {
|
||||
classA: classARef,
|
||||
classB: classBRef,
|
||||
type: mode,
|
||||
nameA,
|
||||
nameB
|
||||
})
|
||||
dispatch('close')
|
||||
dispatch('close', _id)
|
||||
}
|
||||
|
||||
const items: DropdownIntlItem[] = [
|
||||
|
||||
@@ -153,7 +153,8 @@
|
||||
{exclude}
|
||||
{_classes}
|
||||
association={selected}
|
||||
on:close={() => {
|
||||
on:create
|
||||
on:close={(res) => {
|
||||
selected = undefined
|
||||
}}
|
||||
/>
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
import { resolvedLocationStore, Switcher } from '@hcengineering/ui'
|
||||
import view, { Viewlet, ViewletPreference } from '@hcengineering/view'
|
||||
import core, { DocumentQuery, Ref, WithLookup } from '@hcengineering/core'
|
||||
import { deepEqual } from 'fast-equals'
|
||||
import { createQuery } from '@hcengineering/presentation'
|
||||
|
||||
export let viewlet: WithLookup<Viewlet> | undefined
|
||||
@@ -49,7 +50,7 @@
|
||||
) {
|
||||
if (viewlets == null || viewlets.length === 0) return
|
||||
const newViewlet = viewlets.find((viewlet) => viewlet?._id === activeViewlet[key]) ?? viewlets[0]
|
||||
if (viewlet?._id !== newViewlet?._id) {
|
||||
if (viewlet?._id !== newViewlet?._id || !deepEqual(viewlet.config, newViewlet.config)) {
|
||||
viewlet = newViewlet
|
||||
setActiveViewletId(newViewlet._id)
|
||||
dispatch('viewlet', viewlet)
|
||||
|
||||
Reference in New Issue
Block a user