Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into dev
gitea/salix/dev This commit has test failures Details

This commit is contained in:
Joan Sanchez 2019-03-29 11:58:52 +01:00
commit 5ff6241e2d
5 changed files with 43 additions and 7 deletions

11
back/models/sip.js Normal file
View File

@ -0,0 +1,11 @@
module.exports = Self => {
// Validations
Self.validatesUniquenessOf('extension', {
message: `The extension must be unique`
});
Self.validatesPresenceOf('secret', {
message: `The secret can't be blank`
});
};

View File

@ -73,5 +73,7 @@
"Street cannot be empty": "Dirección no puede estar en blanco",
"City cannot be empty": "Cuidad no puede estar en blanco",
"Code cannot be blank": "Código no puede estar en blanco",
"You cannot remove this department": "No puedes eliminar este departamento"
"You cannot remove this department": "No puedes eliminar este departamento",
"The extension must be unique": "La extensión debe ser unica",
"The secret can't be blank": "La contraseña no puede estar en blanco"
}

View File

@ -1,11 +1,8 @@
<mg-ajax path="/api/Sips/{{patch.params.id}}" options="vnPatch"></mg-ajax>
<vn-watcher
vn-id="watcher"
data="$ctrl.worker.sip"
form="form"
save="patch">
data="$ctrl.worker.sip">
</vn-watcher>
<form name="form" ng-submit="watcher.submit()" compact>
<form name="form" ng-submit="$ctrl.onSubmit()" compact>
<vn-card pad-large>
<vn-vertical>
<vn-horizontal>

View File

@ -1,7 +1,31 @@
import ngModule from '../module';
class Controller {
constructor($scope, $http) {
this.$scope = $scope;
this.$http = $http;
}
onSubmit() {
const sip = this.worker.sip;
const params = {
userFk: this.worker.userFk,
extension: sip.extension,
secret: sip.secret
};
this.$scope.watcher.check();
this.$http.patch('/api/Sips', params).then(() => {
this.$scope.watcher.updateOriginalData();
this.$scope.watcher.notifySaved();
});
}
}
Controller.$inject = ['$scope', '$http'];
ngModule.component('vnWorkerPbx', {
template: require('./index.html'),
controller: Controller,
bindings: {
worker: '<'
}

4
package-lock.json generated
View File

@ -10821,6 +10821,7 @@
"version": "1.1.11",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@ -10993,6 +10994,7 @@
"version": "3.0.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
@ -16746,7 +16748,7 @@
},
"xmlbuilder": {
"version": "9.0.7",
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz",
"resolved": "http://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz",
"integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0="
},
"xmlcreate": {