mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-15 04:49:00 +00:00
UBERF-6638: fix colours for statuses (#5620)
Signed-off-by: Vyacheslav Tumanov <me@slavatumanov.me>
This commit is contained in:
parent
f98765af3a
commit
4fe6e5e62c
@ -30,12 +30,14 @@
|
|||||||
<Icon {icon} size={'medium'} />
|
<Icon {icon} size={'medium'} />
|
||||||
{/if}
|
{/if}
|
||||||
{#if iconComponent}
|
{#if iconComponent}
|
||||||
{#await getResource(iconComponent) then component}
|
<div class="icon-place">
|
||||||
<svelte:component this={component} size={'smaller'} {...value.iconProps} />
|
{#await getResource(iconComponent) then component}
|
||||||
{/await}
|
<svelte:component this={component} size={'smaller'} {...value.iconProps} />
|
||||||
|
{/await}
|
||||||
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
<span class="ml-2 max-w-120 overflow-label searchResult">
|
<span class="ml-1 max-w-120 overflow-label searchResult">
|
||||||
{#if value.shortTitle !== undefined}
|
{#if value.shortTitle !== undefined}
|
||||||
<span class="shortTitle">{value.shortTitle}</span>
|
<span class="shortTitle">{value.shortTitle}</span>
|
||||||
{/if}
|
{/if}
|
||||||
@ -44,6 +46,9 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
.icon-place {
|
||||||
|
width: 20px;
|
||||||
|
}
|
||||||
.searchResult {
|
.searchResult {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
@ -104,6 +104,7 @@
|
|||||||
props={{
|
props={{
|
||||||
value: message,
|
value: message,
|
||||||
hideLink: true,
|
hideLink: true,
|
||||||
|
space: object.space,
|
||||||
boundary,
|
boundary,
|
||||||
type: canGroup ? 'short' : 'default'
|
type: canGroup ? 'short' : 'default'
|
||||||
}}
|
}}
|
||||||
|
@ -51,6 +51,7 @@
|
|||||||
<Component
|
<Component
|
||||||
is={objectPresenter.presenter}
|
is={objectPresenter.presenter}
|
||||||
props={{
|
props={{
|
||||||
|
space: value.space,
|
||||||
value,
|
value,
|
||||||
showNotify,
|
showNotify,
|
||||||
skipLabel,
|
skipLabel,
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
import { DisplayActivityMessage, ActivityMessagePreviewType } from '@hcengineering/activity'
|
import { DisplayActivityMessage, ActivityMessagePreviewType } from '@hcengineering/activity'
|
||||||
import { getClient } from '@hcengineering/presentation'
|
import { getClient } from '@hcengineering/presentation'
|
||||||
import { Action, Component } from '@hcengineering/ui'
|
import { Action, Component } from '@hcengineering/ui'
|
||||||
import { Class, Doc, Ref } from '@hcengineering/core'
|
import { Class, Doc, Ref, Space } from '@hcengineering/core'
|
||||||
|
|
||||||
import activity from '../../plugin'
|
import activity from '../../plugin'
|
||||||
|
|
||||||
@ -25,6 +25,7 @@
|
|||||||
export let readonly = false
|
export let readonly = false
|
||||||
export let type: ActivityMessagePreviewType = 'full'
|
export let type: ActivityMessagePreviewType = 'full'
|
||||||
export let actions: Action[] = []
|
export let actions: Action[] = []
|
||||||
|
export let space: Ref<Space> | undefined = undefined
|
||||||
|
|
||||||
const client = getClient()
|
const client = getClient()
|
||||||
const hierarchy = client.getHierarchy()
|
const hierarchy = client.getHierarchy()
|
||||||
@ -42,7 +43,8 @@
|
|||||||
value,
|
value,
|
||||||
type,
|
type,
|
||||||
readonly,
|
readonly,
|
||||||
actions
|
actions,
|
||||||
|
space
|
||||||
}}
|
}}
|
||||||
on:click
|
on:click
|
||||||
/>
|
/>
|
||||||
|
@ -23,11 +23,13 @@
|
|||||||
import AddedAttributesPresenter from './attributes/AddedAttributesPresenter.svelte'
|
import AddedAttributesPresenter from './attributes/AddedAttributesPresenter.svelte'
|
||||||
import RemovedAttributesPresenter from './attributes/RemovedAttributesPresenter.svelte'
|
import RemovedAttributesPresenter from './attributes/RemovedAttributesPresenter.svelte'
|
||||||
import SetAttributesPresenter from './attributes/SetAttributesPresenter.svelte'
|
import SetAttributesPresenter from './attributes/SetAttributesPresenter.svelte'
|
||||||
|
import { Ref, Space } from '@hcengineering/core'
|
||||||
|
|
||||||
export let viewlet: DocUpdateMessageViewlet | undefined
|
export let viewlet: DocUpdateMessageViewlet | undefined
|
||||||
export let attributeUpdates: DocAttributeUpdates
|
export let attributeUpdates: DocAttributeUpdates
|
||||||
export let attributeModel: AttributeModel
|
export let attributeModel: AttributeModel
|
||||||
export let preview = false
|
export let preview = false
|
||||||
|
export let space: Ref<Space> | undefined = undefined
|
||||||
|
|
||||||
const client = getClient()
|
const client = getClient()
|
||||||
const hierarchy = client.getHierarchy()
|
const hierarchy = client.getHierarchy()
|
||||||
@ -39,7 +41,7 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if presenter}
|
{#if presenter}
|
||||||
<Component is={presenter} props={{ value: attributeUpdates }} />
|
<Component is={presenter} props={{ value: attributeUpdates, space }} />
|
||||||
{:else}
|
{:else}
|
||||||
{#if attributeUpdates.added.length}
|
{#if attributeUpdates.added.length}
|
||||||
<AddedAttributesPresenter {viewlet} {attributeModel} values={attributeUpdates.added} {preview} />
|
<AddedAttributesPresenter {viewlet} {attributeModel} values={attributeUpdates.added} {preview} />
|
||||||
@ -52,6 +54,7 @@
|
|||||||
{viewlet}
|
{viewlet}
|
||||||
{attributeModel}
|
{attributeModel}
|
||||||
values={attributeUpdates.set}
|
values={attributeUpdates.set}
|
||||||
|
{space}
|
||||||
prevValue={attributeUpdates.prevValue}
|
prevValue={attributeUpdates.prevValue}
|
||||||
{preview}
|
{preview}
|
||||||
/>
|
/>
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
} from '@hcengineering/activity'
|
} from '@hcengineering/activity'
|
||||||
import { Person, PersonAccount } from '@hcengineering/contact'
|
import { Person, PersonAccount } from '@hcengineering/contact'
|
||||||
import { personAccountByIdStore, personByIdStore } from '@hcengineering/contact-resources'
|
import { personAccountByIdStore, personByIdStore } from '@hcengineering/contact-resources'
|
||||||
import { Account, AttachedDoc, Class, Collection, Doc, Ref } from '@hcengineering/core'
|
import { Account, AttachedDoc, Class, Collection, Doc, Ref, Space } from '@hcengineering/core'
|
||||||
import { IntlString } from '@hcengineering/platform'
|
import { IntlString } from '@hcengineering/platform'
|
||||||
import { createQuery, getClient } from '@hcengineering/presentation'
|
import { createQuery, getClient } from '@hcengineering/presentation'
|
||||||
import { Component, ShowMore, Action } from '@hcengineering/ui'
|
import { Component, ShowMore, Action } from '@hcengineering/ui'
|
||||||
@ -53,6 +53,7 @@
|
|||||||
export let hoverStyles: 'borderedHover' | 'filledHover' = 'borderedHover'
|
export let hoverStyles: 'borderedHover' | 'filledHover' = 'borderedHover'
|
||||||
export let hideLink = false
|
export let hideLink = false
|
||||||
export let type: ActivityMessageViewType = 'default'
|
export let type: ActivityMessageViewType = 'default'
|
||||||
|
export let space: Ref<Space> | undefined = undefined
|
||||||
export let onClick: (() => void) | undefined = undefined
|
export let onClick: (() => void) | undefined = undefined
|
||||||
|
|
||||||
const client = getClient()
|
const client = getClient()
|
||||||
@ -206,7 +207,7 @@
|
|||||||
/>
|
/>
|
||||||
</ShowMore>
|
</ShowMore>
|
||||||
{:else if value.attributeUpdates && attributeModel}
|
{:else if value.attributeUpdates && attributeModel}
|
||||||
<DocUpdateMessageAttributes attributeUpdates={value.attributeUpdates} {attributeModel} {viewlet} />
|
<DocUpdateMessageAttributes attributeUpdates={value.attributeUpdates} {attributeModel} {viewlet} {space} />
|
||||||
{/if}
|
{/if}
|
||||||
</svelte:fragment>
|
</svelte:fragment>
|
||||||
</ActivityMessageTemplate>
|
</ActivityMessageTemplate>
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
import { Action, Component, Icon } from '@hcengineering/ui'
|
import { Action, Component, Icon } from '@hcengineering/ui'
|
||||||
import { createQuery, getClient } from '@hcengineering/presentation'
|
import { createQuery, getClient } from '@hcengineering/presentation'
|
||||||
import { IntlString } from '@hcengineering/platform'
|
import { IntlString } from '@hcengineering/platform'
|
||||||
import { AttachedDoc, Class, Collection, Doc, Ref } from '@hcengineering/core'
|
import { AttachedDoc, Class, Collection, Doc, Ref, Space } from '@hcengineering/core'
|
||||||
import { AttributeModel } from '@hcengineering/view'
|
import { AttributeModel } from '@hcengineering/view'
|
||||||
import { createEventDispatcher } from 'svelte'
|
import { createEventDispatcher } from 'svelte'
|
||||||
import { buildRemovedDoc, checkIsObjectRemoved } from '@hcengineering/view-resources'
|
import { buildRemovedDoc, checkIsObjectRemoved } from '@hcengineering/view-resources'
|
||||||
@ -36,6 +36,7 @@
|
|||||||
export let readonly = false
|
export let readonly = false
|
||||||
export let type: ActivityMessagePreviewType = 'full'
|
export let type: ActivityMessagePreviewType = 'full'
|
||||||
export let actions: Action[] = []
|
export let actions: Action[] = []
|
||||||
|
export let space: Ref<Space> | undefined = undefined
|
||||||
|
|
||||||
const client = getClient()
|
const client = getClient()
|
||||||
const hierarchy = client.getHierarchy()
|
const hierarchy = client.getHierarchy()
|
||||||
@ -118,7 +119,13 @@
|
|||||||
preview
|
preview
|
||||||
/>
|
/>
|
||||||
{:else if value.attributeUpdates && attributeModel}
|
{:else if value.attributeUpdates && attributeModel}
|
||||||
<DocUpdateMessageAttributes attributeUpdates={value.attributeUpdates} {attributeModel} {viewlet} preview />
|
<DocUpdateMessageAttributes
|
||||||
|
attributeUpdates={value.attributeUpdates}
|
||||||
|
{attributeModel}
|
||||||
|
{space}
|
||||||
|
{viewlet}
|
||||||
|
preview
|
||||||
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
</span>
|
</span>
|
||||||
</BaseMessagePreview>
|
</BaseMessagePreview>
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
import { Icon, IconEdit, Component } from '@hcengineering/ui'
|
import { Icon, IconEdit, Component } from '@hcengineering/ui'
|
||||||
import { ObjectPresenter } from '@hcengineering/view-resources'
|
import { ObjectPresenter } from '@hcengineering/view-resources'
|
||||||
import { getClient } from '@hcengineering/presentation'
|
import { getClient } from '@hcengineering/presentation'
|
||||||
import { Doc } from '@hcengineering/core'
|
import { Doc, Ref, Space } from '@hcengineering/core'
|
||||||
import { AttributeModel } from '@hcengineering/view'
|
import { AttributeModel } from '@hcengineering/view'
|
||||||
import { DocAttributeUpdates, DocUpdateMessageViewlet } from '@hcengineering/activity'
|
import { DocAttributeUpdates, DocUpdateMessageViewlet } from '@hcengineering/activity'
|
||||||
|
|
||||||
@ -27,6 +27,7 @@
|
|||||||
export let attributeModel: AttributeModel
|
export let attributeModel: AttributeModel
|
||||||
export let values: Values
|
export let values: Values
|
||||||
export let preview = false
|
export let preview = false
|
||||||
|
export let space: Ref<Space> | undefined = undefined
|
||||||
|
|
||||||
const client = getClient()
|
const client = getClient()
|
||||||
|
|
||||||
@ -38,13 +39,16 @@
|
|||||||
|
|
||||||
$: attrViewletConfig = viewlet?.config?.[attributeModel.key]
|
$: attrViewletConfig = viewlet?.config?.[attributeModel.key]
|
||||||
$: attributeIcon = attrViewletConfig?.icon ?? attributeModel.icon ?? IconEdit
|
$: attributeIcon = attrViewletConfig?.icon ?? attributeModel.icon ?? IconEdit
|
||||||
$: space = typeof attributeValues[0] === 'object' ? attributeValues[0]?.space : undefined
|
$: _space = space ?? (typeof attributeValues[0] === 'object' ? attributeValues[0]?.space : undefined)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="content overflow-label" class:preview>
|
<div class="content overflow-label" class:preview>
|
||||||
<span class="mr-1">
|
<span class="mr-1">
|
||||||
{#if attrViewletConfig?.iconPresenter}
|
{#if attrViewletConfig?.iconPresenter}
|
||||||
<Component is={attrViewletConfig?.iconPresenter} props={{ value: attributeValues[0], space, size: 'small' }} />
|
<Component
|
||||||
|
is={attrViewletConfig?.iconPresenter}
|
||||||
|
props={{ value: attributeValues[0], space: _space, size: 'small' }}
|
||||||
|
/>
|
||||||
{:else}
|
{:else}
|
||||||
<Icon icon={attributeIcon} size="small" />
|
<Icon icon={attributeIcon} size="small" />
|
||||||
{/if}
|
{/if}
|
||||||
|
@ -19,12 +19,14 @@
|
|||||||
|
|
||||||
import ChangeAttributesTemplate from './ChangeAttributesTemplate.svelte'
|
import ChangeAttributesTemplate from './ChangeAttributesTemplate.svelte'
|
||||||
import { getIsTextType } from '../../../utils'
|
import { getIsTextType } from '../../../utils'
|
||||||
|
import { Ref, Space } from '@hcengineering/core'
|
||||||
|
|
||||||
export let viewlet: DocUpdateMessageViewlet | undefined
|
export let viewlet: DocUpdateMessageViewlet | undefined
|
||||||
export let attributeModel: AttributeModel
|
export let attributeModel: AttributeModel
|
||||||
export let values: DocAttributeUpdates['set']
|
export let values: DocAttributeUpdates['set']
|
||||||
export let prevValue: any
|
export let prevValue: any
|
||||||
export let preview = false
|
export let preview = false
|
||||||
|
export let space: Ref<Space> | undefined = undefined
|
||||||
|
|
||||||
$: attrViewletConfig = viewlet?.config?.[attributeModel.key]
|
$: attrViewletConfig = viewlet?.config?.[attributeModel.key]
|
||||||
$: attributeIcon = attrViewletConfig?.icon ?? attributeModel.icon ?? IconEdit
|
$: attributeIcon = attrViewletConfig?.icon ?? attributeModel.icon ?? IconEdit
|
||||||
@ -66,7 +68,7 @@
|
|||||||
{/if}
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
{:else}
|
{:else}
|
||||||
<ChangeAttributesTemplate {viewlet} {attributeModel} {values} {preview}>
|
<ChangeAttributesTemplate {viewlet} {attributeModel} {values} {preview} {space}>
|
||||||
<svelte:fragment slot="text">
|
<svelte:fragment slot="text">
|
||||||
<Label label={attributeModel.label} />
|
<Label label={attributeModel.label} />
|
||||||
<span class="lower"><Label label={activity.string.Set} /></span>
|
<span class="lower"><Label label={activity.string.Set} /></span>
|
||||||
|
@ -242,6 +242,7 @@
|
|||||||
<InboxNotificationPresenter
|
<InboxNotificationPresenter
|
||||||
value={group[0]}
|
value={group[0]}
|
||||||
{viewlets}
|
{viewlets}
|
||||||
|
space={value.space}
|
||||||
on:click={(e) => {
|
on:click={(e) => {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
-->
|
-->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { getClient } from '@hcengineering/presentation'
|
import { getClient } from '@hcengineering/presentation'
|
||||||
import { matchQuery } from '@hcengineering/core'
|
import { Ref, Space, matchQuery } from '@hcengineering/core'
|
||||||
import notification, {
|
import notification, {
|
||||||
ActivityInboxNotification,
|
ActivityInboxNotification,
|
||||||
ActivityNotificationViewlet,
|
ActivityNotificationViewlet,
|
||||||
@ -32,6 +32,7 @@
|
|||||||
|
|
||||||
export let value: DisplayActivityInboxNotification
|
export let value: DisplayActivityInboxNotification
|
||||||
export let viewlets: ActivityNotificationViewlet[] = []
|
export let viewlets: ActivityNotificationViewlet[] = []
|
||||||
|
export let space: Ref<Space> | undefined = undefined
|
||||||
|
|
||||||
const client = getClient()
|
const client = getClient()
|
||||||
|
|
||||||
@ -99,6 +100,6 @@
|
|||||||
on:click
|
on:click
|
||||||
/>
|
/>
|
||||||
{:else}
|
{:else}
|
||||||
<ActivityMessagePreview value={displayMessage} {actions} on:click />
|
<ActivityMessagePreview value={displayMessage} {actions} {space} on:click />
|
||||||
{/if}
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
|
@ -16,11 +16,12 @@
|
|||||||
import view from '@hcengineering/view'
|
import view from '@hcengineering/view'
|
||||||
import { getClient } from '@hcengineering/presentation'
|
import { getClient } from '@hcengineering/presentation'
|
||||||
import { Component } from '@hcengineering/ui'
|
import { Component } from '@hcengineering/ui'
|
||||||
import { Class, Doc, Ref } from '@hcengineering/core'
|
import { Class, Doc, type Ref, type Space } from '@hcengineering/core'
|
||||||
import { ActivityNotificationViewlet, DisplayInboxNotification } from '@hcengineering/notification'
|
import { ActivityNotificationViewlet, DisplayInboxNotification } from '@hcengineering/notification'
|
||||||
|
|
||||||
export let value: DisplayInboxNotification
|
export let value: DisplayInboxNotification
|
||||||
export let viewlets: ActivityNotificationViewlet[] = []
|
export let viewlets: ActivityNotificationViewlet[] = []
|
||||||
|
export let space: Ref<Space> | undefined = undefined
|
||||||
|
|
||||||
const client = getClient()
|
const client = getClient()
|
||||||
const hierarchy = client.getHierarchy()
|
const hierarchy = client.getHierarchy()
|
||||||
@ -29,5 +30,5 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if objectPresenter}
|
{#if objectPresenter}
|
||||||
<Component is={objectPresenter.presenter} props={{ value, viewlets }} on:click />
|
<Component is={objectPresenter.presenter} props={{ value, viewlets, space }} on:click />
|
||||||
{/if}
|
{/if}
|
||||||
|
Loading…
Reference in New Issue
Block a user