From 80bbd9e5d4a46bbbaab9868f4e3bb0fb72e3f26b Mon Sep 17 00:00:00 2001 From: dherrero Date: Wed, 11 Oct 2017 14:21:32 +0200 Subject: [PATCH 1/2] bug fixed in datePicker --- client/core/src/datePicker/datePicker.js | 5 +++-- client/route/src/create/create.html | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/client/core/src/datePicker/datePicker.js b/client/core/src/datePicker/datePicker.js index 79d7d6cd9..43f34d9df 100644 --- a/client/core/src/datePicker/datePicker.js +++ b/client/core/src/datePicker/datePicker.js @@ -37,7 +37,8 @@ class DatePicker extends Component { set model(value) { this._model = value; if (value && !this.modelView) { - let format = this._formatFlat2Angular(this.iniOptions.dateFormat || 'Y-m-d'); + let initialDateFormat = (this.iniOptions && this.iniOptions.dateFormat) ? this.iniOptions.dateFormat : 'Y-m-d'; + let format = this._formatFlat2Angular(initialDateFormat); this.modelView = this.$filter('date')(value, format); } } @@ -83,7 +84,7 @@ class DatePicker extends Component { let model; if (!value) { model = undefined; - } else if (!this.iniOptions.dateFormat || (this.iniOptions.dateFormat && this.iniOptions.dateFormat.startsWith('Y-m-d'))) { + } else if (!this.iniOptions || (this.iniOptions.dateFormat && this.iniOptions.dateFormat.startsWith('Y-m-d'))) { model = value; } else { let formats = this.iniOptions.dateFormat.split(/[ZT.,/ :-]/); diff --git a/client/route/src/create/create.html b/client/route/src/create/create.html index 90430b090..c85ae935c 100644 --- a/client/route/src/create/create.html +++ b/client/route/src/create/create.html @@ -11,7 +11,7 @@ Create Route - + From f24e16b81d3695496008562e23f62127b461fb9c Mon Sep 17 00:00:00 2001 From: dherrero Date: Wed, 11 Oct 2017 15:00:18 +0200 Subject: [PATCH 2/2] moved model agency --- client/route/src/create/create.html | 7 ++++++- services/production/common/models/agency.js | 5 ----- services/route/server/model-config.json | 4 ++++ .../{production/common => service}/methods/agency/list.js | 0 services/service/models/agency.js | 3 +++ services/{production/common => service}/models/agency.json | 4 ---- 6 files changed, 13 insertions(+), 10 deletions(-) delete mode 100644 services/production/common/models/agency.js rename services/{production/common => service}/methods/agency/list.js (100%) create mode 100644 services/service/models/agency.js rename services/{production/common => service}/models/agency.json (88%) diff --git a/client/route/src/create/create.html b/client/route/src/create/create.html index c85ae935c..d1f8d77e9 100644 --- a/client/route/src/create/create.html +++ b/client/route/src/create/create.html @@ -12,7 +12,12 @@ Create Route - + + diff --git a/services/production/common/models/agency.js b/services/production/common/models/agency.js deleted file mode 100644 index ac3aec84a..000000000 --- a/services/production/common/models/agency.js +++ /dev/null @@ -1,5 +0,0 @@ -var app = require('../../server/server'); - -module.exports = function(Agency) { - require('../methods/agency/list.js')(Agency); -}; \ No newline at end of file diff --git a/services/route/server/model-config.json b/services/route/server/model-config.json index da305afb0..837396e47 100644 --- a/services/route/server/model-config.json +++ b/services/route/server/model-config.json @@ -47,5 +47,9 @@ }, "Zone": { "dataSource": "vn" + }, + "Agency": { + "dataSource": "vn", + "public": true } } diff --git a/services/production/common/methods/agency/list.js b/services/service/methods/agency/list.js similarity index 100% rename from services/production/common/methods/agency/list.js rename to services/service/methods/agency/list.js diff --git a/services/service/models/agency.js b/services/service/models/agency.js new file mode 100644 index 000000000..51351c00a --- /dev/null +++ b/services/service/models/agency.js @@ -0,0 +1,3 @@ +module.exports = function(Agency) { + require('../methods/agency/list.js')(Agency); +}; diff --git a/services/production/common/models/agency.json b/services/service/models/agency.json similarity index 88% rename from services/production/common/models/agency.json rename to services/service/models/agency.json index 69daf7b58..bca21ae29 100644 --- a/services/production/common/models/agency.json +++ b/services/service/models/agency.json @@ -11,10 +11,6 @@ "name": { "type": "String", "required": false - }, - "tpv":{ - "type": "Number", - "required": false } }, "acls": [