Skip to content

Commit

Permalink
fix frontend actions
Browse files Browse the repository at this point in the history
  • Loading branch information
joelclems committed Mar 3, 2023
1 parent 7f2262c commit 36dc0a0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
5 changes: 4 additions & 1 deletion doc/changelog.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# Changelog

## 1.0.4 (03-03-2023)

## 1.0.4 (unreleased)
**🐛 Corrections**

- Corrige un bug sur le composant de filtrage

## 1.0.3 (03-03-2023)

Expand Down
2 changes: 1 addition & 1 deletion frontend/app/components/layout/base/layout.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
mat-raised-button
[color]="computedLayout.color"
[disabled]="computedLayout.disabled"
(click)="onButtonClick()"
(click)="onButtonClick($event)"
>
<mat-icon *ngIf="computedLayout.icon">{{ computedLayout.icon }}</mat-icon>
{{ computedLayout.title }}
Expand Down
5 changes: 3 additions & 2 deletions frontend/app/components/layout/form/generic-form.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ export class ModulesGenericFormComponent extends ModulesLayoutComponent implemen
// pour ne pas casser la référence à data
this._formService.updateData(this.data, this.formGroup.value);
this.updateForm();
this.emitAction({ type: 'data-change' });
this._mLayout.reComputeLayout('form');
this.computedLayout.change && this.computedLayout.change(dataChanged);
}

Expand Down Expand Up @@ -95,7 +97,6 @@ export class ModulesGenericFormComponent extends ModulesLayoutComponent implemen
if (action == 'import') {
return this._mAction.processImport(context, data);
}

this.emitAction(action);
this.emitAction(event);
}
}
6 changes: 6 additions & 0 deletions frontend/app/components/test/test-layout.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,10 @@ export class TestLayoutComponent implements OnInit {
this.data = layoutDefinitionJson.data || {};
});
}

processAction(event) {
if (event.type == 'data-change') {
this.process();
}
}
}

0 comments on commit 36dc0a0

Please sign in to comment.