diff --git a/bower.json b/bower.json index f22968c..159b628 100644 --- a/bower.json +++ b/bower.json @@ -33,6 +33,7 @@ "paper-listbox": "polymerelements/paper-listbox#^1.1.2", "paper-item": "PolymerElements/paper-item#^1.2.1", "paper-input": "PolymerElements/paper-input#^1.1.24", + "paper-checkbox": "PolymerElements/paper-checkbox#^1.4.2", "paper-radio-group": "PolymerElements/paper-radio-group#^1.2.2" }, "devDependencies": { diff --git a/strolch-wc-inspector-behavior.html b/strolch-wc-inspector-behavior.html new file mode 100644 index 0000000..36764f1 --- /dev/null +++ b/strolch-wc-inspector-behavior.html @@ -0,0 +1,81 @@ + \ No newline at end of file diff --git a/strolch-wc-inspector-object.html b/strolch-wc-inspector-object.html index b154154..8de1972 100644 --- a/strolch-wc-inspector-object.html +++ b/strolch-wc-inspector-object.html @@ -16,6 +16,8 @@ + + @@ -418,14 +420,11 @@ is: 'strolch-wc-inspector-object', + behaviors: [ + StrolchInspectorBehavior + ], + properties: { - basePath: { - type: String, - value: './' - }, - dlgTitle: { - type: String - }, realm: { type: String, value: function () { @@ -648,13 +647,6 @@ _handleAjaxResponse: function (evt) { console.log('NOT YET DEFINED!'); - }, - - _handleAjaxError: function (data) { - this.fire('strolch-handle-ajax-error', { - title: this.dlgTitle, - detail: data.detail - }); } }); diff --git a/strolch-wc-inspector-objects.html b/strolch-wc-inspector-objects.html index 9e253fa..c70e50f 100644 --- a/strolch-wc-inspector-objects.html +++ b/strolch-wc-inspector-objects.html @@ -13,6 +13,7 @@ + @@ -237,14 +238,14 @@ content-type="application/json" handle-as="json" on-response="_handleAjaxResponse" - on-error="_handleAjaxError"> + on-error="onAjaxError"> + on-error="onAjaxError"> @@ -254,14 +255,11 @@ is: 'strolch-wc-inspector-objects', + behaviors: [ + StrolchInspectorBehavior + ], + properties: { - basePath: { - type: String, - value: './' - }, - dlgTitle: { - type: String - }, realm: { type: String, value: function () { @@ -591,13 +589,6 @@ _handleAjaxResponse: function (evt) { console.log('NOT YET DEFINED!'); - }, - - _handleAjaxError: function (data) { - this.fire('strolch-handle-ajax-error', { - title: this.dlgTitle, - detail: data.detail - }); } }); diff --git a/strolch-wc-inspector.html b/strolch-wc-inspector.html index a5f8742..46ce09f 100644 --- a/strolch-wc-inspector.html +++ b/strolch-wc-inspector.html @@ -17,6 +17,7 @@ + @@ -95,7 +96,7 @@
- + @@ -185,17 +186,11 @@ is: 'strolch-wc-inspector', + behaviors: [ + StrolchInspectorBehavior + ], + properties: { - basePath: { - type: String, - value: './' - }, - dlgTitle: { - type: String - }, - dlgText: { - type: String - }, realms: { type: Array, value: function () { @@ -258,10 +253,23 @@ }, listeners: { - "strolch-handle-ajax-error": "onAjaxError", "strolch-show-dialog": "onShowDialog" }, + onStrolchImport: function (event) { + this.reload(); + this.showError('Import complete', event.detail.msg); + }, + onShowDialog: function (event) { + this.showError(event.detail.title, event.detail.text); + }, + showError: function (title, text) { + this.dlgTitle = title; + this.dlgText = text; + console.log('ERROR: ' + this.dlgTitle + ': ' + this.dlgText); + this.$.dlg.open(); + }, + selectedRealmChanged: function (newValue, oldValue) { if (newValue != null) { console.log('Selected realm changed from ' + oldValue + " to " + newValue); @@ -277,43 +285,6 @@ } }, - onStrolchImport: function (event) { - this.reload(); - this.showError('Import complete', event.detail.msg); - }, - - onAjaxError: function (event) { - var dlgTitle = event.detail.title; - var data = event.detail; - var dlgText; - if (data.detail.request.response) { - if (data.detail.request.response.msg) { - dlgText = data.detail.request.response.msg; - } else if (data.detail.request.response.charAt(0) == '{') { - var json = JSON.parse(data.detail.request.response); - if (json.msg) { - dlgText = json.msg; - } else { - dlgText = data.detail.request.response; - } - } else { - dlgText = data.detail.request.response; - } - } else { - dlgText = data.detail.error; - } - - this.fire('strolch-show-dialog', { - title: dlgTitle, - text: dlgText - }); - }, - onShowDialog: function (event) { - var dlgTitle = event.detail.title; - var dlgText = event.detail.text; - this.showError(dlgTitle, dlgText); - }, - ready: function () { // }, @@ -467,24 +438,6 @@ _handleAjaxResponse: function (evt) { console.log('NOT YET DEFINED!'); - }, - - _handleAjaxError: function (data) { - var dlgTitle = 'Debug action failed'; - var dlgText; - if (data.detail.request.response) { - dlgText = data.detail.request.response.msg; - } else { - dlgText = data.detail.error; - } - this.showError(dlgTitle, dlgText); - }, - - showError: function (title, text) { - this.dlgTitle = title; - this.dlgText = text; - console.log('ERROR: ' + this.dlgTitle + ': ' + this.dlgText); - this.$.dlg.open(); } }); diff --git a/strolch-wc-role-privilege.html b/strolch-wc-role-privilege.html new file mode 100644 index 0000000..e623854 --- /dev/null +++ b/strolch-wc-role-privilege.html @@ -0,0 +1,248 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/strolch-wc-role.html b/strolch-wc-role.html new file mode 100644 index 0000000..bb881dc --- /dev/null +++ b/strolch-wc-role.html @@ -0,0 +1,149 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/strolch-wc-roles.html b/strolch-wc-roles.html new file mode 100644 index 0000000..cb7d939 --- /dev/null +++ b/strolch-wc-roles.html @@ -0,0 +1,142 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/strolch-wc-sessions.html b/strolch-wc-sessions.html index 561b59f..057be7c 100644 --- a/strolch-wc-sessions.html +++ b/strolch-wc-sessions.html @@ -17,6 +17,8 @@ + + @@ -112,17 +114,11 @@ is: 'strolch-wc-sessions', + behaviors: [ + StrolchInspectorBehavior + ], + properties: { - basePath: { - type: String, - value: './' - }, - dlgTitle: { - type: String - }, - dlgText: { - type: String - }, sessions: { type: Array } @@ -145,38 +141,17 @@ return user.firstname + ' ' + user.lastname; }, - listeners: {}, - - onAjaxError: function (event) { - var dlgTitle = event.detail.title; - var data = event.detail; - var dlgText; - if (data.detail.request.response) { - if (data.detail.request.response.msg) { - dlgText = data.detail.request.response.msg; - } else if (data.detail.request.response.charAt(0) == '{') { - var json = JSON.parse(data.detail.request.response); - if (json.msg) { - dlgText = json.msg; - } else { - dlgText = data.detail.request.response; - } - } else { - dlgText = data.detail.request.response; - } - } else { - dlgText = data.detail.error; - } - - this.fire('strolch-show-dialog', { - title: dlgTitle, - text: dlgText - }); + listeners: { + "strolch-show-dialog": "onShowDialog" }, onShowDialog: function (event) { - var dlgTitle = event.detail.title; - var dlgText = event.detail.text; - this.showError(dlgTitle, dlgText); + this.showError(event.detail.title, event.detail.text); + }, + showError: function (title, text) { + this.dlgTitle = title; + this.dlgText = text; + console.log('ERROR: ' + this.dlgTitle + ': ' + this.dlgText); + this.$.dlg.open(); }, ready: function () { @@ -210,24 +185,6 @@ _handleAjaxResponse: function (evt) { console.log('NOT YET DEFINED!'); - }, - - _handleAjaxError: function (data) { - var dlgTitle = 'Debug action failed'; - var dlgText; - if (data.detail.request.response) { - dlgText = data.detail.request.response.msg; - } else { - dlgText = data.detail.error; - } - this.showError(dlgTitle, dlgText); - }, - - showError: function (title, text) { - this.dlgTitle = title; - this.dlgText = text; - console.log('ERROR: ' + this.dlgTitle + ': ' + this.dlgText); - this.$.dlg.open(); } }); diff --git a/strolch-wc-users.html b/strolch-wc-users.html index 72476de..46a4e27 100644 --- a/strolch-wc-users.html +++ b/strolch-wc-users.html @@ -20,6 +20,8 @@ + + @@ -227,17 +229,11 @@ is: 'strolch-wc-users', + behaviors: [ + StrolchInspectorBehavior + ], + properties: { - basePath: { - type: String, - value: './' - }, - dlgTitle: { - type: String - }, - dlgText: { - type: String - }, roles: { type: Array }, @@ -253,61 +249,21 @@ } }, - toLocalDateTime: function (val) { - return Strolch.toLocalDateTime(val); - }, - arrayToString: function (arr) { - var s = ''; - for (var i = 0; i < arr.length; i++) { - s += arr[i]; - if (i + 1 < arr.length) - s += ', '; - } - - return s; - }, - isEmptyString: function (v) { - return v != null && v.length == 0 - }, - isNotEmptyString: function (v) { - return v != null && v.length > 0 - }, _getName: function (user) { return user.firstname + ' ' + user.lastname; }, - listeners: {}, - - onAjaxError: function (event) { - var dlgTitle = event.detail.title; - var data = event.detail; - var dlgText; - if (data.detail.request.response) { - if (data.detail.request.response.msg) { - dlgText = data.detail.request.response.msg; - } else if (data.detail.request.response.charAt(0) == '{') { - var json = JSON.parse(data.detail.request.response); - if (json.msg) { - dlgText = json.msg; - } else { - dlgText = data.detail.request.response; - } - } else { - dlgText = data.detail.request.response; - } - } else { - dlgText = data.detail.error; - } - - this.fire('strolch-show-dialog', { - title: dlgTitle, - text: dlgText - }); + listeners: { + "strolch-show-dialog": "onShowDialog" }, onShowDialog: function (event) { - var dlgTitle = event.detail.title; - var dlgText = event.detail.text; - this.showError(dlgTitle, dlgText); + this.showError(event.detail.title, event.detail.text); + }, + showError: function (title, text) { + this.dlgTitle = title; + this.dlgText = text; + console.log('ERROR: ' + this.dlgTitle + ': ' + this.dlgText); + this.$.dlg.open(); }, ready: function () { @@ -420,16 +376,6 @@ console.log('NOT YET DEFINED!'); }, - _handleAjaxError: function (data) { - var dlgText; - if (data.detail.request.response) { - dlgText = data.detail.request.response.msg; - } else { - dlgText = data.detail.error; - } - this.showError(this.dlgTitle, dlgText); - }, - _validateUser: function (user) { if (this.isEmptyString(user.username)) return 'Username is not set!'; @@ -509,13 +455,6 @@ this.selectedRoles = selectedRoles; this.$.userDlg.open(); - }, - - showError: function (title, text) { - this.dlgTitle = title; - this.dlgText = text; - console.log('ERROR: ' + this.dlgTitle + ': ' + this.dlgText); - this.$.dlg.open(); } });