Browse Source

Merge pull request #9583 from vvlladd28/bug/user/hide-activate

Hide display buttons activation link and resend activation when user activated
pull/9584/head
Igor Kulikov 3 years ago
committed by GitHub
parent
commit
02b7e384e4
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      ui-ngx/src/app/modules/home/pages/user/user.component.html
  2. 4
      ui-ngx/src/app/modules/home/pages/user/user.component.ts

4
ui-ngx/src/app/modules/home/pages/user/user.component.html

@ -37,13 +37,13 @@
<button mat-raised-button color="primary"
[disabled]="(isLoading$ | async)"
(click)="onEntityAction($event, 'displayActivationLink')"
[fxShow]="!isEdit">
[fxShow]="!isEdit && !isUserCredentialPresent()">
{{'user.display-activation-link' | translate }}
</button>
<button mat-raised-button color="primary"
[disabled]="(isLoading$ | async)"
(click)="onEntityAction($event, 'resendActivation')"
[fxShow]="!isEdit">
[fxShow]="!isEdit && !isUserCredentialPresent()">
{{'user.resend-activation' | translate }}
</button>
<button mat-raised-button color="primary"

4
ui-ngx/src/app/modules/home/pages/user/user.component.ts

@ -23,7 +23,7 @@ import { User } from '@shared/models/user.model';
import { selectAuth } from '@core/auth/auth.selectors';
import { map } from 'rxjs/operators';
import { Authority } from '@shared/models/authority.enum';
import { isDefinedAndNotNull, isUndefined } from '@core/utils';
import { isDefinedAndNotNull } from '@core/utils';
import { EntityTableConfig } from '@home/models/entity/entities-table-config.models';
import { ActionNotificationShow } from '@app/core/notification/notification.actions';
import { TranslateService } from '@ngx-translate/core';
@ -64,7 +64,7 @@ export class UserComponent extends EntityComponent<User> {
}
isUserCredentialPresent(): boolean {
return this.entity && this.entity.additionalInfo && isDefinedAndNotNull(this.entity.additionalInfo.userCredentialsEnabled);
return isDefinedAndNotNull(this.entity?.additionalInfo?.userCredentialsEnabled);
}
buildForm(entity: User): UntypedFormGroup {

Loading…
Cancel
Save