1354 refactor item-descriptor-popover
gitea/salix/dev This commit looks good Details

This commit is contained in:
Bernat 2019-05-07 11:32:35 +02:00
parent 810f4462f6
commit 83898c9ba7
15 changed files with 49 additions and 75 deletions

View File

@ -186,8 +186,7 @@
</div>
</vn-popover>
<vn-item-descriptor-popover
vn-id="descriptor"
quicklinks="$ctrl.quicklinks">
vn-id="descriptor">
</vn-item-descriptor-popover>
<vn-ticket-descriptor-popover
vn-id="ticketDescriptor">

View File

@ -161,15 +161,6 @@ class Controller {
}
// Item Descriptor
showDescriptor(event, itemFk) {
this.quicklinks = {
btnThree: {
icon: 'icon-transaction',
state: `item.card.diary({
id: ${itemFk}
})`,
tooltip: 'Item diary'
}
};
this.$.descriptor.itemFk = itemFk;
this.$.descriptor.parent = event.target;
this.$.descriptor.show();

View File

@ -110,6 +110,5 @@
</tpl-body>
</vn-dialog>
<vn-item-descriptor-popover
vn-id="descriptor"
quicklinks="$ctrl.quicklinks">
vn-id="descriptor">
</vn-item-descriptor-popover>

View File

@ -103,15 +103,6 @@ class Controller {
// Item Descriptor
showDescriptor(event, itemFk) {
this.quicklinks = {
btnThree: {
icon: 'icon-transaction',
state: `item.card.diary({
id: ${itemFk}
})`,
tooltip: 'Item diary'
}
};
this.$scope.descriptor.itemFk = itemFk;
this.$scope.descriptor.parent = event.target;
this.$scope.descriptor.show();

View File

@ -151,8 +151,7 @@
</vn-horizontal>
</vn-card>
<vn-item-descriptor-popover
vn-id="itemDescriptor"
quicklinks="$ctrl.quicklinks">
vn-id="itemDescriptor">
</vn-item-descriptor-popover>
<vn-worker-descriptor-popover
vn-id="workerDescriptor"

View File

@ -18,15 +18,6 @@ class Controller {
}
showItemDescriptor(event, itemFk) {
this.quicklinks = {
btnThree: {
icon: 'icon-transaction',
state: `item.card.diary({
id: ${itemFk}
})`,
tooltip: 'Item diary'
}
};
this.$.itemDescriptor.itemFk = itemFk;
this.$.itemDescriptor.parent = event.target;
this.$.itemDescriptor.show();

View File

@ -9,6 +9,7 @@ class Controller extends Component {
this.$http = $http;
this.$q = $q;
this.client = null;
this._quicklinks = {};
}
set clientFk(id) {
@ -28,14 +29,16 @@ class Controller extends Component {
return this._client;
}
set quicklinks(value = {}) {
this._quicklinks = Object.assign(value, this._quicklinks);
}
get quicklinks() {
return this._quicklinks;
}
set quicklinks(value = {}) {
Object.keys(value).forEach(key => {
this._quicklinks[key] = value[key];
});
}
show() {
this.$.popover.parent = this.parent;
this.$.popover.show();

View File

@ -9,6 +9,7 @@ class Controller extends Component {
this.$http = $http;
this.$q = $q;
this.worker = null;
this._quicklinks = {};
}
set invoiceOutId(id) {
@ -23,14 +24,16 @@ class Controller extends Component {
return this._invoiceOutId;
}
set quicklinks(value = {}) {
this._quicklinks = Object.assign(value, this._quicklinks);
}
get quicklinks() {
return this._quicklinks;
}
set quicklinks(value = {}) {
Object.keys(value).forEach(key => {
this._quicklinks[key] = value[key];
});
}
show() {
this.$.popover.parent = this.parent;
this.$.popover.show();

View File

@ -9,6 +9,7 @@ class Controller extends Component {
this.$http = $http;
this.$q = $q;
this.item = null;
this._quicklinks = {};
}
set itemFk(id) {
@ -16,6 +17,15 @@ class Controller extends Component {
this._itemFk = id;
this.item = null;
this._quicklinks = {
btnThree: {
icon: 'icon-transaction',
state: `item.card.diary({
id: ${id},
})`,
tooltip: 'Item diary'
}
};
this.getCard();
}
@ -28,14 +38,16 @@ class Controller extends Component {
return this._item;
}
set quicklinks(value = {}) {
this._quicklinks = Object.assign(value, this._quicklinks);
}
get quicklinks() {
return this._quicklinks;
}
set quicklinks(value = {}) {
Object.keys(value).forEach(key => {
this._quicklinks[key] = value[key];
});
}
show() {
this.$.popover.parent = this.parent;
this.$.popover.show();

View File

@ -139,8 +139,7 @@
question="Do you want to clone this item?"
message="All it's properties will be copied">
</vn-confirm>
<vn-item-descriptor-popover vn-id="itemDescriptor">
</vn-item-descriptor-popover>
<vn-item-descriptor-popover vn-id="itemDescriptor"></vn-item-descriptor-popover>
<vn-worker-descriptor-popover
vn-id="workerDescriptor"
worker-fk="$ctrl.selectedWorker">

View File

@ -53,15 +53,6 @@ class Controller {
event.preventDefault();
event.stopPropagation();
this.quicklinks = {
btnThree: {
icon: 'icon-transaction',
state: `item.card.diary({
id: ${itemFk},
})`,
tooltip: 'Item diary'
}
};
this.$.itemDescriptor.itemFk = itemFk;
this.$.itemDescriptor.parent = event.target;
this.$.itemDescriptor.show();

View File

@ -85,6 +85,5 @@
</vn-horizontal>
</vn-card>
<vn-item-descriptor-popover
vn-id="descriptor"
quicklinks="$ctrl.quicklinks">
vn-id="descriptor">
</vn-item-descriptor-popover>

View File

@ -31,15 +31,6 @@ class Controller {
}
showDescriptor(event, itemFk) {
this.quicklinks = {
btnThree: {
icon: 'icon-transaction',
state: `item.card.diary({
id: ${itemFk},
})`,
tooltip: 'Item diary'
}
};
this.$scope.descriptor.itemFk = itemFk;
this.$scope.descriptor.parent = event.target;
this.$scope.descriptor.show();

View File

@ -9,6 +9,7 @@ class Controller extends Component {
this.$http = $http;
this.$q = $q;
this.ticket = null;
this._quicklinks = {};
}
set ticketFk(id) {
@ -28,14 +29,16 @@ class Controller extends Component {
return this._ticket;
}
set quicklinks(value = {}) {
this._quicklinks = Object.assign(value, this._quicklinks);
}
get quicklinks() {
return this._quicklinks;
}
set quicklinks(value = {}) {
Object.keys(value).forEach(key => {
this._quicklinks[key] = value[key];
});
}
show() {
this.$.popover.parent = this.parent;
this.$.popover.show();

View File

@ -9,6 +9,7 @@ class Controller extends Component {
this.$http = $http;
this.$q = $q;
this.worker = null;
this._quicklinks = {};
}
set workerFk(workerFk) {
@ -23,14 +24,16 @@ class Controller extends Component {
return this._workerFk;
}
set quicklinks(value = {}) {
this._quicklinks = Object.assign(value, this._quicklinks);
}
get quicklinks() {
return this._quicklinks;
}
set quicklinks(value = {}) {
Object.keys(value).forEach(key => {
this._quicklinks[key] = value[key];
});
}
show() {
this.$.popover.parent = this.parent;
this.$.popover.show();