Merge branch 'RED-3800' into 'master'

RED-3800: License UI fixes

See merge request redactmanager/red-ui!136
This commit is contained in:
Dan Percic 2023-10-11 11:21:34 +02:00
commit bac940d4b9
5 changed files with 18 additions and 11 deletions

View File

@ -16,7 +16,7 @@
<div class="space-between flex-align-items-center"> <div class="space-between flex-align-items-center">
<span>{{ license.name }}</span> <span>{{ license.name }}</span>
<div class="mr-10 flex-align-items-center"> <div class="mr-10 flex-align-items-center">
<div [class.green]="license.id === licenseService.activeLicense.id" class="dot mr-4"></div> <div [class.active]="license.id === licenseService.activeLicense.id" class="dot mr-4"></div>
<span class="small-label">{{ getStatus(license.id) | translate | uppercase }}</span> <span class="small-label">{{ getStatus(license.id) | translate | uppercase }}</span>
</div> </div>
</div> </div>

View File

@ -1,15 +1,17 @@
.green {
background: var(--iqser-green-2);
}
.space-between { .space-between {
justify-content: space-between; justify-content: space-between;
} }
.dot { .dot {
position: relative; position: relative;
background-color: var(--iqser-red-1);
&.active {
background: var(--iqser-green-2);
}
} }
.small-label { .small-label {
font-weight: 600; font-weight: 600;
color: var(--iqser-text);
} }

View File

@ -3,7 +3,7 @@ import { LicenseService } from '@services/license.service';
import { ILicense } from '@red/domain'; import { ILicense } from '@red/domain';
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
import { map, tap } from 'rxjs/operators'; import { map, tap } from 'rxjs/operators';
import { IqserPermissionsService } from '@iqser/common-ui'; import { LoadingService } from '@iqser/common-ui';
const translations = { const translations = {
active: _('license-info-screen.status.active'), active: _('license-info-screen.status.active'),
@ -26,14 +26,19 @@ export class LicenseSelectComponent {
}), }),
); );
constructor(readonly licenseService: LicenseService, private readonly _permissionsService: IqserPermissionsService) {} constructor(
readonly licenseService: LicenseService,
private readonly _loadingService: LoadingService,
) {}
getStatus(id) { getStatus(id: string): string {
return id === this.licenseService.activeLicense.id ? translations.active : translations.inactive; return id === this.licenseService.activeLicense.id ? translations.active : translations.inactive;
} }
async licenseChanged(license: ILicense) { async licenseChanged(license: ILicense) {
this._loadingService.start();
await this.licenseService.loadLicenseData(license); await this.licenseService.loadLicenseData(license);
this.licenseService.setSelectedLicense(license); this.licenseService.setSelectedLicense(license);
this._loadingService.stop();
} }
} }

View File

@ -17,8 +17,8 @@ const defaultOnError: ILicenses = {
product: 'Error', product: 'Error',
licensedTo: 'Error', licensedTo: 'Error',
licensedToEmail: 'Error', licensedToEmail: 'Error',
validFrom: '01-01-2023', validFrom: '2023-01-01T00:00:00Z',
validUntil: '01-01-2024', validUntil: '2023-12-31T00:00:00Z',
features: [ features: [
{ {
name: LicenseFeatures.PROCESSING_PAGES, name: LicenseFeatures.PROCESSING_PAGES,

@ -1 +1 @@
Subproject commit bd532cd28fe9b7fb57c3e92253df490f6efae6a1 Subproject commit df01d0a910fe443a11904b74055495ebc5ffc647