Skip to content
Snippets Groups Projects

feat(admin): add a loop to render all of the structures + add buttons to...

Merged Mathieu Ponton requested to merge 492-new-ui-admin into dev
Files
12
// button-cell-renderer.component.ts
import { Component } from '@angular/core';
import { ICellRendererAngularComp } from 'ag-grid-angular';
import { ICellRendererParams } from 'ag-grid-community';
@Component({
selector: 'app-button-cell-renderer',
template: `<app-button
size="small"
[disabled]="disabled"
[label]="'Relancer'"
[variant]="'secondary'"
[style]="'display: inline-block'"
/>`,
})
export class ButtonCellRendererComponent implements ICellRendererAngularComp {
public disabled = true;
agInit(params: ICellRendererParams): void {
this.disabled = this.shouldDisable(params);
}
refresh(params: ICellRendererParams): boolean {
this.disabled = this.shouldDisable(params);
return true;
}
public shouldDisable(params: ICellRendererParams): boolean {
return !params.data.isOutdated || params.context.gridId === 'toClaim';
}
}
Loading