From b1736bae53238dff7b6866b351a671fac5046fe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adina=20=C8=9Aeudan?= Date: Wed, 11 Oct 2023 11:46:26 +0300 Subject: [PATCH] RED-3800: License UI fixes --- .../license-select/license-select.component.html | 2 +- .../license-select/license-select.component.scss | 10 ++++++---- .../license-select/license-select.component.ts | 11 ++++++++--- apps/red-ui/src/app/services/license.service.ts | 4 ++-- libs/common-ui | 2 +- 5 files changed, 18 insertions(+), 11 deletions(-) diff --git a/apps/red-ui/src/app/modules/admin/screens/license/components/license-select/license-select.component.html b/apps/red-ui/src/app/modules/admin/screens/license/components/license-select/license-select.component.html index 54246338d..338b9d930 100644 --- a/apps/red-ui/src/app/modules/admin/screens/license/components/license-select/license-select.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/license/components/license-select/license-select.component.html @@ -16,7 +16,7 @@
{{ license.name }}
-
+
{{ getStatus(license.id) | translate | uppercase }}
diff --git a/apps/red-ui/src/app/modules/admin/screens/license/components/license-select/license-select.component.scss b/apps/red-ui/src/app/modules/admin/screens/license/components/license-select/license-select.component.scss index 5d71f0eab..02442aecf 100644 --- a/apps/red-ui/src/app/modules/admin/screens/license/components/license-select/license-select.component.scss +++ b/apps/red-ui/src/app/modules/admin/screens/license/components/license-select/license-select.component.scss @@ -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); } diff --git a/apps/red-ui/src/app/modules/admin/screens/license/components/license-select/license-select.component.ts b/apps/red-ui/src/app/modules/admin/screens/license/components/license-select/license-select.component.ts index 30f1a4cb6..609c9f95a 100644 --- a/apps/red-ui/src/app/modules/admin/screens/license/components/license-select/license-select.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/license/components/license-select/license-select.component.ts @@ -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(); } } diff --git a/apps/red-ui/src/app/services/license.service.ts b/apps/red-ui/src/app/services/license.service.ts index 270f5724f..53bcd83d9 100644 --- a/apps/red-ui/src/app/services/license.service.ts +++ b/apps/red-ui/src/app/services/license.service.ts @@ -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, diff --git a/libs/common-ui b/libs/common-ui index bd532cd28..df01d0a91 160000 --- a/libs/common-ui +++ b/libs/common-ui @@ -1 +1 @@ -Subproject commit bd532cd28fe9b7fb57c3e92253df490f6efae6a1 +Subproject commit df01d0a910fe443a11904b74055495ebc5ffc647