diff --git a/front/src/app/app.module.ts b/front/src/app/app.module.ts index 9e24ce1..463fb4a 100644 --- a/front/src/app/app.module.ts +++ b/front/src/app/app.module.ts @@ -42,7 +42,7 @@ import { UserService, } from 'common/service'; import { CommonModule } from '@angular/common'; -import { ErrorComponent, PopInComponent, SpinerComponent, TopMenuComponent, UploadFileComponent, PasswordEntryComponent, EntryComponent, AsyncActionStatusComponent, ErrorMessageStateComponent, CheckboxComponent, BurgerPropertyComponent } from 'common/component'; +import { ErrorComponent, PopInComponent, SpinerComponent, TopMenuComponent, UploadFileComponent, PasswordEntryComponent, EntryComponent, AsyncActionStatusComponent, ErrorMessageStateComponent, CheckboxComponent, BurgerPropertyComponent, EntryValidatorComponent, RenderSettingsComponent } from 'common/component'; import { ForbiddenScene } from 'common/scene'; import { AdminUserService, ApplicationService, ApplicationTokenService, SettingsService } from 'app/service'; import { PopInUploadProgress, PopInDeleteConfirm } from 'common/popin'; @@ -55,11 +55,13 @@ import { PopInUploadProgress, PopInDeleteConfirm } from 'common/popin'; ErrorComponent, PasswordEntryComponent, EntryComponent, + EntryValidatorComponent, SpinerComponent, AsyncActionStatusComponent, ErrorMessageStateComponent, CheckboxComponent, BurgerPropertyComponent, + RenderSettingsComponent, PopInComponent, PopInUploadProgress, diff --git a/front/src/app/scene/application-edit/application-edit.html b/front/src/app/scene/application-edit/application-edit.html index e103e79..edd1974 100644 --- a/front/src/app/scene/application-edit/application-edit.html +++ b/front/src/app/scene/application-edit/application-edit.html @@ -109,21 +109,40 @@ diff --git a/front/src/app/scene/application-edit/application-edit.ts b/front/src/app/scene/application-edit/application-edit.ts index 07dbbd2..52cc9d5 100644 --- a/front/src/app/scene/application-edit/application-edit.ts +++ b/front/src/app/scene/application-edit/application-edit.ts @@ -4,11 +4,12 @@ * @license PROPRIETARY (see license file) */ -import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnInit } from '@angular/core'; +import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { ApplicationService, ApplicationModel, ApplicationTokenService } from 'app/service'; import { ApplicationTokenModel } from 'app/service/application-token'; import { AsyncActionState } from 'common/component'; +import { CheckerParameter } from 'common/component/entry-validator/entry-validator'; import { NotificationService, PopInService } from 'common/service'; import { isNumeric } from 'common/utils'; @@ -185,6 +186,7 @@ export class ApplicationEditScene implements OnInit { .then((response: ApplicationTokenModel) => { console.log(`??? get fullllllll response: ${JSON.stringify(response, null, 4)}`); self.tokens.push(response); + response.token = `"${response.id}:${response.token}"` self.cdr.detectChanges(); }) .catch((error: any) => { @@ -225,15 +227,65 @@ export class ApplicationEditScene implements OnInit { this.confirmDeleteApplicationToken = undefined; } } + + createFrom = [ + { + title: "Name/Description token", + placeholder: "Enter the token name / decription", + value: "", + type: "INPUT", + checker: this.checkTokenName, + }, + { + title: "Validity time (in day)", + placeholder: "Enter the Time To Lead (in day)", + value: "", + checker: this.checkTokenName, + }, + + ]; + + tokenName: string = undefined; tokenTTL: number = undefined; - checkTokenName(newValue: string) { + tokenCreateErrorCount: number = 2; + + newTokenName(newValue: string) { this.tokenName = newValue; } - checkTokenTTL(newValue: string) { + checkTokenName(chekParam: CheckerParameter): void { + if (chekParam.value.length < 3) { + chekParam.result("Must have 3 chars"); + return; + } + chekParam.result(true); + } + + newTokenTTL(newValue: string) { if (isNumeric(newValue)) { this.tokenTTL = Number(newValue); } } + + checkTokenTTL(chekParam: CheckerParameter): void { + if (!isNumeric(chekParam.value)) { + chekParam.result("Must be a number"); + return; + } + if (chekParam.value.length<1) { + chekParam.result("Minimum one day"); + return; + } + let value = Number(chekParam.value); + if (value<0) { + chekParam.result("Value must be > 0"); + return; + } + if (value===0) { + chekParam.result("This have no need to create token"); + return; + } + chekParam.result(true); + } } diff --git a/front/src/app/scene/change-password/change-password.html b/front/src/app/scene/change-password/change-password.html index f4aa885..395fbfe 100644 --- a/front/src/app/scene/change-password/change-password.html +++ b/front/src/app/scene/change-password/change-password.html @@ -23,7 +23,7 @@ placeholder="Enter new password" [hasError]="password1State !== true" (changeValue)="checkPassword($event)"> - + @@ -32,7 +32,7 @@ placeholder="Enter new password (verify)" [hasError]="password2State !== true" (changeValue)="checkPassword2($event)"> - +
diff --git a/front/src/app/scene/settings/settings.html b/front/src/app/scene/settings/settings.html index ed48d79..6adc1fc 100644 --- a/front/src/app/scene/settings/settings.html +++ b/front/src/app/scene/settings/settings.html @@ -1,47 +1,20 @@
-
{{menu.title}}
+
Global SSO Management
- + {{data.title}} {{data.description}} -
-
-
-
-
-
- - {{elem.title}} -
-
{{elem.description}}
-
-
-
{{elem.title}}:
-
{{elem.description}}
-
- -
-
-
-
{{elem.title}}
-
{{elem.description}}
-
- -
-
-
+