Merge branch 'RED-7858' into 'master'
RED-7858: Remove Email Report button in License Information screen Closes RED-7858 See merge request redactmanager/red-ui!173
This commit is contained in:
commit
423059f11a
@ -1,6 +1,5 @@
|
|||||||
<iqser-page-header
|
<iqser-page-header
|
||||||
(closeAction)="routerHistoryService.navigateToLastDossiersScreen()"
|
(closeAction)="routerHistoryService.navigateToLastDossiersScreen()"
|
||||||
[buttonConfigs]="buttonConfigs"
|
|
||||||
[pageLabel]="'license-information' | translate"
|
[pageLabel]="'license-information' | translate"
|
||||||
[showCloseButton]="currentUser.isUser && permissionsService.has$(roles.dossiers.read) | async"
|
[showCloseButton]="currentUser.isUser && permissionsService.has$(roles.dossiers.read) | async"
|
||||||
></iqser-page-header>
|
></iqser-page-header>
|
||||||
|
|||||||
@ -1,9 +1,6 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
import { getConfig, IqserPermissionsService } from '@iqser/common-ui';
|
||||||
import { List } from '@common-ui/utils';
|
|
||||||
import { ButtonConfig, getConfig, IconButtonTypes, IqserPermissionsService } from '@iqser/common-ui';
|
|
||||||
import { getCurrentUser } from '@iqser/common-ui/lib/users';
|
import { getCurrentUser } from '@iqser/common-ui/lib/users';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
|
||||||
import type { AppConfig, User } from '@red/domain';
|
import type { AppConfig, User } from '@red/domain';
|
||||||
import { LicenseService } from '@services/license.service';
|
import { LicenseService } from '@services/license.service';
|
||||||
import { RouterHistoryService } from '@services/router-history.service';
|
import { RouterHistoryService } from '@services/router-history.service';
|
||||||
@ -18,38 +15,10 @@ export class LicenseScreenComponent {
|
|||||||
protected readonly roles = Roles;
|
protected readonly roles = Roles;
|
||||||
protected readonly currentUser = getCurrentUser<User>();
|
protected readonly currentUser = getCurrentUser<User>();
|
||||||
protected readonly currentYear = new Date().getFullYear();
|
protected readonly currentYear = new Date().getFullYear();
|
||||||
protected readonly buttonConfigs: List<ButtonConfig> = [
|
|
||||||
{
|
|
||||||
label: _('license-info-screen.email-report'),
|
|
||||||
action: (): void => this.sendMail(),
|
|
||||||
type: IconButtonTypes.primary,
|
|
||||||
helpModeKey: 'license_information',
|
|
||||||
hide: !this.permissionsService.has(Roles.license.readReport),
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
readonly licenseService: LicenseService,
|
readonly licenseService: LicenseService,
|
||||||
readonly permissionsService: IqserPermissionsService,
|
readonly permissionsService: IqserPermissionsService,
|
||||||
readonly routerHistoryService: RouterHistoryService,
|
readonly routerHistoryService: RouterHistoryService,
|
||||||
private readonly _translateService: TranslateService,
|
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
sendMail(): void {
|
|
||||||
const licenseCustomer = this.licenseService.selectedLicense.licensedTo;
|
|
||||||
const subject = this._translateService.instant('license-info-screen.email.title', {
|
|
||||||
licenseCustomer,
|
|
||||||
}) as string;
|
|
||||||
const lineBreak = '%0D%0A';
|
|
||||||
const body = [
|
|
||||||
this._translateService.instant('license-info-screen.email.body.analyzed', {
|
|
||||||
pages: this.licenseService.selectedLicenseReport.numberOfAnalyzedPages,
|
|
||||||
}),
|
|
||||||
this._translateService.instant('license-info-screen.email.body.licensed', {
|
|
||||||
pages: this.licenseService.totalLicensedNumberOfPages,
|
|
||||||
}),
|
|
||||||
].join(lineBreak);
|
|
||||||
const mail = this.licenseService.selectedLicense.licensedToEmail;
|
|
||||||
window.location.href = `mailto:${mail}?subject=${subject}&body=${body}`;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user