New Activity - squashed (#4032)

Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
Co-authored-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Kristina
2023-12-11 18:54:36 +07:00
committed by GitHub
co-authored by Andrey Sobolev
parent 119d65653a
commit ea3eb4af83
212 changed files with 7611 additions and 3159 deletions
@@ -14,16 +14,25 @@
// limitations under the License.
-->
<script lang="ts">
// import { TypeDate } from '@hcengineering/core'
import { DateRangePresenter } from '@hcengineering/ui'
export let value: number | null | undefined
export let onChange: ((value: number | null) => void) | undefined = undefined
export let noShift: boolean = false
export let shouldShowAvatar: boolean = true
export let accent: boolean = false
export let inline: boolean = false
</script>
{#if onChange !== undefined}
<DateRangePresenter {value} {noShift} editable on:change={(e) => onChange?.(e.detail)} />
<DateRangePresenter
{value}
{noShift}
editable
on:change={(e) => onChange?.(e.detail)}
{shouldShowAvatar}
{accent}
{inline}
/>
{:else}
<DateRangePresenter {value} {noShift} />
<DateRangePresenter {value} {noShift} {shouldShowAvatar} {accent} {inline} />
{/if}
@@ -14,11 +14,11 @@
// limitations under the License.
-->
<script lang="ts">
import contact, { Contact, getName } from '@hcengineering/contact'
import { createEventDispatcher, onDestroy } from 'svelte'
import core, { Class, ClassifierKind, Doc, Mixin, Ref } from '@hcengineering/core'
import notification from '@hcengineering/notification'
import { Panel } from '@hcengineering/panel'
import { getResource, translate } from '@hcengineering/platform'
import { getResource } from '@hcengineering/platform'
import {
AttributeCategory,
AttributeCategoryOrder,
@@ -30,10 +30,10 @@
getClient,
hasResource
} from '@hcengineering/presentation'
import { AnyComponent, Button, Component, IconMixin, IconMoreH, showPopup, themeStore } from '@hcengineering/ui'
import { AnyComponent, Button, Component, IconMixin, IconMoreH, showPopup } from '@hcengineering/ui'
import view from '@hcengineering/view'
import { createEventDispatcher, onDestroy } from 'svelte'
import { ContextMenu, ParentsNavigator, DocNavLink } from '..'
import { ContextMenu, ParentsNavigator, DocNavLink, getDocLabel } from '..'
import { categorizeFields, getCollectionCounter, getFiltredKeys } from '../utils'
import DocAttributeBar from './DocAttributeBar.svelte'
@@ -210,21 +210,11 @@
let rawTitle: string = ''
$: if (object !== undefined) {
getTitle(object).then((t) => {
rawTitle = t
})
}
async function getTitle (object: Doc): Promise<string> {
const name = (object as any).name
if (name !== undefined) {
if (hierarchy.isDerived(object._class, contact.class.Person)) {
return getName(client.getHierarchy(), object as Contact)
getDocLabel(client, object).then((t) => {
if (t) {
rawTitle = t
}
return name
}
const label = hierarchy.getClass(object._class).label
return await translate(label, {}, $themeStore.language)
})
}
async function getHeaderEditor (_class: Ref<Class<Doc>>): Promise<AnyComponent | undefined> {
@@ -17,8 +17,11 @@
import type { Space } from '@hcengineering/core'
export let value: Space
export let accent = false
</script>
{#if value}
{value.name}
<span class:fs-bold={accent}>
{value.name}
</span>
{/if}
@@ -18,6 +18,7 @@
import { LabelAndProps, LinkWrapper, tooltip } from '@hcengineering/ui'
export let value: string | string[] | undefined
export let accent: boolean = false
export let oneLine: boolean = false
$: tooltipParams = getTooltip(value)
@@ -36,7 +37,11 @@
}
</script>
<span class="{oneLine ? 'overflow-label' : 'lines-limit-2'} select-text" use:tooltip={tooltipParams}>
<span
class="{oneLine ? 'overflow-label' : 'lines-limit-2'} select-text"
class:fs-bold={accent}
use:tooltip={tooltipParams}
>
{#if Array.isArray(value)}
{#each value as str, i}
<span class:ml-1={i !== 0}><LinkWrapper text={str} /></span>