Fix feature highlighting
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
<div><a href="#" (click)="handleBackClick($event)" i18n>Back</a></div>
|
||||
<h3><i class="fm fm-farm"></i> <span i18n>Farms</span></h3>
|
||||
<div class="farms">
|
||||
<div class="row m-0 pl-3 pr-3" *ngFor="let feature of features" (click)="handleFeatureClick(feature)" (mouseenter)="handleFeatureMouseEnter(feature)" (mouseleave)="handleFeatureMouseLeave(feature)">
|
||||
<div class="row m-0 pl-3 pr-3" *ngFor="let feature of features"[ngClass]="{'selected':isFeatureSelected(feature)}" (click)="handleFeatureClick(feature)" (mouseenter)="handleFeatureMouseEnter(feature)" (mouseleave)="handleFeatureMouseLeave(feature)">
|
||||
<fm-map-feature-list-feature-container [feature]="feature"></fm-map-feature-list-feature-container>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -11,7 +11,7 @@ fm-map-feature-list-feature-container {
|
||||
padding-left:1.5rem;
|
||||
}
|
||||
|
||||
.row:hover {
|
||||
.row.selected {
|
||||
background-color: gray('100');
|
||||
}
|
||||
|
||||
|
@@ -1,29 +1,29 @@
|
||||
import { Component, Injectable } from '@angular/core';
|
||||
import { Location } from '@angular/common';
|
||||
import { AbstractFeatureListComponent } from '../feature-list/feature-list.component';
|
||||
import { ForItemType } from '../for-item/for-itemtype.decorator';
|
||||
import { Store } from '@ngrx/store';
|
||||
import * as mapReducers from '../../reducers/map.reducer';
|
||||
import { commonReducers, ItemTypeService } from '@farmmaps/common';
|
||||
import * as mapActions from '../../actions/map.actions';
|
||||
import { tassign } from 'tassign';
|
||||
import { Router } from '@angular/router';
|
||||
|
||||
@ForItemType("vnd.farmmaps.itemtype.croppingscheme")
|
||||
@Injectable()
|
||||
@Component({
|
||||
selector: 'fm-map-feature-list-croppingscheme',
|
||||
templateUrl: './feature-list-croppingscheme.component.html',
|
||||
styleUrls: ['./feature-list-croppingscheme.component.scss']
|
||||
})
|
||||
export class FeatureListCroppingschemeComponent extends AbstractFeatureListComponent {
|
||||
|
||||
constructor(store: Store<mapReducers.State | commonReducers.State>, itemTypeService: ItemTypeService, location: Location, private router: Router) {
|
||||
super(store, itemTypeService, location);
|
||||
}
|
||||
|
||||
handleFeatureClick(feature) {
|
||||
var queryState = tassign(mapReducers.initialState.queryState, { parentCode: feature.get('code'), itemType: "vnd.farmmaps.itemtype.cropfield" });
|
||||
this.store.dispatch(new mapActions.DoQuery(queryState));
|
||||
}
|
||||
}
|
||||
import { Component, Injectable } from '@angular/core';
|
||||
import { Location } from '@angular/common';
|
||||
import { AbstractFeatureListComponent } from '../feature-list/feature-list.component';
|
||||
import { ForItemType } from '../for-item/for-itemtype.decorator';
|
||||
import { Store } from '@ngrx/store';
|
||||
import * as mapReducers from '../../reducers/map.reducer';
|
||||
import { commonReducers, ItemTypeService } from '@farmmaps/common';
|
||||
import * as mapActions from '../../actions/map.actions';
|
||||
import { tassign } from 'tassign';
|
||||
import { Router } from '@angular/router';
|
||||
|
||||
@ForItemType("vnd.farmmaps.itemtype.croppingscheme")
|
||||
@Injectable()
|
||||
@Component({
|
||||
selector: 'fm-map-feature-list-croppingscheme',
|
||||
templateUrl: './feature-list-croppingscheme.component.html',
|
||||
styleUrls: ['./feature-list-croppingscheme.component.scss']
|
||||
})
|
||||
export class FeatureListCroppingschemeComponent extends AbstractFeatureListComponent {
|
||||
|
||||
constructor(store: Store<mapReducers.State | commonReducers.State>, itemTypeService: ItemTypeService, location: Location, private router: Router) {
|
||||
super(store, itemTypeService, location);
|
||||
}
|
||||
|
||||
handleFeatureClick(feature) {
|
||||
var queryState = tassign(mapReducers.initialState.queryState, { parentCode: feature.get('code'), itemType: "vnd.farmmaps.itemtype.cropfield" });
|
||||
this.store.dispatch(new mapActions.DoQuery(queryState));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user