Commit 22aade5a authored by Augustin Leconte's avatar Augustin Leconte
Browse files

feat(manage-user): merge request fixes

parent 3ebc0de6
Pipeline #20198 passed with stage
in 5 minutes and 5 seconds
......@@ -7,15 +7,14 @@ import { ICellRendererAngularComp } from 'ag-grid-angular';
styleUrls: ['./administred-structures.component.scss'],
})
export class AdministredStructuresComponent implements ICellRendererAngularComp {
structures;
public structures: any;
constructor() {}
agInit(params): void {
public agInit(params: any): void {
this.structures = params;
}
refresh(params?: any): boolean {
public refresh(params?: any): boolean {
this.structures = params;
return true;
}
}
<button type="button" (click)="onClick($event)">{{ label }}</button>
<button type="button" (click)="onClick()">{{ label }}</button>
......@@ -6,26 +6,20 @@ import { ICellRendererAngularComp } from 'ag-grid-angular';
templateUrl: './delete-user.component.html',
})
export class DeleteUserComponent implements ICellRendererAngularComp {
params;
label: string;
public params: any;
public label: string;
constructor() {}
agInit(params): void {
public agInit(params: any): void {
this.params = params;
this.label = this.params.label || null;
}
refresh(params?: any): boolean {
public refresh(): boolean {
return true;
}
onClick($event) {
public onClick(): void {
if (this.params.onClick instanceof Function) {
const params = {
event: $event,
rowData: this.params.node.data,
};
this.params.onClick(this.params);
}
}
......
......@@ -9,7 +9,7 @@
<div class="tables-list">
<div>
<h4 class="title" *ngIf="unVerifiedUsers">Utilisateurs non vérifiés ({{ unVerifiedUsers.length }})</h4>
<h3 class="title" *ngIf="unVerifiedUsers">Utilisateurs non vérifiés ({{ unVerifiedUsers.length }})</h3>
<ag-grid-angular
class="ag-theme-alpine user-table"
[rowData]="unVerifiedUsers"
......@@ -23,7 +23,7 @@
</ag-grid-angular>
</div>
<div>
<h4 class="title" *ngIf="unAttachedUsers">Utilisateurs non rattachés ({{ unAttachedUsers.length }})</h4>
<h3 class="title" *ngIf="unAttachedUsers">Utilisateurs non rattachés ({{ unAttachedUsers.length }})</h3>
<ag-grid-angular
class="ag-theme-alpine user-table"
[rowData]="unAttachedUsers"
......@@ -37,7 +37,7 @@
</ag-grid-angular>
</div>
<div>
<h4 class="title" *ngIf="attachedUsers">Utilisateurs rattachés ({{ attachedUsers.length }})</h4>
<h3 class="title" *ngIf="attachedUsers">Utilisateurs rattachés ({{ attachedUsers.length }})</h3>
<ag-grid-angular
class="ag-theme-alpine user-table"
[rowData]="attachedUsers"
......
......@@ -12,10 +12,7 @@
display: flex;
flex-direction: column;
margin-left: 10%;
}
h4 {
margin-bottom: 1%;
margin-bottom: 2%;
}
app-delete-user {
......
......@@ -20,24 +20,22 @@ export class ManageUsersComponent {
public columnDefs;
public frameworkComponents;
public defaultColDef: ColDef;
public unAttachedColDef: ColDef;
public defaultColDef = {
editable: true,
sortable: true,
flex: 1,
minWidth: 100,
filter: true,
resizable: true,
};
public unAttachedColDef = {
...this.defaultColDef,
cellStyle: {
color: '#da6c2e',
},
};
constructor(private adminService: AdminService) {
this.defaultColDef = {
editable: true,
sortable: true,
flex: 1,
minWidth: 100,
filter: true,
resizable: true,
};
this.unAttachedColDef = {
...this.defaultColDef,
cellStyle: {
color: '#da6c2e',
},
};
this.columnDefs = [
{
headerName: 'Nom',
......@@ -76,7 +74,6 @@ export class ManageUsersComponent {
cellStyle: { 'text-align': 'center' },
},
];
this.frameworkComponents = {
deleteUserComponent: DeleteUserComponent,
administredStructuresComponent: AdministredStructuresComponent,
......@@ -86,7 +83,7 @@ export class ManageUsersComponent {
this.findUnVerifiedUsers();
}
public onDeleteButtonClick(arg) {
public onDeleteButtonClick(arg): void {
const user = arg.data;
this.deleteUser(user, false);
}
......@@ -107,7 +104,7 @@ export class ManageUsersComponent {
this.deleteModalOpenned = !this.deleteModalOpenned;
}
public async findAttachedUsers(): Promise<void> {
public findAttachedUsers(): void {
this.adminService.getAttachedUsers().subscribe((users) => {
this.attachedUsers = users;
this.attachedUsers.map((user) => {
......@@ -131,7 +128,7 @@ export class ManageUsersComponent {
});
}
getRowHeight(params) {
public getRowHeight(params): number {
return params.data.structures ? (params.data.structures.length != 0 ? params.data.structures.length * 40 : 40) : 40;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment