Skip to content

Commit

Permalink
Fixes #1116 - IHM edit causes incorrect mapping of Nature Reserves
Browse files Browse the repository at this point in the history
  • Loading branch information
HarelM committed Jan 12, 2020
1 parent 843e037 commit 2396cda
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 22 deletions.
4 changes: 2 additions & 2 deletions IsraelHiking.API/Services/TagsHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,9 @@ private Category CreateOthersCategory()
otherCategory.Items.Add(new IconAndTags(natureReserveIcon,
new List<KeyValuePair<string, string>>
{
new KeyValuePair<string, string>("boundary", "protected_area"),
new KeyValuePair<string, string>("leisure", "nature_reserve"),
new KeyValuePair<string, string>("boundary", "national_park"),
new KeyValuePair<string, string>("boundary", "protected_area")
new KeyValuePair<string, string>("boundary", "national_park")
}));

return otherCategory;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
<div [dir]="resources.direction">
<mat-card class="mat-elevation-z0">
<mat-card-header *ngIf="!isPoint()">
<mat-card-title [ngClass]="resources.getTextAlignment(info.title)" [dir]="resources.getDirection(info.title)">
<span class="text-large" [dir]="resources.getDirection(info.title)">{{info.title}}</span>
</mat-card-title>
</mat-card-header>
<div fxLayout="row">
<mat-form-field fxFill>
<input matInput #titleInput type="text" [dir]="resources.getDirection(info.title)" [(ngModel)]="info.title" placeholder="{{resources.nameInLanguage}}" fxFill />
<mat-form-field fxFill *ngIf="isPoint()">
<input matInput type="text" [dir]="resources.getDirection(info.title)" [(ngModel)]="info.title" placeholder="{{resources.nameInLanguage}}" fxFill />
</mat-form-field>
</div>

<image-scroller [images]="info.imagesUrls" [canEdit]="true"></image-scroller>

<div fxLayout="row">
<mat-form-field fxFill>
<textarea rows="4" maxlength="255" matInput [dir]="resources.getDirection(info.description)" [(ngModel)]="info.description" placeholder="{{resources.descriptionInLanguage}}" fxFill></textarea>
Expand All @@ -32,21 +35,23 @@
<button mat-button fxFill><i class="fa icon-plus"></i></button>
</div>
</div>
<div fxLayout="row">
<mat-form-field fxFill>
<mat-select placeholder="{{resources.categories}}" [ngModel]="selectedCategory" (selectionChange)="selectCategory($event)" fxFill>
<mat-option *ngFor="let category of categories" [value]="category"><i class="fa" [ngClass]="category.icon" [style.color]="category.color"></i> {{resources.translate(category.label)}}</mat-option>
</mat-select>
</mat-form-field>
</div>
<br />
<br />
<div fxLayout="row wrap" *ngIf="selectedCategory">
<button mat-button *ngFor="let icon of selectedCategory.icons" (click)="selectIcon(icon)" fxFlex [ngClass]="{active: icon == selectedCategory.selectedIcon}">
<i class="fa fa-lg" [ngClass]="icon.icon" [style.color]="icon.color"></i>
<br />
<span class="chrome-wordwrap-fix category-button-text">{{resources.translate(icon.label)}}</span>
</button>
<div *ngIf="isPoint()">
<div fxLayout="row">
<mat-form-field fxFill>
<mat-select placeholder="{{resources.categories}}" [ngModel]="selectedCategory" (selectionChange)="selectCategory($event)" fxFill>
<mat-option *ngFor="let category of categories" [value]="category"><i class="fa" [ngClass]="category.icon" [style.color]="category.color"></i> {{resources.translate(category.label)}}</mat-option>
</mat-select>
</mat-form-field>
</div>
<br />
<br />
<div fxLayout="row wrap" *ngIf="selectedCategory">
<button mat-button *ngFor="let icon of selectedCategory.icons" (click)="selectIcon(icon)" fxFlex [ngClass]="{active: icon == selectedCategory.selectedIcon}">
<i class="fa fa-lg" [ngClass]="icon.icon" [style.color]="icon.color"></i>
<br />
<span class="chrome-wordwrap-fix category-button-text">{{resources.translate(icon.label)}}</span>
</button>
</div>
</div>
</mat-card>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,8 @@ export class PublicPointOfInterestEditComponent extends BaseMapComponent impleme
public trackByIndex(index) {
return index;
}

public isPoint(): boolean {
return this.info != null && !this.info.isArea && !this.info.isRoute;
}
}
4 changes: 3 additions & 1 deletion IsraelHiking.Web/sources/application/services/poi.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ export class PoiService {
label: category.name,
icon: category.icon,
color: category.color,
icons: category.items.map(i => i.iconColorCategory)
icons: category.items
.filter(i => i.iconColorCategory.icon != "icon-nature-reserve")
.map(i => i.iconColorCategory)
} as ISelectableCategory);
}
return selectableCategories;
Expand Down

0 comments on commit 2396cda

Please sign in to comment.