RED-10363: fixed cosmetical issue, added tooltips to and disabled btns.

This commit is contained in:
Nicoleta Panaghiu 2024-11-14 11:04:10 +02:00
parent 1d61d07305
commit ab2af31f28
5 changed files with 17 additions and 12 deletions

View File

@ -258,6 +258,7 @@ export const appModuleFactory = (config: AppConfig) => {
provide: MAT_TOOLTIP_DEFAULT_OPTIONS,
useValue: {
disableTooltipInteractivity: true,
showDelay: 1,
},
},
BaseDatePipe,

View File

@ -1,4 +1,4 @@
import { Component, Input, OnChanges } from '@angular/core';
import { Component, computed, Input, OnChanges } from '@angular/core';
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
import { CircleButtonType, CircleButtonTypes } from '@iqser/common-ui';
import { Action, ActionTypes, Dossier, File, ProcessingFileStatuses } from '@red/domain';
@ -9,6 +9,7 @@ import { BulkActionsService } from '../../services/bulk-actions.service';
import { ExpandableFileActionsComponent } from '@shared/components/expandable-file-actions/expandable-file-actions.component';
import { IqserTooltipPositions } from '@common-ui/utils';
import { NgIf } from '@angular/common';
import { RulesService } from '../../../admin/services/rules.service';
@Component({
selector: 'redaction-dossier-overview-bulk-actions [dossier] [selectedFiles]',
@ -43,11 +44,13 @@ export class DossierOverviewBulkActionsComponent implements OnChanges {
@Input() maxWidth: number;
buttons: Action[];
readonly IqserTooltipPositions = IqserTooltipPositions;
readonly areRulesLocked = computed(() => this._rulesService.currentTemplateRules().timeoutDetected);
constructor(
private readonly _permissionsService: PermissionsService,
private readonly _userPreferenceService: UserPreferenceService,
private readonly _bulkActionsService: BulkActionsService,
private readonly _rulesService: RulesService,
) {}
private get _buttons(): Action[] {
@ -136,8 +139,9 @@ export class DossierOverviewBulkActionsComponent implements OnChanges {
id: 'reanalyse-files-btn',
type: ActionTypes.circleBtn,
action: () => this._bulkActionsService.reanalyse(this.selectedFiles),
tooltip: _('dossier-overview.bulk.reanalyse'),
tooltip: this.areRulesLocked() ? _('dossier-listing.rules.timeoutError') : _('dossier-overview.bulk.reanalyse'),
icon: 'iqser:refresh',
disabled: this.areRulesLocked(),
show:
this.#canReanalyse &&
(this.#analysisForced || this.#canEnableAutoAnalysis || this.selectedFiles.every(file => file.isError)),

View File

@ -19,7 +19,6 @@ import {
getConfig,
HelpModeService,
IqserAllowDirective,
IqserDialog,
IqserPermissionsService,
isIqserDevMode,
LoadingService,

View File

@ -34,12 +34,14 @@ export class PagesComponent implements AfterViewInit {
// TODO: looks like this is not working
scrollToLastViewedPage() {
const currentPdfPage = this._pdf.currentPage();
scrollIntoView(document.getElementById(`quick-nav-page-${currentPdfPage}`), {
behavior: 'smooth',
scrollMode: 'if-needed',
block: 'start',
inline: 'start',
});
const currentElement = document.getElementById(`quick-nav-page-${currentPdfPage}`);
if (currentElement)
scrollIntoView(currentElement, {
behavior: 'smooth',
scrollMode: 'if-needed',
block: 'start',
inline: 'start',
});
}
pageSelectedByClick($event: number): void {

View File

@ -252,11 +252,10 @@ export class FileActionsComponent implements OnChanges {
id: 'btn-reanalyse_file_preview',
type: ActionTypes.circleBtn,
action: () => this.#reanalyseFile(),
tooltip: _('file-preview.reanalyse-notification'),
tooltipClass: 'small',
tooltip: this.areRulesLocked() ? _('dossier-listing.rules.timeoutError') : _('file-preview.reanalyse-notification'),
icon: 'iqser:refresh',
show: this.showReanalyseFilePreview,
disabled: this.file.isProcessing,
disabled: this.file.isProcessing || this.areRulesLocked(),
helpModeKey: 'stop_analysis',
},
{