pull request changes

This commit is contained in:
Bernat Exposito Domenech 2020-03-11 12:03:55 +01:00
parent e92030ec6e
commit d0b0c9d060
6 changed files with 10 additions and 16 deletions

View File

@ -167,6 +167,9 @@ export default class Watcher extends Component {
); );
}); });
} }
/**
* return the request method.
*/
requestMethod() { requestMethod() {
return this.$attrs.save && this.$attrs.save.toLowerCase(); return this.$attrs.save && this.$attrs.save.toLowerCase();
@ -183,7 +186,7 @@ export default class Watcher extends Component {
} }
/** /**
* Checks if data is ready to send. * Checks if the form is valid.
*/ */
isInvalid() { isInvalid() {
if (this.form && this.form.$invalid) if (this.form && this.form.$invalid)

View File

@ -129,5 +129,5 @@
"ORDER_ROW_UNAVAILABLE": "No hay disponibilidad de este producto", "ORDER_ROW_UNAVAILABLE": "No hay disponibilidad de este producto",
"Distance must be lesser than 1000": "La distancia debe ser inferior a 1000", "Distance must be lesser than 1000": "La distancia debe ser inferior a 1000",
"This ticket is deleted": "Este ticket está eliminado", "This ticket is deleted": "Este ticket está eliminado",
"The introduced data already exists": "La información introducida ya existe" "A travel with this data already exists": "Ya existe un travel con estos datos"
} }

View File

@ -10,7 +10,7 @@ module.exports = Self => {
Self.rewriteDbError(function(err) { Self.rewriteDbError(function(err) {
if (err.code === 'ER_DUP_ENTRY') if (err.code === 'ER_DUP_ENTRY')
return new UserError('The introduced data already exists'); return new UserError('A travel with this data already exists');
return err; return err;
}); });
}; };

View File

@ -5,21 +5,11 @@ class Controller extends Section {
constructor($element, $, $stateParams) { constructor($element, $, $stateParams) {
super($element, $); super($element, $);
this.$stateParams = $stateParams; this.$stateParams = $stateParams;
this.travel = {};
} }
$onChanges() { $onChanges() {
if (this.$stateParams && this.$stateParams.q) if (this.$stateParams && this.$stateParams.q)
this._travel = JSON.parse(this.$stateParams.q); this.travel = JSON.parse(this.$stateParams.q);
}
get travel() {
return this._travel;
}
set travel(value) {
this._travel = value;
if (!value) return;
} }
onSubmit() { onSubmit() {

View File

@ -36,7 +36,7 @@ describe('Travel Component vnTravelCreate', () => {
controller.$onChanges(); controller.$onChanges();
expect(controller._travel).toEqual(json); expect(controller.travel).toEqual(json);
}); });
}); });
}); });

View File

@ -1,2 +1,3 @@
Do you want to clone this travel?: ¿Desea clonar este envio? Do you want to clone this travel?: ¿Desea clonar este envio?
All it's properties will be copied: Todas sus propiedades serán copiadas All it's properties will be copied: Todas sus propiedades serán copiadas
Clone: Clonar