Secret removed from worker/pbx
gitea/salix/master This commit looks good Details

This commit is contained in:
Juan Ferrer 2019-06-17 11:14:45 +02:00
parent 9a18d0bd8c
commit da01d52756
9 changed files with 16 additions and 29 deletions

View File

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

View File

@ -17,9 +17,6 @@
},
"extension": {
"type": "Number"
},
"secret": {
"type": "String"
}
},
"relations": {

View File

@ -552,8 +552,7 @@ export default {
confirmButton: 'vn-order-line > vn-confirm button[response="ACCEPT"]',
},
workerPbx: {
extensionInput: 'vn-worker-pbx vn-input-number[model="$ctrl.worker.sip.extension"] input',
passwordInput: 'vn-worker-pbx vn-textfield[model="$ctrl.worker.sip.secret"] input',
extensionInput: 'vn-worker-pbx vn-textfield[model="$ctrl.worker.sip.extension"] input',
saveButton: 'vn-worker-pbx vn-submit[label="Save"] input'
},
routeIndex: {

View File

@ -25,11 +25,9 @@ describe('Worker pbx path', () => {
const result = await nightmare
.clearInput(selectors.workerPbx.extensionInput)
.write(selectors.workerPbx.extensionInput, 4444)
.clearInput(selectors.workerPbx.passwordInput)
.write(selectors.workerPbx.passwordInput, 666666)
.waitToClick(selectors.workerPbx.saveButton)
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
expect(result).toEqual('Data saved! User must access web');
});
});

View File

@ -1,5 +1,5 @@
{
"PHONE_INVALID_FORMAT": "El formato del teléfono no es correcto",
"Phone format is invalid": "El formato del teléfono no es correcto",
"You are not allowed to change the credit": "No tienes privilegios para modificar el crédito",
"Unable to mark the equivalence surcharge": "No se puede marcar el recargo de equivalencia",
"The default consignee can not be unchecked": "No se puede desmarcar el consignatario predeterminado",
@ -75,13 +75,13 @@
"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",
"EXTENSION_INVALID_FORMAT": "La extensión es invalida",
"We weren't able to send this SMS": "No hemos podido enviar el SMS",
"This client can't be invoiced": "Este cliente no puede ser facturado",
"This ticket can't be invoiced": "Este ticket no puede ser facturado",
"That item is not available on that day": "El item no esta disponible para esa fecha",
"That item doesn't exists": "That item doesn't exists",
"That item doesn't exists": "El artículo no existe",
"You cannot add or modify services to an invoiced ticket": "No puedes añadir o modificar servicios a un ticket facturado",
"This ticket can not be modified": "Este ticket no puede ser modificado",
"NOT_ZONE_WITH_THIS_PARAMETERS": "Para este día no hay ninguna zona configurada"
"NOT_ZONE_WITH_THIS_PARAMETERS": "Para este día no hay ninguna zona configurada",
"Extension format is invalid": "El formato de la extensión es inválido"
}

View File

@ -36,7 +36,7 @@ module.exports = Self => {
Self.download = async function(id) {
let file;
let env = process.env.NODE_ENV;
let [invoice] = await Self.rawSql(`SELECT hedera.invoiceGetPath(?) path`, [id]);
let [invoice] = await Self.rawSql(`SELECT invoiceOut_getPath(?) path`, [id]);
if (env && env != 'development') {
file = {

View File

@ -15,4 +15,5 @@ Fiscal Identifier: NIF
User name: Usuario
Departments: Departamentos
Calendar: Calendario
Search workers by id, firstName, lastName or user name: Buscar trabajadores por el identificador, nombre, apellidos o nombre de usuario
Search workers by id, firstName, lastName or user name: Buscar trabajadores por el identificador, nombre, apellidos o nombre de usuario
Data saved! User must access web: ¡Datos guardados! El usuario deberá acceder con su contraseña a la web para que los cambios surtan efecto.

View File

@ -6,14 +6,9 @@
<vn-card pad-large>
<vn-vertical>
<vn-horizontal>
<vn-input-number vn-one min="1" step="1"
<vn-textfield vn-one
label="Extension"
model="$ctrl.worker.sip.extension">
</vn-input-number>
<vn-textfield
vn-one
label="Password"
model="$ctrl.worker.sip.secret">
</vn-textfield>
</vn-horizontal>
</vn-vertical>

View File

@ -1,27 +1,28 @@
import ngModule from '../module';
class Controller {
constructor($scope, $http) {
constructor($scope, $http, vnApp, $translate) {
this.$scope = $scope;
this.$http = $http;
this.vnApp = vnApp;
this._ = $translate;
}
onSubmit() {
const sip = this.worker.sip;
const params = {
userFk: this.worker.userFk,
extension: sip.extension,
secret: sip.secret
extension: sip.extension
};
this.$scope.watcher.check();
this.$http.patch('/api/Sips', params).then(() => {
this.$scope.watcher.updateOriginalData();
this.$scope.watcher.notifySaved();
this.vnApp.showSuccess(this._.instant('Data saved! User must access web'));
});
}
}
Controller.$inject = ['$scope', '$http'];
Controller.$inject = ['$scope', '$http', 'vnApp', '$translate'];
ngModule.component('vnWorkerPbx', {
template: require('./index.html'),