From 84737a0bb92e12abaa8d567e3f0269112ac1f034 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Wed, 30 Jan 2019 13:32:25 +0100 Subject: [PATCH 1/2] #997 worker.summary, bugs fixed --- front/core/components/watcher/watcher.js | 21 ++++++----- modules/client/front/basic-data/index.html | 30 +++++++++++---- modules/client/front/routes.json | 1 + modules/worker/front/basic-data/index.html | 44 ++++++++++++---------- modules/worker/front/basic-data/index.js | 15 +++----- modules/worker/front/descriptor/index.html | 16 ++++---- modules/worker/front/index/index.html | 5 +-- 7 files changed, 75 insertions(+), 57 deletions(-) diff --git a/front/core/components/watcher/watcher.js b/front/core/components/watcher/watcher.js index d00d6d782..84383f477 100644 --- a/front/core/components/watcher/watcher.js +++ b/front/core/components/watcher/watcher.js @@ -13,15 +13,18 @@ import UserError from '../../lib/user-error'; * properties are provided. */ export default class Watcher extends Component { - constructor($element, $scope, $state, $transitions, $http, vnApp, $translate, $attrs, $q) { + constructor($element, $, $state, $stateParams, $transitions, $http, vnApp, $translate, $attrs, $q) { super($element); - this.$ = $scope; - this.$state = $state; - this.$http = $http; - this._ = $translate; - this.$attrs = $attrs; - this.vnApp = vnApp; - this.$q = $q; + Object.assign(this, { + $, + $state, + $stateParams, + $http, + _: $translate, + $attrs, + vnApp, + $q + }); this.state = null; this.deregisterCallback = $transitions.onStart({}, @@ -240,7 +243,7 @@ export default class Watcher extends Component { return newCopy; } } -Watcher.$inject = ['$element', '$scope', '$state', '$transitions', '$http', 'vnApp', '$translate', '$attrs', '$q']; +Watcher.$inject = ['$element', '$scope', '$state', '$stateParams', '$transitions', '$http', 'vnApp', '$translate', '$attrs', '$q']; ngModule.component('vnWatcher', { template: require('./watcher.html'), diff --git a/modules/client/front/basic-data/index.html b/modules/client/front/basic-data/index.html index 4ab264050..189cfe261 100644 --- a/modules/client/front/basic-data/index.html +++ b/modules/client/front/basic-data/index.html @@ -8,25 +8,40 @@
- - - + + - - + + + + - {{firstName}} {{name}} - + id-field="id" + url="api/Workers" + save="post"> - - - - - - + + + + + + + + + + + + diff --git a/modules/worker/front/basic-data/index.js b/modules/worker/front/basic-data/index.js index 3b324a17c..28107dc12 100644 --- a/modules/worker/front/basic-data/index.js +++ b/modules/worker/front/basic-data/index.js @@ -1,21 +1,16 @@ import ngModule from '../module'; class Controller { - constructor($, $state) { - Object.assign(this, { - $, - $state - }); + constructor($) { + Object.assign(this, {$}); } onSubmit() { - this.$.watcher.submit().then(() => { - this.card.reload(); - }); + this.$.watcher.submit() + .then(() => this.card.reload()); } } - -Controller.$inject = ['$scope', '$state']; +Controller.$inject = ['$scope']; ngModule.component('vnWorkerBasicData', { template: require('./index.html'), diff --git a/modules/worker/front/descriptor/index.html b/modules/worker/front/descriptor/index.html index 4222ca490..315ad7c9c 100644 --- a/modules/worker/front/descriptor/index.html +++ b/modules/worker/front/descriptor/index.html @@ -10,27 +10,27 @@
-
{{::$ctrl.worker.firstName}} {{::$ctrl.worker.name}}
+
{{$ctrl.worker.firstName}} {{$ctrl.worker.name}}
+ value="{{$ctrl.worker.id}}"> + value="{{$ctrl.worker.user.name}}"> + value="{{$ctrl.worker.user.email}}"> + value="{{$ctrl.worker.client.fi}}"> + value="{{$ctrl.worker.department.department}}"> + value="{{$ctrl.worker.phone}}"> + value="{{$ctrl.worker.sip.phone}}">