From 54be660e9a16228210d5d0b4fcf1c69add2fd25b Mon Sep 17 00:00:00 2001 From: Denis Bykhov Date: Sat, 15 Mar 2025 21:32:53 +0500 Subject: [PATCH] Emoji for types (#8240) Signed-off-by: Denis Bykhov --- models/card/src/index.ts | 15 ++++-- .../src/components/Content.svelte | 8 ++-- .../src/components/Description.svelte | 3 +- .../src/components/EditCard.svelte | 3 ++ .../src/components/MasterTagAttributes.svelte | 13 +++-- .../src/components/MasterTagSelector.svelte | 47 +++---------------- .../src/components/TagHierarchy.svelte | 6 ++- .../components/settings/GeneralSection.svelte | 21 ++++++--- plugins/card/src/index.ts | 2 + .../src/components/ClassRefPresenter.svelte | 2 +- .../src/components/RelationEditor.svelte | 5 ++ 11 files changed, 65 insertions(+), 60 deletions(-) diff --git a/models/card/src/index.ts b/models/card/src/index.ts index d5e83db772..68a5365910 100644 --- a/models/card/src/index.ts +++ b/models/card/src/index.ts @@ -60,11 +60,14 @@ export { cardId } from '@hcengineering/card' @Model(card.class.MasterTag, core.class.Class) export class TMasterTag extends TClass implements MasterTag { + color?: number removed?: boolean } @Model(card.class.Tag, core.class.Mixin) -export class TTag extends TMixin implements Tag {} +export class TTag extends TMixin implements Tag { + color?: number +} @Model(card.class.Card, core.class.Doc, DOMAIN_CARD) @UX(card.string.Card, card.icon.Card) @@ -155,8 +158,14 @@ export function createModel (builder: Builder): void { }, config: [ { key: '', props: { showParent: true } }, - '_class', - { key: '', presenter: view.component.RolePresenter, label: card.string.Tags, props: { fullSize: true } }, + { key: '_class', displayProps: { fixed: 'left' } }, + { + key: '', + presenter: view.component.RolePresenter, + label: card.string.Tags, + props: { fullSize: true }, + displayProps: { fixed: 'left' } + }, { key: '', displayProps: { grow: true } }, { key: 'modifiedOn', diff --git a/plugins/card-resources/src/components/Content.svelte b/plugins/card-resources/src/components/Content.svelte index 2ff6752bbb..bbe0649910 100644 --- a/plugins/card-resources/src/components/Content.svelte +++ b/plugins/card-resources/src/components/Content.svelte @@ -26,12 +26,10 @@ const client = getClient() const hierarchy = client.getHierarchy() - $: hasDescription = !hierarchy.isDerived(doc._class, card.types.File) + $: isFile = hierarchy.isDerived(doc._class, card.types.File) -{#if hasDescription} - -{:else if Object.keys(doc.blobs ?? {}).length === 0 && !readonly} +{#if isFile && Object.keys(doc.blobs ?? {}).length === 0 && !readonly} {/if} @@ -44,3 +42,5 @@ fit={blob.type !== 'application/pdf'} /> {/each} + + diff --git a/plugins/card-resources/src/components/Description.svelte b/plugins/card-resources/src/components/Description.svelte index 456d36dfc9..668def06ed 100644 --- a/plugins/card-resources/src/components/Description.svelte +++ b/plugins/card-resources/src/components/Description.svelte @@ -28,6 +28,7 @@ export let doc: Card export let readonly: boolean = false export let content: HTMLElement + export let minHeight: '15vh' | '25vh' = '25vh' const client = getClient() @@ -89,7 +90,7 @@ {readonly} boundary={content} overflow={'none'} - editorAttributes={{ style: 'padding: 0 2em 2em; margin: 0 -2em; min-height: 30vh' }} + editorAttributes={{ style: `padding: 0 2em 2em; margin: 0 -2em; min-height: ${minHeight}` }} attachFile={async (file) => { return await createEmbedding(file) }} diff --git a/plugins/card-resources/src/components/EditCard.svelte b/plugins/card-resources/src/components/EditCard.svelte index 81b6596f05..ea03fff468 100644 --- a/plugins/card-resources/src/components/EditCard.svelte +++ b/plugins/card-resources/src/components/EditCard.svelte @@ -16,6 +16,7 @@ -->
- {#if value._class === card.class.Card} - - {:else} -
-
- {/if} +
+