1413 ticket.summary refactor checkbox triple state
gitea/salix/dev This commit looks good Details

This commit is contained in:
Bernat 2019-05-09 14:40:59 +02:00
parent a19f9e003d
commit e6d6e63255
4 changed files with 28 additions and 2 deletions

View File

@ -43,7 +43,7 @@
</span>
</vn-td>
<vn-td expand>
<span
<span
class="link"
ng-click="$ctrl.showWorkerDescriptor($event, request.atenderFk)">
{{::request.atender.user.nickname | dashIfEmpty}}
@ -63,6 +63,7 @@
<vn-check vn-one
field="::request.isOk"
triple-state="true"
title="{{$ctrl.getRequestState(request.isOk)}}"
disabled="true">
</vn-check>
</vn-td>

View File

@ -67,6 +67,17 @@ class Controller {
this.$.workerDescriptor.parent = event.target;
this.$.workerDescriptor.show();
}
getRequestState(state) {
switch (state) {
case null:
return 'New';
case false:
return 'Denied';
case true:
return 'Acepted';
}
}
}
Controller.$inject = ['$scope', '$stateParams'];

View File

@ -184,8 +184,11 @@
</span>
</vn-td>
<vn-td number>
<vn-check vn-one
field="::request.isOk"
field="::request.isOk"
triple-state="true"
title="{{$ctrl.getRequestState(request.isOk)}}"
disabled="true">
</vn-check>
</vn-td>

View File

@ -84,6 +84,17 @@ class Controller {
this.getSummary();
});
}
getRequestState(state) {
switch (state) {
case null:
return 'New';
case false:
return 'Denied';
case true:
return 'Acepted';
}
}
}
Controller.$inject = ['$scope', '$state', '$http', 'vnApp', '$translate'];