Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
export let card: Card
export let message: ActivityMessage
export let author: Person | undefined
export let oneRow: boolean = false

const client = getClient()

Expand All @@ -42,6 +43,13 @@

{#if extra.action === 'create'}
<ActivityObjectValue {message} {card} />
{:else if extra.update && extra.action === 'update'}

Check warning on line 46 in plugins/communication-resources/src/components/message/ActivityMessageViewer.svelte

View workflow job for this annotation

GitHub Actions / formatting

Unexpected nullable object value in conditional. An explicit null check is required
<ActivityUpdateViewer update={extra.update} model={attributeModel} content={message.content} {author} {card} />
<ActivityUpdateViewer
update={extra.update}
model={attributeModel}
content={message.content}
{author}
{card}
{oneRow}
/>
{/if}
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
// limitations under the License.
-->
<script lang="ts">
import { ActivityCollaborativeChange } from '@hcengineering/communication-types'
import { MarkupDiffPresenter } from '@hcengineering/view-resources'
import activity from '@hcengineering/activity'
import { ActivityCollaborativeChange } from '@hcengineering/communication-types'
import ui, { Label } from '@hcengineering/ui'
import { AttributeModel } from '@hcengineering/view'
import communication from '../../../plugin'
import { MarkupDiffPresenter } from '@hcengineering/view-resources'

export let model: AttributeModel | undefined = undefined
export let update: ActivityCollaborativeChange
export let oneRow: boolean = false

$: isTooLarge = update.value === activity.string.ValueTooLarge || update.prevValue === activity.string.ValueTooLarge

Expand All @@ -37,15 +37,14 @@
<Label label={model.label} />
<span class="lower"><Label label={activity.string.Edited} /></span>
{/if}
{#if isTooLarge}
<div class="unset row overflow-label">
{#if !oneRow}
{#if isTooLarge}
<Label label={activity.string.ValueTooLarge} />
</div>
{:else}
<div class="showMore" on:click={toggleShowMore}>
<div class="triangle" class:left={!isDiffShown} class:down={isDiffShown} />
<Label label={isDiffShown ? ui.string.ShowLess : ui.string.ShowMore} />
</div>
{:else}
<span class="showMore" on:click={toggleShowMore}>
<Label label={isDiffShown ? ui.string.ShowLess : ui.string.ShowMore} />
</span>
{/if}
{/if}
</div>
{#if isDiffShown}
Expand All @@ -56,29 +55,7 @@
.showMore {
color: var(--global-primary-LinkColor);
cursor: pointer;
display: flex;
align-items: center;
font-weight: 500;
gap: 0.5rem;

.triangle {
width: 0;
height: 0;

&.left {
border-top: 0.25rem solid transparent;
border-bottom: 0.25rem solid transparent;
border-left: 0.25rem solid var(--global-primary-LinkColor);
border-right: none;
}

&.down {
border-left: 0.25rem solid transparent;
border-right: 0.25rem solid transparent;
border-top: 0.25rem solid var(--global-primary-LinkColor);
border-bottom: none;
}
}

&:hover {
color: var(--global-focus-BorderColor);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
export let content: Markdown
export let card: Card
export let author: Person | undefined
export let oneRow: boolean = false
</script>

{#if update.type === ActivityUpdateType.Attribute}
Expand All @@ -43,5 +44,5 @@
{:else if update.type === ActivityUpdateType.Process}
<ActivityUpdateProcessViewer {update} {content} />
{:else if update.type === ActivityUpdateType.CollaborativeChange}
<ActivityCollaborativeContentViewer {model} {update} />
<ActivityCollaborativeContentViewer {model} {update} {oneRow} />
{/if}
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<svelte:fragment slot="content">
{#if message}
{#if isActivityMessage(message)}
<ActivityMessageViewer {message} {card} author={person} />
<ActivityMessageViewer {message} {card} author={person} oneRow />
{:else}
<LiteMessageViewer message={markdownToMarkup(message.content)} />
{/if}
Expand Down
Loading