Merge pull request #11528 from rusikv/enhancement/oauth-minor-improvements
Oauth2 UI improvements
This commit is contained in:
commit
d77b363c13
@ -459,7 +459,7 @@ export class EntityService {
|
|||||||
entitiesObservable = this.queueService.getQueueStatistics(pageLink, config);
|
entitiesObservable = this.queueService.getQueueStatistics(pageLink, config);
|
||||||
break;
|
break;
|
||||||
case EntityType.OAUTH2_CLIENT:
|
case EntityType.OAUTH2_CLIENT:
|
||||||
pageLink.sortOrder.property = 'createdTime';
|
pageLink.sortOrder.property = 'title';
|
||||||
entitiesObservable = this.oauth2Service.findTenantOAuth2ClientInfos(pageLink, config);
|
entitiesObservable = this.oauth2Service.findTenantOAuth2ClientInfos(pageLink, config);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,6 +23,9 @@
|
|||||||
<mat-error *ngIf="entityForm.get('title').hasError('required')">
|
<mat-error *ngIf="entityForm.get('title').hasError('required')">
|
||||||
{{ 'admin.oauth2.client-title-required' | translate }}
|
{{ 'admin.oauth2.client-title-required' | translate }}
|
||||||
</mat-error>
|
</mat-error>
|
||||||
|
<mat-error *ngIf="entityForm.get('title').hasError('maxlength')">
|
||||||
|
{{ 'admin.oauth2.client-title-max-length' | translate }}
|
||||||
|
</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
<div class="tb-form-row tb-standard-fields no-border no-padding column-xs">
|
<div class="tb-form-row tb-standard-fields no-border no-padding column-xs">
|
||||||
@ -67,7 +70,7 @@
|
|||||||
</mat-error>
|
</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
<mat-expansion-panel class="configuration-panel mat-elevation-z0" [expanded]="">
|
<mat-expansion-panel class="configuration-panel mat-elevation-z0" [expanded]="advancedExpanded">
|
||||||
<mat-expansion-panel-header>
|
<mat-expansion-panel-header>
|
||||||
<mat-panel-title fxLayoutAlign="start center" translate>
|
<mat-panel-title fxLayoutAlign="start center" translate>
|
||||||
admin.oauth2.advanced-settings
|
admin.oauth2.advanced-settings
|
||||||
@ -162,7 +165,7 @@
|
|||||||
<div class="tb-form-row tb-standard-fields no-border no-padding column-xs">
|
<div class="tb-form-row tb-standard-fields no-border no-padding column-xs">
|
||||||
<mat-form-field class="flex">
|
<mat-form-field class="flex">
|
||||||
<mat-label translate>admin.oauth2.scope</mat-label>
|
<mat-label translate>admin.oauth2.scope</mat-label>
|
||||||
<mat-chip-grid #scopeList [disabled]="!this.createNewDialog && !(this.isEdit || this.isAdd)">
|
<mat-chip-grid #scopeList required [disabled]="!this.createNewDialog && !(this.isEdit || this.isAdd)">
|
||||||
<mat-chip-row *ngFor="let scope of entityForm.get('scope').value; let k = index; trackBy: trackByParams"
|
<mat-chip-row *ngFor="let scope of entityForm.get('scope').value; let k = index; trackBy: trackByParams"
|
||||||
removable (removed)="removeScope(k, entityForm)">
|
removable (removed)="removeScope(k, entityForm)">
|
||||||
{{scope}}
|
{{scope}}
|
||||||
|
|||||||
@ -103,6 +103,7 @@ export class ClientComponent extends EntityComponent<OAuth2Client, PageLink, OAu
|
|||||||
platformTypes = Object.values(PlatformType);
|
platformTypes = Object.values(PlatformType);
|
||||||
platformTypeTranslations = platformTypeTranslations;
|
platformTypeTranslations = platformTypeTranslations;
|
||||||
generalSettingsMode = true;
|
generalSettingsMode = true;
|
||||||
|
advancedExpanded = false;
|
||||||
|
|
||||||
constructor(protected store: Store<AppState>,
|
constructor(protected store: Store<AppState>,
|
||||||
protected translate: TranslateService,
|
protected translate: TranslateService,
|
||||||
@ -126,7 +127,7 @@ export class ClientComponent extends EntityComponent<OAuth2Client, PageLink, OAu
|
|||||||
|
|
||||||
buildForm(entity: OAuth2Client): UntypedFormGroup {
|
buildForm(entity: OAuth2Client): UntypedFormGroup {
|
||||||
return this.fb.group({
|
return this.fb.group({
|
||||||
title: [entity?.title ? entity.title : '', [Validators.required]],
|
title: [entity?.title ? entity.title : '', [Validators.required, Validators.maxLength(100)]],
|
||||||
additionalInfo: this.fb.group({
|
additionalInfo: this.fb.group({
|
||||||
providerName: [entity?.additionalInfo?.providerName ? entity?.additionalInfo?.providerName : '', Validators.required]
|
providerName: [entity?.additionalInfo?.providerName ? entity?.additionalInfo?.providerName : '', Validators.required]
|
||||||
}),
|
}),
|
||||||
@ -333,7 +334,7 @@ export class ClientComponent extends EntityComponent<OAuth2Client, PageLink, OAu
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.subscriptions.push(basicGroup.get('tenantNameStrategy').valueChanges.subscribe((domain) => {
|
this.subscriptions.push(basicGroup.get('tenantNameStrategy').valueChanges.subscribe((domain) => {
|
||||||
if (domain === 'CUSTOM') {
|
if (domain === 'CUSTOM' && (this.createNewDialog || this.isEdit || this.isAdd)) {
|
||||||
basicGroup.get('tenantNamePattern').enable();
|
basicGroup.get('tenantNamePattern').enable();
|
||||||
} else {
|
} else {
|
||||||
basicGroup.get('tenantNamePattern').disable();
|
basicGroup.get('tenantNamePattern').disable();
|
||||||
@ -345,7 +346,10 @@ export class ClientComponent extends EntityComponent<OAuth2Client, PageLink, OAu
|
|||||||
|
|
||||||
private setProviderDefaultValue(provider: string, clientRegistration: UntypedFormGroup) {
|
private setProviderDefaultValue(provider: string, clientRegistration: UntypedFormGroup) {
|
||||||
if (provider === 'Custom') {
|
if (provider === 'Custom') {
|
||||||
|
const title = clientRegistration.get('title').value;
|
||||||
clientRegistration.reset(this.defaultProvider, {emitEvent: false});
|
clientRegistration.reset(this.defaultProvider, {emitEvent: false});
|
||||||
|
clientRegistration.patchValue({title}, {emitEvent: false});
|
||||||
|
this.advancedExpanded = true;
|
||||||
} else {
|
} else {
|
||||||
const template = this.templates.get(provider);
|
const template = this.templates.get(provider);
|
||||||
template.clientId = '';
|
template.clientId = '';
|
||||||
|
|||||||
@ -61,14 +61,12 @@ export class ClientsTableConfigResolver implements Resolve<EntityTableConfig<OAu
|
|||||||
this.config.headerComponent = ClientTableHeaderComponent;
|
this.config.headerComponent = ClientTableHeaderComponent;
|
||||||
this.config.addDialogStyle = {width: '850px', maxHeight: '100vh'};
|
this.config.addDialogStyle = {width: '850px', maxHeight: '100vh'};
|
||||||
this.config.defaultSortOrder = {property: 'createdTime', direction: Direction.DESC};
|
this.config.defaultSortOrder = {property: 'createdTime', direction: Direction.DESC};
|
||||||
this.config.displayPagination = false;
|
|
||||||
this.config.pageMode = false;
|
|
||||||
|
|
||||||
this.config.columns.push(
|
this.config.columns.push(
|
||||||
new DateEntityTableColumn<OAuth2ClientInfo>('createdTime', 'common.created-time', this.datePipe, '170px'),
|
new DateEntityTableColumn<OAuth2ClientInfo>('createdTime', 'common.created-time', this.datePipe, '170px'),
|
||||||
new EntityTableColumn<OAuth2ClientInfo>('title', 'admin.oauth2.title', '170px'),
|
new EntityTableColumn<OAuth2ClientInfo>('title', 'admin.oauth2.title', '35%'),
|
||||||
new EntityTableColumn<OAuth2ClientInfo>('providerName', 'admin.oauth2.provider', '170px'),
|
new EntityTableColumn<OAuth2ClientInfo>('providerName', 'admin.oauth2.provider', '170px'),
|
||||||
new EntityTableColumn<OAuth2ClientInfo>('platforms', 'admin.oauth2.allowed-platforms', '100%',
|
new EntityTableColumn<OAuth2ClientInfo>('platforms', 'admin.oauth2.allowed-platforms', '170px',
|
||||||
(clientInfo) => {
|
(clientInfo) => {
|
||||||
return clientInfo.platforms && clientInfo.platforms.length ?
|
return clientInfo.platforms && clientInfo.platforms.length ?
|
||||||
clientInfo.platforms.map(platform => this.translate.instant(platformTypeTranslations.get(platform))).join(', ') :
|
clientInfo.platforms.map(platform => this.translate.instant(platformTypeTranslations.get(platform))).join(', ') :
|
||||||
|
|||||||
@ -54,8 +54,6 @@ export class DomainTableConfigResolver implements Resolve<EntityTableConfig<Doma
|
|||||||
this.config.headerComponent = DomainTableHeaderComponent;
|
this.config.headerComponent = DomainTableHeaderComponent;
|
||||||
this.config.addDialogStyle = {width: '850px', maxHeight: '100vh'};
|
this.config.addDialogStyle = {width: '850px', maxHeight: '100vh'};
|
||||||
this.config.defaultSortOrder = {property: 'createdTime', direction: Direction.DESC};
|
this.config.defaultSortOrder = {property: 'createdTime', direction: Direction.DESC};
|
||||||
this.config.displayPagination = false;
|
|
||||||
this.config.pageMode = false;
|
|
||||||
|
|
||||||
this.config.columns.push(
|
this.config.columns.push(
|
||||||
new DateEntityTableColumn<DomainInfo>('createdTime', 'common.created-time', this.datePipe, '170px'),
|
new DateEntityTableColumn<DomainInfo>('createdTime', 'common.created-time', this.datePipe, '170px'),
|
||||||
|
|||||||
@ -55,8 +55,6 @@ export class MobileAppTableConfigResolver implements Resolve<EntityTableConfig<M
|
|||||||
this.config.headerComponent = MobileAppTableHeaderComponent;
|
this.config.headerComponent = MobileAppTableHeaderComponent;
|
||||||
this.config.addDialogStyle = {width: '850px', maxHeight: '100vh'};
|
this.config.addDialogStyle = {width: '850px', maxHeight: '100vh'};
|
||||||
this.config.defaultSortOrder = {property: 'createdTime', direction: Direction.DESC};
|
this.config.defaultSortOrder = {property: 'createdTime', direction: Direction.DESC};
|
||||||
this.config.displayPagination = false;
|
|
||||||
this.config.pageMode = false;
|
|
||||||
|
|
||||||
this.config.columns.push(
|
this.config.columns.push(
|
||||||
new DateEntityTableColumn<MobileAppInfo>('createdTime', 'common.created-time', this.datePipe, '170px'),
|
new DateEntityTableColumn<MobileAppInfo>('createdTime', 'common.created-time', this.datePipe, '170px'),
|
||||||
@ -134,8 +132,8 @@ export class MobileAppTableConfigResolver implements Resolve<EntityTableConfig<M
|
|||||||
|
|
||||||
private appSecretText(entity): string {
|
private appSecretText(entity): string {
|
||||||
let text = entity.appSecret;
|
let text = entity.appSecret;
|
||||||
if (text.length > 40) {
|
if (text.length > 35) {
|
||||||
text = `${text.slice(0, 40)}…`;
|
text = `${text.slice(0, 35)}…`;
|
||||||
}
|
}
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,6 +25,9 @@
|
|||||||
<mat-error *ngIf="entityForm.hasError('unique')">
|
<mat-error *ngIf="entityForm.hasError('unique')">
|
||||||
{{ 'admin.oauth2.mobile-package-unique' | translate }}
|
{{ 'admin.oauth2.mobile-package-unique' | translate }}
|
||||||
</mat-error>
|
</mat-error>
|
||||||
|
<mat-error *ngIf="entityForm.get('pkgName').hasError('maxlength')">
|
||||||
|
{{ 'admin.oauth2.mobile-package-max-length' | translate }}
|
||||||
|
</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
<div class="tb-form-row tb-standard-fields no-border no-padding">
|
<div class="tb-form-row tb-standard-fields no-border no-padding">
|
||||||
|
|||||||
@ -54,7 +54,7 @@ export class MobileAppComponent extends EntityComponent<MobileAppInfo> {
|
|||||||
|
|
||||||
buildForm(entity: MobileAppInfo): UntypedFormGroup {
|
buildForm(entity: MobileAppInfo): UntypedFormGroup {
|
||||||
return this.fb.group({
|
return this.fb.group({
|
||||||
pkgName: [entity?.pkgName ? entity.pkgName : '', [Validators.required]],
|
pkgName: [entity?.pkgName ? entity.pkgName : '', [Validators.required, Validators.maxLength(255)]],
|
||||||
appSecret: [entity?.appSecret ? entity.appSecret : btoa(randomAlphanumeric(64)),
|
appSecret: [entity?.appSecret ? entity.appSecret : btoa(randomAlphanumeric(64)),
|
||||||
[Validators.required, this.base64Format]],
|
[Validators.required, this.base64Format]],
|
||||||
oauth2Enabled: isDefinedAndNotNull(entity?.oauth2Enabled) ? entity.oauth2Enabled : true,
|
oauth2Enabled: isDefinedAndNotNull(entity?.oauth2Enabled) ? entity.oauth2Enabled : true,
|
||||||
|
|||||||
@ -234,14 +234,15 @@
|
|||||||
"delete-mobile-app-text": "Be careful, after the confirmation the mobile application and all related data will become unrecoverable.",
|
"delete-mobile-app-text": "Be careful, after the confirmation the mobile application and all related data will become unrecoverable.",
|
||||||
"title": "Title",
|
"title": "Title",
|
||||||
"client-title-required": "Title is required",
|
"client-title-required": "Title is required",
|
||||||
|
"client-title-max-length": "Title should be less than 100",
|
||||||
"advanced-settings": "Advanced settings",
|
"advanced-settings": "Advanced settings",
|
||||||
"domain-details": "Domain details",
|
"domain-details": "Domain details",
|
||||||
"no-domains": "No domains found",
|
"no-domains": "No domains found",
|
||||||
"search-domains": "Search domains",
|
"search-domains": "Search domains",
|
||||||
"mobile-app-details": "Mobile application details",
|
"mobile-app-details": "Mobile application details",
|
||||||
"add-mobile-app": "Add mobile application",
|
"add-mobile-app": "Add mobile application",
|
||||||
"no-mobile-apps": "Search mobile applications",
|
"no-mobile-apps": "No mobile applications found",
|
||||||
"search-mobile-apps": "No mobile applications found",
|
"search-mobile-apps": "Search mobile applications",
|
||||||
"send-token": "Send token",
|
"send-token": "Send token",
|
||||||
"create-new": "Create new",
|
"create-new": "Create new",
|
||||||
"client-authentication-method": "Client authentication method",
|
"client-authentication-method": "Client authentication method",
|
||||||
@ -315,6 +316,7 @@
|
|||||||
"mobile-package-placeholder": "Ex.: my.example.app",
|
"mobile-package-placeholder": "Ex.: my.example.app",
|
||||||
"mobile-package-hint": "For Android: your own unique Application ID. For iOS: Product bundle identifier.",
|
"mobile-package-hint": "For Android: your own unique Application ID. For iOS: Product bundle identifier.",
|
||||||
"mobile-package-unique": "Application package must be unique.",
|
"mobile-package-unique": "Application package must be unique.",
|
||||||
|
"mobile-package-max-length": "Application package should be less than 256",
|
||||||
"mobile-app-secret": "Application secret",
|
"mobile-app-secret": "Application secret",
|
||||||
"mobile-app-secret-hint": "Base64 encoded string representing at least 512 bits of data.",
|
"mobile-app-secret-hint": "Base64 encoded string representing at least 512 bits of data.",
|
||||||
"mobile-app-secret-required": "Application secret is required.",
|
"mobile-app-secret-required": "Application secret is required.",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user