Repository: qpid-dispatch Updated Branches: refs/heads/master 5cc501dc1 -> 0a35d713c
DISPATCH-771 Show required and unique fields on create entity form Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/0a35d713 Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/0a35d713 Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/0a35d713 Branch: refs/heads/master Commit: 0a35d713c200fb1ee01860d3c4cb4c234234161c Parents: 5cc501d Author: Ernest Allen <[email protected]> Authored: Thu Jun 29 13:31:40 2017 -0400 Committer: Ernest Allen <[email protected]> Committed: Thu Jun 29 13:31:40 2017 -0400 ---------------------------------------------------------------------- .../src/main/webapp/plugin/html/qdrList.html | 9 +++--- .../hawtio/src/main/webapp/plugin/js/qdrList.js | 1 + console/stand-alone/plugin/css/dispatch.css | 29 ++++++++++++++++++++ console/stand-alone/plugin/css/dispatchpf.css | 3 +- console/stand-alone/plugin/html/qdrList.html | 9 +++--- console/stand-alone/plugin/js/qdrList.js | 1 + 6 files changed, 42 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/0a35d713/console/hawtio/src/main/webapp/plugin/html/qdrList.html ---------------------------------------------------------------------- diff --git a/console/hawtio/src/main/webapp/plugin/html/qdrList.html b/console/hawtio/src/main/webapp/plugin/html/qdrList.html index e6f0d3c..9a108e2 100644 --- a/console/hawtio/src/main/webapp/plugin/html/qdrList.html +++ b/console/hawtio/src/main/webapp/plugin/html/qdrList.html @@ -50,13 +50,14 @@ under the License. <td> <div ng-if="attribute.input == 'input'"> <!-- ng-pattern="testPattern(attribute)" --> - <input ng-if="attribute.type == 'number'" type="number" name="{{attribute.name}}" id="{{attribute.name}}" ng-model="attribute.rawValue" ng-required="attribute.required" class="ui-widget-content ui-corner-all"/> - <input ng-if="attribute.type == 'text'" type="text" name="{{attribute.name}}" id="{{attribute.name}}" ng-model="attribute.attributeValue" ng-required="attribute.required" class="ui-widget-content ui-corner-all"/> - <textarea ng-if="attribute.type == 'textarea'" name="{{attribute.name}}" id="{{attribute.name}}" ng-model="attribute.attributeValue" ng-required="attribute.required" class="ui-widget-content ui-corner-all"></textarea> + <div ng-if="attribute.type == 'number'"><input type="number" name="{{attribute.name}}" id="{{attribute.name}}" ng-model="attribute.rawValue" ng-required="attribute.required" ng-class="{required: attribute.required, unique: attribute.unique}" class="ui-widget-content ui-corner-all"/><span ng-if="attribute.required" title="required" class="required-indicator"></span><span ng-if="attribute.unique" title="unique" class="unique-indicator"></span></div> + <div ng-if="attribute.type == 'text'"><input type="text" name="{{attribute.name}}" id="{{attribute.name}}" ng-model="attribute.attributeValue" ng-required="attribute.required" ng-class="{required: attribute.required, unique: attribute.unique}" class="ui-widget-content ui-corner-all"/><span ng-if="attribute.required" title="required" class="required-indicator"></span><span ng-if="attribute.unique" title="unique" class="unique-indicator"></span></div> + <div ng-if="attribute.type == 'textarea'"><textarea name="{{attribute.name}}" id="{{attribute.name}}" ng-model="attribute.attributeValue" ng-required="attribute.required" ng-class="{required: attribute.required, unique: attribute.unique}" class="ui-widget-content ui-corner-all"></textarea><span ng-if="attribute.required" title="required" class="required-indicator"></span><span ng-if="attribute.unique" title="unique" class="unique-indicator"></span></div> <span ng-if="attribute.type == 'disabled'" >{{getAttributeValue(attribute)}}</span> </div> <div ng-if="attribute.input == 'select'"> - <select id="{{attribute.name}}" ng-model="attribute.selected" ng-options="item for item in attribute.rawtype track by item"></select> + <select id="{{attribute.name}}" ng-model="attribute.selected" ng-required="attribute.required" ng-class="{required: attribute.required, unique: attribute.unique}" ng-options="item for item in attribute.rawtype track by item"></select> + <span ng-if="attribute.required" title="required" class="required-indicator"></span><span ng-if="attribute.unique" title="unique" class="unique-indicator"></span> </div> <div ng-if="attribute.input == 'boolean'" class="boolean"> <label><input type="radio" ng-model="attribute.rawValue" ng-value="true"> True</label> http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/0a35d713/console/hawtio/src/main/webapp/plugin/js/qdrList.js ---------------------------------------------------------------------- diff --git a/console/hawtio/src/main/webapp/plugin/js/qdrList.js b/console/hawtio/src/main/webapp/plugin/js/qdrList.js index b2d3806..82f41ba 100644 --- a/console/hawtio/src/main/webapp/plugin/js/qdrList.js +++ b/console/hawtio/src/main/webapp/plugin/js/qdrList.js @@ -382,6 +382,7 @@ var QDR = (function(QDR) { input: schemaEntity.input, type: schemaEntity.type, required: schemaEntity.required, + unique: schemaEntity.unique, selected: schemaEntity.selected, rawtype: schemaEntity.rawtype, disabled: schemaEntity.disabled, http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/0a35d713/console/stand-alone/plugin/css/dispatch.css ---------------------------------------------------------------------- diff --git a/console/stand-alone/plugin/css/dispatch.css b/console/stand-alone/plugin/css/dispatch.css index 33b418a..d0ff9a7 100644 --- a/console/stand-alone/plugin/css/dispatch.css +++ b/console/stand-alone/plugin/css/dispatch.css @@ -707,3 +707,32 @@ div.topoGrid .ui-grid-viewport { .newChart { float: right; } + +select.unique, input.unique { + border: 2px solid blue; +} +select.required, input.required { + border: 2px solid black; +} + +.required-indicator { + padding-left: 0.5em; + font-size: 0.85em; + vertical-align: super; +} + +.required-indicator::before { + content: '(required)' +} + +.unique-indicator { + padding-left: 0.5em; + font-size: 0.85em; + vertical-align: super; +} + +.unique-indicator::before { + content: '(must be unique if supplied)' +} + +.unique-indicator \ No newline at end of file http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/0a35d713/console/stand-alone/plugin/css/dispatchpf.css ---------------------------------------------------------------------- diff --git a/console/stand-alone/plugin/css/dispatchpf.css b/console/stand-alone/plugin/css/dispatchpf.css index aa1583d..15dc0a6 100644 --- a/console/stand-alone/plugin/css/dispatchpf.css +++ b/console/stand-alone/plugin/css/dispatchpf.css @@ -102,8 +102,7 @@ div#list-controller { position: relative; } -#list-controller select, -#list-controller .tree-header { +#list-controller .tree-header, #list-controller .tree-header select { width: 100%; } http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/0a35d713/console/stand-alone/plugin/html/qdrList.html ---------------------------------------------------------------------- diff --git a/console/stand-alone/plugin/html/qdrList.html b/console/stand-alone/plugin/html/qdrList.html index da9952e..8b7800f 100644 --- a/console/stand-alone/plugin/html/qdrList.html +++ b/console/stand-alone/plugin/html/qdrList.html @@ -50,13 +50,14 @@ under the License. <td> <div ng-if="attribute.input == 'input'"> <!-- ng-pattern="testPattern(attribute)" --> - <input ng-if="attribute.type == 'number'" type="number" name="{{attribute.name}}" id="{{attribute.name}}" ng-model="attribute.rawValue" ng-required="attribute.required" class="ui-widget-content ui-corner-all"/> - <input ng-if="attribute.type == 'text'" type="text" name="{{attribute.name}}" id="{{attribute.name}}" ng-model="attribute.attributeValue" ng-required="attribute.required" class="ui-widget-content ui-corner-all"/> - <textarea ng-if="attribute.type == 'textarea'" name="{{attribute.name}}" id="{{attribute.name}}" ng-model="attribute.attributeValue" ng-required="attribute.required" class="ui-widget-content ui-corner-all"></textarea> + <div ng-if="attribute.type == 'number'"><input type="number" name="{{attribute.name}}" id="{{attribute.name}}" ng-model="attribute.rawValue" ng-required="attribute.required" ng-class="{required: attribute.required, unique: attribute.unique}" class="ui-widget-content ui-corner-all"/><span ng-if="attribute.required" title="required" class="required-indicator"></span><span ng-if="attribute.unique" title="unique" class="unique-indicator"></span></div> + <div ng-if="attribute.type == 'text'"><input type="text" name="{{attribute.name}}" id="{{attribute.name}}" ng-model="attribute.attributeValue" ng-required="attribute.required" ng-class="{required: attribute.required, unique: attribute.unique}" class="ui-widget-content ui-corner-all"/><span ng-if="attribute.required" title="required" class="required-indicator"></span><span ng-if="attribute.unique" title="unique" class="unique-indicator"></span></div> + <div ng-if="attribute.type == 'textarea'"><textarea name="{{attribute.name}}" id="{{attribute.name}}" ng-model="attribute.attributeValue" ng-required="attribute.required" ng-class="{required: attribute.required, unique: attribute.unique}" class="ui-widget-content ui-corner-all"></textarea><span ng-if="attribute.required" title="required" class="required-indicator"></span><span ng-if="attribute.unique" title="unique" class="unique-indicator"></span></div> <span ng-if="attribute.type == 'disabled'" >{{getAttributeValue(attribute)}}</span> </div> <div ng-if="attribute.input == 'select'"> - <select id="{{attribute.name}}" ng-model="attribute.selected" ng-options="item for item in attribute.rawtype track by item"></select> + <select id="{{attribute.name}}" ng-model="attribute.selected" ng-required="attribute.required" ng-class="{required: attribute.required, unique: attribute.unique}" ng-options="item for item in attribute.rawtype track by item"></select> + <span ng-if="attribute.required" title="required" class="required-indicator"></span><span ng-if="attribute.unique" title="unique" class="unique-indicator"></span> </div> <div ng-if="attribute.input == 'boolean'" class="boolean"> <label><input type="radio" ng-model="attribute.rawValue" ng-value="true"> True</label> http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/0a35d713/console/stand-alone/plugin/js/qdrList.js ---------------------------------------------------------------------- diff --git a/console/stand-alone/plugin/js/qdrList.js b/console/stand-alone/plugin/js/qdrList.js index 4005178..191b361 100644 --- a/console/stand-alone/plugin/js/qdrList.js +++ b/console/stand-alone/plugin/js/qdrList.js @@ -389,6 +389,7 @@ QDR.log.info("we were just disconnected while on the list page. Setting org to r input: schemaEntity.input, type: schemaEntity.type, required: schemaEntity.required, + unique: schemaEntity.unique, selected: schemaEntity.selected, rawtype: schemaEntity.rawtype, disabled: schemaEntity.disabled, --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
