Skip to content

Commit

Permalink
UBERF-6638: fix colours for statuses (#5620)
Browse files Browse the repository at this point in the history
Signed-off-by: Vyacheslav Tumanov <me@slavatumanov.me>
  • Loading branch information
ThetaDR authored May 20, 2024
1 parent f98765a commit 4fe6e5e
Show file tree
Hide file tree
Showing 12 changed files with 48 additions and 19 deletions.
13 changes: 9 additions & 4 deletions packages/presentation/src/components/SearchResult.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@
<Icon {icon} size={'medium'} />
{/if}
{#if iconComponent}
{#await getResource(iconComponent) then component}
<svelte:component this={component} size={'smaller'} {...value.iconProps} />
{/await}
<div class="icon-place">
{#await getResource(iconComponent) then component}
<svelte:component this={component} size={'smaller'} {...value.iconProps} />
{/await}
</div>
{/if}
</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}
<span class="shortTitle">{value.shortTitle}</span>
{/if}
Expand All @@ -44,6 +46,9 @@
</div>

<style lang="scss">
.icon-place {
width: 20px;
}
.searchResult {
display: flex;
flex-direction: row;
Expand Down
1 change: 1 addition & 0 deletions plugins/activity-resources/src/components/Activity.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
props={{
value: message,
hideLink: true,
space: object.space,
boundary,
type: canGroup ? 'short' : 'default'
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
<Component
is={objectPresenter.presenter}
props={{
space: value.space,
value,
showNotify,
skipLabel,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@
import { DisplayActivityMessage, ActivityMessagePreviewType } from '@hcengineering/activity'
import { getClient } from '@hcengineering/presentation'
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'
export let value: DisplayActivityMessage
export let readonly = false
export let type: ActivityMessagePreviewType = 'full'
export let actions: Action[] = []
export let space: Ref<Space> | undefined = undefined
const client = getClient()
const hierarchy = client.getHierarchy()
Expand All @@ -42,7 +43,8 @@
value,
type,
readonly,
actions
actions,
space
}}
on:click
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@
import AddedAttributesPresenter from './attributes/AddedAttributesPresenter.svelte'
import RemovedAttributesPresenter from './attributes/RemovedAttributesPresenter.svelte'
import SetAttributesPresenter from './attributes/SetAttributesPresenter.svelte'
import { Ref, Space } from '@hcengineering/core'
export let viewlet: DocUpdateMessageViewlet | undefined
export let attributeUpdates: DocAttributeUpdates
export let attributeModel: AttributeModel
export let preview = false
export let space: Ref<Space> | undefined = undefined
const client = getClient()
const hierarchy = client.getHierarchy()
Expand All @@ -39,7 +41,7 @@
</script>

{#if presenter}
<Component is={presenter} props={{ value: attributeUpdates }} />
<Component is={presenter} props={{ value: attributeUpdates, space }} />
{:else}
{#if attributeUpdates.added.length}
<AddedAttributesPresenter {viewlet} {attributeModel} values={attributeUpdates.added} {preview} />
Expand All @@ -52,6 +54,7 @@
{viewlet}
{attributeModel}
values={attributeUpdates.set}
{space}
prevValue={attributeUpdates.prevValue}
{preview}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
} from '@hcengineering/activity'
import { Person, PersonAccount } from '@hcengineering/contact'
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 { createQuery, getClient } from '@hcengineering/presentation'
import { Component, ShowMore, Action } from '@hcengineering/ui'
Expand Down Expand Up @@ -53,6 +53,7 @@
export let hoverStyles: 'borderedHover' | 'filledHover' = 'borderedHover'
export let hideLink = false
export let type: ActivityMessageViewType = 'default'
export let space: Ref<Space> | undefined = undefined
export let onClick: (() => void) | undefined = undefined
const client = getClient()
Expand Down Expand Up @@ -206,7 +207,7 @@
/>
</ShowMore>
{:else if value.attributeUpdates && attributeModel}
<DocUpdateMessageAttributes attributeUpdates={value.attributeUpdates} {attributeModel} {viewlet} />
<DocUpdateMessageAttributes attributeUpdates={value.attributeUpdates} {attributeModel} {viewlet} {space} />
{/if}
</svelte:fragment>
</ActivityMessageTemplate>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import { Action, Component, Icon } from '@hcengineering/ui'
import { createQuery, getClient } from '@hcengineering/presentation'
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 { createEventDispatcher } from 'svelte'
import { buildRemovedDoc, checkIsObjectRemoved } from '@hcengineering/view-resources'
Expand All @@ -36,6 +36,7 @@
export let readonly = false
export let type: ActivityMessagePreviewType = 'full'
export let actions: Action[] = []
export let space: Ref<Space> | undefined = undefined
const client = getClient()
const hierarchy = client.getHierarchy()
Expand Down Expand Up @@ -118,7 +119,13 @@
preview
/>
{:else if value.attributeUpdates && attributeModel}
<DocUpdateMessageAttributes attributeUpdates={value.attributeUpdates} {attributeModel} {viewlet} preview />
<DocUpdateMessageAttributes
attributeUpdates={value.attributeUpdates}
{attributeModel}
{space}
{viewlet}
preview
/>
{/if}
</span>
</BaseMessagePreview>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import { Icon, IconEdit, Component } from '@hcengineering/ui'
import { ObjectPresenter } from '@hcengineering/view-resources'
import { getClient } from '@hcengineering/presentation'
import { Doc } from '@hcengineering/core'
import { Doc, Ref, Space } from '@hcengineering/core'
import { AttributeModel } from '@hcengineering/view'
import { DocAttributeUpdates, DocUpdateMessageViewlet } from '@hcengineering/activity'
Expand All @@ -27,6 +27,7 @@
export let attributeModel: AttributeModel
export let values: Values
export let preview = false
export let space: Ref<Space> | undefined = undefined
const client = getClient()
Expand All @@ -38,13 +39,16 @@
$: attrViewletConfig = viewlet?.config?.[attributeModel.key]
$: 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>

<div class="content overflow-label" class:preview>
<span class="mr-1">
{#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}
<Icon icon={attributeIcon} size="small" />
{/if}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@
import ChangeAttributesTemplate from './ChangeAttributesTemplate.svelte'
import { getIsTextType } from '../../../utils'
import { Ref, Space } from '@hcengineering/core'
export let viewlet: DocUpdateMessageViewlet | undefined
export let attributeModel: AttributeModel
export let values: DocAttributeUpdates['set']
export let prevValue: any
export let preview = false
export let space: Ref<Space> | undefined = undefined
$: attrViewletConfig = viewlet?.config?.[attributeModel.key]
$: attributeIcon = attrViewletConfig?.icon ?? attributeModel.icon ?? IconEdit
Expand Down Expand Up @@ -66,7 +68,7 @@
{/if}
{/if}
{:else}
<ChangeAttributesTemplate {viewlet} {attributeModel} {values} {preview}>
<ChangeAttributesTemplate {viewlet} {attributeModel} {values} {preview} {space}>
<svelte:fragment slot="text">
<Label label={attributeModel.label} />
<span class="lower"><Label label={activity.string.Set} /></span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@
<InboxNotificationPresenter
value={group[0]}
{viewlets}
space={value.space}
on:click={(e) => {
e.preventDefault()
e.stopPropagation()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
-->
<script lang="ts">
import { getClient } from '@hcengineering/presentation'
import { matchQuery } from '@hcengineering/core'
import { Ref, Space, matchQuery } from '@hcengineering/core'
import notification, {
ActivityInboxNotification,
ActivityNotificationViewlet,
Expand All @@ -32,6 +32,7 @@
export let value: DisplayActivityInboxNotification
export let viewlets: ActivityNotificationViewlet[] = []
export let space: Ref<Space> | undefined = undefined
const client = getClient()
Expand Down Expand Up @@ -99,6 +100,6 @@
on:click
/>
{:else}
<ActivityMessagePreview value={displayMessage} {actions} on:click />
<ActivityMessagePreview value={displayMessage} {actions} {space} on:click />
{/if}
{/if}
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@
import view from '@hcengineering/view'
import { getClient } from '@hcengineering/presentation'
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'
export let value: DisplayInboxNotification
export let viewlets: ActivityNotificationViewlet[] = []
export let space: Ref<Space> | undefined = undefined
const client = getClient()
const hierarchy = client.getHierarchy()
Expand All @@ -29,5 +30,5 @@
</script>

{#if objectPresenter}
<Component is={objectPresenter.presenter} props={{ value, viewlets }} on:click />
<Component is={objectPresenter.presenter} props={{ value, viewlets, space }} on:click />
{/if}

0 comments on commit 4fe6e5e

Please sign in to comment.