cleaned comments and debugging
diff --git a/xos/configurations/common/admin-openrc.sh b/xos/configurations/common/admin-openrc.sh
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/xos/configurations/common/admin-openrc.sh
diff --git a/xos/core/xoslib/karma.conf.js b/xos/core/xoslib/karma.conf.js
index 5c9818a..5eba2fe 100644
--- a/xos/core/xoslib/karma.conf.js
+++ b/xos/core/xoslib/karma.conf.js
@@ -37,7 +37,7 @@
// list of files to exclude
exclude: [
- '**/xos-utils.test.js' //skip this test, useful in dev, comment before commit
+ //'**/xos-utils.test.js' //skip this test, useful in dev, comment before commit
],
diff --git a/xos/core/xoslib/spec/xoslib/xos-backbone.test.js b/xos/core/xoslib/spec/xoslib/xos-backbone.test.js
index df5b20b..f97cc07 100644
--- a/xos/core/xoslib/spec/xoslib/xos-backbone.test.js
+++ b/xos/core/xoslib/spec/xoslib/xos-backbone.test.js
@@ -8,7 +8,7 @@
});
});
- xdescribe('get_defaults mehod', () => {
+ describe('get_defaults mehod', () => {
it('should return default config', () => {
let res = get_defaults('test');
@@ -22,7 +22,7 @@
});
- xdescribe('The extend_defaults method', () => {
+ describe('The extend_defaults method', () => {
it('should return an extended config', () => {
let extended = extend_defaults('test', {extended: true});
@@ -223,7 +223,7 @@
});
});
- xdescribe('getCookie method with no cookie', () => {
+ describe('getCookie method with no cookie', () => {
beforeEach(() => {
document.cookie = 'fakeCookie=true=;expires=Thu, 01 Jan 1970 00:00:01 GMT;';
@@ -235,7 +235,7 @@
});
});
- xdescribe('getCookie method with a fake cookie', () => {
+ describe('getCookie method with a fake cookie', () => {
beforeEach(() => {
document.cookie = 'fakeCookie=true';
@@ -248,7 +248,7 @@
});
});
-xdescribe('The XOSModel', () => {
+describe('The XOSModel', () => {
var model;
diff --git a/xos/core/xoslib/static/js/xosTenant.js b/xos/core/xoslib/static/js/xosTenant.js
index 24af63f..f933c89 100644
--- a/xos/core/xoslib/static/js/xosTenant.js
+++ b/xos/core/xoslib/static/js/xosTenant.js
@@ -289,9 +289,6 @@
'Create Slice': function() {
var addDialog = this;
- // TODO
- // we should validate the slice with the custom xosValidate function defined in define_modle (xos-backbone.js:755)
-
detailView.synchronous = true;
detailView.afterSave = function() {
$(addDialog).dialog('close');
diff --git a/xos/core/xoslib/static/js/xoslib/xos-backbone.js b/xos/core/xoslib/static/js/xoslib/xos-backbone.js
index 6b4134f..a677d88 100644
--- a/xos/core/xoslib/static/js/xoslib/xos-backbone.js
+++ b/xos/core/xoslib/static/js/xoslib/xos-backbone.js
@@ -461,6 +461,8 @@
modelAttrs[key] = value;
collectionAttrs[key] = value;
}
+ // NOTE xosValidate added by Matteo Scandolo
+ // check with Scott
if ($.inArray(key, ["validate", "preSave", "readOnlyFields", "xosValidate"]) >= 0) {
modelAttrs[key] = value;
}
diff --git a/xos/core/xoslib/static/js/xoslib/xosHelper.js b/xos/core/xoslib/static/js/xoslib/xosHelper.js
index 50be612..16046ae 100644
--- a/xos/core/xoslib/static/js/xoslib/xosHelper.js
+++ b/xos/core/xoslib/static/js/xoslib/xosHelper.js
@@ -574,10 +574,8 @@
validation error before creating the infoMsg in the log
*/
- // NOTE
- // this does NOT trigger the xosValidate function define in the model (eg: xos-backbone-js:755)
errors = this.model.xosValidate(data);
- console.log(this.model.xosValidate);
+
if (errors) {
this.onFormDataInvalid(errors);
return;