mirror of
https://github.com/hcengineering/platform.git
synced 2024-11-22 21:50:34 +03:00
Hide activity links for messages in context (#4964)
Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com> Signed-off-by: Alex Velichko <alex@hardcoreeng.com> Co-authored-by: Alex Velichko <alex@hardcoreeng.com>
This commit is contained in:
parent
61263c7ffe
commit
730437e334
@ -197,7 +197,6 @@ export class TDocUpdateMessageViewlet extends TDoc implements DocUpdateMessageVi
|
||||
action!: DocUpdateAction
|
||||
|
||||
label?: IntlString
|
||||
labelComponent?: AnyComponent
|
||||
|
||||
valueAttr?: string
|
||||
|
||||
|
@ -17,6 +17,7 @@
|
||||
"For": "For",
|
||||
"From": "from",
|
||||
"In": "In",
|
||||
"At": "at",
|
||||
"LastReply": "Last reply",
|
||||
"New": "New",
|
||||
"NewestFirst": "Newest first",
|
||||
|
@ -17,6 +17,7 @@
|
||||
"For": "Для",
|
||||
"From": "из",
|
||||
"In": "В",
|
||||
"At": "В",
|
||||
"LastReply": "Последний ответ",
|
||||
"New": "Новые",
|
||||
"NewestFirst": "Сначала новые",
|
||||
|
@ -102,6 +102,7 @@
|
||||
is={activity.component.ActivityMessagePresenter}
|
||||
props={{
|
||||
value: message,
|
||||
hideLink: true,
|
||||
boundary
|
||||
}}
|
||||
/>
|
||||
|
@ -42,6 +42,7 @@
|
||||
export let actions: Action[] = []
|
||||
export let hoverable = true
|
||||
export let hoverStyles: 'borderedHover' | 'filledHover' = 'borderedHover'
|
||||
export let hideLink = false
|
||||
export let onClick: (() => void) | undefined = undefined
|
||||
|
||||
$: personAccount = $personAccountByIdStore.get((value.createdBy ?? value.modifiedBy) as Ref<PersonAccount>)
|
||||
@ -95,6 +96,7 @@
|
||||
object={undefined}
|
||||
parentObject={undefined}
|
||||
isEdited={false}
|
||||
{hideLink}
|
||||
label={value.title}
|
||||
/>
|
||||
</svelte:fragment>
|
||||
|
@ -28,11 +28,13 @@
|
||||
export let object: Doc | undefined
|
||||
export let parentObject: Doc | undefined
|
||||
export let label: IntlString | undefined = undefined
|
||||
export let hideLink = false
|
||||
export let isEdited: boolean = false
|
||||
|
||||
let linkData: LinkData | undefined = undefined
|
||||
|
||||
$: void getLinkData(message, object, parentObject, person).then((data) => {
|
||||
$: !hideLink &&
|
||||
getLinkData(message, object, parentObject, person).then((data) => {
|
||||
linkData = data
|
||||
})
|
||||
</script>
|
||||
|
@ -38,6 +38,7 @@
|
||||
export let attachmentImageSize: 'x-large' | undefined = undefined
|
||||
export let showLinksPreview = true
|
||||
export let videoPreload = true
|
||||
export let hideLink = false
|
||||
export let compact = false
|
||||
export let onClick: (() => void) | undefined = undefined
|
||||
export let onReply: (() => void) | undefined = undefined
|
||||
@ -71,6 +72,7 @@
|
||||
attachmentImageSize,
|
||||
showLinksPreview,
|
||||
videoPreload,
|
||||
hideLink,
|
||||
compact,
|
||||
onClick,
|
||||
onReply
|
||||
|
@ -53,6 +53,7 @@
|
||||
export let skipLabel = false
|
||||
export let hoverable = true
|
||||
export let hoverStyles: 'borderedHover' | 'filledHover' = 'borderedHover'
|
||||
export let showDatePreposition = false
|
||||
export let onClick: (() => void) | undefined = undefined
|
||||
export let onReply: (() => void) | undefined = undefined
|
||||
|
||||
@ -170,6 +171,13 @@
|
||||
{#if !skipLabel}
|
||||
<slot name="header" />
|
||||
{/if}
|
||||
|
||||
{#if !skipLabel && showDatePreposition}
|
||||
<span class="text-sm lower">
|
||||
<Label label={activity.string.At} />
|
||||
</span>
|
||||
{/if}
|
||||
|
||||
<span
|
||||
class="text-sm"
|
||||
use:tooltip={{
|
||||
|
@ -42,6 +42,7 @@
|
||||
export let excludedActions: string[] = []
|
||||
export let hoverable = true
|
||||
export let hoverStyles: 'borderedHover' | 'filledHover' = 'borderedHover'
|
||||
export let hideLink = false
|
||||
export let compact = false
|
||||
export let onClick: (() => void) | undefined = undefined
|
||||
export let onReply: (() => void) | undefined = undefined
|
||||
@ -121,7 +122,7 @@
|
||||
<span class="text-sm lower ml-1">
|
||||
<Label label={activity.string.Mentioned} />
|
||||
</span>
|
||||
{#if targetDoc}
|
||||
{#if !hideLink && targetDoc}
|
||||
<DocNavLink object={targetDoc} component={targetPanel?.component ?? view.component.EditDoc} shrink={0}>
|
||||
<span class="text-sm">
|
||||
{#if currentAccount.person === targetDoc._id}
|
||||
|
@ -31,12 +31,14 @@
|
||||
export let parentObject: Doc | undefined
|
||||
export let attributeModel: AttributeModel | undefined = undefined
|
||||
export let collectionName: IntlString | undefined = undefined
|
||||
export let hideLink = false
|
||||
|
||||
const isOwn = message.objectId === message.attachedTo
|
||||
|
||||
let linkData: LinkData | undefined = undefined
|
||||
|
||||
$: void getLinkData(message, object, parentObject, person).then((data) => {
|
||||
$: !hideLink &&
|
||||
getLinkData(message, object, parentObject, person).then((data) => {
|
||||
linkData = data
|
||||
})
|
||||
|
||||
|
@ -51,6 +51,7 @@
|
||||
export let excludedActions: string[] = []
|
||||
export let hoverable = true
|
||||
export let hoverStyles: 'borderedHover' | 'filledHover' = 'borderedHover'
|
||||
export let hideLink = false
|
||||
export let onClick: (() => void) | undefined = undefined
|
||||
export let onReply: (() => void) | undefined = undefined
|
||||
|
||||
@ -161,13 +162,11 @@
|
||||
{withFlatActions}
|
||||
{hoverable}
|
||||
{hoverStyles}
|
||||
showDatePreposition={hideLink}
|
||||
{onClick}
|
||||
{onReply}
|
||||
>
|
||||
<svelte:fragment slot="header">
|
||||
{#if viewlet?.labelComponent && object}
|
||||
<Component is={viewlet.labelComponent} props={{ value: object }} />
|
||||
{:else if object}
|
||||
<DocUpdateMessageHeader
|
||||
message={value}
|
||||
{object}
|
||||
@ -177,8 +176,8 @@
|
||||
{objectName}
|
||||
{collectionName}
|
||||
{attributeModel}
|
||||
{hideLink}
|
||||
/>
|
||||
{/if}
|
||||
</svelte:fragment>
|
||||
<svelte:fragment slot="content">
|
||||
{#if viewlet?.component && object}
|
||||
|
@ -237,7 +237,6 @@ export interface DocUpdateMessageViewlet extends ActivityMessageViewlet {
|
||||
valueAttr?: string
|
||||
|
||||
label?: IntlString
|
||||
labelComponent?: AnyComponent
|
||||
|
||||
icon?: Asset
|
||||
component?: AnyComponent
|
||||
@ -345,6 +344,7 @@ export default plugin(activityId, {
|
||||
To: '' as IntlString,
|
||||
Unset: '' as IntlString,
|
||||
In: '' as IntlString,
|
||||
At: '' as IntlString,
|
||||
NewestFirst: '' as IntlString,
|
||||
Edit: '' as IntlString,
|
||||
Updated: '' as IntlString,
|
||||
|
@ -586,6 +586,7 @@
|
||||
withShowMore={false}
|
||||
attachmentImageSize="x-large"
|
||||
showLinksPreview={false}
|
||||
hideLink
|
||||
/>
|
||||
</div>
|
||||
{/each}
|
||||
|
@ -28,10 +28,12 @@
|
||||
export let object: Doc | undefined
|
||||
export let parentObject: Doc | undefined
|
||||
export let skipLabel = false
|
||||
export let hideLink = false
|
||||
|
||||
let linkData: LinkData | undefined = undefined
|
||||
|
||||
$: getLinkData(message, object, parentObject, person).then((data) => {
|
||||
$: !hideLink &&
|
||||
getLinkData(message, object, parentObject, person).then((data) => {
|
||||
linkData = data
|
||||
})
|
||||
</script>
|
||||
|
@ -14,7 +14,7 @@
|
||||
// limitations under the License.
|
||||
-->
|
||||
<script lang="ts">
|
||||
import { createEventDispatcher, onMount } from 'svelte'
|
||||
import { createEventDispatcher } from 'svelte'
|
||||
import { Doc, Ref, SortingOrder } from '@hcengineering/core'
|
||||
import { createQuery } from '@hcengineering/presentation'
|
||||
import activity from '@hcengineering/activity'
|
||||
@ -87,7 +87,7 @@
|
||||
{#each messages as message}
|
||||
<div class="item">
|
||||
<Lazy>
|
||||
<ChatMessagePresenter value={message} />
|
||||
<ChatMessagePresenter value={message} hideLink />
|
||||
</Lazy>
|
||||
</div>
|
||||
{/each}
|
||||
@ -125,7 +125,7 @@
|
||||
.messages {
|
||||
overflow: auto;
|
||||
flex: 1;
|
||||
padding: 0 1rem;
|
||||
padding: 0.75rem 0.25rem;
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
|
||||
|
@ -49,6 +49,7 @@
|
||||
export let attachmentImageSize: AttachmentImageSize = 'auto'
|
||||
export let showLinksPreview = true
|
||||
export let videoPreload = true
|
||||
export let hideLink = false
|
||||
export let compact = false
|
||||
export let onClick: (() => void) | undefined = undefined
|
||||
export let onReply: (() => void) | undefined = undefined
|
||||
@ -183,11 +184,13 @@
|
||||
{withFlatActions}
|
||||
{hoverable}
|
||||
{hoverStyles}
|
||||
{skipLabel}
|
||||
showDatePreposition={hideLink}
|
||||
{onClick}
|
||||
{onReply}
|
||||
>
|
||||
<svelte:fragment slot="header">
|
||||
<ChatMessageHeader {object} {parentObject} message={value} {viewlet} {person} {skipLabel} />
|
||||
<ChatMessageHeader {object} {parentObject} message={value} {viewlet} {person} {skipLabel} {hideLink} />
|
||||
</svelte:fragment>
|
||||
<svelte:fragment slot="content">
|
||||
{#if !isEditing}
|
||||
|
@ -160,7 +160,7 @@ export class CommonTrackerPage extends CalendarPage {
|
||||
}
|
||||
|
||||
async checkCommentExist (comment: string): Promise<void> {
|
||||
await expect(this.textComment.filter({ hasText: comment })).toBeVisible()
|
||||
await expect(this.textComment.filter({ hasText: comment }).first()).toBeVisible()
|
||||
}
|
||||
|
||||
async checkActivityExist (activity: string): Promise<void> {
|
||||
|
@ -6,18 +6,22 @@ const config: PlaywrightTestConfig = {
|
||||
projects: [
|
||||
{
|
||||
name: 'Platform',
|
||||
use: { ...devices['Desktop Chrome'] }
|
||||
}
|
||||
],
|
||||
use: {
|
||||
...devices['Desktop Chrome'],
|
||||
screenshot: 'only-on-failure',
|
||||
viewport: {
|
||||
width: 1440,
|
||||
height: 900
|
||||
},
|
||||
trace: {
|
||||
mode: 'retain-on-failure',
|
||||
snapshots: true,
|
||||
screenshots: true,
|
||||
sources: true
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
],
|
||||
retries: 1,
|
||||
timeout: 60000,
|
||||
maxFailures: 5,
|
||||
|
@ -165,7 +165,7 @@ test.describe('Vacancy tests', () => {
|
||||
const vacancyDetailsPage = new VacancyDetailsPage(page)
|
||||
await vacancyDetailsPage.moreActionOn('Archive')
|
||||
await vacancyDetailsPage.pressYesForPopup(page)
|
||||
await vacancyDetailsPage.checkActivityExist('changed archived in')
|
||||
await vacancyDetailsPage.checkActivityExist('changed archived at')
|
||||
|
||||
await navigationMenuPage.buttonVacancies.click()
|
||||
await vacanciesPage.checkVacancyNotExist(
|
||||
|
@ -62,9 +62,9 @@ test.describe('Tracker milestone tests', () => {
|
||||
await milestonesDetailsPage.addComment(commentText)
|
||||
await milestonesDetailsPage.checkCommentExist(commentText)
|
||||
await milestonesDetailsPage.checkActivityExist('created milestone')
|
||||
await milestonesDetailsPage.checkActivityExist('changed target date in')
|
||||
await milestonesDetailsPage.checkActivityExist('changed status in')
|
||||
await milestonesDetailsPage.checkActivityExist('changed description in')
|
||||
await milestonesDetailsPage.checkActivityExist('changed target date at')
|
||||
await milestonesDetailsPage.checkActivityExist('changed status at')
|
||||
await milestonesDetailsPage.checkActivityExist('changed description at')
|
||||
})
|
||||
|
||||
test('Delete a Milestone', async ({ page }) => {
|
||||
|
Loading…
Reference in New Issue
Block a user