diff --git a/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-attribution.component.html b/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-attribution.component.html index 6d9fa637c4af1f03d72f102e34c39d9d6ef6a3e1..cc323e632d77a25481bfd69e8eb2c9591eefbee6 100644 --- a/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-attribution.component.html +++ b/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-attribution.component.html @@ -23,7 +23,7 @@ <ng-container *ngFor="let group of activeGroups; let index = index"> <div class="vitamui-row p-0 px-4" [class.no-hover]="row.state === 'expanded'" *ngIf="!group?.selected" [vitamuiCommonCollapse] #row="vitamuiCommonCollapse"> <div class="d-flex justify-content-between align-items-center clickable"> - <div class="row-label d-flex align-items-center" (click)="updateGroup(group?.id,group?.name, row)">{{group?.name}}</div> + <div class="row-label d-flex align-items-center" (click)="updateGroup(group?.id,group?.name)">{{group?.name}}</div> <button class="btn link underline" (click)="row.toggle()">{{row.state === 'collapsed' ? "Voir detail" : "Masquer detail"}}</button> </div> <app-group-detail *ngIf="row.state === 'expanded'" [group]="group" [@expansionAnimation]></app-group-detail> diff --git a/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-attribution.component.ts b/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-attribution.component.ts index 5ad4e72c13b91e02848dee06b0657fd0cf201226..02569731f425669fbf5155e8dd1acf47dc7f5dbf 100644 --- a/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-attribution.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-attribution.component.ts @@ -36,7 +36,7 @@ */ /* tslint:disable: no-use-before-declare */ -import { CollapseDirective, Group, User } from 'ui-frontend-common'; +import { Group, User } from 'ui-frontend-common'; import { animate, state, style, transition, trigger } from '@angular/animations'; import { Component, forwardRef, Inject, OnInit } from '@angular/core'; @@ -62,6 +62,12 @@ export const GROUP_ATTRIBUTION_VALUE_ACCESSOR: any = { state('expanded', style({ height: '*', visibility: 'visible' })), transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4,0.0,0.2,1)')), ]), + trigger('expansionAnimation', [ + state('true', style({ height: '*', visibility: 'visible' })), + state('void', style({ height: '0px', visibility: 'hidden' })), + transition(':enter', animate('150ms')), + transition(':leave', animate('150ms')), + ]), ] }) export class GroupAttributionComponent implements OnInit { @@ -109,15 +115,13 @@ export class GroupAttributionComponent implements OnInit { this.unselectAllProfileGroups(); } - public updateGroup(groupId: string, groupName: string, groupLevel: string, collapseDirective: CollapseDirective): void { + public updateGroup(groupId: string, groupName: string): void { this.selectedGroupName = groupName; this.user.groupId = groupId; - this.user.level = groupLevel; this.unselectAllProfileGroups(); const selectedGroup = this.activeGroups.find((group) => group.id === groupId); if (selectedGroup) { selectedGroup.selected = true; - collapseDirective.collapse(); } }