RED-10509: disabled stopPropagation when editing file attribute.
This commit is contained in:
parent
820dab3bfb
commit
780976243a
@ -1,6 +1,6 @@
|
||||
<iqser-page-header
|
||||
(closeAction)="router.navigate([dossier().dossiersListRouterLink])"
|
||||
[actionConfigs]="actionConfigs"
|
||||
[actionConfigs]="actionConfigs()"
|
||||
[helpModeKey]="'document'"
|
||||
[showCloseButton]="true"
|
||||
[viewModeSelection]="viewModeSelection"
|
||||
@ -12,6 +12,7 @@
|
||||
[disabled]="downloadFilesDisabled$ | async"
|
||||
[dossier]="dossier()"
|
||||
[files]="entitiesService.all$ | async"
|
||||
[iqserDisableStopPropagation]="shouldDisableStopPropagation()"
|
||||
dossierDownload
|
||||
></redaction-file-download-btn>
|
||||
|
||||
@ -21,6 +22,7 @@
|
||||
[attr.help-mode-key]="'download_csv'"
|
||||
[disabled]="listingService.areSomeSelected$ | async"
|
||||
[icon]="'iqser:csv'"
|
||||
[iqserDisableStopPropagation]="shouldDisableStopPropagation()"
|
||||
[tooltip]="'dossier-overview.header-actions.download-csv' | translate"
|
||||
></iqser-circle-button>
|
||||
|
||||
@ -29,6 +31,7 @@
|
||||
*ngIf="permissionsService.displayReanalyseBtn(dossier())"
|
||||
[disabled]="(listingService.areSomeSelected$ | async) || areRulesLocked()"
|
||||
[icon]="'iqser:refresh'"
|
||||
[iqserDisableStopPropagation]="shouldDisableStopPropagation()"
|
||||
[tooltipClass]="'small warn'"
|
||||
[tooltip]="
|
||||
(areRulesLocked() ? 'dossier-listing.rules.timeoutError' : 'dossier-overview.new-rule.toast.actions.reanalyse-all')
|
||||
@ -43,6 +46,7 @@
|
||||
[attr.help-mode-key]="'upload_document'"
|
||||
[buttonId]="'upload-document-btn'"
|
||||
[icon]="'iqser:upload'"
|
||||
[iqserDisableStopPropagation]="shouldDisableStopPropagation()"
|
||||
[tooltip]="'dossier-overview.header-actions.upload-document' | translate"
|
||||
[type]="circleButtonTypes.primary"
|
||||
class="ml-14"
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
import { ChangeDetectionStrategy, Component, computed, EventEmitter, input, OnInit, Output } from '@angular/core';
|
||||
import { ChangeDetectionStrategy, Component, computed, EventEmitter, input, Output } from '@angular/core';
|
||||
import {
|
||||
ActionConfig,
|
||||
CircleButtonComponent,
|
||||
CircleButtonTypes,
|
||||
DisableStopPropagationDirective,
|
||||
@ -23,12 +22,14 @@ import { PrimaryFileAttributeService } from '@services/primary-file-attribute.se
|
||||
import { Router } from '@angular/router';
|
||||
import { Roles } from '@users/roles';
|
||||
import { SortingService } from '@iqser/common-ui/lib/sorting';
|
||||
import { List, some } from '@iqser/common-ui/lib/utils';
|
||||
import { some } from '@iqser/common-ui/lib/utils';
|
||||
import { AsyncPipe, NgIf } from '@angular/common';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { FileDownloadBtnComponent } from '@shared/components/buttons/file-download-btn/file-download-btn.component';
|
||||
import { ViewModeSelectionComponent } from '../view-mode-selection/view-mode-selection.component';
|
||||
import { RulesService } from '../../../admin/services/rules.service';
|
||||
import { toSignal } from '@angular/core/rxjs-interop';
|
||||
import { FileAttributesService } from '@services/entity-services/file-attributes.service';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-dossier-overview-screen-header [dossier] [upload]',
|
||||
@ -46,18 +47,20 @@ import { RulesService } from '../../../admin/services/rules.service';
|
||||
],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class DossierOverviewScreenHeaderComponent implements OnInit {
|
||||
export class DossierOverviewScreenHeaderComponent {
|
||||
readonly dossier = input<Dossier>();
|
||||
@Output() readonly upload = new EventEmitter<void>();
|
||||
readonly circleButtonTypes = CircleButtonTypes;
|
||||
readonly roles = Roles;
|
||||
actionConfigs: List<ActionConfig>;
|
||||
readonly downloadFilesDisabled$: Observable<boolean>;
|
||||
readonly downloadComponentLogsDisabled$: Observable<boolean>;
|
||||
readonly isDocumine = getConfig().IS_DOCUMINE;
|
||||
readonly areSomeSelected = toSignal(this.listingService.areSomeSelected$);
|
||||
readonly actionConfigs = computed(() => this.configService.actionConfig(this.dossier().id, this.areSomeSelected()));
|
||||
readonly areRulesLocked = computed(() => {
|
||||
return this._rulesService.currentTemplateRules().timeoutDetected;
|
||||
});
|
||||
readonly shouldDisableStopPropagation = computed(() => this._fileAttributesService.isEditingFileAttribute());
|
||||
|
||||
constructor(
|
||||
private readonly _toaster: Toaster,
|
||||
@ -72,6 +75,7 @@ export class DossierOverviewScreenHeaderComponent implements OnInit {
|
||||
private readonly _loadingService: LoadingService,
|
||||
private readonly _primaryFileAttributeService: PrimaryFileAttributeService,
|
||||
private readonly _rulesService: RulesService,
|
||||
private readonly _fileAttributesService: FileAttributesService,
|
||||
) {
|
||||
const someNotProcessed$ = this.entitiesService.all$.pipe(some(file => !file.lastProcessed));
|
||||
this.downloadFilesDisabled$ = combineLatest([this.listingService.areSomeSelected$, someNotProcessed$]).pipe(
|
||||
@ -82,10 +86,6 @@ export class DossierOverviewScreenHeaderComponent implements OnInit {
|
||||
);
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.actionConfigs = this.configService.actionConfig(this.dossier().id, this.listingService.areSomeSelected$);
|
||||
}
|
||||
|
||||
async reanalyseDossier() {
|
||||
this._loadingService.start();
|
||||
const rules = await firstValueFrom(this._rulesService.getFor(this.dossier().dossierTemplateId));
|
||||
|
||||
@ -47,6 +47,7 @@ import { annotationFilterChecker, RedactionFilterSorter, sortArray, sortByName }
|
||||
import { EditDossierDialogComponent } from '../shared-dossiers/dialogs/edit-dossier-dialog/edit-dossier-dialog.component';
|
||||
import { DossiersDialogService } from '../shared-dossiers/services/dossiers-dialog.service';
|
||||
import { BulkActionsService } from './services/bulk-actions.service';
|
||||
import { FileAttributesService } from '@services/entity-services/file-attributes.service';
|
||||
|
||||
@Injectable()
|
||||
export class ConfigService {
|
||||
@ -68,6 +69,7 @@ export class ConfigService {
|
||||
private readonly _userPreferenceService: UserPreferenceService,
|
||||
private readonly _dossiersService: DossiersService,
|
||||
private readonly _iqserPermissionsService: IqserPermissionsService,
|
||||
private readonly _fileAttributesService: FileAttributesService,
|
||||
) {
|
||||
const previousListingMode = this._userPreferenceService.getFilesListingMode();
|
||||
const listingMode = previousListingMode ? previousListingMode : ListingModes.table;
|
||||
@ -113,7 +115,7 @@ export class ConfigService {
|
||||
};
|
||||
}
|
||||
|
||||
actionConfig(dossierId: string, disabled$: Observable<boolean>): List<ActionConfig> {
|
||||
actionConfig(dossierId: string, disabled: boolean): List<ActionConfig> {
|
||||
return [
|
||||
{
|
||||
id: 'editDossier',
|
||||
@ -122,7 +124,8 @@ export class ConfigService {
|
||||
icon: 'iqser:edit',
|
||||
hide: !this.#currentUser.isManager && !this._iqserPermissionsService.has(Roles.dossiers.edit),
|
||||
helpModeKey: 'edit_dossier',
|
||||
disabled$,
|
||||
disableStopPropagation: this._fileAttributesService.isEditingFileAttribute(),
|
||||
disabled,
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
@ -1 +1 @@
|
||||
Subproject commit 7c6f9fc25e499a7b58bc38a5a59f704c8eac758b
|
||||
Subproject commit ae0eebcc6feceba4fe5c930d79eadd9b9a60b7e9
|
||||
Loading…
x
Reference in New Issue
Block a user