Skip to content
This repository has been archived by the owner on Jul 18, 2019. It is now read-only.

Commit

Permalink
Support specifying an object attribute for items
Browse files Browse the repository at this point in the history
  • Loading branch information
gashcrumb committed May 29, 2015
1 parent 18d428d commit 2399f1f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
11 changes: 7 additions & 4 deletions dist/hawtio-ui.js
Expand Up @@ -1610,6 +1610,9 @@ var UI;
dialog.close();
options.onClose(result);
};
$scope.getName = function (item) {
return Core.pathGet(item, options.index.split('.'));
};
}]
});
}
Expand Down Expand Up @@ -4083,8 +4086,9 @@ var UIBootstrap;
hawtioPluginLoader.addModule("hawtio-compat.modal");
})(UIBootstrap || (UIBootstrap = {}));

angular.module("hawtio-ui-templates", []).run(["$templateCache", function($templateCache) {$templateCache.put("plugins/datatable/html/test.html","<div ng-controller=\"DataTable.SimpleTableTestController\">\n <div class=\"row\">\n <div class=\"section-header\">\n\n <div class=\"section-filter\">\n <input type=\"text\" class=\"search-query\" placeholder=\"Filter...\" ng-model=\"mygrid.filterOptions.filterText\">\n <i class=\"fa fa-remove clickable\" title=\"Clear filter\" ng-click=\"mygrid.filterOptions.filterText = \'\'\"></i>\n </div>\n\n </div>\n </div>\n\n <h3>hawtio-simple-table example</h3>\n\n <table class=\"table table-striped\" hawtio-simple-table=\"mygrid\"></table>\n\n <div class=\"row\">\n <p>Selected folks:</p>\n <ul>\n <li ng-repeat=\"person in selectedItems\">{{person.name}}</li>\n </ul>\n\n <p>\n <a class=\"btn\" href=\"#/datatable/test?multi={{!mygrid.multiSelect}}\">multi select is: {{mygrid.multiSelect}}</a>\n </p>\n </div>\n</div>\n");
$templateCache.put("plugins/editor/html/editor.html","<div class=\"editor-autoresize\">\n <textarea name=\"{{name}}\" ng-model=\"text\"></textarea>\n</div>\n");
angular.module("hawtio-ui-templates", []).run(["$templateCache", function($templateCache) {$templateCache.put("plugins/editor/html/editor.html","<div class=\"editor-autoresize\">\n <textarea name=\"{{name}}\" ng-model=\"text\"></textarea>\n</div>\n");
$templateCache.put("plugins/datatable/html/test.html","<div ng-controller=\"DataTable.SimpleTableTestController\">\n <div class=\"row\">\n <div class=\"section-header\">\n\n <div class=\"section-filter\">\n <input type=\"text\" class=\"search-query\" placeholder=\"Filter...\" ng-model=\"mygrid.filterOptions.filterText\">\n <i class=\"fa fa-remove clickable\" title=\"Clear filter\" ng-click=\"mygrid.filterOptions.filterText = \'\'\"></i>\n </div>\n\n </div>\n </div>\n\n <h3>hawtio-simple-table example</h3>\n\n <table class=\"table table-striped\" hawtio-simple-table=\"mygrid\"></table>\n\n <div class=\"row\">\n <p>Selected folks:</p>\n <ul>\n <li ng-repeat=\"person in selectedItems\">{{person.name}}</li>\n </ul>\n\n <p>\n <a class=\"btn\" href=\"#/datatable/test?multi={{!mygrid.multiSelect}}\">multi select is: {{mygrid.multiSelect}}</a>\n </p>\n </div>\n</div>\n");
$templateCache.put("plugins/ui-bootstrap/html/message.html","<div class=\"modal-header\">\n <h3>{{ title }}</h3>\n</div>\n<div class=\"modal-body\">\n <p>{{ message }}</p>\n</div>\n<div class=\"modal-footer\">\n <button ng-repeat=\"btn in buttons\" ng-click=\"close(btn.result)\" class=\"btn\" ng-class=\"btn.cssClass\">{{ btn.label }}</button>\n</div>\n");
$templateCache.put("plugins/ui/html/breadcrumbs.html","<span class=\"hawtio-breadcrumb\">\n <li ng-repeat=\"(level, config) in levels track by level\" ng-show=\"config\">\n <div hawtio-drop-down=\"config\" process-submenus=\"false\"></div>\n </li>\n</span>\n");
$templateCache.put("plugins/ui/html/colorPicker.html","<div class=\"color-picker\">\n <div class=\"wrapper\">\n <div class=\"selected-color\" style=\"background-color: {{property}};\" ng-click=\"popout = !popout\"></div>\n </div>\n <div class=\"color-picker-popout\">\n <table>\n <tr>\n <td ng-repeat=\"color in colorList\">\n <div class=\"{{color.select}}\" style=\"background-color: {{color.color}};\"\n ng-click=\"selectColor(color)\">\n </div>\n <td>\n <td>\n <i class=\"fa fa-remove clickable\" ng-click=\"popout = !popout\"></i>\n </td>\n </tr>\n </table>\n </div>\n</div>\n");
$templateCache.put("plugins/ui/html/confirmDialog.html","<div modal=\"show\">\n <form class=\"form-horizontal no-bottom-margin\">\n <div class=\"modal-header\"><h4>{{title}}</h4></div>\n <div class=\"modal-body\">\n </div>\n <div class=\"modal-footer\">\n <input class=\"btn btn-danger\" ng-show=\"{{showOkButton != \'false\'}}\" type=\"submit\" value=\"{{okButtonText}}\" ng-click=\"submit()\">\n <button class=\"btn btn-primary\" ng-click=\"cancel()\">{{cancelButtonText}}</button>\n </div>\n </form>\n</div>\n");
Expand All @@ -4097,14 +4101,13 @@ $templateCache.put("plugins/ui/html/filter.html","<div class=\"inline-block sect
$templateCache.put("plugins/ui/html/icon.html","<span>\n <span ng-show=\"icon && icon.type && icon.src\" title=\"{{icon.title}}\" ng-switch=\"icon.type\">\n <i ng-switch-when=\"icon\" class=\"{{icon.src}} {{icon.class}}\"></i>\n <img ng-switch-when=\"img\" ng-src=\"{{icon.src}}\" class=\"{{icon.class}}\">\n </span>\n <span ng-hide=\"icon && icon.type && icon.src\">\n &nbsp;\n </span>\n</span>\n\n");
$templateCache.put("plugins/ui/html/layoutUI.html","<div ng-view></div>\n");
$templateCache.put("plugins/ui/html/list.html","<div>\n\n <!-- begin cell template -->\n <script type=\"text/ng-template\" id=\"cellTemplate.html\">\n <div class=\"ngCellText\">\n {{row.entity}}\n </div>\n </script>\n <!-- end cell template -->\n\n <!-- begin row template -->\n <script type=\"text/ng-template\" id=\"rowTemplate.html\">\n <div class=\"list-row\">\n <div ng-show=\"config.showSelectionCheckbox\"\n class=\"list-row-select\">\n <input type=\"checkbox\" ng-model=\"row.selected\">\n </div>\n <div class=\"list-row-contents\"></div>\n </div>\n </script>\n <!-- end row template -->\n\n <!-- must have a little margin in the top -->\n <div class=\"list-root\" style=\"margin-top: 15px\"></div>\n\n</div>\n");
$templateCache.put("plugins/ui/html/multiItemConfirmActionDialog.html","<div>\n <form class=\"no-bottom-margin\">\n <div class=\"modal-header\">\n <span>{{options.title || \'Are you sure?\'}}</span>\n </div>\n <div class=\"modal-body\">\n <p ng-show=\'options.action\'\n ng-class=\'options.actionClass\'\n ng-bind=\'options.action\'></p>\n <ul>\n <li ng-repeat=\"item in options.collection\">{{item[options.index]}}</li>\n </ul>\n <p ng-show=\"options.custom\" \n ng-class=\"options.customClass\" \n ng-bind=\"options.custom\"></p>\n </div>\n <div class=\"modal-footer\">\n <button class=\"btn\" \n ng-class=\"options.okClass\" \n ng-click=\"close(true)\">{{options.okText || \'Ok\'}}</button>\n <button class=\"btn\" \n ng-class=\"options.cancelClass\"\n ng-click=\"close(false)\">{{options.cancelText || \'Cancel\'}}</button>\n </div>\n </form>\n</div>\n");
$templateCache.put("plugins/ui/html/multiItemConfirmActionDialog.html","<div>\n <form class=\"no-bottom-margin\">\n <div class=\"modal-header\">\n <span>{{options.title || \'Are you sure?\'}}</span>\n </div>\n <div class=\"modal-body\">\n <p ng-show=\'options.action\'\n ng-class=\'options.actionClass\'\n ng-bind=\'options.action\'></p>\n <ul>\n <li ng-repeat=\"item in options.collection\" ng-bind=\"getName(item)\"></li>\n </ul>\n <p ng-show=\"options.custom\" \n ng-class=\"options.customClass\" \n ng-bind=\"options.custom\"></p>\n </div>\n <div class=\"modal-footer\">\n <button class=\"btn\" \n ng-class=\"options.okClass\" \n ng-click=\"close(true)\">{{options.okText || \'Ok\'}}</button>\n <button class=\"btn\" \n ng-class=\"options.cancelClass\"\n ng-click=\"close(false)\">{{options.cancelText || \'Cancel\'}}</button>\n </div>\n </form>\n</div>\n");
$templateCache.put("plugins/ui/html/object.html","<div>\n <script type=\"text/ng-template\" id=\"primitiveValueTemplate.html\">\n <span ng-show=\"data\" object-path=\"{{path}}\">{{data}}</span>\n </script>\n <script type=\"text/ng-template\" id=\"arrayValueListTemplate.html\">\n <ul class=\"zebra-list\" ng-show=\"data\" object-path=\"{{path}}\">\n <li ng-repeat=\"item in data\">\n <div hawtio-object=\"item\" config=\"config\" path=\"path\" row=\"row\"></div>\n </li>\n </ul>\n </script>\n <script type=\"text/ng-template\" id=\"arrayValueTableTemplate.html\">\n <table class=\"table table-striped\" object-path=\"{{path}}\">\n <thead>\n </thead>\n <tbody>\n </tbody>\n </table>\n </script>\n <script type=\"text/ng-template\" id=\"dateAttributeTemplate.html\">\n <dl class=\"\" ng-show=\"data\" object-path=\"{{path}}\">\n <dt>{{key}}</dt>\n <dd ng-show=\"data && data.getTime() > 0\">{{data | date:\"EEEE, MMMM dd, yyyy \'at\' hh : mm : ss a Z\"}}</dd>\n <dd ng-show=\"data && data.getTime() <= 0\"></dd>\n\n </dl>\n </script>\n <script type=\"text/ng-template\" id=\"dateValueTemplate.html\">\n <span ng-show=\"data\">\n <span ng-show=\"data && data.getTime() > 0\" object-path=\"{{path}}\">{{data | date:\"EEEE, MMMM dd, yyyy \'at\' hh : mm : ss a Z\"}}</span>\n <span ng-show=\"data && data.getTime() <= 0\" object-path=\"{{path}}\"></span>\n </span>\n </script>\n <script type=\"text/ng-template\" id=\"primitiveAttributeTemplate.html\">\n <dl class=\"\" ng-show=\"data\" object-path=\"{{path}}\">\n <dt>{{key}}</dt>\n <dd>{{data}}</dd>\n </dl>\n </script>\n <script type=\"text/ng-template\" id=\"objectAttributeTemplate.html\">\n <dl class=\"\" ng-show=\"data\" object-path=\"{{path}}\">\n <dt>{{key}}</dt>\n <dd>\n <div hawtio-object=\"data\" config=\"config\" path=\"path\" row=\"row\"></div>\n </dd>\n </dl>\n </script>\n <script type=\"text/ng-template\" id=\"arrayAttributeListTemplate.html\">\n <dl class=\"\" ng-show=\"data\" object-path=\"{{path}}\">\n <dt>{{key}}</dt>\n <dd>\n <ul class=\"zebra-list\">\n <li ng-repeat=\"item in data\" ng-init=\"path = path + \'/\' + $index\">\n <div hawtio-object=\"item\" config=\"config\" path=\"path\" row=\"row\"></div>\n </li>\n </ul>\n </dd>\n </dl>\n </script>\n <script type=\"text/ng-template\" id=\"arrayAttributeTableTemplate.html\">\n <dl class=\"\" ng-show=\"data\" object-path=\"{{path}}\">\n <dt>{{key}}</dt>\n <dd>\n <table class=\"table table-striped\">\n <thead>\n </thead>\n <tbody>\n </tbody>\n </table>\n </dd>\n </dl>\n </script>\n <script type=\"text/ng-template\" id=\"headerTemplate.html\">\n <th object-path=\"{{path}}\">{{key}}</th>\n </script>\n <script type=\"text/ng-template\" id=\"rowTemplate.html\">\n <tr object-path=\"{{path}}\"></tr>\n </script>\n <script type=\"text/ng-template\" id=\"cellTemplate.html\">\n <td object-path=\"{{path}}\"></td>\n </script>\n</div>\n");
$templateCache.put("plugins/ui/html/pane.html","<div class=\"pane\">\n <div class=\"pane-wrapper\">\n <div class=\"pane-header-wrapper\">\n </div>\n <div class=\"pane-viewport\">\n <div class=\"pane-content\">\n </div>\n </div>\n <div class=\"pane-bar\"\n ng-mousedown=\"startMoving($event)\"\n ng-click=\"toggle()\"></div>\n </div>\n</div>\n");
$templateCache.put("plugins/ui/html/slideout.html","<div class=\"slideout {{direction || \'right\'}}\">\n <div class=slideout-title>\n <div class=\"mouse-pointer pull-right\" ng-click=\"hidePanel($event)\" title=\"Close panel\">\n <i class=\"fa fa-remove\"></i>\n </div>\n <span>{{title}}</span>\n </div>\n <div class=\"slideout-content\">\n <div class=\"slideout-body\"></div>\n </div>\n</div>\n");
$templateCache.put("plugins/ui/html/tablePager.html","<div class=\"hawtio-pager clearfix\">\n <label>{{rowIndex() + 1}} / {{tableLength()}}</label>\n <div class=btn-group>\n <button class=\"btn\" ng-disabled=\"isEmptyOrFirst()\" ng-click=\"first()\"><i class=\"fa fa-fast-backward\"></i></button>\n <button class=\"btn\" ng-disabled=\"isEmptyOrFirst()\" ng-click=\"previous()\"><i class=\"fa fa-step-backward\"></i></button>\n <button class=\"btn\" ng-disabled=\"isEmptyOrLast()\" ng-click=\"next()\"><i class=\"fa fa-step-forward\"></i></button>\n <button class=\"btn\" ng-disabled=\"isEmptyOrLast()\" ng-click=\"last()\"><i class=\"fa fa-fast-forward\"></i></button>\n </div>\n</div>\n");
$templateCache.put("plugins/ui/html/tagFilter.html","<div>\n <ul class=\"list-unstyled label-list\">\n <li ng-repeat=\"tag in visibleTags | orderBy:\'tag.id || tag\'\"\n class=\"mouse-pointer\"\n ng-click=\"toggleSelectionFromGroup(selected, tag.id || tag)\">\n <span class=\"badge\"\n ng-class=\"isInGroup(selected, tag.id || tag, \'badge-success\', \'\')\"\n >{{tag.id || tag}}</span>\n <span class=\"pull-right\"\n ng-show=\"tag.count\">{{tag.count}}&nbsp;</span>\n </li>\n </ul>\n <div class=\"mouse-pointer\"\n ng-show=\"selected.length\"\n ng-click=\"clearGroup(selected)\">\n <i class=\"fa fa-remove\" ></i> Clear Tags\n </div>\n</div>\n");
$templateCache.put("plugins/ui/html/toc.html","<div>\n <div ng-repeat=\"item in myToc\">\n <div id=\"{{item[\'href\']}}Target\" ng-bind-html=\"item.text\">\n </div>\n </div>\n</div>\n");
$templateCache.put("plugins/ui-bootstrap/html/message.html","<div class=\"modal-header\">\n <h3>{{ title }}</h3>\n</div>\n<div class=\"modal-body\">\n <p>{{ message }}</p>\n</div>\n<div class=\"modal-footer\">\n <button ng-repeat=\"btn in buttons\" ng-click=\"close(btn.result)\" class=\"btn\" ng-class=\"btn.cssClass\">{{ btn.label }}</button>\n</div>\n");
$templateCache.put("plugins/ui/html/test/auto-columns.html","<div ng-controller=\"UI.UITestController2\">\n\n <div>\n <div class=\"row\">\n <h3>Auto Columns</h3>\n <p>Lays out a bunch of inline-block child elements into columns automatically based on the size of the parent container. Specify the selector for the child items as an argument</p>\n\n <script type=\"text/ng-template\" id=\"autoColumnTemplate\">\n<div id=\"container\"\n style=\"height: 225px;\n width: 785px;\n background: lightgrey;\n border-radius: 4px;\"\n hawtio-auto-columns=\".ex-children\"\n min-margin=\"5\">\n <div class=\"ex-children\"\n style=\"display: inline-block;\n width: 64px; height: 64px;\n border-radius: 4px;\n background: lightgreen;\n text-align: center;\n vertical-align: middle;\n margin: 5px;\"\n ng-repeat=\"div in divs\">{{div}}</div>\n</div>\n </script>\n <div hawtio-editor=\"autoColumnEx\" mode=\"fileUploadExMode\"></div>\n <div class=\"directive-example\">\n <div compile=\"autoColumnEx\"></div>\n </div>\n </div>\n </div>\n</div>\n");
$templateCache.put("plugins/ui/html/test/auto-dropdown.html","<div ng-controller=\"UI.UITestController2\">\n\n <div>\n <div class=\"row\">\n <h3>Auto Drop Down</h3>\n <p>Handy for horizontal lists of things like menus, if the width of the element is smaller than the items inside any overflowing elements will be collected into a special dropdown element that\'s required at the end of the list</p>\n <script type=\"text/ng-template\" id=\"autoDropDownTemplate\">\n <ul class=\"nav nav-tabs\" hawtio-auto-dropdown>\n <!-- All of our menu items -->\n <li ng-repeat=\"item in menuItems\">\n <a href=\"\">{{item}}</a>\n </li>\n <!-- The dropdown that will collect overflow elements -->\n <li class=\"dropdown overflow\" style=\"float: right !important; visibility: hidden;\">\n <a href=\"\" class=\"dropdown-toggle\" data-toggle=\"dropdown\">\n <i class=\"fa fa-chevron-down\"></i>\n </a>\n <ul class=\"dropdown-menu right\"></ul>\n </li>\n </ul>\n </script>\n <div hawtio-editor=\"autoDropDown\" mode=\"fileUploadExMode\"></div>\n <div class=\"directive-example\">\n <div compile=\"autoDropDown\"></div>\n </div>\n </div>\n </div>\n</div>\n");
$templateCache.put("plugins/ui/html/test/breadcrumbs.html","<div ng-controller=\"UI.UITestController2\">\n\n <div>\n\n <div class=\"row\">\n <h3>BreadCrumbs</h3>\n <p>A breadcrumb implementation that supports dropdowns for each node. The data structure is a tree structure with a single starting node. When the user makes a selection the directive will update the \'path\' property of the config object. The directive also watches the \'path\' property, allowing you to also set the initial state of the breadcrumbs.</p>\n <script type=\"text/ng-template\" id=\"breadcrumbTemplate\">\n<p>path: {{breadcrumbConfig.path}}</p>\n<ul class=\"nav nav-tabs\">\n<hawtio-breadcrumbs config=\"breadcrumbConfig\"></hawtio-breadcrumbs>\n</ul>\n </script>\n <h5>HTML</h5>\n <div hawtio-editor=\"breadcrumbEx\" mode=\"fileUploadExMode\"></div>\n <h5>JSON</h5>\n <div hawtio-editor=\"breadcrumbConfigTxt\" mode=\"javascript\"></div>\n <div class=\"directive-example\">\n <div compile=\"breadcrumbEx\"></div>\n </div>\n </div>\n\n </div>\n</div>\n");
Expand Down
Binary file added favicon.ico
Binary file not shown.
2 changes: 1 addition & 1 deletion plugins/ui/html/multiItemConfirmActionDialog.html
Expand Up @@ -8,7 +8,7 @@
ng-class='options.actionClass'
ng-bind='options.action'></p>
<ul>
<li ng-repeat="item in options.collection">{{item[options.index]}}</li>
<li ng-repeat="item in options.collection" ng-bind="getName(item)"></li>
</ul>
<p ng-show="options.custom"
ng-class="options.customClass"
Expand Down
3 changes: 3 additions & 0 deletions plugins/ui/ts/dialog.ts
Expand Up @@ -68,6 +68,9 @@ module UI {
dialog.close();
options.onClose(result);
};
$scope.getName = (item) => {
return Core.pathGet(item, options.index.split('.'));
}
}]
});
}
Expand Down

0 comments on commit 2399f1f

Please sign in to comment.