Skip to content

Commit

Permalink
fix GenericFormComponent inheritance - fix #2961
Browse files Browse the repository at this point in the history
  • Loading branch information
TheoLechemia committed Mar 14, 2024
1 parent 16b4eca commit 5e4eef1
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export class AcquisitionFrameworksComponent extends GenericFormComponent impleme
}

ngOnInit() {
super.ngOnInit();
this.getAcquisitionFrameworks();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ export class AreasComponent extends GenericFormComponent implements OnInit {
}

ngOnInit() {
super.ngOnInit();
this.valueFieldName = this.valueFieldName === undefined ? 'id_area' : this.valueFieldName;

this.getAreas();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export class DatalistComponent extends GenericFormComponent implements OnInit {
}

ngOnInit() {
super.ngOnInit();
this.designStyle = this.designStyle || 'material';
this.formId = `datalist_${Math.ceil(Math.random() * 1e10)}`;
this.getData();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export class DatasetsComponent extends GenericFormComponent implements OnInit, O
}

ngOnInit() {
super.ngOnInit();
this.bindValue = this.bindAllItem ? null : this.bindValue;
this.getDatasets();
}
Expand Down Expand Up @@ -102,6 +103,7 @@ export class DatasetsComponent extends GenericFormComponent implements OnInit, O
}

ngOnChanges(changes) {
super.ngOnChanges(changes);
// detetch change on input idAcquisitionFramework
// (the number, if the AFcomponent is not multiSelect) to reload datasets
if (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export class NomenclatureComponent
}

ngOnInit() {
super.ngOnInit();
this.keyValue = this.bindAllItem ? null : this.keyValue || 'id_nomenclature'; // patch pour les cas ou this.keyValue == undefined
this.labelLang = 'label_' + this._translate.currentLang;
this.definitionLang = 'definition_' + this._translate.currentLang;
Expand Down Expand Up @@ -124,6 +125,8 @@ export class NomenclatureComponent
}

ngOnChanges(changes: SimpleChanges) {
super.ngOnChanges(changes);

// if change regne => change groupe2inpn also
if (changes.regne !== undefined && !changes.regne.firstChange) {
this.initLabels();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ import { GenericFormComponent } from '@geonature_common/form/genericForm.compone
templateUrl: 'observers-text.component.html',
styleUrls: ['./observers-text.component.scss'],
})
export class ObserversTextComponent extends GenericFormComponent implements OnInit {
export class ObserversTextComponent extends GenericFormComponent {
constructor() {
super();
}

ngOnInit() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export class ObserversComponent extends GenericFormComponent {
}

ngOnInit() {
super.ngOnInit();
this.bindValue = this.bindAllItem ? null : this.bindValue;
this.multiSelect = this.multiSelect || true;
// uniformise as IdList the id of list
Expand Down

0 comments on commit 5e4eef1

Please sign in to comment.