2018-12-04 12:18:27 +00:00
|
|
|
import ngModule from '../module';
|
2020-04-25 09:50:04 +00:00
|
|
|
import Descriptor from 'salix/components/descriptor';
|
2018-12-04 12:18:27 +00:00
|
|
|
|
2020-04-25 09:50:04 +00:00
|
|
|
class Controller extends Descriptor {
|
2020-03-18 11:55:22 +00:00
|
|
|
$onInit() {
|
2018-12-04 12:18:27 +00:00
|
|
|
this.moreOptions = [
|
2020-04-25 09:50:04 +00:00
|
|
|
{
|
|
|
|
name: 'Delete',
|
|
|
|
callback: () => this.$.deleteZone.show(),
|
|
|
|
}
|
2018-12-04 12:18:27 +00:00
|
|
|
];
|
|
|
|
}
|
2018-12-04 13:38:56 +00:00
|
|
|
|
|
|
|
onMoreChange(callback) {
|
|
|
|
callback.call(this);
|
|
|
|
}
|
|
|
|
|
2020-04-25 09:50:04 +00:00
|
|
|
onDeleteAccept() {
|
|
|
|
return this.$http.delete(`Zones/${this.zone.id}`).then(() => {
|
|
|
|
this.$state.go('zone.index');
|
|
|
|
});
|
2018-12-04 13:38:56 +00:00
|
|
|
}
|
2018-12-04 12:18:27 +00:00
|
|
|
}
|
|
|
|
|
2020-04-25 09:50:04 +00:00
|
|
|
ngModule.vnComponent('vnZoneDescriptor', {
|
2018-12-04 12:18:27 +00:00
|
|
|
template: require('./index.html'),
|
|
|
|
controller: Controller,
|
|
|
|
bindings: {
|
|
|
|
zone: '<'
|
|
|
|
}
|
|
|
|
});
|