Skip to content

Commit

Permalink
refact: move warning clear to independant method
Browse files Browse the repository at this point in the history
  • Loading branch information
edelclaux committed Jan 16, 2025
1 parent e6847b0 commit f534d9a
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 9 deletions.
4 changes: 4 additions & 0 deletions frontend/app/services/hierarchy.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ export class HierarchyService {
this.isLoading = false;
}

clear(): void {
this.warning = '';
}

getHierarchyFromZh(zh) {
if (zh.properties.main_id_rb) {
this.getHierarchy(zh.properties.id_zh);
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/zh-forms/tabs/tab0/zh-form-tab0.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ export class ZhFormTab0Component implements OnInit {
ngOnDestroy() {
if (this.$_geojsonSub) this.$_geojsonSub.unsubscribe();
if (this.$_currentZhSub) this.$_currentZhSub.unsubscribe();
this.hierarchy.warning = '';
this.hierarchy.clear();
}

featureCollectionToMultipolygon(featureCollection) {
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/zh-forms/tabs/tab1/zh-form-tab1.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,6 @@ export class ZhFormTab1Component implements OnInit {
ngOnDestroy() {
if (this.$_currentZhSub) this.$_currentZhSub.unsubscribe();
this.ngbModal.dismissAll();
this.hierarchy.warning = '';
this.hierarchy.clear();
}
}
2 changes: 1 addition & 1 deletion frontend/app/zh-forms/tabs/tab2/zh-form-tab2.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,6 @@ export class ZhFormTab2Component implements OnInit, AfterViewInit {
ngOnDestroy() {
if (this.$_currentZhSub) this.$_currentZhSub.unsubscribe();
if (this.$_fromChangeSub) this.$_fromChangeSub.unsubscribe();
this.hierarchy.warning = '';
this.hierarchy.clear();
}
}
2 changes: 1 addition & 1 deletion frontend/app/zh-forms/tabs/tab3/zh-form-tab3.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,6 @@ export class ZhFormTab3Component implements OnInit {
ngOnDestroy() {
if (this.$_currentZhSub) this.$_currentZhSub.unsubscribe();
if (this.$_fromChangeSub) this.$_fromChangeSub.unsubscribe();
this.hierarchy.warning = '';
this.hierarchy.clear();
}
}
2 changes: 1 addition & 1 deletion frontend/app/zh-forms/tabs/tab4/zh-form-tab4.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,6 @@ export class ZhFormTab4Component implements OnInit {
}

ngOnDestroy() {
this.hierarchy.warning = '';
this.hierarchy.clear();
}
}
2 changes: 1 addition & 1 deletion frontend/app/zh-forms/tabs/tab5/zh-form-tab5.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1180,6 +1180,6 @@ export class ZhFormTab5Component implements OnInit {
ngOnDestroy() {
if (this.$_getTabChangeSub) this.$_getTabChangeSub.unsubscribe();
if (this.$_currentZhSub) this.$_currentZhSub.unsubscribe();
this.hierarchy.warning = '';
this.hierarchy.clear();
}
}
2 changes: 1 addition & 1 deletion frontend/app/zh-forms/tabs/tab6/zh-form-tab6.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1021,6 +1021,6 @@ export class ZhFormTab6Component implements OnInit {
ngOnDestroy() {
if (this.$_getTabChangeSub) this.$_getTabChangeSub.unsubscribe();
if (this.$_currentZhSub) this.$_currentZhSub.unsubscribe();
this.hierarchy.warning = '';
this.hierarchy.clear();
}
}
2 changes: 1 addition & 1 deletion frontend/app/zh-forms/tabs/tab7/zh-form-tab7.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,6 @@ export class ZhFormTab7Component implements OnInit {
ngOnDestroy() {
if (this.$_getTabChangeSub) this.$_getTabChangeSub.unsubscribe();
if (this.$_currentZhSub) this.$_currentZhSub.unsubscribe();
this.hierarchy.warning = '';
this.hierarchy.clear();
}
}
2 changes: 1 addition & 1 deletion frontend/app/zh-forms/tabs/tab9/zh-form-tab9.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ export class ZhFormTab9Component implements OnInit {
ngOnDestroy() {
if (this.$_getTabChangeSub) this.$_getTabChangeSub.unsubscribe();
if (this.$_currentZhSub) this.$_currentZhSub.unsubscribe();
this.hierarchy.warning = '';
this.hierarchy.clear();
}
}

0 comments on commit f534d9a

Please sign in to comment.