Merge branch 'master' into VM/RED-6801

This commit is contained in:
Valentin Mihai 2023-07-10 15:40:01 +03:00
commit 10dbc193b3
10 changed files with 28 additions and 6 deletions

View File

@ -5,7 +5,7 @@
</a>
</ng-container>
<a *ngIf="tenantsService.getStoredTenants().length > 1" [id]="'switch-accounts'" [matMenuTriggerFor]="tenantsMenu" mat-menu-item>
<a [id]="'switch-accounts'" [matMenuTriggerFor]="tenantsMenu" mat-menu-item>
{{ 'top-bar.navigation-items.my-account.children.select-tenant' | translate }}
</a>

View File

@ -1,5 +1,4 @@
import { Component } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
import { LicenseService } from '@services/license.service';
import { map } from 'rxjs/operators';
import type { ILicenseReport } from '@red/domain';
@ -22,7 +21,7 @@ export class LicenseUsageComponent {
})),
);
constructor(readonly licenseService: LicenseService, private readonly _translateService: TranslateService) {}
constructor(readonly licenseService: LicenseService) {}
getAnalysisPercentageOfLicense() {
const totalLicensedNumberOfPages = this.licenseService.totalLicensedNumberOfPages;

View File

@ -52,6 +52,7 @@
*ngFor="let dictionary of dictionaries"
[matTooltip]="dictionary.description"
[value]="dictionary.type"
(click)="typeChanged()"
matTooltipPosition="after"
>
<span> {{ dictionary.label }} </span>

View File

@ -141,6 +141,14 @@ export class RedactTextDialogComponent
}
}
typeChanged() {
if (!this.#applyToAllDossiers) {
const selectedDictionaryType = this.form.get('dictionary').value;
const selectedDictionary = this.dictionaries.find(d => d.type === selectedDictionaryType);
this.options[1].extraOption.disabled = selectedDictionary.dossierDictionaryOnly;
}
}
save(): void {
this.#enhanceManualRedaction(this.data.manualRedactionEntryWrapper.manualRedactionEntry);
const redaction = this.data.manualRedactionEntryWrapper.manualRedactionEntry;

View File

@ -1,10 +1,11 @@
import { inject, Injectable } from '@angular/core';
import { GenericService } from '@iqser/common-ui';
import { GenericService, Toaster } from '@iqser/common-ui';
import { ILicense, ILicenseReport, ILicenseReportRequest, ILicenses } from '@red/domain';
import { BehaviorSubject, firstValueFrom, Observable, of } from 'rxjs';
import { catchError, filter, tap } from 'rxjs/operators';
import dayjs from 'dayjs';
import { NGXLogger } from 'ngx-logger';
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
const defaultOnError: ILicenses = {
activeLicense: 'err',
@ -42,6 +43,7 @@ export class LicenseService extends GenericService<ILicenseReport> {
readonly #licenseData$ = new BehaviorSubject<ILicenses | undefined>(undefined);
readonly #selectedLicense$ = new BehaviorSubject<ILicense | undefined>(undefined);
readonly #logger = inject(NGXLogger);
readonly #toaster = inject(Toaster);
protected readonly _defaultModelPath = 'report';
readonly licenseData$: Observable<ILicenses>;
readonly selectedLicense$: Observable<ILicense>;
@ -60,6 +62,10 @@ export class LicenseService extends GenericService<ILicenseReport> {
filter(licenses => !!licenses),
tap(data => (this.activeLicenseId = data.activeLicense)),
tap(() => {
const activeLicense = this.activeLicense;
if (!activeLicense) {
return;
}
const uploadedBytesCapacity = this.activeLicense.features.find(f => f.name === 'uploadedBytesCapacity')?.value;
this.uploadedBytesCapacity = uploadedBytesCapacity ? parseInt(uploadedBytesCapacity, 10) : 0;
}),
@ -82,7 +88,6 @@ export class LicenseService extends GenericService<ILicenseReport> {
get activeLicenseKey(): string {
const activeLicense = this.activeLicense;
if (!activeLicense) {
this.#logger.error('[LICENSE] No active license found!');
return '';
}
@ -136,6 +141,11 @@ export class LicenseService extends GenericService<ILicenseReport> {
const licenses = await firstValueFrom(licenses$);
this.#licenseData$.next(licenses);
this.setDefaultSelectedLicense();
const activeLicense = this.activeLicense;
if (!activeLicense) {
this.#logger.error('[LICENSE] No active license found!');
this.#toaster.warning(_('no-active-license'));
}
}
setSelectedLicense($event: ILicense) {

View File

@ -1722,6 +1722,7 @@
}
},
"minutes": "",
"no-active-license": "",
"notification": {
"assign-approver": "Sie wurden dem Dokument <b>{fileHref, select, null{{fileName}} other{<a href=\"{fileHref}\" target=\"_blank\">{fileName}</a>}}</b> im Dossier <b>{dossierHref, select, null{{dossierName}} other{<a href=\"{dossierHref}\" target=\"_blank\">{dossierName}</a>}}<b> als Genehmiger zugewiesen!",
"assign-reviewer": "Sie wurden dem Dokument <b>{fileHref, select, null{{fileName}} other{<a href=\"{fileHref}\" target=\"_blank\">{fileName}</a>}}</b> im Dossier <b>{dossierHref, select, null{{dossierName}} other{<a href=\"{dossierHref}\" target=\"_blank\">{dossierName}</a>}}<b> als Reviewer zugewiesen!",

View File

@ -1722,6 +1722,7 @@
}
},
"minutes": "minutes",
"no-active-license": "Invalid or corrupt license Please contact your administrator",
"notification": {
"assign-approver": "You have been assigned as approver for <b>{fileHref, select, null{{fileName}} other{<a href=\"{fileHref}\" target=\"_blank\">{fileName}</a>}}</b> in dossier: <b>{dossierHref, select, null{{dossierName}} other{<a href=\"{dossierHref}\" target=\"_blank\">{dossierName}</a>}}</b>!",
"assign-reviewer": "You have been assigned as reviewer for <b>{fileHref, select, null{{fileName}} other{<a href=\"{fileHref}\" target=\"_blank\">{fileName}</a>}}</b> in dossier: <b>{dossierHref, select, null{{dossierName}} other{<a href=\"{dossierHref}\" target=\"_blank\">{dossierName}</a>}}</b>!",

View File

@ -1722,6 +1722,7 @@
}
},
"minutes": "",
"no-active-license": "",
"notification": {
"assign-approver": "Sie wurden dem Dokument <b>{fileHref, select, null{{fileName}} other{<a href=\"{fileHref}\" target=\"_blank\">{fileName}</a>}}</b> im Dossier <b>{dossierHref, select, null{{dossierName}} other{<a href=\"{dossierHref}\" target=\"_blank\">{dossierName}</a>}}<b> als Genehmiger zugewiesen!",
"assign-reviewer": "Sie wurden dem Dokument <b>{fileHref, select, null{{fileName}} other{<a href=\"{fileHref}\" target=\"_blank\">{fileName}</a>}}</b> im Dossier <b>{dossierHref, select, null{{dossierName}} other{<a href=\"{dossierHref}\" target=\"_blank\">{dossierName}</a>}}<b> als Reviewer zugewiesen!",

View File

@ -1722,6 +1722,7 @@
}
},
"minutes": "minutes",
"no-active-license": "Invalid or corrupt license Please contact your administrator",
"notification": {
"assign-approver": "You have been assigned as approver for <b>{fileHref, select, null{{fileName}} other{<a href=\"{fileHref}\" target=\"_blank\">{fileName}</a>}}</b> in dossier: <b>{dossierHref, select, null{{dossierName}} other{<a href=\"{dossierHref}\" target=\"_blank\">{dossierName}</a>}}</b>!",
"assign-reviewer": "You have been assigned as reviewer for <b>{fileHref, select, null{{fileName}} other{<a href=\"{fileHref}\" target=\"_blank\">{fileName}</a>}}</b> in dossier: <b>{dossierHref, select, null{{dossierName}} other{<a href=\"{dossierHref}\" target=\"_blank\">{dossierName}</a>}}</b>!",

@ -1 +1 @@
Subproject commit a4e425d3739d6145325a8fe347d9fcae1e12a662
Subproject commit a8f5fb2e25cd1f150c1099d387b4f9dece3b922c