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,73 @@
|
|
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('Directive: alchFlyout', function() {
|
15
|
+
var scope,
|
16
|
+
compile,
|
17
|
+
testItems,
|
18
|
+
element,
|
19
|
+
elementScope;
|
20
|
+
|
21
|
+
beforeEach(module('alchemy', 'incubator/views/alch-flyout.html'));
|
22
|
+
|
23
|
+
beforeEach(inject(function(_$compile_, _$rootScope_) {
|
24
|
+
compile = _$compile_;
|
25
|
+
scope = _$rootScope_;
|
26
|
+
}));
|
27
|
+
|
28
|
+
beforeEach(function() {
|
29
|
+
testItems = [
|
30
|
+
{url: 'http://redhat.com', display: 'Red Hat'},
|
31
|
+
{url: 'http://google.com', display: 'Google'},
|
32
|
+
];
|
33
|
+
scope.items = testItems;
|
34
|
+
|
35
|
+
element = angular.element('<ul alch-flyout="items"></ul>');
|
36
|
+
compile(element)(scope);
|
37
|
+
scope.$digest();
|
38
|
+
|
39
|
+
elementScope = element.isolateScope();
|
40
|
+
elementScope.setHover = function() {};
|
41
|
+
});
|
42
|
+
|
43
|
+
it("should display a .flyout <ul>", function() {
|
44
|
+
expect(element.is('ul')).toBe(true);
|
45
|
+
expect(element.hasClass('flyout')).toBe(true);
|
46
|
+
});
|
47
|
+
|
48
|
+
it("should display an <li> element for each item.", function() {
|
49
|
+
expect(element.find('li').length).toBe(2);
|
50
|
+
expect(element.find('.flyout-item').length).toBe(2);
|
51
|
+
});
|
52
|
+
|
53
|
+
describe("should respond to mouse events", function() {
|
54
|
+
var target;
|
55
|
+
|
56
|
+
beforeEach(function() {
|
57
|
+
target = angular.element(element.find('li')[1]);
|
58
|
+
spyOn(elementScope, 'setHover');
|
59
|
+
});
|
60
|
+
|
61
|
+
it("by setting the item to active on mouse in", function() {
|
62
|
+
target.mouseenter();
|
63
|
+
|
64
|
+
expect(elementScope.setHover).toHaveBeenCalledWith(testItems[1], true);
|
65
|
+
});
|
66
|
+
|
67
|
+
it("by setting the item to inactive on mouse out", function() {
|
68
|
+
target.mouseleave();
|
69
|
+
|
70
|
+
expect(elementScope.setHover).toHaveBeenCalledWith(testItems[1], false);
|
71
|
+
});
|
72
|
+
});
|
73
|
+
});
|
@@ -0,0 +1,55 @@
|
|
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: alchFormButtons', function() {
|
16
|
+
var $scope, $compile, element;
|
17
|
+
|
18
|
+
beforeEach(module(
|
19
|
+
'alchemy',
|
20
|
+
'incubator/views/alch-save-control.html',
|
21
|
+
'incubator/views/alch-form-buttons.html'
|
22
|
+
));
|
23
|
+
|
24
|
+
beforeEach(inject(function(_$compile_, _$rootScope_) {
|
25
|
+
$compile = _$compile_;
|
26
|
+
$scope = _$rootScope_;
|
27
|
+
}));
|
28
|
+
|
29
|
+
beforeEach(function() {
|
30
|
+
element = '<form name="testForm">' +
|
31
|
+
'<input name="name" ng-model="fake.name" required>' +
|
32
|
+
'<div alch-form-buttons ' +
|
33
|
+
'on-cancel="transitionTo(\'product.index\')" ' +
|
34
|
+
'on-save="save(product)" ' +
|
35
|
+
'working="working"> ' +
|
36
|
+
'</div>' +
|
37
|
+
'</form>';
|
38
|
+
|
39
|
+
element = $compile(element)($scope);
|
40
|
+
$scope.$digest();
|
41
|
+
});
|
42
|
+
|
43
|
+
it("should set create button to disabled if no server validator is set but the form is invalid", function() {
|
44
|
+
var disabled = angular.element(element).find('.btn-primary').attr('disabled');
|
45
|
+
expect(disabled).toBe('disabled');
|
46
|
+
});
|
47
|
+
|
48
|
+
it("should set create button to enabled if a server validator is set", function() {
|
49
|
+
$scope.testForm.name.$error.server = true;
|
50
|
+
$scope.$digest();
|
51
|
+
var disabled = angular.element(element).find('.btn-primary').attr('disabled');
|
52
|
+
expect(disabled).toBe(undefined);
|
53
|
+
});
|
54
|
+
|
55
|
+
});
|
@@ -0,0 +1,76 @@
|
|
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: alchFormGroup', function() {
|
16
|
+
var $scope, $compile, element;
|
17
|
+
|
18
|
+
beforeEach(module(
|
19
|
+
'alchemy',
|
20
|
+
'incubator/views/alch-form-group.html'
|
21
|
+
));
|
22
|
+
|
23
|
+
beforeEach(inject(function(_$compile_, _$rootScope_) {
|
24
|
+
$compile = _$compile_;
|
25
|
+
$scope = _$rootScope_;
|
26
|
+
}));
|
27
|
+
|
28
|
+
beforeEach(function() {
|
29
|
+
element = '<form name="testForm">' +
|
30
|
+
'<div alch-form-group label="Name" required>' +
|
31
|
+
'<input id="name" ' +
|
32
|
+
'name="name" ' +
|
33
|
+
'ng-model="fake.name" ' +
|
34
|
+
'type="text" ' +
|
35
|
+
'tabindex="1" ' +
|
36
|
+
'required/>' +
|
37
|
+
'</div>' +
|
38
|
+
'</form>';
|
39
|
+
|
40
|
+
$scope.fake = {name: ''};
|
41
|
+
element = $compile(element)($scope);
|
42
|
+
$scope.$digest();
|
43
|
+
});
|
44
|
+
|
45
|
+
it("should add a 'form-control' class to the input", function() {
|
46
|
+
expect(element.find('input').hasClass('form-control')).toBe(true);
|
47
|
+
});
|
48
|
+
|
49
|
+
it("should display validation error messages if they exist", function() {
|
50
|
+
$scope.testForm.name.$error.messages = ['Error message']
|
51
|
+
$scope.$digest();
|
52
|
+
|
53
|
+
expect(element.find('.help-block').hasClass('ng-hide')).toBe(false);
|
54
|
+
expect(element.find('li').length).toBeGreaterThan(0);
|
55
|
+
});
|
56
|
+
|
57
|
+
it("should set the form group to an error state if the form is invalid and dirty", function() {
|
58
|
+
$scope.testForm.name.$dirty = true;
|
59
|
+
$scope.$digest();
|
60
|
+
|
61
|
+
expect($scope.testForm.name.$invalid).toBe(true);
|
62
|
+
expect($scope.testForm.name.$dirty).toBe(true);
|
63
|
+
expect(element.find('.has-error').length).toBeGreaterThan(0);
|
64
|
+
});
|
65
|
+
|
66
|
+
it("should not set the form group to an error state if the form is invalid but not dirty", function() {
|
67
|
+
expect(element.find('.has-errors').length).toBe(0);
|
68
|
+
});
|
69
|
+
|
70
|
+
it("should do nothing if valid and dirty", function() {
|
71
|
+
$scope.testForm.name.$dirty = true;
|
72
|
+
$scope.$digest();
|
73
|
+
|
74
|
+
expect(element.find('.has-errors').length).toBe(0);
|
75
|
+
});
|
76
|
+
});
|
@@ -0,0 +1,123 @@
|
|
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('Directive: alchInfiniteScroll', function () {
|
14
|
+
var $scope, $compile, $q, element;
|
15
|
+
|
16
|
+
beforeEach(module('alchemy'));
|
17
|
+
|
18
|
+
beforeEach(inject(function ($rootScope, _$compile_, _$q_){
|
19
|
+
$scope = $rootScope;
|
20
|
+
$compile = _$compile_;
|
21
|
+
$q = _$q_;
|
22
|
+
|
23
|
+
$scope.scrollHandler = {
|
24
|
+
doIt: function() {
|
25
|
+
var deferred = $q.defer();
|
26
|
+
element.append('<p style="height: 10px;"></p>');
|
27
|
+
deferred.resolve({});
|
28
|
+
return deferred.promise;
|
29
|
+
}
|
30
|
+
};
|
31
|
+
$scope.data = [];
|
32
|
+
element = angular.element('<div data="data" alch-infinite-scroll="scrollHandler.doIt()" style=" height: 100px; position: absolute; overflow-y: auto;"></div>');
|
33
|
+
$('body').append(element);
|
34
|
+
}));
|
35
|
+
|
36
|
+
describe("loads more results if scrolling near the bottom", function() {
|
37
|
+
beforeEach(function() {
|
38
|
+
$compile(element)($scope);
|
39
|
+
$scope.$digest();
|
40
|
+
});
|
41
|
+
|
42
|
+
it("calls the provided scroll function when scrolling near the bottom.", function() {
|
43
|
+
spyOn($scope.scrollHandler, "doIt");
|
44
|
+
|
45
|
+
// 95% of the height of the scroll area
|
46
|
+
element.scrollTop(element[0].scrollHeight *.95);
|
47
|
+
element.trigger('scroll');
|
48
|
+
|
49
|
+
expect($scope.scrollHandler.doIt).toHaveBeenCalled();
|
50
|
+
});
|
51
|
+
|
52
|
+
it("does not calls the provided scroll function when not scrolling near the bottom.", function() {
|
53
|
+
spyOn($scope.scrollHandler, "doIt");
|
54
|
+
|
55
|
+
// 10% of the height of the scroll area
|
56
|
+
element.scrollTop(element[0].scrollHeight *.10);
|
57
|
+
element.trigger('scroll');
|
58
|
+
|
59
|
+
expect($scope.scrollHandler.doIt).not.toHaveBeenCalled();
|
60
|
+
});
|
61
|
+
});
|
62
|
+
|
63
|
+
describe("loads more results if there is not a scrollbar", function() {
|
64
|
+
it("on initial load.", function() {
|
65
|
+
spyOn($scope.scrollHandler, "doIt").andCallThrough();
|
66
|
+
$compile(element)($scope);
|
67
|
+
$scope.$digest();
|
68
|
+
expect($scope.scrollHandler.doIt.callCount).toBe(10);
|
69
|
+
});
|
70
|
+
});
|
71
|
+
|
72
|
+
describe("does not load more results if there is already a scrollbar", function() {
|
73
|
+
beforeEach(function() {
|
74
|
+
$compile(element)($scope);
|
75
|
+
$scope.$digest();
|
76
|
+
});
|
77
|
+
|
78
|
+
it("on initial load.", function() {
|
79
|
+
spyOn($scope.scrollHandler, "doIt").andCallThrough();
|
80
|
+
$scope.$digest();
|
81
|
+
expect($scope.scrollHandler.doIt.callCount).toBe(0);
|
82
|
+
});
|
83
|
+
});
|
84
|
+
|
85
|
+
describe("loads more results based on the height of the elements", function() {
|
86
|
+
beforeEach(function() {
|
87
|
+
element.empty();
|
88
|
+
element.append('<p style="height: 10px;"></p>');
|
89
|
+
});
|
90
|
+
|
91
|
+
it("loads more results if the scroll height is less than element height.", function() {
|
92
|
+
spyOn($scope.scrollHandler, "doIt").andCallThrough();
|
93
|
+
element.height("9px");
|
94
|
+
|
95
|
+
$compile(element)($scope);
|
96
|
+
$scope.$digest();
|
97
|
+
|
98
|
+
expect($scope.scrollHandler.doIt.callCount).toBe(1);
|
99
|
+
});
|
100
|
+
|
101
|
+
it("does not load more results if the scroll height is equal to the element height.", function() {
|
102
|
+
element.height("10px");
|
103
|
+
|
104
|
+
$compile(element)($scope);
|
105
|
+
|
106
|
+
spyOn($scope.scrollHandler, "doIt");
|
107
|
+
$scope.$digest();
|
108
|
+
|
109
|
+
expect($scope.scrollHandler.doIt.callCount).toBe(0);
|
110
|
+
});
|
111
|
+
|
112
|
+
it("does not load more results if the scroll height is greater than the element height.", function() {
|
113
|
+
element.height("11px");
|
114
|
+
element.append('<p style="height: 10px;"></p>');
|
115
|
+
$compile(element)($scope);
|
116
|
+
|
117
|
+
spyOn($scope.scrollHandler, "doIt");
|
118
|
+
$scope.$digest();
|
119
|
+
|
120
|
+
expect($scope.scrollHandler.doIt.callCount).toBe(0);
|
121
|
+
});
|
122
|
+
});
|
123
|
+
});
|
@@ -0,0 +1,94 @@
|
|
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('Directive: alchMenu', function() {
|
15
|
+
var scope,
|
16
|
+
compile,
|
17
|
+
window,
|
18
|
+
testMenu,
|
19
|
+
element,
|
20
|
+
elementScope;
|
21
|
+
|
22
|
+
beforeEach(module(
|
23
|
+
'alchemy',
|
24
|
+
'incubator/views/alch-menu.html',
|
25
|
+
'incubator/views/alch-dropdown.html',
|
26
|
+
'incubator/views/alch-flyout.html'
|
27
|
+
));
|
28
|
+
|
29
|
+
beforeEach(inject(function(_$compile_, _$rootScope_, $window) {
|
30
|
+
compile = _$compile_;
|
31
|
+
scope = _$rootScope_;
|
32
|
+
window = angular.element($window);
|
33
|
+
}));
|
34
|
+
|
35
|
+
beforeEach(function() {
|
36
|
+
testMenu = {items: [
|
37
|
+
{url: 'http://redhat.com', display: 'Red Hat'},
|
38
|
+
{url: 'http://google.com', display: 'Google'},
|
39
|
+
{display: 'Projects', type: 'dropdown', items: [
|
40
|
+
{url: 'http://katello.org', display: 'Katello'},
|
41
|
+
{url: 'http://theforeman.org', display: 'Foreman'}
|
42
|
+
]}
|
43
|
+
]};
|
44
|
+
scope.items = testMenu;
|
45
|
+
|
46
|
+
element = angular.element('<nav alch-menu="items"></nav>');
|
47
|
+
compile(element)(scope);
|
48
|
+
scope.$digest();
|
49
|
+
|
50
|
+
elementScope = element.isolateScope();
|
51
|
+
});
|
52
|
+
|
53
|
+
it("should display a nav", function() {
|
54
|
+
expect(element.is('nav')).toBe(true);
|
55
|
+
});
|
56
|
+
|
57
|
+
it("should display a .menu-container <ul>", function() {
|
58
|
+
expect(element.find('.menu-container').length).toBe(1);
|
59
|
+
});
|
60
|
+
|
61
|
+
it("should display a .menu-item <li> for each top level menu item", function() {
|
62
|
+
expect(element.find('.menu-item').length).toBe(3);
|
63
|
+
});
|
64
|
+
|
65
|
+
it("should display an <li> element for each item (including children).", function() {
|
66
|
+
expect(element.find('li').length).toBe(5);
|
67
|
+
});
|
68
|
+
|
69
|
+
describe("should handle mouse events for child dropdowns", function() {
|
70
|
+
var target;
|
71
|
+
|
72
|
+
beforeEach(function() {
|
73
|
+
target = angular.element(element.find('li')[2]);
|
74
|
+
spyOn(elementScope, 'handleHover').andCallThrough();
|
75
|
+
});
|
76
|
+
|
77
|
+
it("by setting the item to active on mouse in", function() {
|
78
|
+
target.mouseenter();
|
79
|
+
|
80
|
+
expect(elementScope.handleHover).toHaveBeenCalledWith(testMenu.items[2], true);
|
81
|
+
expect(testMenu.items[2].active).toBe(true);
|
82
|
+
expect(elementScope.dropdown.show).toBe(true);
|
83
|
+
expect(elementScope.dropdown).toBe(testMenu.items[2].items);
|
84
|
+
});
|
85
|
+
|
86
|
+
it("by setting the item to inactive on mouse out", function() {
|
87
|
+
target.mouseenter();
|
88
|
+
target.mouseleave();
|
89
|
+
|
90
|
+
expect(elementScope.handleHover).toHaveBeenCalledWith(testMenu.items[2], false);
|
91
|
+
expect(elementScope.dropdown.show).toBe(false);
|
92
|
+
});
|
93
|
+
});
|
94
|
+
});
|
@@ -0,0 +1,81 @@
|
|
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('Directive: alchModal', function() {
|
15
|
+
var scope,
|
16
|
+
compile,
|
17
|
+
$modal,
|
18
|
+
$q,
|
19
|
+
translate,
|
20
|
+
testItem,
|
21
|
+
element,
|
22
|
+
elementScope;
|
23
|
+
|
24
|
+
beforeEach(module('alchemy', 'incubator/views/alch-modal-remove.html'));
|
25
|
+
|
26
|
+
beforeEach(module(function($provide) {
|
27
|
+
testItem = {
|
28
|
+
name: 'Test Name',
|
29
|
+
taco: 'carnitas',
|
30
|
+
delete: function() {}
|
31
|
+
};
|
32
|
+
|
33
|
+
translate = function() {
|
34
|
+
this.$get = function() {
|
35
|
+
return function() {};
|
36
|
+
};
|
37
|
+
};
|
38
|
+
|
39
|
+
$modal = {
|
40
|
+
$get: function() {
|
41
|
+
return this;
|
42
|
+
},
|
43
|
+
open: function() {
|
44
|
+
var deferred = $q.defer();
|
45
|
+
deferred.resolve({});
|
46
|
+
|
47
|
+
return {
|
48
|
+
result: deferred.promise
|
49
|
+
}
|
50
|
+
}
|
51
|
+
};
|
52
|
+
|
53
|
+
$provide.provider('translateFilter', translate);
|
54
|
+
$provide.provider('$modal', $modal);
|
55
|
+
}));
|
56
|
+
|
57
|
+
beforeEach(inject(function(_$compile_, _$rootScope_, _$q_) {
|
58
|
+
compile = _$compile_;
|
59
|
+
scope = _$rootScope_;
|
60
|
+
$q = _$q_;
|
61
|
+
}));
|
62
|
+
|
63
|
+
beforeEach(function() {
|
64
|
+
element = angular.element(
|
65
|
+
'<span alch-modal="item.delete(item)" model="testItem">' +
|
66
|
+
'<p>Hello!</p></span>');
|
67
|
+
|
68
|
+
compile(element)(scope);
|
69
|
+
scope.$digest();
|
70
|
+
|
71
|
+
elementScope = element.scope();
|
72
|
+
});
|
73
|
+
|
74
|
+
it("allows the opening of a modal dialog via bootstrap ui", function() {
|
75
|
+
spyOn($modal, 'open').andCallThrough();
|
76
|
+
|
77
|
+
elementScope.openModal();
|
78
|
+
|
79
|
+
expect($modal.open).toHaveBeenCalled();
|
80
|
+
});
|
81
|
+
});
|