1457 client.sample.index
gitea/salix/dev This commit looks good Details

This commit is contained in:
Bernat 2019-05-22 07:50:08 +02:00
parent fe250b8269
commit 1769b03846
2 changed files with 27 additions and 4 deletions

View File

@ -23,8 +23,16 @@
<vn-tbody>
<vn-tr ng-repeat="sample in samples">
<vn-td>{{::sample.created | dateTime:'dd/MM/yyyy HH:mm' }}</vn-td>
<vn-td>{{::sample.type.description}}</vn-td>
<vn-td>{{::sample.worker.user.nickname}}</vn-td>
<vn-td
title="{{::sample.type.description}}">
{{::sample.type.description}}
</vn-td>
<vn-td>
<span class="link"
ng-click="$ctrl.showWorkerDescriptor($event, sample.worker.id)">
{{::sample.worker.user.nickname}}
</span>
</vn-td>
<vn-td>{{::sample.company.code}}</vn-td>
</vn-tr>
</vn-tbody>
@ -33,6 +41,10 @@
<vn-pagination model="model"></vn-pagination>
</vn-card>
</vn-vertical>
<vn-worker-descriptor-popover
vn-id="workerDescriptor"
worker-fk="$ctrl.selectedWorker">
</vn-worker-descriptor-popover>
<a ui-sref="client.card.sample.create" vn-tooltip="Send sample"
vn-bind="+" fixed-bottom-right>
<vn-float-button icon="add"></vn-float-button>

View File

@ -1,7 +1,8 @@
import ngModule from '../../module';
class Controller {
constructor($stateParams) {
constructor($scope, $stateParams) {
this.$ = $scope;
this.$stateParams = $stateParams;
this.filter = {
include: [
@ -32,9 +33,19 @@ class Controller {
]
};
}
showWorkerDescriptor(event, workerFk) {
if (event.defaultPrevented) return;
event.preventDefault();
event.stopImmediatePropagation();
this.selectedWorker = workerFk;
this.$.workerDescriptor.parent = event.target;
this.$.workerDescriptor.show();
}
}
Controller.$inject = ['$stateParams'];
Controller.$inject = ['$scope', '$stateParams'];
ngModule.component('vnClientSampleIndex', {
template: require('./index.html'),