From f65770f40a97b0ad71711422630a001bd7b6f0c9 Mon Sep 17 00:00:00 2001 From: Victor Ilyushchenko Date: Mon, 17 Feb 2025 21:47:07 +0300 Subject: [PATCH 1/7] EQMS-1445: Fixed qms doc commments theme styling (#8031) Signed-off-by: Victor Ilyushchenko --- packages/theme/styles/_colors.scss | 6 +++--- packages/theme/styles/_text-editor.scss | 4 +++- plugins/controlled-documents-assets/assets/icons.svg | 4 ++-- .../controlled-documents-resources/src/styles/_colors.scss | 6 ++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/theme/styles/_colors.scss b/packages/theme/styles/_colors.scss index 3db6a2b09b..95d89fba05 100644 --- a/packages/theme/styles/_colors.scss +++ b/packages/theme/styles/_colors.scss @@ -68,9 +68,9 @@ --text-editor-selected-node-background: rgba(43, 81, 144, 0.1); --text-editor-selected-node-color: #93CAF3; - --text-editor-highlighted-node-warning-active-background-color: #F2D7AE; - --text-editor-highlighted-node-warning-background-color: #F8EBD7; - --text-editor-highlighted-node-warning-border-color: #DE9B35; + --text-editor-highlighted-node-warning-active-background-color: rgba(255, 203, 0, .24); + --text-editor-highlighted-node-warning-background-color: rgba(255, 203, 0, .12); + --text-editor-highlighted-node-warning-border-color: rgba(255, 203, 0, .35); --text-editor-highlighted-node-add-background-color: #DAEDDC; --text-editor-highlighted-node-add-font-color: #1C4220; diff --git a/packages/theme/styles/_text-editor.scss b/packages/theme/styles/_text-editor.scss index c546f3cebf..20f56a6045 100644 --- a/packages/theme/styles/_text-editor.scss +++ b/packages/theme/styles/_text-editor.scss @@ -323,7 +323,9 @@ .text-editor-highlighted-node-warning { background-color: var(--text-editor-highlighted-node-warning-background-color); - border-bottom: 0.0625rem solid var(--text-editor-highlighted-node-warning-border-color); + border-bottom: 2px solid var(--text-editor-highlighted-node-warning-border-color); + padding-bottom: 2px; + transition: background 0.2s ease, border 0.2s ease; &.text-editor-highlighted-node-selected, &:hover { background-color: var(--text-editor-highlighted-node-warning-active-background-color); diff --git a/plugins/controlled-documents-assets/assets/icons.svg b/plugins/controlled-documents-assets/assets/icons.svg index 83134837a7..e80406dd60 100644 --- a/plugins/controlled-documents-assets/assets/icons.svg +++ b/plugins/controlled-documents-assets/assets/icons.svg @@ -1,7 +1,7 @@ - - + + diff --git a/plugins/controlled-documents-resources/src/styles/_colors.scss b/plugins/controlled-documents-resources/src/styles/_colors.scss index 4d0e1ef26a..44e6db6f7a 100644 --- a/plugins/controlled-documents-resources/src/styles/_colors.scss +++ b/plugins/controlled-documents-resources/src/styles/_colors.scss @@ -17,8 +17,7 @@ .theme-dark { --theme-docs-contrast-color: #ffffff; --theme-docs-description-border-color: rgba(0, 0, 0, 0.2); - --theme-docs-frozen-description-color: #e7f2f3; - --theme-docs-comment-highlighted-color: #fefbf1; + --theme-docs-comment-highlighted-color: var(--theme-comp-header-color); --theme-docs-warning-color: rgba(222, 155, 53, 0.08); --theme-docs-warning-icon-color: #d27540; --theme-docs-accepted-color: #38833f; @@ -28,8 +27,7 @@ .theme-light { --theme-docs-contrast-color: #000000; --theme-docs-description-border-color: rgba(0, 0, 0, 0.2); - --theme-docs-frozen-description-color: #e7f2f3; - --theme-docs-comment-highlighted-color: #fefbf1; + --theme-docs-comment-highlighted-color: var(--theme-comp-header-color); --theme-docs-warning-color: rgba(222, 155, 53, 0.08); --theme-docs-warning-icon-color: #d27540; --theme-docs-accepted-color: #38833f; From 57e055504f5fab8e591bdbc3c7b3fe7a86372d90 Mon Sep 17 00:00:00 2001 From: Victor Ilyushchenko Date: Tue, 18 Feb 2025 10:18:16 +0300 Subject: [PATCH 2/7] Fixed reference url resolver (#8041) Signed-off-by: Victor Ilyushchenko --- .../text-editor-resources/src/components/extension/reference.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/text-editor-resources/src/components/extension/reference.ts b/plugins/text-editor-resources/src/components/extension/reference.ts index 34d9ab1501..65f9004b17 100644 --- a/plugins/text-editor-resources/src/components/extension/reference.ts +++ b/plugins/text-editor-resources/src/components/extension/reference.ts @@ -363,7 +363,7 @@ export async function getReferenceFromUrl (text: string): Promise | undefined = linkProvider !== undefined ? (await (await getResource(linkProvider.decode))(id)) ?? id : id - const label = await getReferenceLabel(objectclass, id) + const label = await getReferenceLabel(objectclass, _id) if (label === '') return return { From e2b4b2244cf5234fc2f09bdcd836a8047ec4e037 Mon Sep 17 00:00:00 2001 From: Victor Ilyushchenko Date: Tue, 18 Feb 2025 11:48:48 +0300 Subject: [PATCH 3/7] EQMS-1435: Enable watermark in obsolete documents (#8032) * EQMS-1435: Enable waterwark in obsolete documents Signed-off-by: Victor Ilyushchenko * added watermark to the doc Signed-off-by: Victor Ilyushchenko --------- Signed-off-by: Victor Ilyushchenko --- .../components/document/EditDocContent.svelte | 44 +++++++++++++++++-- .../print/DocumentPrintTitlePage.svelte | 2 +- 2 files changed, 41 insertions(+), 5 deletions(-) diff --git a/plugins/controlled-documents-resources/src/components/document/EditDocContent.svelte b/plugins/controlled-documents-resources/src/components/document/EditDocContent.svelte index 033191c900..5e404a3980 100644 --- a/plugins/controlled-documents-resources/src/components/document/EditDocContent.svelte +++ b/plugins/controlled-documents-resources/src/components/document/EditDocContent.svelte @@ -20,7 +20,7 @@ import { getClient } from '@hcengineering/presentation' import view from '@hcengineering/view' import attachment, { Attachment } from '@hcengineering/attachment' - import documents from '@hcengineering/controlled-documents' + import documents, { DocumentState } from '@hcengineering/controlled-documents' import { Editor, Heading } from '@hcengineering/text-editor' import { CollaboratorEditor, @@ -34,8 +34,9 @@ highlightUpdateCommand, getNodeElement } from '@hcengineering/text-editor-resources' - import { navigate, EditBox, Scroller } from '@hcengineering/ui' + import { navigate, EditBox, Scroller, Label } from '@hcengineering/ui' import { getCollaborationUser, getObjectLinkFragment } from '@hcengineering/view-resources' + import plugin from '../../plugin' import { $areDocumentCommentPopupsOpened as areDocumentCommentPopupsOpened, @@ -248,7 +249,7 @@ handleShowHeading(ev.detail)} /> -
+
{#if $isEditable} + {#if $controlledDocument.state === DocumentState.Obsolete} +
+ {#each { length: 24 } as _, i} +
+ {/each} +
+ {/if} diff --git a/plugins/controlled-documents-resources/src/components/print/DocumentPrintTitlePage.svelte b/plugins/controlled-documents-resources/src/components/print/DocumentPrintTitlePage.svelte index a6dade36ef..f9f7654b12 100644 --- a/plugins/controlled-documents-resources/src/components/print/DocumentPrintTitlePage.svelte +++ b/plugins/controlled-documents-resources/src/components/print/DocumentPrintTitlePage.svelte @@ -54,7 +54,7 @@ $controlledDocument != null && (isOrgSpace ? $controlledDocument.state !== DocumentState.Effective - : ![DocumentState.Effective, DocumentState.Obsolete, DocumentState.Archived].includes($controlledDocument.state)) + : ![DocumentState.Effective, DocumentState.Archived].includes($controlledDocument.state)) {#if $controlledDocument !== null} From 4af5dfdd782cb831dc3e5e18f4e884e72d169f86 Mon Sep 17 00:00:00 2001 From: Victor Ilyushchenko Date: Tue, 18 Feb 2025 16:44:15 +0300 Subject: [PATCH 4/7] EQMS-1437: use different label to display trainees' results "owner". (#8046) * EQMS-1437: use different column to display trainees' results "owner". Signed-off-by: Victor Ilyushchenko * ff Signed-off-by: Victor Ilyushchenko --------- Signed-off-by: Victor Ilyushchenko --- models/training/src/index.ts | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/models/training/src/index.ts b/models/training/src/index.ts index fc25f209de..dcd9c2e091 100644 --- a/models/training/src/index.ts +++ b/models/training/src/index.ts @@ -16,7 +16,7 @@ import activity from '@hcengineering/activity' import notification, { type NotificationType } from '@hcengineering/notification' import { type Asset, type IntlString } from '@hcengineering/platform' -import type { BuildModelKey, Viewlet, ViewletDescriptor } from '@hcengineering/view' +import type { BuildModelKey, KeyFilterPreset, Viewlet, ViewletDescriptor } from '@hcengineering/view' import questions from '@hcengineering/model-questions' import contact from '@hcengineering/contact' import tracker from '@hcengineering/model-tracker' @@ -659,9 +659,19 @@ function defineTrainingAttempt (builder: Builder): void { sortingKey: 'state', displayProps: { align: 'center' } } - const columnOwner: BuildModelKey = { - ...columns.owner, - key: 'owner' + const columnTrainee: BuildModelKey = { + key: 'owner', + label: training.string.TrainingRequestTrainee, + presenter: contacts.component.EmployeePresenter, + props: { shouldShowName: true }, + displayProps: { align: 'center' } + } + + const columnTraineeFilter: KeyFilterPreset = { + _class: training.class.TrainingAttempt, + component: contacts.component.EmployeeFilter, + key: 'owner', + label: training.string.TrainingRequestTrainee } defineTableBrowserViewletDescriptor( @@ -693,7 +703,7 @@ function defineTrainingAttempt (builder: Builder): void { columnScore, 'createdOn', 'submittedOn', - columnOwner + columnTrainee ], configOptions: { strict: true, @@ -720,7 +730,7 @@ function defineTrainingAttempt (builder: Builder): void { }) builder.mixin(training.class.TrainingAttempt, core.class.Class, view.mixin.ClassFilters, { - filters: ['state', 'owner', 'submittedOn'] as Array, + filters: ['state', 'submittedOn', columnTraineeFilter] as Array, strict: true }) From c2d8a3153444dd8cbd83ff0103f4d00446437ce0 Mon Sep 17 00:00:00 2001 From: Victor Ilyushchenko Date: Tue, 18 Feb 2025 19:01:28 +0300 Subject: [PATCH 5/7] UBERF-9334: fixed ActionContext managment (#8047) Signed-off-by: Victor Ilyushchenko --- .../src/components/ActionContext.svelte | 30 +++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/packages/presentation/src/components/ActionContext.svelte b/packages/presentation/src/components/ActionContext.svelte index f6926950de..c5e86e3001 100644 --- a/packages/presentation/src/components/ActionContext.svelte +++ b/packages/presentation/src/components/ActionContext.svelte @@ -13,37 +13,43 @@ // limitations under the License. --> From cae76abb8aabef39285512f4c96f33b75d9ff3fb Mon Sep 17 00:00:00 2001 From: Victor Ilyushchenko Date: Tue, 18 Feb 2025 20:03:00 +0300 Subject: [PATCH 6/7] UBERF-8545: fix links in readonly documents (#8050) Signed-off-by: Victor Ilyushchenko --- packages/text/src/kits/default-kit.ts | 2 +- .../src/components/extension/link.ts | 26 ++++++++++++++++++- .../src/kits/default-kit.ts | 2 +- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/packages/text/src/kits/default-kit.ts b/packages/text/src/kits/default-kit.ts index 56aea0a518..30d78e7dad 100644 --- a/packages/text/src/kits/default-kit.ts +++ b/packages/text/src/kits/default-kit.ts @@ -56,7 +56,7 @@ export const DefaultKit = Extension.create({ }), Typography.configure({}), Link.extend({ inclusive: false }).configure({ - openOnClick: true, + openOnClick: false, HTMLAttributes: { class: 'cursor-pointer', rel: 'noopener noreferrer', target: '_blank' } }) ] diff --git a/plugins/text-editor-resources/src/components/extension/link.ts b/plugins/text-editor-resources/src/components/extension/link.ts index e78f4fa3a1..091c06378a 100644 --- a/plugins/text-editor-resources/src/components/extension/link.ts +++ b/plugins/text-editor-resources/src/components/extension/link.ts @@ -15,6 +15,8 @@ import { showPopup } from '@hcengineering/ui' import { Extension } from '@tiptap/core' +import { type MarkType } from '@tiptap/pm/model' +import { Plugin, PluginKey } from '@tiptap/pm/state' import LinkPopup from '../LinkPopup.svelte' export const LinkUtilsExtension = Extension.create({ @@ -42,6 +44,28 @@ export const LinkUtilsExtension = Extension.create({ }, addProseMirrorPlugins () { - return [] + return [LinkClickHandlerPlugin({ type: this.editor.schema.marks.link })] } }) + +interface LinkClickHandlerOptions { + type: MarkType +} + +export function LinkClickHandlerPlugin (options: LinkClickHandlerOptions): Plugin { + return new Plugin({ + key: new PluginKey('handleClickLink'), + props: { + handleClick: (view, pos, event) => { + const $pos = view.state.doc.resolve(pos) + const link = options.type.isInSet($pos.marks()) + if (typeof link?.attrs.href === 'string') { + window.open(link.attrs.href, link.attrs.target) + return true + } + + return false + } + } + }) +} diff --git a/plugins/text-editor-resources/src/kits/default-kit.ts b/plugins/text-editor-resources/src/kits/default-kit.ts index e67de7cf3d..f2cd3d79bd 100644 --- a/plugins/text-editor-resources/src/kits/default-kit.ts +++ b/plugins/text-editor-resources/src/kits/default-kit.ts @@ -62,7 +62,7 @@ export const DefaultKit = Extension.create({ }), Typography.configure({}), Link.extend({ inclusive: false }).configure({ - openOnClick: true, + openOnClick: false, HTMLAttributes: { class: 'cursor-pointer', rel: 'noopener noreferrer', target: '_blank' } }), CodeBlockHighlighExtension.configure(codeBlockHighlightOptions) From 69c66667c2bcec63f1ea8aa67f124dd726ac4383 Mon Sep 17 00:00:00 2001 From: Victor Ilyushchenko Date: Tue, 18 Feb 2025 20:32:46 +0300 Subject: [PATCH 7/7] EQMS-1440: disable delayed qms doc effectiveness and review interval (#8049) * EQMS-1440: disable delayed qms doc effectiveness and review interval Signed-off-by: Victor Ilyushchenko * ff Signed-off-by: Victor Ilyushchenko * ff Signed-off-by: Victor Ilyushchenko --------- Signed-off-by: Victor Ilyushchenko --- .../components/document/EditDocRelease.svelte | 52 +++++++++---------- .../sanity/tests/documents/documents.spec.ts | 2 +- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/plugins/controlled-documents-resources/src/components/document/EditDocRelease.svelte b/plugins/controlled-documents-resources/src/components/document/EditDocRelease.svelte index efe2ffc34c..06c4edb0d7 100644 --- a/plugins/controlled-documents-resources/src/components/document/EditDocRelease.svelte +++ b/plugins/controlled-documents-resources/src/components/document/EditDocRelease.svelte @@ -58,33 +58,33 @@ const client = getClient() - async function changePlannedEffectiveDate (plannedEffectiveDate: Timestamp) { - if (!$controlledDocument) { - return - } + // async function changePlannedEffectiveDate (plannedEffectiveDate: Timestamp) { + // if (!$controlledDocument) { + // return + // } - await client.update($controlledDocument, { plannedEffectiveDate }) - } + // await client.update($controlledDocument, { plannedEffectiveDate }) + // } - let selectedDate: Timestamp = - $controlledDocument?.plannedEffectiveDate != null && $controlledDocument?.plannedEffectiveDate > 0 - ? $controlledDocument.plannedEffectiveDate - : Date.now() + // let selectedDate: Timestamp = + // $controlledDocument?.plannedEffectiveDate != null && $controlledDocument?.plannedEffectiveDate > 0 + // ? $controlledDocument.plannedEffectiveDate + // : Date.now() - let selected: IntlString | undefined = undefined - if ($controlledDocument?.plannedEffectiveDate === 0) { - selected = documentsRes.string.EffectiveImmediately - } else if ($controlledDocument?.plannedEffectiveDate != null) { - selected = documentsRes.string.EffectiveOn - } + // let selected: IntlString | undefined = undefined + // if ($controlledDocument?.plannedEffectiveDate === 0) { + // selected = documentsRes.string.EffectiveImmediately + // } else if ($controlledDocument?.plannedEffectiveDate != null) { + // selected = documentsRes.string.EffectiveOn + // } - async function changeSelectedDate (ev: CustomEvent) { - if (ev.detail !== undefined) { - selectedDate = ev.detail - await changePlannedEffectiveDate(ev.detail) - selected = documentsRes.string.EffectiveOn - } - } + // async function changeSelectedDate (ev: CustomEvent) { + // if (ev.detail !== undefined) { + // selectedDate = ev.detail + // await changePlannedEffectiveDate(ev.detail) + // selected = documentsRes.string.EffectiveOn + // } + // } const reviewIntervals: DropdownTextItem[] = [] for (const interval of periodicReviewIntervals) { @@ -254,10 +254,10 @@ gap="none" />
-
+
- +