Merge branch 'dan' into 'master'
DM-604 bug fix for release See merge request redactmanager/red-ui!209
This commit is contained in:
commit
a53d139687
@ -228,7 +228,13 @@ const routes: IqserRoutes = [
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forRoot(routes, { scrollPositionRestoration: 'enabled', bindToComponentInputs: true })],
|
||||
imports: [
|
||||
RouterModule.forRoot(routes, {
|
||||
scrollPositionRestoration: 'enabled',
|
||||
bindToComponentInputs: true,
|
||||
paramsInheritanceStrategy: 'always',
|
||||
}),
|
||||
],
|
||||
providers: [{ provide: RouteReuseStrategy, useExisting: CustomRouteReuseStrategy }],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { CanActivate } from '@angular/router';
|
||||
import { firstValueFrom } from 'rxjs';
|
||||
import { DashboardStatsService } from '@services/dossier-templates/dashboard-stats.service';
|
||||
import { firstValueFrom } from 'rxjs';
|
||||
|
||||
// TODO: Remove this and use a CanActivateFn instead
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class DashboardGuard implements CanActivate {
|
||||
constructor(private readonly _dashboardStatsService: DashboardStatsService) {}
|
||||
|
||||
@ -1,16 +1,19 @@
|
||||
import { Injectable, Injector, ProviderToken } from '@angular/core';
|
||||
import { ActivatedRouteSnapshot, CanActivate, Router } from '@angular/router';
|
||||
import { FilesMapService } from '@services/files/files-map.service';
|
||||
import { FilesService } from '@services/files/files.service';
|
||||
import { firstValueFrom } from 'rxjs';
|
||||
import { getConfig } from '@iqser/common-ui';
|
||||
import { TenantsService } from '@iqser/common-ui/lib/tenants';
|
||||
import { DOSSIER_ID, DOSSIER_TEMPLATE_ID } from '@red/domain';
|
||||
import { DossiersService } from '@services/dossiers/dossiers.service';
|
||||
import { DictionaryService } from '@services/entity-services/dictionary.service';
|
||||
import { DossierDictionariesMapService } from '@services/entity-services/dossier-dictionaries-map.service';
|
||||
import { TenantsService } from '@iqser/common-ui/lib/tenants';
|
||||
import { FilesMapService } from '@services/files/files-map.service';
|
||||
import { FilesService } from '@services/files/files.service';
|
||||
import { firstValueFrom } from 'rxjs';
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class DossierFilesGuard implements CanActivate {
|
||||
readonly isDocumine = getConfig().IS_DOCUMINE;
|
||||
|
||||
constructor(
|
||||
private readonly _injector: Injector,
|
||||
private readonly _tenantsService: TenantsService,
|
||||
@ -45,8 +48,8 @@ export class DossierFilesGuard implements CanActivate {
|
||||
async loadDossierData(dossierId: string, dossierTemplateId: string) {
|
||||
const promises = [];
|
||||
|
||||
if (!this._dictionaryMapService.has(dossierId)) {
|
||||
const dictionaryPromise = this._dictionaryService.loadDossierDictionary(dossierTemplateId, dossierId);
|
||||
if (!this._dictionaryMapService.has(dossierId) && !this.isDocumine) {
|
||||
const dictionaryPromise = this._dictionaryService.loadDossierRedaction(dossierTemplateId, dossierId);
|
||||
promises.push(dictionaryPromise);
|
||||
}
|
||||
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
import { CanDeactivateFn } from '@angular/router';
|
||||
import { inject } from '@angular/core';
|
||||
import { CanDeactivateFn } from '@angular/router';
|
||||
import { FileAttributesService } from '@services/entity-services/file-attributes.service';
|
||||
import { DossierOverviewScreenComponent } from '../modules/dossier-overview/screen/dossier-overview-screen.component';
|
||||
|
||||
// TODO: rename to something like "isNotEditingFileAttributeGuard"
|
||||
export const editAttributeGuard: CanDeactivateFn<DossierOverviewScreenComponent> = () =>
|
||||
!inject(FileAttributesService).isEditingFileAttribute();
|
||||
|
||||
@ -2,11 +2,12 @@
|
||||
<div class="dialog-content">
|
||||
<div *ngFor="let category of notificationCategories">
|
||||
<div class="iqser-input-group header w-full">
|
||||
<mat-slide-toggle color="primary" formControlName="{{ category }}Enabled">{{
|
||||
translations[category] | translate
|
||||
}}</mat-slide-toggle>
|
||||
<mat-slide-toggle color="primary" formControlName="{{ category }}Enabled"
|
||||
>{{ translations[category] | translate }}
|
||||
</mat-slide-toggle>
|
||||
</div>
|
||||
|
||||
<!-- TODO: This lots of getters-->
|
||||
<div *ngIf="isCategoryActive(category)" class="options-content">
|
||||
<div [translate]="'notifications-screen.options-title'" class="statement"></div>
|
||||
|
||||
@ -15,8 +16,8 @@
|
||||
<div class="iqser-input-group">
|
||||
<ng-container *ngFor="let preference of getRssFilteredSettings(notificationGroupsValues[i])">
|
||||
<mat-checkbox
|
||||
*ngIf="!skipPreference(preference)"
|
||||
(change)="addRemovePreference($event.checked, category, preference)"
|
||||
*ngIf="!skipPreference(preference)"
|
||||
[checked]="isPreferenceChecked(category, preference)"
|
||||
color="primary"
|
||||
>
|
||||
|
||||
@ -1,14 +1,15 @@
|
||||
import { ChangeDetectionStrategy, Component, Inject } from '@angular/core';
|
||||
import { BaseDialogComponent } from '@iqser/common-ui';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { IAudit } from '@red/domain';
|
||||
import { DossierStatesService } from '@services/entity-services/dossier-states.service';
|
||||
import { KeyValue } from '@angular/common';
|
||||
import { ChangeDetectionStrategy, Component, Inject } from '@angular/core';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { BaseDialogComponent } from '@iqser/common-ui';
|
||||
import { IAudit } from '@red/domain';
|
||||
|
||||
interface DialogData {
|
||||
readonly auditEntry: IAudit;
|
||||
}
|
||||
|
||||
type OrderFn = (a: KeyValue<string, string>, b: KeyValue<string, string>) => number;
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-audit-info-dialog',
|
||||
templateUrl: './audit-info-dialog.component.html',
|
||||
@ -17,14 +18,13 @@ interface DialogData {
|
||||
})
|
||||
export class AuditInfoDialogComponent extends BaseDialogComponent {
|
||||
constructor(
|
||||
private readonly _dossierStatesService: DossierStatesService,
|
||||
protected readonly _dialogRef: MatDialogRef<AuditInfoDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) readonly data: DialogData,
|
||||
) {
|
||||
super(_dialogRef, false);
|
||||
}
|
||||
|
||||
readonly originalOrder = (a: KeyValue<string, string>, b: KeyValue<string, string>): number => 0;
|
||||
readonly originalOrder: OrderFn = () => 0;
|
||||
|
||||
async save(): Promise<void> {
|
||||
return;
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
import { BaseFormComponent } from '@iqser/common-ui';
|
||||
import { DigitalSignatureService } from '../../../services/digital-signature.service';
|
||||
import { DigitalSignatureOption, DigitalSignatureOptions, IDigitalSignatureRequest } from '@red/domain';
|
||||
import { firstValueFrom, Observable } from 'rxjs';
|
||||
import { DigitalSignatureService } from '../../../services/digital-signature.service';
|
||||
|
||||
// TODO: This should be handled with services for each type of signature
|
||||
export abstract class BaseSignatureConfigurationComponent extends BaseFormComponent {
|
||||
file: File | null;
|
||||
|
||||
|
||||
@ -5,28 +5,29 @@
|
||||
[readonly]="!!file"
|
||||
accept=".p12"
|
||||
></iqser-upload-file>
|
||||
|
||||
<form [formGroup]="form">
|
||||
<div class="flex">
|
||||
<div class="flex fields-container">
|
||||
<div class="iqser-input-group required w-300">
|
||||
<label [translate]="'digital-signature-dialog.forms.pkcs.certificate-name'"></label>
|
||||
<input id="certificate-name-input" formControlName="certificateName" type="text" />
|
||||
<input formControlName="certificateName" id="certificate-name-input" type="text" />
|
||||
</div>
|
||||
<div *ngIf="!digitalSignature" class="iqser-input-group required w-300">
|
||||
<label [translate]="'digital-signature-dialog.forms.pkcs.password-key'"></label>
|
||||
<input id="certificate-password-input" formControlName="password" type="password" />
|
||||
<input formControlName="password" id="certificate-password-input" type="password" />
|
||||
</div>
|
||||
<div class="iqser-input-group w-300">
|
||||
<label [translate]="'digital-signature-dialog.forms.pkcs.contact-information'"></label>
|
||||
<input id="certificate-contact-info-input" formControlName="contactInfo" type="text" />
|
||||
<input formControlName="contactInfo" id="certificate-contact-info-input" type="text" />
|
||||
</div>
|
||||
<div class="iqser-input-group w-300">
|
||||
<label [translate]="'digital-signature-dialog.forms.pkcs.location'"></label>
|
||||
<input id="certificate-location-input" formControlName="location" type="text" />
|
||||
<input formControlName="location" id="certificate-location-input" type="text" />
|
||||
</div>
|
||||
<div class="iqser-input-group w-450">
|
||||
<label [translate]="'digital-signature-dialog.forms.pkcs.reason'"></label>
|
||||
<textarea id="certificate-location-input" formControlName="reason" rows="4" type="text"></textarea>
|
||||
<textarea formControlName="reason" id="certificate-reason-input" rows="4" type="text"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core';
|
||||
import { UntypedFormBuilder, Validators } from '@angular/forms';
|
||||
import { BaseSignatureConfigurationComponent } from '../base-signature-configuration-component';
|
||||
import { DigitalSignatureOptions, IPkcsDigitalSignature, IPkcsDigitalSignatureRequest } from '@red/domain';
|
||||
import { lastIndexOfEnd } from '@utils/functions';
|
||||
import { firstValueFrom } from 'rxjs';
|
||||
import { DigitalSignatureService } from '../../../../services/digital-signature.service';
|
||||
import { lastIndexOfEnd } from '../../../../../../utils';
|
||||
import { BaseSignatureConfigurationComponent } from '../base-signature-configuration-component';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-pkcs-signature-configuration',
|
||||
@ -15,7 +15,10 @@ import { lastIndexOfEnd } from '../../../../../../utils';
|
||||
export class PkcsSignatureConfigurationComponent extends BaseSignatureConfigurationComponent implements OnInit {
|
||||
@Input() digitalSignature!: IPkcsDigitalSignatureRequest;
|
||||
|
||||
constructor(protected readonly _digitalSignatureService: DigitalSignatureService, private readonly _formBuilder: UntypedFormBuilder) {
|
||||
constructor(
|
||||
protected readonly _digitalSignatureService: DigitalSignatureService,
|
||||
private readonly _formBuilder: UntypedFormBuilder,
|
||||
) {
|
||||
super(_digitalSignatureService, DigitalSignatureOptions.PKCS);
|
||||
}
|
||||
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import { Component, Inject } from '@angular/core';
|
||||
import { UntypedFormGroup, Validators } from '@angular/forms';
|
||||
import { Validators } from '@angular/forms';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { getCurrentUser } from '@users/user.service';
|
||||
import { ISmtpConfiguration } from '@red/domain';
|
||||
import { BaseDialogComponent } from '@iqser/common-ui';
|
||||
import { ISmtpConfiguration } from '@red/domain';
|
||||
import { getCurrentUser } from '@users/user.service';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-smtp-auth-dialog',
|
||||
@ -25,7 +25,7 @@ export class SmtpAuthDialogComponent extends BaseDialogComponent {
|
||||
this._dialogRef.close(this.form.getRawValue());
|
||||
}
|
||||
|
||||
private _getForm(): UntypedFormGroup {
|
||||
private _getForm() {
|
||||
return this._formBuilder.group({
|
||||
user: [this.data?.user || this.#currentUser.email, [Validators.required]],
|
||||
password: [this.data?.password, Validators.required],
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { MatDialogRef } from '@angular/material/dialog';
|
||||
import { IconButtonTypes } from '@iqser/common-ui';
|
||||
|
||||
@ -11,7 +10,7 @@ import { IconButtonTypes } from '@iqser/common-ui';
|
||||
export class UploadDictionaryDialogComponent {
|
||||
readonly iconButtonTypes = IconButtonTypes;
|
||||
|
||||
constructor(private readonly _translateService: TranslateService, public dialogRef: MatDialogRef<UploadDictionaryDialogComponent>) {}
|
||||
constructor(public dialogRef: MatDialogRef<UploadDictionaryDialogComponent>) {}
|
||||
|
||||
cancel() {
|
||||
this.dialogRef.close();
|
||||
|
||||
@ -96,6 +96,7 @@
|
||||
</div>
|
||||
</ng-template>
|
||||
|
||||
<!--TODO: use ngTemplateContextGuard for typings here-->
|
||||
<ng-template #tableItemTemplate let-entity="entity">
|
||||
<div *ngIf="cast(entity) as log">
|
||||
<div class="cell">
|
||||
|
||||
@ -14,8 +14,8 @@
|
||||
[helpModeKey]="'digital_signature'"
|
||||
[showButton]="permissionsService.has$(roles.digitalSignature.write) | async"
|
||||
[text]="'digital-signature-screen.no-data.title' | translate"
|
||||
icon="iqser:document"
|
||||
buttonId="configure-certificate-btn"
|
||||
icon="iqser:document"
|
||||
></iqser-empty-state>
|
||||
|
||||
<ng-container *ngIf="digitalSignature">
|
||||
@ -23,6 +23,7 @@
|
||||
*ngIf="currentCertificateType === certificateType.PKCS"
|
||||
[digitalSignature]="digitalSignature"
|
||||
></redaction-pkcs-signature-configuration>
|
||||
|
||||
<redaction-kms-signature-configuration
|
||||
*ngIf="currentCertificateType === certificateType.KMS"
|
||||
[digitalSignature]="digitalSignature"
|
||||
@ -31,19 +32,19 @@
|
||||
|
||||
<div [class.hidden]="!digitalSignature" class="changes-box">
|
||||
<iqser-icon-button
|
||||
buttonId="save-certificate-changes-btn"
|
||||
(action)="saveDigitalSignature()"
|
||||
[disabled]="disabled"
|
||||
[label]="'digital-signature-screen.action.save' | translate"
|
||||
[type]="iconButtonTypes.primary"
|
||||
buttonId="save-certificate-changes-btn"
|
||||
icon="iqser:check"
|
||||
></iqser-icon-button>
|
||||
|
||||
<div
|
||||
id="remove-certificate-btn"
|
||||
(click)="removeDigitalSignature()"
|
||||
*ngIf="digitalSignature"
|
||||
class="all-caps-label cancel"
|
||||
id="remove-certificate-btn"
|
||||
translate="digital-signature-screen.action.remove"
|
||||
></div>
|
||||
</div>
|
||||
|
||||
@ -52,12 +52,14 @@
|
||||
</div>
|
||||
|
||||
<redaction-watermark-selector
|
||||
*ngIf="!config.IS_DOCUMINE"
|
||||
[dossierTemplateId]="dossierTemplateId"
|
||||
[label]="'dossier-watermark-selector.watermark' | translate"
|
||||
formControlName="watermarkId"
|
||||
></redaction-watermark-selector>
|
||||
|
||||
<redaction-watermark-selector
|
||||
*ngIf="!config.IS_DOCUMINE"
|
||||
[dossierTemplateId]="dossierTemplateId"
|
||||
[label]="'dossier-watermark-selector.preview' | translate"
|
||||
formControlName="previewWatermarkId"
|
||||
@ -83,7 +85,7 @@
|
||||
<div class="flex">
|
||||
<redaction-select
|
||||
[height]="165"
|
||||
[label]="'report-type.label' | translate : { length: reportTemplateIdsLength }"
|
||||
[label]="'report-type.label' | translate: { length: reportTemplateIdsLength }"
|
||||
[optionTemplate]="reportTemplateOptionTemplate"
|
||||
[options]="availableReportTypes"
|
||||
[valueMapper]="reportTemplateValueMapper"
|
||||
@ -94,7 +96,7 @@
|
||||
<redaction-select
|
||||
*deny="roles.getRss"
|
||||
[height]="165"
|
||||
[label]="'download-type.label' | translate : { length: downloadFileTypesLength }"
|
||||
[label]="'download-type.label' | translate: { length: downloadFileTypesLength }"
|
||||
[options]="downloadTypes"
|
||||
formControlName="downloadFileTypes"
|
||||
></redaction-select>
|
||||
|
||||
@ -1,16 +1,16 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { firstValueFrom, forkJoin, Observable, throwError } from 'rxjs';
|
||||
import { EntitiesService, QueryParam, Toaster } from '@iqser/common-ui';
|
||||
import { Dictionary, DictionaryEntryType, DictionaryEntryTypes, IDictionary, IUpdateDictionary, SuperTypes } from '@red/domain';
|
||||
import { catchError, map, switchMap, tap } from 'rxjs/operators';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { DossierTemplateStatsService } from './dossier-template-stats.service';
|
||||
import { DictionariesMapService } from './dictionaries-map.service';
|
||||
import { HttpErrorResponse, HttpStatusCode } from '@angular/common/http';
|
||||
import { FALLBACK_COLOR } from '@utils/constants';
|
||||
import { DossierDictionariesMapService } from '@services/entity-services/dossier-dictionaries-map.service';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { EntitiesService, QueryParam, Toaster } from '@iqser/common-ui';
|
||||
import { List } from '@iqser/common-ui/lib/utils';
|
||||
import { Dictionary, DictionaryEntryType, DictionaryEntryTypes, IDictionary, IUpdateDictionary, SuperTypes } from '@red/domain';
|
||||
import { DossierDictionariesMapService } from '@services/entity-services/dossier-dictionaries-map.service';
|
||||
import { FALLBACK_COLOR } from '@utils/constants';
|
||||
import { firstValueFrom, forkJoin, Observable, throwError } from 'rxjs';
|
||||
import { catchError, map, switchMap, tap } from 'rxjs/operators';
|
||||
import { IMAGE_CATEGORIES } from '../../modules/file-preview/utils/constants';
|
||||
import { DictionariesMapService } from './dictionaries-map.service';
|
||||
import { DossierTemplateStatsService } from './dossier-template-stats.service';
|
||||
|
||||
const IMAGE_TYPES = ['image', 'formula', 'ocr'];
|
||||
|
||||
@ -216,7 +216,7 @@ export class DictionaryService extends EntitiesService<IDictionary, Dictionary>
|
||||
return possibleDictionaries;
|
||||
}
|
||||
|
||||
async loadDossierDictionary(dossierTemplateId: string, dossierId: string): Promise<Dictionary> {
|
||||
async loadDossierRedaction(dossierTemplateId: string, dossierId: string): Promise<Dictionary> {
|
||||
const promise = this.getForType(dossierTemplateId, 'dossier_redaction', dossierId);
|
||||
const dict = await promise.catch(() => undefined);
|
||||
if (dict) {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { INGXLoggerConfig, NgxLoggerLevel, NGXLoggerRulesService } from 'ngx-logger';
|
||||
import { ILoggerConfig } from '@red/domain';
|
||||
import { INGXLoggerConfig, NgxLoggerLevel, NGXLoggerRulesService } from 'ngx-logger';
|
||||
|
||||
@Injectable()
|
||||
export class LoggerRulesService extends NGXLoggerRulesService {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user