descriptor can now have 4 quicklinks
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Carlos Jimenez Ruiz 2020-07-03 13:28:49 +02:00
parent 3284ef5b55
commit 663b5fb9aa
4 changed files with 24 additions and 3 deletions

View File

@ -94,7 +94,8 @@ ngModule.vnComponent('vnDescriptor', {
transclude: {
btnOne: '?btnOne',
btnTwo: '?btnTwo',
btnThree: '?btnThree'
btnThree: '?btnThree',
btnFour: '?btnFour'
}
});

View File

@ -88,7 +88,7 @@ vn-descriptor-content {
display: flex;
align-items: center;
justify-content: center;
padding: 0 $spacing-md;
padding: 10px 5px;
margin: 0 $spacing-sm;
& > vn-icon {

View File

@ -146,6 +146,20 @@
</vn-quick-link>
</div>
<div ng-transclude="btnTwo">
<vn-quick-link
tooltip="Client ticket list"
state="['ticket.index', {q: $ctrl.filter}]"
icon="icon-ticket">
</vn-quick-link>
</div>
<div ng-transclude="btnThree">
<vn-quick-link
tooltip="New order"
state="['order.create', {clientFk: $ctrl.ticket.clientFk}]"
icon="icon-basketadd">
</vn-quick-link>
</div>
<div ng-transclude="btnFour">
<vn-quick-link
ng-if="$ctrl.ticket.stowaway"
tooltip="Ship stowaways"
@ -153,7 +167,7 @@
icon="icon-stowaway">
</vn-quick-link>
</div>
<div ng-transclude="btnThree">
<div ng-transclude="btnFour">
<vn-quick-link
ng-if="$ctrl.ticket.ship"
tooltip="Stowaway"

View File

@ -38,6 +38,12 @@ class Controller extends Descriptor {
return this.ticket.stowaway || this.ticket.ship;
}
get filter() {
if (this.ticket)
return JSON.stringify({clientFk: this.ticket.clientFk});
return null;
}
isTicketEditable() {
this.$http.get(`Tickets/${this.$state.params.id}/isEditable`).then(res => {
this.isEditable = res.data;