Skip to content

Commit

Permalink
fix(feature-details): delete route property if directions tool not i…
Browse files Browse the repository at this point in the history
…n toolbox (#747)

* fix(feature-details): fix routing property when directions tool out of config

* fix(feature-details): delete route property if directions tool not in toolbox

* delete unnecessary

Co-authored-by: Marc-André Barbeau <[email protected]>
  • Loading branch information
PhilippeLafreniere18 and mbarbeau authored Oct 14, 2020
1 parent eff4335 commit 227800f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<table class="igo-striped mat-typography" *ngIf="feature && isObject(feature.properties) && feature.properties.target !== 'iframe'">
<table class="igo-striped mat-typography" *ngIf="feature && toolbox && isObject(feature.properties) && feature.properties.target !== 'iframe'">
<tbody>
<tr *ngFor="let property of filterFeatureProperties(feature) | keyvalue">

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,7 @@ export class FeatureDetailsComponent {

@Input() map: IgoMap;

@Input()
get toolbox(): Toolbox {
return this._toolbox;
}
set toolbox(value: Toolbox) {
this._toolbox = value;
this.toolbox$.next(value);
}
private _toolbox: Toolbox;
public toolbox$ = new BehaviorSubject<Toolbox>(undefined);
@Input() toolbox: Toolbox;

@Input()
get feature(): Feature {
Expand Down Expand Up @@ -128,12 +119,8 @@ export class FeatureDetailsComponent {
});
}

if (feature.properties && feature.properties.Route) {
this.toolbox$.subscribe((value) => {
if (value && !value.getTool('directions')) {
delete feature.properties.Route;
}
});
if (feature.properties && feature.properties.Route && !this.toolbox.getTool('directions')) {
delete feature.properties.Route;
}

if (allowedFieldsAndAlias) {
Expand Down

0 comments on commit 227800f

Please sign in to comment.