From c7a15d2a93bcf5a8f09981a42b8c172b7a05569a Mon Sep 17 00:00:00 2001 From: Valentin Mihai Date: Tue, 5 Sep 2023 17:34:48 +0300 Subject: [PATCH 1/5] DM-358 - WIP on implementing Help Mode-IDs for DocuMine --- src/assets/styles/common-help-mode.scss | 2 ++ src/lib/help-mode/utils/constants.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/assets/styles/common-help-mode.scss b/src/assets/styles/common-help-mode.scss index 95b824f..baa5564 100644 --- a/src/assets/styles/common-help-mode.scss +++ b/src/assets/styles/common-help-mode.scss @@ -7,6 +7,8 @@ .help-highlight, .help-mode:hover { background: rgba(92, 229, 148, 0.5); + //background: rgba(253,189,0, 0.5); box-shadow: 0 0 0 2px var(--iqser-helpmode-primary) inset; + //box-shadow: 0 0 0 2px var(--iqser-yellow-2) inset; cursor: help; } diff --git a/src/lib/help-mode/utils/constants.ts b/src/lib/help-mode/utils/constants.ts index d97a3cf..0f9190e 100644 --- a/src/lib/help-mode/utils/constants.ts +++ b/src/lib/help-mode/utils/constants.ts @@ -4,6 +4,7 @@ export const OVERLAPPING_DROPDOWNS_IDS = { USER_MENU: 'user-menu-items', WORKLOAD_FILTER: 'workload-filters', DOCUMENT_INFO: 'document-info', + BREADCRUMBS_MENU: 'breadcrumbs-menu-items', }; export const SCROLL_BUTTONS_IDS = ['scroll-up', 'scroll-down']; export const PDF_TRON_IFRAME_ID = 'webviewer-1'; @@ -25,6 +26,7 @@ export const OverlappingElements = { USER_MENU: 'USER_MENU', WORKLOAD_FILTER: 'WORKLOAD_FILTER', DOCUMENT_INFO: 'DOCUMENT_INFO', + BREADCRUMBS_MENU: 'BREADCRUMBS_MENU', } as const; export type OverlappingElement = keyof typeof OverlappingElements; From d4d593d24ac4f99dc9455d05906ae37db3c19ac9 Mon Sep 17 00:00:00 2001 From: Valentin Mihai Date: Wed, 6 Sep 2023 18:53:28 +0300 Subject: [PATCH 2/5] DM-358 - WIP on implementing Help Mode-IDs for DocuMine --- src/lib/listing/page-header/page-header.component.html | 2 +- src/lib/listing/page-header/page-header.component.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/listing/page-header/page-header.component.html b/src/lib/listing/page-header/page-header.component.html index 4952155..aff6a0b 100644 --- a/src/lib/listing/page-header/page-header.component.html +++ b/src/lib/listing/page-header/page-header.component.html @@ -74,7 +74,7 @@ *ngIf="showCloseButton" [class.ml-6]="actionConfigs" [icon]="'iqser:close'" - [attr.help-mode-key]="'edit_dossier_in_dossier'" + [attr.help-mode-key]="'close_dossier'" [tooltip]="'common.close' | translate" > diff --git a/src/lib/listing/page-header/page-header.component.ts b/src/lib/listing/page-header/page-header.component.ts index b91c0af..6b8e793 100644 --- a/src/lib/listing/page-header/page-header.component.ts +++ b/src/lib/listing/page-header/page-header.component.ts @@ -40,7 +40,7 @@ export class PageHeaderComponent { ) {} get filterHelpModeKey() { - return this.helpModeKey ? `filter_${this.helpModeKey}_list` : ''; + return this.helpModeKey ? (this.helpModeKey === 'dossier' ? 'filter_dossier_list' : 'filter_documents') : ''; } get #showResetFilters$(): Observable { From da0e0577218fa268bd14e06db889f74b23508f75 Mon Sep 17 00:00:00 2001 From: Valentin Mihai Date: Thu, 7 Sep 2023 19:23:36 +0300 Subject: [PATCH 3/5] DM-358 - added all keys --- src/lib/help-mode/help-mode.service.ts | 6 ++---- src/lib/help-mode/utils/constants.ts | 9 +++++++-- .../inputs/editable-input/editable-input.component.html | 1 + .../inputs/editable-input/editable-input.component.ts | 1 + 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/lib/help-mode/help-mode.service.ts b/src/lib/help-mode/help-mode.service.ts index 287a047..f8b2ec8 100644 --- a/src/lib/help-mode/help-mode.service.ts +++ b/src/lib/help-mode/help-mode.service.ts @@ -5,16 +5,15 @@ import { BehaviorSubject, firstValueFrom } from 'rxjs'; import { HelpModeDialogComponent } from './help-mode-dialog/help-mode-dialog.component'; import { HELP_MODE_KEYS, MANUAL_BASE_URL } from './tokens'; import { - ANNOTATIONS_LIST_ID, HELP_HIGHLIGHT_CLASS, HELP_MODE_CLASS, OVERLAPPING_DROPDOWNS_IDS, OverlappingElement, PDF_TRON_IFRAME_ID, SCROLL_BUTTONS_IDS, + SCROLLABLE_PARENT_VIEWS_IDS, ScrollableParentView, ScrollableParentViews, - VIRTUAL_SCROLL_ID, WEB_VIEWER_ELEMENTS, } from './utils/constants'; @@ -174,8 +173,7 @@ export class HelpModeService { } if (helper.scrollableParentView) { - const scrollableElementId = - helper.scrollableParentView === ScrollableParentViews.VIRTUAL_SCROLL ? VIRTUAL_SCROLL_ID : ANNOTATIONS_LIST_ID; + const scrollableElementId = SCROLLABLE_PARENT_VIEWS_IDS[helper.scrollableParentView]; const scrollableElement: HTMLElement = document.getElementById(scrollableElementId); if (!scrollableElement) { diff --git a/src/lib/help-mode/utils/constants.ts b/src/lib/help-mode/utils/constants.ts index 0f9190e..64b132f 100644 --- a/src/lib/help-mode/utils/constants.ts +++ b/src/lib/help-mode/utils/constants.ts @@ -1,5 +1,3 @@ -export const VIRTUAL_SCROLL_ID = 'virtual-scroll'; -export const ANNOTATIONS_LIST_ID = 'annotations-list'; export const OVERLAPPING_DROPDOWNS_IDS = { USER_MENU: 'user-menu-items', WORKLOAD_FILTER: 'workload-filters', @@ -18,6 +16,13 @@ export const WEB_VIEWER_ELEMENTS = [ export const ScrollableParentViews = { VIRTUAL_SCROLL: 'VIRTUAL_SCROLL', ANNOTATIONS_LIST: 'ANNOTATIONS_LIST', + SCM_EDIT_DIALOG: 'SCM_EDIT_DIALOG', +} as const; + +export const SCROLLABLE_PARENT_VIEWS_IDS = { + VIRTUAL_SCROLL: 'virtual-scroll', + ANNOTATIONS_LIST: 'annotations-list', + SCM_EDIT_DIALOG: 'scm-edit', } as const; export type ScrollableParentView = keyof typeof ScrollableParentViews; diff --git a/src/lib/inputs/editable-input/editable-input.component.html b/src/lib/inputs/editable-input/editable-input.component.html index 1cb24cb..fe31cc8 100644 --- a/src/lib/inputs/editable-input/editable-input.component.html +++ b/src/lib/inputs/editable-input/editable-input.component.html @@ -9,6 +9,7 @@ (action)="editing = true" [tooltip]="editTooltip" [type]="buttonsType" + [attr.help-mode-key]="helpModeKey" class="edit-button" icon="iqser:edit" > diff --git a/src/lib/inputs/editable-input/editable-input.component.ts b/src/lib/inputs/editable-input/editable-input.component.ts index bec7a5a..b7deeb9 100644 --- a/src/lib/inputs/editable-input/editable-input.component.ts +++ b/src/lib/inputs/editable-input/editable-input.component.ts @@ -23,6 +23,7 @@ export class EditableInputComponent implements OnChanges { @Input() showPreview = true; @Input() canEdit = true; @Input() buttonsType: CircleButtonType = CircleButtonTypes.default; + @Input() helpModeKey: string = ''; @Output() readonly save = new EventEmitter(); parentDimensions?: { width: number; height: number }; newValue = ''; From c83eb568db039e60db49d96b5a99af204b0bdd99 Mon Sep 17 00:00:00 2001 From: Valentin Mihai Date: Thu, 7 Sep 2023 23:15:22 +0300 Subject: [PATCH 4/5] DM-358 - added documine theme for helpers --- src/assets/styles/common-help-mode.scss | 7 +++++-- src/lib/help-mode/help-mode.service.ts | 6 ++++++ src/lib/help-mode/utils/constants.ts | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/assets/styles/common-help-mode.scss b/src/assets/styles/common-help-mode.scss index baa5564..b74c0a3 100644 --- a/src/assets/styles/common-help-mode.scss +++ b/src/assets/styles/common-help-mode.scss @@ -7,8 +7,11 @@ .help-highlight, .help-mode:hover { background: rgba(92, 229, 148, 0.5); - //background: rgba(253,189,0, 0.5); box-shadow: 0 0 0 2px var(--iqser-helpmode-primary) inset; - //box-shadow: 0 0 0 2px var(--iqser-yellow-2) inset; cursor: help; + + &.documine-theme { + background: rgba(253,189,0, 0.5); + box-shadow: 0 0 0 2px var(--iqser-yellow-2) inset; + } } diff --git a/src/lib/help-mode/help-mode.service.ts b/src/lib/help-mode/help-mode.service.ts index f8b2ec8..04f12a5 100644 --- a/src/lib/help-mode/help-mode.service.ts +++ b/src/lib/help-mode/help-mode.service.ts @@ -5,6 +5,7 @@ import { BehaviorSubject, firstValueFrom } from 'rxjs'; import { HelpModeDialogComponent } from './help-mode-dialog/help-mode-dialog.component'; import { HELP_MODE_KEYS, MANUAL_BASE_URL } from './tokens'; import { + DOCUMINE_THEME_CLASS, HELP_HIGHLIGHT_CLASS, HELP_MODE_CLASS, OVERLAPPING_DROPDOWNS_IDS, @@ -16,6 +17,7 @@ import { ScrollableParentViews, WEB_VIEWER_ELEMENTS, } from './utils/constants'; +import { getConfig } from '../services'; export interface Helper { readonly element: HTMLElement; @@ -42,6 +44,7 @@ export class HelpModeService { readonly #helpModeDialogIsOpened$ = new BehaviorSubject(false); readonly helpModeDialogIsOpened$ = this.#helpModeDialogIsOpened$.asObservable(); readonly #renderer: Renderer2; + readonly #isDocumine = getConfig().IS_DOCUMINE; #helpers: Record = {}; #dialogMode = false; @@ -137,6 +140,9 @@ export class HelpModeService { this.#renderer.setAttribute(helperElement, 'href', this.generateDocsLink(key)); this.#renderer.setAttribute(helperElement, 'target', '_blank'); this.#renderer.addClass(helperElement, HELP_MODE_CLASS); + if (this.#isDocumine) { + this.#renderer.addClass(helperElement, DOCUMINE_THEME_CLASS); + } return helperElement; } diff --git a/src/lib/help-mode/utils/constants.ts b/src/lib/help-mode/utils/constants.ts index 64b132f..8cc6c8d 100644 --- a/src/lib/help-mode/utils/constants.ts +++ b/src/lib/help-mode/utils/constants.ts @@ -37,4 +37,5 @@ export const OverlappingElements = { export type OverlappingElement = keyof typeof OverlappingElements; export const HELP_MODE_CLASS = 'help-mode'; +export const DOCUMINE_THEME_CLASS = 'documine-theme'; export const HELP_HIGHLIGHT_CLASS = 'help-highlight'; From 4f4123cd5d1780a962d9df350137cc4b244b66c9 Mon Sep 17 00:00:00 2001 From: Valentin Mihai Date: Fri, 8 Sep 2023 15:48:27 +0300 Subject: [PATCH 5/5] DM-358 - set some keys depending on user roles --- src/assets/styles/common-help-mode.scss | 2 +- src/lib/help-mode/utils/constants.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/assets/styles/common-help-mode.scss b/src/assets/styles/common-help-mode.scss index b74c0a3..211e3b2 100644 --- a/src/assets/styles/common-help-mode.scss +++ b/src/assets/styles/common-help-mode.scss @@ -11,7 +11,7 @@ cursor: help; &.documine-theme { - background: rgba(253,189,0, 0.5); + background: rgba(253, 189, 0, 0.5); box-shadow: 0 0 0 2px var(--iqser-yellow-2) inset; } } diff --git a/src/lib/help-mode/utils/constants.ts b/src/lib/help-mode/utils/constants.ts index 8cc6c8d..5804db5 100644 --- a/src/lib/help-mode/utils/constants.ts +++ b/src/lib/help-mode/utils/constants.ts @@ -17,12 +17,14 @@ export const ScrollableParentViews = { VIRTUAL_SCROLL: 'VIRTUAL_SCROLL', ANNOTATIONS_LIST: 'ANNOTATIONS_LIST', SCM_EDIT_DIALOG: 'SCM_EDIT_DIALOG', + WORKFLOW_VIEW: 'WORKFLOW_VIEW', } as const; export const SCROLLABLE_PARENT_VIEWS_IDS = { VIRTUAL_SCROLL: 'virtual-scroll', ANNOTATIONS_LIST: 'annotations-list', SCM_EDIT_DIALOG: 'scm-edit', + WORKFLOW_VIEW: 'workflow-view', } as const; export type ScrollableParentView = keyof typeof ScrollableParentViews;