RED-3800: License UI fixes

This commit is contained in:
Adina Țeudan 2023-10-11 11:46:26 +03:00
parent bb882178f2
commit b1736bae53
5 changed files with 18 additions and 11 deletions

View File

@ -16,7 +16,7 @@
<div class="space-between flex-align-items-center">
<span>{{ license.name }}</span>
<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>
</div>
</div>

View File

@ -1,15 +1,17 @@
.green {
background: var(--iqser-green-2);
}
.space-between {
justify-content: space-between;
}
.dot {
position: relative;
background-color: var(--iqser-red-1);
&.active {
background: var(--iqser-green-2);
}
}
.small-label {
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 { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
import { map, tap } from 'rxjs/operators';
import { IqserPermissionsService } from '@iqser/common-ui';
import { LoadingService } from '@iqser/common-ui';
const translations = {
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;
}
async licenseChanged(license: ILicense) {
this._loadingService.start();
await this.licenseService.loadLicenseData(license);
this.licenseService.setSelectedLicense(license);
this._loadingService.stop();
}
}

View File

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

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