AW-6806 Allow delete
Some checks failed
FarmMaps.Develop/FarmMapsLib/pipeline/head There was a failure building this commit
Some checks failed
FarmMaps.Develop/FarmMapsLib/pipeline/head There was a failure building this commit
This commit is contained in:
parent
fe73f615ad
commit
ac15b2018d
@ -2,7 +2,7 @@ import {Component, Injectable, Input, Directive} from '@angular/core';
|
|||||||
import {Location} from '@angular/common';
|
import {Location} from '@angular/common';
|
||||||
import {Store} from '@ngrx/store';
|
import {Store} from '@ngrx/store';
|
||||||
import * as mapReducers from '../../reducers/map.reducer';
|
import * as mapReducers from '../../reducers/map.reducer';
|
||||||
import {AppConfig, commonReducers, IItem, ItemTypeService} from '@farmmaps/common';
|
import {AppConfig, commonReducers, IItem, ItemService, ItemTypeService} from '@farmmaps/common';
|
||||||
import * as mapActions from '../../actions/map.actions';
|
import * as mapActions from '../../actions/map.actions';
|
||||||
import {Router} from '@angular/router';
|
import {Router} from '@angular/router';
|
||||||
import { IItemLayer } from '../../models/item.layer';
|
import { IItemLayer } from '../../models/item.layer';
|
||||||
@ -15,7 +15,7 @@ export abstract class AbstractSelectedItemComponent {
|
|||||||
@Input() parentItem: IItem;
|
@Input() parentItem: IItem;
|
||||||
@Input() itemLayer: IItemLayer;
|
@Input() itemLayer: IItemLayer;
|
||||||
@Input() overlayLayers: Array<IItemLayer>;
|
@Input() overlayLayers: Array<IItemLayer>;
|
||||||
constructor(public store: Store<mapReducers.State | commonReducers.State>, public itemTypeService: ItemTypeService, private location: Location, public router: Router) {
|
constructor(public store: Store<mapReducers.State | commonReducers.State>, public itemTypeService: ItemTypeService, public itemService: ItemService, private location: Location, public router: Router) {
|
||||||
}
|
}
|
||||||
|
|
||||||
handleOnView(item: IItem) {
|
handleOnView(item: IItem) {
|
||||||
@ -37,6 +37,11 @@ export abstract class AbstractSelectedItemComponent {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleOnDelete(item: IItem) {
|
||||||
|
this.itemService.deleteItem(item.code);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
handleAddAsLayer(item: IItem,layerIndex = -1) {
|
handleAddAsLayer(item: IItem,layerIndex = -1) {
|
||||||
this.store.dispatch(new mapActions.AddLayer(item,layerIndex));
|
this.store.dispatch(new mapActions.AddLayer(item,layerIndex));
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user