Hotfix: Clone option added to vnItemDescriptor
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
134b4be136
commit
b94c97d322
|
@ -99,4 +99,10 @@
|
|||
<input type="button" response="cancel" translate-attr="{value: 'Cancel'}"/>
|
||||
<button response="accept" translate>Save</button>
|
||||
</tpl-buttons>
|
||||
</vn-dialog>
|
||||
</vn-dialog>
|
||||
<vn-confirm
|
||||
vn-id="clone"
|
||||
on-accept="$ctrl.onCloneAccept()"
|
||||
question="Do you want to clone this item?"
|
||||
message="All it's properties will be copied">
|
||||
</vn-confirm>
|
||||
|
|
|
@ -6,7 +6,8 @@ class Controller extends Component {
|
|||
constructor($element, $) {
|
||||
super($element, $);
|
||||
this.moreOptions = [
|
||||
{callback: this.showRegularizeDialog, name: 'Regularize stock'}
|
||||
{callback: this.showRegularizeDialog, name: 'Regularize stock'},
|
||||
{callback: () => this.$.clone.show(), name: 'Clone'}
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -88,6 +89,11 @@ class Controller extends Component {
|
|||
this.warehouseFk = null;
|
||||
this.quantity = null;
|
||||
}
|
||||
|
||||
onCloneAccept() {
|
||||
this.$http.post(`Items/${this.item.id}/clone`)
|
||||
.then(res => this.$state.go('item.card.tags', {id: res.data.id}));
|
||||
}
|
||||
}
|
||||
|
||||
Controller.$inject = ['$element', '$scope'];
|
||||
|
|
Loading…
Reference in New Issue