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,268 @@
|
|
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
|
+
angular.module('Bastion.test-mocks', ['ui.router']);
|
15
|
+
|
16
|
+
angular.module('Bastion.test-mocks').config(['$provide', function ($provide) {
|
17
|
+
|
18
|
+
$provide.factory('PrefixInterceptor', function () {
|
19
|
+
return {
|
20
|
+
request: function (config) {
|
21
|
+
return config;
|
22
|
+
}
|
23
|
+
};
|
24
|
+
});
|
25
|
+
|
26
|
+
}]);
|
27
|
+
|
28
|
+
angular.module('Bastion.test-mocks').run(['$state', '$stateParams', '$rootScope',
|
29
|
+
function($state, $stateParams, $rootScope) {
|
30
|
+
|
31
|
+
$rootScope.transitionTo = function(state, params) {};
|
32
|
+
$rootScope.$state = $state;
|
33
|
+
$rootScope.$stateParams = $stateParams;
|
34
|
+
|
35
|
+
}
|
36
|
+
]);
|
37
|
+
|
38
|
+
angular.module('Bastion.test-mocks').factory('MockResource', function () {
|
39
|
+
function resourceGenerator() {
|
40
|
+
var Resource, mockResource, successResponse, errorResponse;
|
41
|
+
|
42
|
+
successResponse ={
|
43
|
+
displayMessages: {
|
44
|
+
success: ['success'],
|
45
|
+
error: ['error']
|
46
|
+
}
|
47
|
+
};
|
48
|
+
|
49
|
+
errorResponse = {
|
50
|
+
data: {
|
51
|
+
errors: {
|
52
|
+
name: 'Invalid name'
|
53
|
+
}
|
54
|
+
}
|
55
|
+
};
|
56
|
+
|
57
|
+
mockResource = {
|
58
|
+
id: 1,
|
59
|
+
name: 'Test Resource',
|
60
|
+
label: '',
|
61
|
+
failed: false,
|
62
|
+
readonly: false,
|
63
|
+
$get: function() {
|
64
|
+
return {then: function(callback) {
|
65
|
+
callback(mockResource);
|
66
|
+
}};
|
67
|
+
},
|
68
|
+
$save: function(params, success, error) {
|
69
|
+
if (typeof(params) === "function") {
|
70
|
+
error = success;
|
71
|
+
success = params;
|
72
|
+
}
|
73
|
+
|
74
|
+
if (!this.failed) {
|
75
|
+
success(this);
|
76
|
+
} else {
|
77
|
+
error(errorResponse);
|
78
|
+
}
|
79
|
+
},
|
80
|
+
$update: function(params, success, error) {
|
81
|
+
if (typeof(params) === "function") {
|
82
|
+
error = success;
|
83
|
+
success = params;
|
84
|
+
}
|
85
|
+
|
86
|
+
if (this.failed) {
|
87
|
+
error({ data: {errors: ['error!']}});
|
88
|
+
} else {
|
89
|
+
success(this);
|
90
|
+
}
|
91
|
+
},
|
92
|
+
$delete: function(success, failure) {
|
93
|
+
success(this);
|
94
|
+
},
|
95
|
+
$promise: {then: function(callback) {
|
96
|
+
callback(mockResource);
|
97
|
+
}}
|
98
|
+
};
|
99
|
+
|
100
|
+
Resource = function(parameters) {
|
101
|
+
var copy = angular.copy(mockResource);
|
102
|
+
if(parameters) {
|
103
|
+
angular.extend(copy, parameters);
|
104
|
+
}
|
105
|
+
Resource.mockResources.results.push(copy);
|
106
|
+
Resource.mockResources.total += 1;
|
107
|
+
Resource.mockResources.subtotal += 1;
|
108
|
+
return copy;
|
109
|
+
};
|
110
|
+
|
111
|
+
Resource.mockResources = {
|
112
|
+
results: [
|
113
|
+
mockResource
|
114
|
+
],
|
115
|
+
total: 2,
|
116
|
+
subtotal: 1
|
117
|
+
};
|
118
|
+
|
119
|
+
Resource.get = function(params, callback) {
|
120
|
+
var item;
|
121
|
+
|
122
|
+
angular.forEach(Resource.mockResources.results, function(value) {
|
123
|
+
if (params.id) {
|
124
|
+
if (value.id.toString() === params.id.toString()) {
|
125
|
+
item = value;
|
126
|
+
}
|
127
|
+
}
|
128
|
+
});
|
129
|
+
|
130
|
+
if (callback) {
|
131
|
+
callback(item);
|
132
|
+
}
|
133
|
+
|
134
|
+
return item;
|
135
|
+
};
|
136
|
+
|
137
|
+
Resource.query = function(params, callback) {
|
138
|
+
if (typeof(params) === "function") {
|
139
|
+
params.call(this, Resource.mockResources);
|
140
|
+
} else if (callback) {
|
141
|
+
callback.call(this, Resource.mockResources);
|
142
|
+
}
|
143
|
+
return Resource.mockResources;
|
144
|
+
};
|
145
|
+
Resource.queryPaged = Resource.query;
|
146
|
+
Resource.queryUnpaged = Resource.query;
|
147
|
+
|
148
|
+
Resource.save = function(params, data, success, error) {
|
149
|
+
var item = new Resource(data);
|
150
|
+
|
151
|
+
Resource.mockResources.results.push(item);
|
152
|
+
success(item);
|
153
|
+
|
154
|
+
return item;
|
155
|
+
};
|
156
|
+
|
157
|
+
Resource.update = function(params, data, success, error) {
|
158
|
+
var item = Resource.get(params);
|
159
|
+
|
160
|
+
if (item) {
|
161
|
+
item = angular.extend(item, data);
|
162
|
+
} else {
|
163
|
+
item = data;
|
164
|
+
}
|
165
|
+
|
166
|
+
if (success) {
|
167
|
+
success(item);
|
168
|
+
}
|
169
|
+
return item;
|
170
|
+
};
|
171
|
+
|
172
|
+
Resource.delete = function(params, success, error) {
|
173
|
+
params = null;
|
174
|
+
delete params;
|
175
|
+
|
176
|
+
if (this.failed) {
|
177
|
+
error({ data: {errors: ['error!']}});
|
178
|
+
} else {
|
179
|
+
success(params);
|
180
|
+
}
|
181
|
+
|
182
|
+
return true;
|
183
|
+
};
|
184
|
+
|
185
|
+
Resource.remove = Resource.delete;
|
186
|
+
|
187
|
+
return Resource;
|
188
|
+
}
|
189
|
+
|
190
|
+
return {
|
191
|
+
$new: function() {
|
192
|
+
return resourceGenerator();
|
193
|
+
}
|
194
|
+
};
|
195
|
+
});
|
196
|
+
|
197
|
+
angular.module('Bastion.test-mocks').factory('MockForm', function() {
|
198
|
+
return {
|
199
|
+
name: {
|
200
|
+
$invalid: false,
|
201
|
+
$setValidity: function() {
|
202
|
+
this.$invalid = true;
|
203
|
+
},
|
204
|
+
$error: {
|
205
|
+
messages: []
|
206
|
+
}
|
207
|
+
}
|
208
|
+
};
|
209
|
+
});
|
210
|
+
|
211
|
+
|
212
|
+
angular.module('Bastion.test-mocks').factory('MockTask', ['MockResource',
|
213
|
+
function(MockResource) {
|
214
|
+
var myMock = MockResource.$new();
|
215
|
+
var searchIdGenerator = 0;
|
216
|
+
myMock.registeredSearches = {};
|
217
|
+
|
218
|
+
myMock.poll = function(task, finishedCallBack) {
|
219
|
+
myMock.get(task, finishedCallBack);
|
220
|
+
};
|
221
|
+
|
222
|
+
myMock.registerSearch = function(searchParams, callback) {
|
223
|
+
searchIdGenerator += 1;
|
224
|
+
var searchId = searchIdGenerator;
|
225
|
+
myMock.registeredSearches[searchId] = callback;
|
226
|
+
};
|
227
|
+
|
228
|
+
myMock.unregisterSearch = function(id) {
|
229
|
+
delete myMock.registeredSearches[id];
|
230
|
+
};
|
231
|
+
|
232
|
+
myMock.simulateBulkSearch = function (taskData) {
|
233
|
+
_.each(myMock.registeredSearches, function (callback) {
|
234
|
+
callback(taskData);
|
235
|
+
});
|
236
|
+
};
|
237
|
+
return myMock;
|
238
|
+
}
|
239
|
+
]);
|
240
|
+
|
241
|
+
angular.module('Bastion.test-mocks').factory('MockOrganization', ['MockResource',
|
242
|
+
function(MockResource) {
|
243
|
+
var myMock = MockResource.$new();
|
244
|
+
|
245
|
+
myMock.mockDiscoveryTask = {
|
246
|
+
pending: false,
|
247
|
+
input: 'http://fake/',
|
248
|
+
output: ['http://fake/foo']
|
249
|
+
};
|
250
|
+
|
251
|
+
myMock.cancelRepoDiscover = function(params, success) {
|
252
|
+
success(myMock.mockDiscoveryTask);
|
253
|
+
};
|
254
|
+
myMock.repoDiscover = function(params, success) {
|
255
|
+
success(myMock.mockDiscoveryTask);
|
256
|
+
};
|
257
|
+
|
258
|
+
return myMock;
|
259
|
+
}
|
260
|
+
]);
|
261
|
+
|
262
|
+
angular.module('Bastion.test-mocks').factory('translateMock', function () {
|
263
|
+
|
264
|
+
return function (message) {
|
265
|
+
return message;
|
266
|
+
};
|
267
|
+
|
268
|
+
});
|
@@ -0,0 +1,33 @@
|
|
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('Filter:as', function() {
|
15
|
+
var array, scope = {};
|
16
|
+
|
17
|
+
beforeEach(module('Bastion.utils'));
|
18
|
+
|
19
|
+
beforeEach(inject(function($filter) {
|
20
|
+
array = [
|
21
|
+
{id: 1, name: 'one'},
|
22
|
+
{id: 2, name: 'two'},
|
23
|
+
{id: 3, name: 'three'}
|
24
|
+
];
|
25
|
+
scope.asFilter = $filter('as')
|
26
|
+
}));
|
27
|
+
|
28
|
+
it("should set items to the value of array", function() {
|
29
|
+
expect(scope.asFilter(array, 'items')).toEqual(array);
|
30
|
+
expect(scope.items).toEqual(array);
|
31
|
+
});
|
32
|
+
|
33
|
+
});
|
@@ -0,0 +1,52 @@
|
|
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:formUtils', function() {
|
15
|
+
var FormUtils;
|
16
|
+
|
17
|
+
beforeEach(module('Bastion.utils', 'Bastion.test-mocks'));
|
18
|
+
|
19
|
+
beforeEach(inject(function($injector) {
|
20
|
+
FormUtils = $injector.get('FormUtils');
|
21
|
+
}));
|
22
|
+
|
23
|
+
describe("provides a function that turns a name into a label", function() {
|
24
|
+
var uuidFormat = (/[a-z0-9]{8}-[a-z0-9]{4}-4[a-z0-9]{3}-[a-z0-9]{4}-[a-z0-9]{12}/);
|
25
|
+
|
26
|
+
it("that replaces special characters with underscores", function() {
|
27
|
+
var model = {name: 'a label !@# 123'};
|
28
|
+
|
29
|
+
FormUtils.labelize(model);
|
30
|
+
|
31
|
+
expect(model.label).toBe('a_label_____123');
|
32
|
+
});
|
33
|
+
|
34
|
+
it("that will generate a UUID if a non-ascii name is used", function() {
|
35
|
+
var model = {name: 'žluťoučký'};
|
36
|
+
|
37
|
+
FormUtils.labelize(model);
|
38
|
+
|
39
|
+
expect(model.label).toMatch(uuidFormat);
|
40
|
+
});
|
41
|
+
|
42
|
+
|
43
|
+
it("that will generate a UUID if name contains more than 128 characters", function() {
|
44
|
+
var model = {name: 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. ' +
|
45
|
+
'Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque pena'};
|
46
|
+
|
47
|
+
FormUtils.labelize(model);
|
48
|
+
|
49
|
+
expect(model.label).toMatch(uuidFormat);
|
50
|
+
});
|
51
|
+
});
|
52
|
+
});
|
@@ -0,0 +1,54 @@
|
|
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: setTitle', function () {
|
15
|
+
var $scope, $compile, PageTitle, resource, element;
|
16
|
+
|
17
|
+
beforeEach(module('Bastion.widgets', 'Bastion.test-mocks'));
|
18
|
+
|
19
|
+
beforeEach(module(function ($provide) {
|
20
|
+
PageTitle = {
|
21
|
+
setTitle: function () {}
|
22
|
+
};
|
23
|
+
|
24
|
+
$provide.value('PageTitle', PageTitle);
|
25
|
+
}));
|
26
|
+
|
27
|
+
beforeEach(inject(function (_$compile_, _$rootScope_, MockResource) {
|
28
|
+
$compile = _$compile_;
|
29
|
+
$scope = _$rootScope_;
|
30
|
+
resource = MockResource.$new().get({id: 1});
|
31
|
+
}));
|
32
|
+
|
33
|
+
it("should wait on a promise if the model is provided", function () {
|
34
|
+
spyOn(PageTitle, 'setTitle');
|
35
|
+
$scope.resource = resource;
|
36
|
+
element = angular.element('<div page-title ng-model="resource">new awesome title</div>');
|
37
|
+
|
38
|
+
$compile(element)($scope);
|
39
|
+
expect(PageTitle.setTitle).not.toHaveBeenCalled();
|
40
|
+
|
41
|
+
$scope.$digest();
|
42
|
+
|
43
|
+
expect(PageTitle.setTitle).toHaveBeenCalledWith('new awesome title', jasmine.any(Object));
|
44
|
+
});
|
45
|
+
|
46
|
+
it("should set the page title without waiting for a $promise if none exists", function () {
|
47
|
+
spyOn(PageTitle, 'setTitle');
|
48
|
+
element = angular.element('<div page-title>new awesome title</div>');
|
49
|
+
|
50
|
+
$compile(element)($scope);
|
51
|
+
|
52
|
+
expect(PageTitle.setTitle).toHaveBeenCalledWith('new awesome title', jasmine.any(Object));
|
53
|
+
});
|
54
|
+
});
|
@@ -0,0 +1,51 @@
|
|
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: PageTitle', function () {
|
15
|
+
var $window, $interpolate, PageTitle;
|
16
|
+
|
17
|
+
beforeEach(module('Bastion.widgets'));
|
18
|
+
|
19
|
+
beforeEach(inject(function (_$window_, _$interpolate_, _PageTitle_) {
|
20
|
+
$window = _$window_;
|
21
|
+
$interpolate = _$interpolate_;
|
22
|
+
PageTitle = _PageTitle_;
|
23
|
+
}));
|
24
|
+
|
25
|
+
it("provides a way to set titles", function () {
|
26
|
+
PageTitle.setTitle("my new title: {{ title }}", {title: 'blah'})
|
27
|
+
expect(PageTitle.titles.length).toBe(1);
|
28
|
+
expect($window.document.title).toBe("my new title: blah");
|
29
|
+
});
|
30
|
+
|
31
|
+
it("provides a way to reset to the first title", function () {
|
32
|
+
PageTitle.setTitle("my new title: {{ title }}", {title: 'blah'})
|
33
|
+
PageTitle.setTitle('title 1');
|
34
|
+
PageTitle.setTitle('title 2');
|
35
|
+
|
36
|
+
PageTitle.resetToFirst();
|
37
|
+
expect(PageTitle.titles.length).toBe(1);
|
38
|
+
expect($window.document.title).toBe("my new title: blah");
|
39
|
+
});
|
40
|
+
|
41
|
+
it("stores a stack of titles and provides a way to retrieve it", function () {
|
42
|
+
expect(PageTitle.titles.length).toBe(0);
|
43
|
+
|
44
|
+
PageTitle.setTitle('title 1');
|
45
|
+
expect(PageTitle.titles.length).toBe(1);
|
46
|
+
|
47
|
+
PageTitle.setTitle('title 2');
|
48
|
+
expect(PageTitle.titles.length).toBe(2);
|
49
|
+
expect(PageTitle.titles[1]).toBe('title 2');
|
50
|
+
})
|
51
|
+
});
|