Merge branch '2165-travel_index_buttonClon' of verdnatura/salix into dev
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Bernat Exposito 2020-03-11 12:28:41 +00:00 committed by Gitea
commit 79498fe4a0
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