bastion 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.jshintrc +35 -0
- data/Gruntfile.js +24 -0
- data/LICENSE +339 -0
- data/README.md +8 -0
- data/Rakefile +53 -0
- data/app/assets/javascripts/bastion/auth/auth.module.js +87 -0
- data/app/assets/javascripts/bastion/auth/authorization.service.js +48 -0
- data/app/assets/javascripts/bastion/bastion-bootstrap.js +32 -0
- data/app/assets/javascripts/bastion/bastion-resource.factory.js +39 -0
- data/app/assets/javascripts/bastion/bastion.js +52 -0
- data/app/assets/javascripts/bastion/bastion.module.js +213 -0
- data/app/assets/javascripts/bastion/i18n/README +9 -0
- data/app/assets/javascripts/bastion/i18n/i18n.module.js +24 -0
- data/app/assets/javascripts/bastion/i18n/katello.pot +968 -0
- data/app/assets/javascripts/bastion/i18n/locale/README +1 -0
- data/app/assets/javascripts/bastion/i18n/translate.service.js +14 -0
- data/app/assets/javascripts/bastion/i18n/translations.js +3 -0
- data/app/assets/javascripts/bastion/i18n/zanata.xml +28 -0
- data/app/assets/javascripts/bastion/incubator/alch-alert.directive.js +67 -0
- data/app/assets/javascripts/bastion/incubator/alch-container-scroll.directive.js +44 -0
- data/app/assets/javascripts/bastion/incubator/alch-dropdown.directive.js +28 -0
- data/app/assets/javascripts/bastion/incubator/alch-edit.directive.js +361 -0
- data/app/assets/javascripts/bastion/incubator/alch-flyout.directive.js +19 -0
- data/app/assets/javascripts/bastion/incubator/alch-form-buttons.directive.js +60 -0
- data/app/assets/javascripts/bastion/incubator/alch-form-group.directive.js +87 -0
- data/app/assets/javascripts/bastion/incubator/alch-infinite-scroll.directive.js +84 -0
- data/app/assets/javascripts/bastion/incubator/alch-menu.directive.js +56 -0
- data/app/assets/javascripts/bastion/incubator/alch-modal.directive.js +80 -0
- data/app/assets/javascripts/bastion/incubator/alch-save-control.directive.js +42 -0
- data/app/assets/javascripts/bastion/incubator/alch-table.directive.js +295 -0
- data/app/assets/javascripts/bastion/incubator/format/alch-format.module.js +21 -0
- data/app/assets/javascripts/bastion/incubator/format/array-to-string.filter.js +30 -0
- data/app/assets/javascripts/bastion/incubator/format/boolean-to-yes-no.filter.js +34 -0
- data/app/assets/javascripts/bastion/incubator/format/capitalize.filter.js +32 -0
- data/app/assets/javascripts/bastion/incubator/format/key-value-to-string.filter.js +40 -0
- data/app/assets/javascripts/bastion/incubator/format/unlimitedFilter.filter.js +35 -0
- data/app/assets/javascripts/bastion/incubator/stylesheets/alch-edit.scss +34 -0
- data/app/assets/javascripts/bastion/incubator/stylesheets/header.scss +207 -0
- data/app/assets/javascripts/bastion/incubator/views/alch-alert.html +6 -0
- data/app/assets/javascripts/bastion/incubator/views/alch-dropdown.html +19 -0
- data/app/assets/javascripts/bastion/incubator/views/alch-edit-add-item.html +21 -0
- data/app/assets/javascripts/bastion/incubator/views/alch-edit-add-remove-cancel.html +28 -0
- data/app/assets/javascripts/bastion/incubator/views/alch-edit-checkbox.html +6 -0
- data/app/assets/javascripts/bastion/incubator/views/alch-edit-custom.html +8 -0
- data/app/assets/javascripts/bastion/incubator/views/alch-edit-multiselect.html +17 -0
- data/app/assets/javascripts/bastion/incubator/views/alch-edit-save-cancel.html +20 -0
- data/app/assets/javascripts/bastion/incubator/views/alch-edit-select.html +10 -0
- data/app/assets/javascripts/bastion/incubator/views/alch-edit-text.html +6 -0
- data/app/assets/javascripts/bastion/incubator/views/alch-edit-textarea.html +6 -0
- data/app/assets/javascripts/bastion/incubator/views/alch-edit.html +18 -0
- data/app/assets/javascripts/bastion/incubator/views/alch-flyout.html +10 -0
- data/app/assets/javascripts/bastion/incubator/views/alch-form-buttons.html +10 -0
- data/app/assets/javascripts/bastion/incubator/views/alch-form-group.html +9 -0
- data/app/assets/javascripts/bastion/incubator/views/alch-menu.html +18 -0
- data/app/assets/javascripts/bastion/incubator/views/alch-modal-remove.html +13 -0
- data/app/assets/javascripts/bastion/incubator/views/alch-save-control.html +18 -0
- data/app/assets/javascripts/bastion/layouts/details-nutupane.html +73 -0
- data/app/assets/javascripts/bastion/layouts/nutupane.html +63 -0
- data/app/assets/javascripts/bastion/layouts/select-all-results.html +9 -0
- data/app/assets/javascripts/bastion/menu/menu-expander.service.js +51 -0
- data/app/assets/javascripts/bastion/menu/menu.module.js +26 -0
- data/app/assets/javascripts/bastion/utils/as.filter.js +33 -0
- data/app/assets/javascripts/bastion/utils/form-utils.service.js +53 -0
- data/app/assets/javascripts/bastion/utils/utils.module.js +21 -0
- data/app/assets/javascripts/bastion/widgets/current-tasks.directive.js +67 -0
- data/app/assets/javascripts/bastion/widgets/nutupane-table.directive.js +59 -0
- data/app/assets/javascripts/bastion/widgets/nutupane.factory.js +316 -0
- data/app/assets/javascripts/bastion/widgets/page-title.directive.js +61 -0
- data/app/assets/javascripts/bastion/widgets/page-title.service.js +42 -0
- data/app/assets/javascripts/bastion/widgets/path-selector.directive.js +109 -0
- data/app/assets/javascripts/bastion/widgets/views/current-tasks.html +23 -0
- data/app/assets/javascripts/bastion/widgets/views/path-selector.html +11 -0
- data/app/assets/javascripts/bastion/widgets/widgets.module.js +24 -0
- data/app/assets/stylesheets/bastion/animations.less +15 -0
- data/app/assets/stylesheets/bastion/bastion.less +160 -0
- data/app/assets/stylesheets/bastion/forms.less +41 -0
- data/app/assets/stylesheets/bastion/gpg-keys.less +36 -0
- data/app/assets/stylesheets/bastion/helpers.less +6 -0
- data/app/assets/stylesheets/bastion/mixins.less +15 -0
- data/app/assets/stylesheets/bastion/nutupane.less +382 -0
- data/app/assets/stylesheets/bastion/overrides.less +54 -0
- data/app/assets/stylesheets/bastion/path-selector.less +123 -0
- data/app/assets/stylesheets/bastion/systems.less +35 -0
- data/app/assets/stylesheets/bastion/tasks.less +23 -0
- data/app/assets/stylesheets/bastion/typography.less +31 -0
- data/app/assets/stylesheets/bastion/variables.less +3 -0
- data/app/controllers/bastion/bastion_controller.rb +24 -0
- data/app/views/bastion/layouts/application.html.erb +32 -0
- data/app/views/bastion/layouts/application_ie.html.erb +5 -0
- data/bastion.js +26 -0
- data/bower.json +94 -0
- data/config/routes.rb +25 -0
- data/config/routes/mount_engine.rb +3 -0
- data/grunt/bower.js +20 -0
- data/grunt/htmlhint.js +15 -0
- data/grunt/jshint.js +9 -0
- data/grunt/karma.js +83 -0
- data/lib/bastion.rb +17 -0
- data/lib/bastion/engine.rb +37 -0
- data/lib/bastion/version.rb +3 -0
- data/package.json +29 -0
- data/test/auth/authorization.service.test.js +63 -0
- data/test/bastion/bastion-resource.factory.test.js +31 -0
- data/test/bastion/test-constants.js +30 -0
- data/test/i18n/translate.service.test.js +31 -0
- data/test/incubator/alch-alert.directive.test.js +84 -0
- data/test/incubator/alch-container-scroll.directive.test.js +68 -0
- data/test/incubator/alch-dropdown.directive.test.js +113 -0
- data/test/incubator/alch-edit.directive.test.js +320 -0
- data/test/incubator/alch-flyout.directive.test.js +73 -0
- data/test/incubator/alch-form-buttons.directive.test.js +55 -0
- data/test/incubator/alch-form-group.directive.test.js +76 -0
- data/test/incubator/alch-infinite-scroll.directive.test.js +123 -0
- data/test/incubator/alch-menu.directive.test.js +94 -0
- data/test/incubator/alch-modal.directive.test.js +81 -0
- data/test/incubator/alch-table.directive.test.js +270 -0
- data/test/incubator/format/array-to-string.filter.test.js +38 -0
- data/test/incubator/format/boolean-to-yes-no.filter.test.js +41 -0
- data/test/incubator/format/capitalize.filter.test.js +35 -0
- data/test/incubator/format/key-value-to-string.filter.test.js +60 -0
- data/test/incubator/format/unlimited-filter.filter.test.js +31 -0
- data/test/incubator/nutupane-table.directive.test.js +69 -0
- data/test/incubator/nutupane.factory.test.js +307 -0
- data/test/menu/menu-expander.service.test.js +74 -0
- data/test/test-mocks.module.js +268 -0
- data/test/utils/as.filter.test.js +33 -0
- data/test/utils/form-utils.service.test.js +52 -0
- data/test/widgets/page-title.directive.test.js +54 -0
- data/test/widgets/page-title.service.test.js +51 -0
- data/test/widgets/path-selector.directive.test.js +136 -0
- data/vendor/assets/fonts/bastion/bootstrap/glyphicons-halflings-regular.eot +0 -0
- data/vendor/assets/fonts/bastion/bootstrap/glyphicons-halflings-regular.svg +229 -0
- data/vendor/assets/fonts/bastion/bootstrap/glyphicons-halflings-regular.ttf +0 -0
- data/vendor/assets/fonts/bastion/bootstrap/glyphicons-halflings-regular.woff +0 -0
- data/vendor/assets/fonts/bastion/font-awesome/FontAwesome.otf +0 -0
- data/vendor/assets/fonts/bastion/font-awesome/fontawesome-webfont.eot +0 -0
- data/vendor/assets/fonts/bastion/font-awesome/fontawesome-webfont.svg +399 -0
- data/vendor/assets/fonts/bastion/font-awesome/fontawesome-webfont.ttf +0 -0
- data/vendor/assets/fonts/bastion/font-awesome/fontawesome-webfont.woff +0 -0
- data/vendor/assets/fonts/bastion/rcue/OpenSans-Bold-webfont.eot +0 -0
- data/vendor/assets/fonts/bastion/rcue/OpenSans-Bold-webfont.svg +146 -0
- data/vendor/assets/fonts/bastion/rcue/OpenSans-Bold-webfont.ttf +0 -0
- data/vendor/assets/fonts/bastion/rcue/OpenSans-Bold-webfont.woff +0 -0
- data/vendor/assets/fonts/bastion/rcue/OpenSans-BoldItalic-webfont.eot +0 -0
- data/vendor/assets/fonts/bastion/rcue/OpenSans-BoldItalic-webfont.svg +146 -0
- data/vendor/assets/fonts/bastion/rcue/OpenSans-BoldItalic-webfont.ttf +0 -0
- data/vendor/assets/fonts/bastion/rcue/OpenSans-BoldItalic-webfont.woff +0 -0
- data/vendor/assets/fonts/bastion/rcue/OpenSans-ExtraBold-webfont.eot +0 -0
- data/vendor/assets/fonts/bastion/rcue/OpenSans-ExtraBold-webfont.svg +146 -0
- data/vendor/assets/fonts/bastion/rcue/OpenSans-ExtraBold-webfont.ttf +0 -0
- data/vendor/assets/fonts/bastion/rcue/OpenSans-ExtraBold-webfont.woff +0 -0
- data/vendor/assets/fonts/bastion/rcue/OpenSans-ExtraBoldItalic-webfont.eot +0 -0
- data/vendor/assets/fonts/bastion/rcue/OpenSans-ExtraBoldItalic-webfont.svg +146 -0
- data/vendor/assets/fonts/bastion/rcue/OpenSans-ExtraBoldItalic-webfont.ttf +0 -0
- data/vendor/assets/fonts/bastion/rcue/OpenSans-ExtraBoldItalic-webfont.woff +0 -0
- data/vendor/assets/fonts/bastion/rcue/OpenSans-Italic-webfont.eot +0 -0
- data/vendor/assets/fonts/bastion/rcue/OpenSans-Italic-webfont.svg +146 -0
- data/vendor/assets/fonts/bastion/rcue/OpenSans-Italic-webfont.ttf +0 -0
- data/vendor/assets/fonts/bastion/rcue/OpenSans-Italic-webfont.woff +0 -0
- data/vendor/assets/fonts/bastion/rcue/OpenSans-Light-webfont.eot +0 -0
- data/vendor/assets/fonts/bastion/rcue/OpenSans-Light-webfont.svg +146 -0
- data/vendor/assets/fonts/bastion/rcue/OpenSans-Light-webfont.ttf +0 -0
- data/vendor/assets/fonts/bastion/rcue/OpenSans-Light-webfont.woff +0 -0
- data/vendor/assets/fonts/bastion/rcue/OpenSans-LightItalic-webfont.eot +0 -0
- data/vendor/assets/fonts/bastion/rcue/OpenSans-LightItalic-webfont.svg +146 -0
- data/vendor/assets/fonts/bastion/rcue/OpenSans-LightItalic-webfont.ttf +0 -0
- data/vendor/assets/fonts/bastion/rcue/OpenSans-LightItalic-webfont.woff +0 -0
- data/vendor/assets/fonts/bastion/rcue/OpenSans-Regular-webfont.eot +0 -0
- data/vendor/assets/fonts/bastion/rcue/OpenSans-Regular-webfont.svg +146 -0
- data/vendor/assets/fonts/bastion/rcue/OpenSans-Regular-webfont.ttf +0 -0
- data/vendor/assets/fonts/bastion/rcue/OpenSans-Regular-webfont.woff +0 -0
- data/vendor/assets/fonts/bastion/rcue/OpenSans-Semibold-webfont.eot +0 -0
- data/vendor/assets/fonts/bastion/rcue/OpenSans-Semibold-webfont.svg +146 -0
- data/vendor/assets/fonts/bastion/rcue/OpenSans-Semibold-webfont.ttf +0 -0
- data/vendor/assets/fonts/bastion/rcue/OpenSans-Semibold-webfont.woff +0 -0
- data/vendor/assets/fonts/bastion/rcue/OpenSans-SemiboldItalic-webfont.eot +0 -0
- data/vendor/assets/fonts/bastion/rcue/OpenSans-SemiboldItalic-webfont.svg +146 -0
- data/vendor/assets/fonts/bastion/rcue/OpenSans-SemiboldItalic-webfont.ttf +0 -0
- data/vendor/assets/fonts/bastion/rcue/OpenSans-SemiboldItalic-webfont.woff +0 -0
- data/vendor/assets/fonts/bastion/rcue/Overpass-Bold-webfont.eot +0 -0
- data/vendor/assets/fonts/bastion/rcue/Overpass-Bold-webfont.svg +454 -0
- data/vendor/assets/fonts/bastion/rcue/Overpass-Bold-webfont.ttf +0 -0
- data/vendor/assets/fonts/bastion/rcue/Overpass-Bold-webfont.woff +0 -0
- data/vendor/assets/fonts/bastion/rcue/Overpass-Regular-webfont.eot +0 -0
- data/vendor/assets/fonts/bastion/rcue/Overpass-Regular-webfont.svg +454 -0
- data/vendor/assets/fonts/bastion/rcue/Overpass-Regular-webfont.ttf +0 -0
- data/vendor/assets/fonts/bastion/rcue/Overpass-Regular-webfont.woff +0 -0
- data/vendor/assets/javascripts/bastion/alchemy/alchemy.js +20 -0
- data/vendor/assets/javascripts/bastion/angular-animate/angular-animate.js +1226 -0
- data/vendor/assets/javascripts/bastion/angular-blocks/angular-blocks.js +79 -0
- data/vendor/assets/javascripts/bastion/angular-bootstrap/ui-bootstrap-tpls.js +3677 -0
- data/vendor/assets/javascripts/bastion/angular-bootstrap/ui-bootstrap.js +3427 -0
- data/vendor/assets/javascripts/bastion/angular-gettext/angular-gettext.js +345 -0
- data/vendor/assets/javascripts/bastion/angular-resource/angular-resource.js +594 -0
- data/vendor/assets/javascripts/bastion/angular-route/angular-route.js +920 -0
- data/vendor/assets/javascripts/bastion/angular-sanitize/angular-sanitize.js +622 -0
- data/vendor/assets/javascripts/bastion/angular-ui-bootstrap/datepicker.js +447 -0
- data/vendor/assets/javascripts/bastion/angular-ui-bootstrap/timepicker.js +232 -0
- data/vendor/assets/javascripts/bastion/angular-ui-router/angular-ui-router.js +3223 -0
- data/vendor/assets/javascripts/bastion/angular-uuid4/angular-uuid4.js +21 -0
- data/vendor/assets/javascripts/bastion/angular/angular.js +20560 -0
- data/vendor/assets/javascripts/bastion/es5-shim/es5-shim.js +1216 -0
- data/vendor/assets/javascripts/bastion/json3/json3.js +861 -0
- data/vendor/assets/javascripts/bastion/ngUpload/ng-upload.js +205 -0
- data/vendor/assets/javascripts/bastion/underscore/underscore.js +1276 -0
- data/vendor/assets/stylesheets/bastion/alchemy/_colors.scss +99 -0
- data/vendor/assets/stylesheets/bastion/alchemy/_media_object.scss +22 -0
- data/vendor/assets/stylesheets/bastion/alchemy/_mixins.scss +24 -0
- data/vendor/assets/stylesheets/bastion/alchemy/_normalize.scss +396 -0
- data/vendor/assets/stylesheets/bastion/alchemy/_vars.scss +31 -0
- data/vendor/assets/stylesheets/bastion/alchemy/alchemy.scss +8 -0
- data/vendor/assets/stylesheets/bastion/bootstrap/alerts.less +67 -0
- data/vendor/assets/stylesheets/bastion/bootstrap/badges.less +51 -0
- data/vendor/assets/stylesheets/bastion/bootstrap/bootstrap.less +49 -0
- data/vendor/assets/stylesheets/bastion/bootstrap/breadcrumbs.less +23 -0
- data/vendor/assets/stylesheets/bastion/bootstrap/button-groups.less +227 -0
- data/vendor/assets/stylesheets/bastion/bootstrap/buttons.less +155 -0
- data/vendor/assets/stylesheets/bastion/bootstrap/carousel.less +232 -0
- data/vendor/assets/stylesheets/bastion/bootstrap/close.less +33 -0
- data/vendor/assets/stylesheets/bastion/bootstrap/code.less +53 -0
- data/vendor/assets/stylesheets/bastion/bootstrap/component-animations.less +29 -0
- data/vendor/assets/stylesheets/bastion/bootstrap/dropdowns.less +187 -0
- data/vendor/assets/stylesheets/bastion/bootstrap/forms.less +375 -0
- data/vendor/assets/stylesheets/bastion/bootstrap/glyphicons.less +237 -0
- data/vendor/assets/stylesheets/bastion/bootstrap/grid.less +79 -0
- data/vendor/assets/stylesheets/bastion/bootstrap/input-groups.less +136 -0
- data/vendor/assets/stylesheets/bastion/bootstrap/jumbotron.less +46 -0
- data/vendor/assets/stylesheets/bastion/bootstrap/labels.less +64 -0
- data/vendor/assets/stylesheets/bastion/bootstrap/list-group.less +88 -0
- data/vendor/assets/stylesheets/bastion/bootstrap/media.less +56 -0
- data/vendor/assets/stylesheets/bastion/bootstrap/mixins.less +845 -0
- data/vendor/assets/stylesheets/bastion/bootstrap/modals.less +129 -0
- data/vendor/assets/stylesheets/bastion/bootstrap/navbar.less +612 -0
- data/vendor/assets/stylesheets/bastion/bootstrap/navs.less +242 -0
- data/vendor/assets/stylesheets/bastion/bootstrap/normalize.less +406 -0
- data/vendor/assets/stylesheets/bastion/bootstrap/pager.less +55 -0
- data/vendor/assets/stylesheets/bastion/bootstrap/pagination.less +85 -0
- data/vendor/assets/stylesheets/bastion/bootstrap/panels.less +182 -0
- data/vendor/assets/stylesheets/bastion/bootstrap/popovers.less +133 -0
- data/vendor/assets/stylesheets/bastion/bootstrap/print.less +105 -0
- data/vendor/assets/stylesheets/bastion/bootstrap/progress-bars.less +80 -0
- data/vendor/assets/stylesheets/bastion/bootstrap/responsive-utilities.less +209 -0
- data/vendor/assets/stylesheets/bastion/bootstrap/scaffolding.less +119 -0
- data/vendor/assets/stylesheets/bastion/bootstrap/tables.less +231 -0
- data/vendor/assets/stylesheets/bastion/bootstrap/theme.less +247 -0
- data/vendor/assets/stylesheets/bastion/bootstrap/thumbnails.less +36 -0
- data/vendor/assets/stylesheets/bastion/bootstrap/tooltip.less +95 -0
- data/vendor/assets/stylesheets/bastion/bootstrap/type.less +281 -0
- data/vendor/assets/stylesheets/bastion/bootstrap/utilities.less +56 -0
- data/vendor/assets/stylesheets/bastion/bootstrap/variables.less +642 -0
- data/vendor/assets/stylesheets/bastion/bootstrap/wells.less +29 -0
- data/vendor/assets/stylesheets/bastion/font-awesome/less/bootstrap.less +84 -0
- data/vendor/assets/stylesheets/bastion/font-awesome/less/core.less +129 -0
- data/vendor/assets/stylesheets/bastion/font-awesome/less/extras.less +93 -0
- data/vendor/assets/stylesheets/bastion/font-awesome/less/font-awesome-ie7.less +1953 -0
- data/vendor/assets/stylesheets/bastion/font-awesome/less/font-awesome.less +33 -0
- data/vendor/assets/stylesheets/bastion/font-awesome/less/icons.less +381 -0
- data/vendor/assets/stylesheets/bastion/font-awesome/less/mixins.less +48 -0
- data/vendor/assets/stylesheets/bastion/font-awesome/less/path.less +14 -0
- data/vendor/assets/stylesheets/bastion/font-awesome/less/variables.less +735 -0
- data/vendor/assets/stylesheets/bastion/font-awesome/scss/_bootstrap.scss +84 -0
- data/vendor/assets/stylesheets/bastion/font-awesome/scss/_core.scss +129 -0
- data/vendor/assets/stylesheets/bastion/font-awesome/scss/_extras.scss +93 -0
- data/vendor/assets/stylesheets/bastion/font-awesome/scss/_icons.scss +381 -0
- data/vendor/assets/stylesheets/bastion/font-awesome/scss/_mixins.scss +48 -0
- data/vendor/assets/stylesheets/bastion/font-awesome/scss/_path.scss +14 -0
- data/vendor/assets/stylesheets/bastion/font-awesome/scss/_variables.scss +734 -0
- data/vendor/assets/stylesheets/bastion/font-awesome/scss/font-awesome-ie7.scss +1953 -0
- data/vendor/assets/stylesheets/bastion/font-awesome/scss/font-awesome.scss +33 -0
- data/vendor/assets/stylesheets/bastion/rcue/buttons.less +44 -0
- data/vendor/assets/stylesheets/bastion/rcue/fonts.less +52 -0
- data/vendor/assets/stylesheets/bastion/rcue/forms.less +19 -0
- data/vendor/assets/stylesheets/bastion/rcue/mixins.less +50 -0
- data/vendor/assets/stylesheets/bastion/rcue/navbar.less +481 -0
- data/vendor/assets/stylesheets/bastion/rcue/rcue.less +15 -0
- data/vendor/assets/stylesheets/bastion/rcue/variables.less +47 -0
- metadata +376 -0
@@ -0,0 +1,31 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright 2014 Red Hat, Inc.
|
3
|
+
*
|
4
|
+
* This software is licensed to you under the GNU General Public
|
5
|
+
* License as published by the Free Software Foundation; either version
|
6
|
+
* 2 of the License (GPLv2) or (at your option) any later version.
|
7
|
+
* There is NO WARRANTY for this software, express or implied,
|
8
|
+
* including the implied warranties of MERCHANTABILITY,
|
9
|
+
* NON-INFRINGEMENT, or FITNESS FOR A PARTICULAR PURPOSE. You should
|
10
|
+
* have received a copy of GPLv2 along with this software; if not, see
|
11
|
+
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
12
|
+
*/
|
13
|
+
describe('Filter:unlimitedFilter', function() {
|
14
|
+
var unlimitedFilter;
|
15
|
+
|
16
|
+
beforeEach(module('alchemy.format'));
|
17
|
+
|
18
|
+
beforeEach(module(function($provide) {
|
19
|
+
$provide.value('translate', function(a) {return a});
|
20
|
+
}));
|
21
|
+
|
22
|
+
beforeEach(inject(function($filter) {
|
23
|
+
unlimitedFilter = $filter('unlimitedFilter');
|
24
|
+
}));
|
25
|
+
|
26
|
+
it("ensures correctly transforms limit", function() {
|
27
|
+
expect(unlimitedFilter(3, true)).toBe('Unlimited');
|
28
|
+
expect(unlimitedFilter(2)).toBe('2');
|
29
|
+
});
|
30
|
+
|
31
|
+
});
|
@@ -0,0 +1,69 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright 2014 Red Hat, Inc.
|
3
|
+
*
|
4
|
+
* This software is licensed to you under the GNU General Public
|
5
|
+
* License as published by the Free Software Foundation; either version
|
6
|
+
* 2 of the License (GPLv2) or (at your option) any later version.
|
7
|
+
* There is NO WARRANTY for this software, express or implied,
|
8
|
+
* including the implied warranties of MERCHANTABILITY,
|
9
|
+
* NON-INFRINGEMENT, or FITNESS FOR A PARTICULAR PURPOSE. You should
|
10
|
+
* have received a copy of GPLv2 along with this software; if not, see
|
11
|
+
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
12
|
+
*/
|
13
|
+
|
14
|
+
|
15
|
+
describe('Directive: nutupaneTable', function() {
|
16
|
+
var scope,
|
17
|
+
compile,
|
18
|
+
tableElement;
|
19
|
+
|
20
|
+
beforeEach(module('alchemy'));
|
21
|
+
|
22
|
+
beforeEach(inject(function(_$compile_, _$rootScope_) {
|
23
|
+
compile = _$compile_;
|
24
|
+
scope = _$rootScope_;
|
25
|
+
}));
|
26
|
+
|
27
|
+
beforeEach(function() {
|
28
|
+
tableElement = angular.element(
|
29
|
+
'<div nutupane-table>' +
|
30
|
+
'<table>' +
|
31
|
+
'<thead>' +
|
32
|
+
'<tr><th>Column 1</th></tr>' +
|
33
|
+
'</thead>' +
|
34
|
+
'<tbody>' +
|
35
|
+
'<tr>' +
|
36
|
+
'<td>Row 1</td>' +
|
37
|
+
'</tr>' +
|
38
|
+
'</tbody>' +
|
39
|
+
'</table>' +
|
40
|
+
'</div>');
|
41
|
+
|
42
|
+
compile(tableElement)(scope);
|
43
|
+
scope.$digest();
|
44
|
+
scope.$broadcast("$stateChangeSuccess", {}, {}, {}, {});
|
45
|
+
});
|
46
|
+
|
47
|
+
it("should create a new table element with just the thead", function() {
|
48
|
+
var theads = tableElement.find('thead'),
|
49
|
+
tbodys = tableElement.find('tbody');
|
50
|
+
|
51
|
+
expect(theads.length).toEqual(2);
|
52
|
+
expect(tbodys.length).toEqual(1);
|
53
|
+
});
|
54
|
+
|
55
|
+
it("should hide the original table's thead", function() {
|
56
|
+
var originalTableHead = angular.element(tableElement.find('thead')[1]);
|
57
|
+
|
58
|
+
expect(originalTableHead.css('display')).toBe('none');
|
59
|
+
});
|
60
|
+
|
61
|
+
it("should remove the duplicate row select from the cloned table if present", function() {
|
62
|
+
var rowSelectTable = tableElement.clone();
|
63
|
+
rowSelectTable.find('thead').prepend("<tr><th class='row-select'></th></tr>");
|
64
|
+
compile(rowSelectTable)(scope);
|
65
|
+
scope.$digest();
|
66
|
+
scope.$broadcast("$stateChangeSuccess", {}, {}, {}, {});
|
67
|
+
expect(rowSelectTable.find('.row-select').length).toBe(1);
|
68
|
+
});
|
69
|
+
});
|
@@ -0,0 +1,307 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright 2014 Red Hat, Inc.
|
3
|
+
*
|
4
|
+
* This software is licensed to you under the GNU General Public
|
5
|
+
* License as published by the Free Software Foundation; either version
|
6
|
+
* 2 of the License (GPLv2) or (at your option) any later version.
|
7
|
+
* There is NO WARRANTY for this software, express or implied,
|
8
|
+
* including the implied warranties of MERCHANTABILITY,
|
9
|
+
* NON-INFRINGEMENT, or FITNESS FOR A PARTICULAR PURPOSE. You should
|
10
|
+
* have received a copy of GPLv2 along with this software; if not, see
|
11
|
+
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
12
|
+
*/
|
13
|
+
|
14
|
+
describe('Factory: Nutupane', function() {
|
15
|
+
var $timeout,
|
16
|
+
$location,
|
17
|
+
Resource,
|
18
|
+
expectedResult,
|
19
|
+
Nutupane;
|
20
|
+
|
21
|
+
beforeEach(module('Bastion.widgets'));
|
22
|
+
|
23
|
+
beforeEach(module(function() {
|
24
|
+
expectedResult = [{id: 2, value: "value2"}, {id:3, value: "value3"}];
|
25
|
+
Resource = {
|
26
|
+
queryPaged: function(params, callback) {
|
27
|
+
var result = {results: expectedResult};
|
28
|
+
if (callback) {
|
29
|
+
callback(result);
|
30
|
+
}
|
31
|
+
return result;
|
32
|
+
},
|
33
|
+
customAction: function() {},
|
34
|
+
total: 10,
|
35
|
+
subtotal: 8,
|
36
|
+
offset: 5,
|
37
|
+
sort: {
|
38
|
+
by: "description",
|
39
|
+
order: "ASC"
|
40
|
+
}
|
41
|
+
};
|
42
|
+
}));
|
43
|
+
|
44
|
+
beforeEach(inject(function(_$location_, _$timeout_, _Nutupane_) {
|
45
|
+
$location = _$location_;
|
46
|
+
$timeout = _$timeout_;
|
47
|
+
Nutupane = _Nutupane_;
|
48
|
+
}));
|
49
|
+
|
50
|
+
describe("adds additional functionality to the Nutupane table by", function() {
|
51
|
+
var nutupane;
|
52
|
+
|
53
|
+
beforeEach(function() {
|
54
|
+
nutupane = new Nutupane(Resource);
|
55
|
+
nutupane.table.working = false;
|
56
|
+
nutupane.table.selectAll = function() {};
|
57
|
+
nutupane.table.getSelected = function() {};
|
58
|
+
nutupane.table.disableSelectAll = function () { };
|
59
|
+
nutupane.table.enableSelectAll = function () { };
|
60
|
+
nutupane.table.allSelected = function () { return true; };
|
61
|
+
nutupane.table.rows = [{id: 0, value: "value0"}, {id:1, value: "value1"}];
|
62
|
+
nutupane.table.resource = Resource;
|
63
|
+
});
|
64
|
+
|
65
|
+
it("providing a method to fetch records for the table", function() {
|
66
|
+
var expected = nutupane.table.rows.concat(expectedResult);
|
67
|
+
|
68
|
+
spyOn(Resource, 'queryPaged').andCallThrough();
|
69
|
+
nutupane.query();
|
70
|
+
|
71
|
+
expect(Resource.queryPaged).toHaveBeenCalled();
|
72
|
+
expect(nutupane.table.rows.length).toBe(4);
|
73
|
+
angular.forEach(nutupane.table.rows, function(value, index) {
|
74
|
+
expect(value).toBe(expected[index]);
|
75
|
+
});
|
76
|
+
});
|
77
|
+
|
78
|
+
it("providing a method to refresh the table", function() {
|
79
|
+
spyOn(Resource, 'queryPaged').andCallThrough();
|
80
|
+
nutupane.refresh();
|
81
|
+
|
82
|
+
expect(Resource.queryPaged).toHaveBeenCalled();
|
83
|
+
expect(nutupane.table.rows).toBe(expectedResult);
|
84
|
+
});
|
85
|
+
|
86
|
+
it("providing a method to perform a search", function() {
|
87
|
+
spyOn(Resource, 'queryPaged');
|
88
|
+
nutupane.table.closeItem = function() {};
|
89
|
+
|
90
|
+
nutupane.table.search();
|
91
|
+
|
92
|
+
expect(Resource.queryPaged).toHaveBeenCalled();
|
93
|
+
});
|
94
|
+
|
95
|
+
it("refusing to perform a search if the table is currently fetching", function() {
|
96
|
+
spyOn(Resource, 'queryPaged');
|
97
|
+
nutupane.table.closeItem = function() {};
|
98
|
+
nutupane.table.working = true;
|
99
|
+
|
100
|
+
nutupane.table.search();
|
101
|
+
|
102
|
+
expect(Resource.queryPaged).not.toHaveBeenCalled();
|
103
|
+
});
|
104
|
+
|
105
|
+
it("setting the search parameter in the URL when performing a search", function() {
|
106
|
+
spyOn(Resource, 'queryPaged');
|
107
|
+
nutupane.table.closeItem = function() {};
|
108
|
+
nutupane.table.working = true;
|
109
|
+
|
110
|
+
nutupane.table.search("Find Me");
|
111
|
+
|
112
|
+
expect($location.search().search).toEqual("Find Me");
|
113
|
+
});
|
114
|
+
|
115
|
+
it("enforcing the user of this factory to define a closeItem function", function() {
|
116
|
+
expect(nutupane.table.closeItem).toThrow();
|
117
|
+
});
|
118
|
+
|
119
|
+
it("updates a single occurrence of a row within the list of rows.", function() {
|
120
|
+
var newRow = {id:0, value:"new value", anotherValue: "value"};
|
121
|
+
nutupane.query();
|
122
|
+
nutupane.table.replaceRow(newRow);
|
123
|
+
expect(nutupane.table.rows[0]).toBe(newRow);
|
124
|
+
});
|
125
|
+
|
126
|
+
it("removes a single occurrence of a row within the list of rows.", function() {
|
127
|
+
var row = {id:0, value: "value2"};
|
128
|
+
nutupane.removeRow(row.id);
|
129
|
+
expect(nutupane.table.rows.length).toBe(1);
|
130
|
+
expect(nutupane.table.rows).not.toContain(row);
|
131
|
+
});
|
132
|
+
|
133
|
+
it("decrements num selected if removed row is selected.", function() {
|
134
|
+
var row = nutupane.table.rows[0];
|
135
|
+
row.selected = true;
|
136
|
+
nutupane.table.numSelected = 1;
|
137
|
+
|
138
|
+
nutupane.removeRow(row.id);
|
139
|
+
expect(nutupane.table.rows.length).toBe(1);
|
140
|
+
expect(nutupane.table.rows).not.toContain(row);
|
141
|
+
expect(nutupane.table.numSelected).toBe(0);
|
142
|
+
});
|
143
|
+
|
144
|
+
it("providing a method that fetches more data", function() {
|
145
|
+
nutupane.table.rows = [];
|
146
|
+
spyOn(Resource, 'queryPaged');
|
147
|
+
|
148
|
+
nutupane.table.nextPage();
|
149
|
+
|
150
|
+
expect(Resource.queryPaged).toHaveBeenCalled();
|
151
|
+
});
|
152
|
+
|
153
|
+
it("refusing to fetch more data if the table is currently working", function() {
|
154
|
+
spyOn(Resource, 'queryPaged');
|
155
|
+
nutupane.table.working = true;
|
156
|
+
nutupane.table.nextPage();
|
157
|
+
|
158
|
+
expect(Resource.queryPaged).not.toHaveBeenCalled();
|
159
|
+
});
|
160
|
+
|
161
|
+
it("refusing to fetch more data if the subtotal of records equals the number of rows", function() {
|
162
|
+
spyOn(Resource, 'queryPaged');
|
163
|
+
nutupane.table.rows = new Array(8);
|
164
|
+
nutupane.table.nextPage();
|
165
|
+
|
166
|
+
expect(Resource.queryPaged).not.toHaveBeenCalled();
|
167
|
+
});
|
168
|
+
|
169
|
+
it("provides a way to add an individual row", function() {
|
170
|
+
nutupane.table.rows = new Array(8);
|
171
|
+
nutupane.table.addRow('');
|
172
|
+
|
173
|
+
expect(nutupane.table.rows.length).toBe(9);
|
174
|
+
});
|
175
|
+
|
176
|
+
it("provides a way to enable select all results", function(){
|
177
|
+
nutupane.enableSelectAllResults();
|
178
|
+
expect(nutupane.table.selectAllResultsEnabled).toBe(true);
|
179
|
+
});
|
180
|
+
|
181
|
+
it("provides a way to select all results", function() {
|
182
|
+
nutupane.enableSelectAllResults();
|
183
|
+
spyOn(nutupane.table, 'selectAll');
|
184
|
+
spyOn(nutupane.table, 'disableSelectAll');
|
185
|
+
|
186
|
+
nutupane.table.selectAllResults(true);
|
187
|
+
|
188
|
+
expect(nutupane.table.selectAll).toHaveBeenCalledWith(true);
|
189
|
+
expect(nutupane.table.disableSelectAll).toHaveBeenCalled();
|
190
|
+
expect(nutupane.table.allResultsSelected).toBe(true);
|
191
|
+
expect(nutupane.table.numSelected).toBe(nutupane.table.resource.subtotal);
|
192
|
+
});
|
193
|
+
|
194
|
+
it("provides a way to de-select all results", function(){
|
195
|
+
nutupane.enableSelectAllResults();
|
196
|
+
nutupane.table.numSelected = 0;
|
197
|
+
spyOn(nutupane.table, 'selectAll');
|
198
|
+
spyOn(nutupane.table, 'enableSelectAll');
|
199
|
+
nutupane.table.selectAllResults(false);
|
200
|
+
|
201
|
+
expect(nutupane.table.selectAll).toHaveBeenCalledWith(false);
|
202
|
+
expect(nutupane.table.enableSelectAll).toHaveBeenCalled();
|
203
|
+
expect(nutupane.table.allResultsSelected).toBe(false);
|
204
|
+
expect(nutupane.table.numSelected).toBe(0);
|
205
|
+
});
|
206
|
+
|
207
|
+
it("provides a way to get deselected items", function(){
|
208
|
+
var deselected;
|
209
|
+
nutupane.enableSelectAllResults();
|
210
|
+
nutupane.table.rows = expectedResult;
|
211
|
+
angular.forEach(nutupane.table.rows, function(item, itemIndex) {
|
212
|
+
item.selected = true;
|
213
|
+
});
|
214
|
+
nutupane.table.rows[0].selected = false
|
215
|
+
deselected = nutupane.getDeselected();
|
216
|
+
|
217
|
+
expect(deselected.length).toBe(1);
|
218
|
+
expect(deselected[0]).toBe(nutupane.table.rows[0]);
|
219
|
+
});
|
220
|
+
|
221
|
+
it("provides a way to retrieve selected result items", function(){
|
222
|
+
var results;
|
223
|
+
nutupane.enableSelectAllResults();
|
224
|
+
nutupane.table.selectAllResults(true);
|
225
|
+
nutupane.table.searchTerm = "FOO"
|
226
|
+
|
227
|
+
angular.forEach(nutupane.table.rows, function(item, itemIndex) {
|
228
|
+
item.selected = true;
|
229
|
+
});
|
230
|
+
nutupane.table.rows[0].selected = false;
|
231
|
+
results = nutupane.getAllSelectedResults('id');
|
232
|
+
expect(results.excluded.ids[0]).toBe(nutupane.table.rows[0]['id']);
|
233
|
+
expect(results.included.search).toBe("FOO");
|
234
|
+
});
|
235
|
+
|
236
|
+
describe("provides a way to sort the table", function() {
|
237
|
+
it ("defaults the sort to ascending if the previous sort does not match the new sort.", function() {
|
238
|
+
var expectedParams = {sort_by: 'name', sort_order: 'ASC', search: '', page: 1};
|
239
|
+
nutupane.table.resource.sort = {};
|
240
|
+
|
241
|
+
spyOn(Resource, 'queryPaged');
|
242
|
+
nutupane.table.sortBy({id: "name"});
|
243
|
+
|
244
|
+
expect(Resource.queryPaged).toHaveBeenCalledWith(expectedParams, jasmine.any(Function));
|
245
|
+
});
|
246
|
+
|
247
|
+
it("toggles the sort order if already sorting by that column", function() {
|
248
|
+
var expectedParams = {sort_by: 'name', sort_order: 'DESC', search: '', page: 1};
|
249
|
+
nutupane.table.resource.sort = {
|
250
|
+
by: 'name',
|
251
|
+
order: 'ASC'
|
252
|
+
};
|
253
|
+
|
254
|
+
spyOn(Resource, 'queryPaged');
|
255
|
+
nutupane.table.sortBy({id: "name"});
|
256
|
+
|
257
|
+
expect(Resource.queryPaged).toHaveBeenCalledWith(expectedParams, jasmine.any(Function));
|
258
|
+
});
|
259
|
+
|
260
|
+
it("sets the column sort order and marks it as active.", function() {
|
261
|
+
var column = {id: "name"}
|
262
|
+
nutupane.table.resource.sort = {};
|
263
|
+
nutupane.table.sortBy(column);
|
264
|
+
expect(column.sortOrder).toBe("ASC");
|
265
|
+
expect(column.active).toBe(true);
|
266
|
+
});
|
267
|
+
|
268
|
+
it("refreshes the table by calling query()", function() {
|
269
|
+
spyOn(nutupane, "query");
|
270
|
+
nutupane.table.sortBy({id: "name"});
|
271
|
+
expect(nutupane.query).toHaveBeenCalled();
|
272
|
+
});
|
273
|
+
});
|
274
|
+
});
|
275
|
+
|
276
|
+
describe("Nutupane should", function() {
|
277
|
+
beforeEach(function() {
|
278
|
+
nutupane = new Nutupane(Resource, {}, 'customAction');
|
279
|
+
nutupane.table.working = false;
|
280
|
+
nutupane.table.closeItem = function () {};
|
281
|
+
nutupane.table.allSelected = function () {};
|
282
|
+
nutupane.table.selectAll = function () {};
|
283
|
+
});
|
284
|
+
|
285
|
+
it("provide a method to fetch records for the table via a custom action", function() {
|
286
|
+
spyOn(Resource, 'customAction');
|
287
|
+
nutupane.query();
|
288
|
+
|
289
|
+
expect(Resource.customAction).toHaveBeenCalled();
|
290
|
+
});
|
291
|
+
|
292
|
+
it("naming the URL search field based off the action", function() {
|
293
|
+
spyOn(Resource, 'customAction');
|
294
|
+
nutupane.table.search('*');
|
295
|
+
|
296
|
+
expect($location.search()['customActionSearch']).toBe('*');
|
297
|
+
});
|
298
|
+
|
299
|
+
it("provide a method to add params", function () {
|
300
|
+
nutupane.addParam('test', 'ABC');
|
301
|
+
|
302
|
+
expect(nutupane.getParams()['test']).toBe('ABC');
|
303
|
+
});
|
304
|
+
});
|
305
|
+
|
306
|
+
});
|
307
|
+
|
@@ -0,0 +1,74 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright 2014 Red Hat, Inc.
|
3
|
+
*
|
4
|
+
* This software is licensed to you under the GNU General Public
|
5
|
+
* License as published by the Free Software Foundation; either version
|
6
|
+
* 2 of the License (GPLv2) or (at your option) any later version.
|
7
|
+
* There is NO WARRANTY for this software, express or implied,
|
8
|
+
* including the implied warranties of MERCHANTABILITY,
|
9
|
+
* NON-INFRINGEMENT, or FITNESS FOR A PARTICULAR PURPOSE. You should
|
10
|
+
* have received a copy of GPLv2 along with this software; if not, see
|
11
|
+
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
12
|
+
**/
|
13
|
+
|
14
|
+
describe('Service: MenuExpander', function() {
|
15
|
+
var menuExpander;
|
16
|
+
|
17
|
+
beforeEach(module('Bastion.menu'));
|
18
|
+
|
19
|
+
beforeEach(inject(function(MenuExpander) {
|
20
|
+
menuExpander = MenuExpander;
|
21
|
+
}));
|
22
|
+
|
23
|
+
describe('sets menu items', function() {
|
24
|
+
it('by adding a menu if the menu does not exist', function() {
|
25
|
+
var menu = [{'url': 'http://google.com', 'label': 'google'}];
|
26
|
+
|
27
|
+
menuExpander.setMenu('system', menu);
|
28
|
+
|
29
|
+
expect(menuExpander.getMenu('system')).toBe(menu);
|
30
|
+
});
|
31
|
+
|
32
|
+
it('by adding to the menu if it already exists', function() {
|
33
|
+
var menu1 = [{'url': 'http://google.com', 'label': 'google'}],
|
34
|
+
menu2 = [{'url': 'http://redhat.com', 'label': 'redhat'}];
|
35
|
+
|
36
|
+
menuExpander.setMenu('system', menu1);
|
37
|
+
menuExpander.setMenu('system', menu2);
|
38
|
+
|
39
|
+
expect(menuExpander.getMenu('system').length).toBe(2);
|
40
|
+
expect(menuExpander.getMenu('system')[0]).toBe(menu1[0]);
|
41
|
+
expect(menuExpander.getMenu('system')[1]).toBe(menu2[0]);
|
42
|
+
});
|
43
|
+
|
44
|
+
it('by not adding duplicate menu items', function() {
|
45
|
+
var menu1 = [{'url': 'http://google.com', 'label': 'google'}],
|
46
|
+
menu2 = [{'url': 'http://google.com', 'label': 'google'}];
|
47
|
+
|
48
|
+
menuExpander.setMenu('system', menu1);
|
49
|
+
menuExpander.setMenu('system', menu2);
|
50
|
+
|
51
|
+
expect(menuExpander.getMenu('system').length).toBe(1);
|
52
|
+
expect(menuExpander.getMenu('system')[0]).toBe(menu1[0]);
|
53
|
+
});
|
54
|
+
});
|
55
|
+
|
56
|
+
describe("gets menu items", function() {
|
57
|
+
it('by returning an empty array if the menu does not exist.', function() {
|
58
|
+
expect($.isArray(menuExpander.getMenu('system'))).toBe(true);
|
59
|
+
expect(menuExpander.getMenu('system').length).toBe(0);
|
60
|
+
});
|
61
|
+
|
62
|
+
it('by returning the menu if it exists.', function() {
|
63
|
+
var menu = [{'url': 'http://google.com', 'label': 'google'}];
|
64
|
+
|
65
|
+
expect(menuExpander.getMenu('system').length).toBe(0);
|
66
|
+
|
67
|
+
menuExpander.setMenu('system', menu);
|
68
|
+
|
69
|
+
expect(menuExpander.getMenu('system').length).toBe(1);
|
70
|
+
expect(menuExpander.getMenu('system')).toBe(menu);
|
71
|
+
});
|
72
|
+
});
|
73
|
+
});
|
74
|
+
|