diff --git a/awx/ui/static/js/controllers/Jobs.js b/awx/ui/static/js/controllers/Jobs.js index e3d196d319..ecbf8d86e5 100644 --- a/awx/ui/static/js/controllers/Jobs.js +++ b/awx/ui/static/js/controllers/Jobs.js @@ -203,6 +203,7 @@ function JobsEdit($scope, $rootScope, $compile, $location, $log, $routeParams, J $scope.job_id = id; $scope.parseType = 'yaml'; $scope.statusSearchSpin = false; + $scope.disableParseSelection = true; function getPlaybooks(project, playbook) { if (!Empty(project)) { diff --git a/awx/ui/static/js/forms/JobTemplates.js b/awx/ui/static/js/forms/JobTemplates.js index 279f7bd980..6feb58babe 100644 --- a/awx/ui/static/js/forms/JobTemplates.js +++ b/awx/ui/static/js/forms/JobTemplates.js @@ -240,6 +240,7 @@ angular.module('JobTemplateFormDefinition', []) addRequired: false, editRequired: false, readonly: true, + ngShow: "allow_callbacks", column: 2, required: false, 'class': 'span12', diff --git a/awx/ui/static/js/lists/JobTemplates.js b/awx/ui/static/js/lists/JobTemplates.js index 9625cb30d3..62c0b1ea93 100644 --- a/awx/ui/static/js/lists/JobTemplates.js +++ b/awx/ui/static/js/lists/JobTemplates.js @@ -27,7 +27,8 @@ angular.module('JobTemplatesListDefinition', []) label: 'Name' }, description: { - label: 'Description' + label: 'Description', + columnClass: 'hidden-sm hidden-xs' } }, @@ -50,24 +51,26 @@ angular.module('JobTemplatesListDefinition', []) edit: { label: 'Edit', ngClick: "editJobTemplate(job_template.id)", - icon: 'icon-edit', awToolTip: 'Edit template', "class": 'btn-default btn-xs', dataPlacement: 'top' }, submit: { label: 'Launch', - icon: 'icon-rocket', mode: 'all', - "class": 'btn-xs btn-success', ngClick: 'submitJob(job_template.id)', awToolTip: 'Start a job using this template', dataPlacement: 'top' }, + schedule: { + label: 'Schedule', + mode: 'all', + awToolTip: 'Schedule a future job using this template', + dataPlacement: 'top' + }, "delete": { label: 'Delete', ngClick: "deleteJobTemplate(job_template.id, job_template.name)", - icon: 'icon-trash', "class": 'btn-danger btn-xs', awToolTip: 'Delete template', dataPlacement: 'top' diff --git a/awx/ui/static/js/lists/Organizations.js b/awx/ui/static/js/lists/Organizations.js index c167adceef..b34faaea30 100644 --- a/awx/ui/static/js/lists/Organizations.js +++ b/awx/ui/static/js/lists/Organizations.js @@ -25,7 +25,8 @@ angular.module('OrganizationListDefinition', []) label: 'Name' }, description: { - label: 'Description' + label: 'Description', + columnClass: 'hidden-sm hidden-xs' } }, diff --git a/awx/ui/static/js/lists/Projects.js b/awx/ui/static/js/lists/Projects.js index 7e44a8ef82..9170d085bc 100644 --- a/awx/ui/static/js/lists/Projects.js +++ b/awx/ui/static/js/lists/Projects.js @@ -28,14 +28,15 @@ angular.module('ProjectsListDefinition', []) }, description: { label: 'Description', - columnClass: 'hidden-sm hidden-xs', - excludeModal: true + excludeModal: true, + columnClass: 'hidden-sm hidden-xs' }, scm_type: { label: 'Type', searchType: 'select', searchOptions: [], // will be set by Options call to projects resource excludeModal: true, + columnClass: 'hidden-sm hidden-xs', nosort: true }, status: { diff --git a/awx/ui/static/less/ansible-ui.less b/awx/ui/static/less/ansible-ui.less index 057a738532..32d86e129e 100644 --- a/awx/ui/static/less/ansible-ui.less +++ b/awx/ui/static/less/ansible-ui.less @@ -584,6 +584,7 @@ legend { /* Pagination */ .page-label { + font-size: 12px; margin-top: 0; text-align: right; } @@ -816,23 +817,19 @@ input[type="checkbox"].checkbox-no-label { .list-actions { margin: 0; } - table { + .list-wrapper { background-color: @well; padding: 10px; border-radius: 4px; border: 1px solid @well-border; } - form { - background-color: @well; - padding: 10px; - border-radius: 4px; - border: 1px solid @well-border; - margin: 10px 0; - } .ui-accordion-content { padding-left: 15px; padding-right: 15px; } + .page-label { + margin-top: 5px; + } } #home-list-actions { @@ -1586,6 +1583,10 @@ tr td button i { text-align: left; } + .list-action-label { + display: none; + } + .site-footer { height: 145px; padding-top: 5px; diff --git a/awx/ui/static/lib/angular-cookies/.bower.json b/awx/ui/static/lib/angular-cookies/.bower.json index fc1b5cf02e..60abf2f915 100644 --- a/awx/ui/static/lib/angular-cookies/.bower.json +++ b/awx/ui/static/lib/angular-cookies/.bower.json @@ -1,19 +1,18 @@ { "name": "angular-cookies", - "version": "1.2.12", + "version": "1.2.15-build.2398+sha.4bab3d8", "main": "./angular-cookies.js", "dependencies": { - "angular": "1.2.12" + "angular": "1.2.15-build.2398+sha.4bab3d8" }, "homepage": "https://github.com/angular/bower-angular-cookies", - "_release": "1.2.12", + "_release": "1.2.15-build.2398+sha.4bab3d8", "_resolution": { "type": "version", - "tag": "v1.2.12", - "commit": "5975d048a8b651b5db467f560c54bde3bfdbd1a2" + "tag": "v1.2.15-build.2398+sha.4bab3d8", + "commit": "8ca6ddfbd86f4bda921fa3d22e8d2e7d7e9b04d4" }, "_source": "git://github.com/angular/bower-angular-cookies.git", "_target": "~1.2.12", - "_originalSource": "angular-cookies", - "_direct": true + "_originalSource": "angular-cookies" } \ No newline at end of file diff --git a/awx/ui/static/lib/angular-cookies/angular-cookies.js b/awx/ui/static/lib/angular-cookies/angular-cookies.js index c4e52747e6..9d3d5a7542 100644 --- a/awx/ui/static/lib/angular-cookies/angular-cookies.js +++ b/awx/ui/static/lib/angular-cookies/angular-cookies.js @@ -1,20 +1,19 @@ /** - * @license AngularJS v1.2.12 + * @license AngularJS v1.2.15-build.2398+sha.4bab3d8 * (c) 2010-2014 Google, Inc. http://angularjs.org * License: MIT */ (function(window, angular, undefined) {'use strict'; /** - * @ngdoc overview + * @ngdoc module * @name ngCookies * @description * * # ngCookies * - * The `ngCookies` module provides a convenient wrapper for reading and writing browser cookies. + * The `ngCookies` module provides a convenient wrapper for reading and writing browser cookies. * - * {@installModule cookies} * *
* @@ -25,9 +24,8 @@ angular.module('ngCookies', ['ng']). /** - * @ngdoc object - * @name ngCookies.$cookies - * @requires $browser + * @ngdoc service + * @name $cookies * * @description * Provides read/write access to browser's cookies. @@ -38,8 +36,8 @@ angular.module('ngCookies', ['ng']). * Requires the {@link ngCookies `ngCookies`} module to be installed. * * @example -{{ someBoolValue | bool:'Candies!':'No candies :(' }}
+``` + +```javascript + $scope.returnValue = $filter('bool')($scope.someBoolValue, 'Candies!', 'No candies :('); +``` + +### default + +The `default` filter allows to **specify a default fallback value** if an object is one of the following: + +- `null` +- `undefined` +- empty string, `''` + +Please notice that if a value equals to `0`, the default value won't be returned, as `0` is accepted. + +This filter is useful when another filter return is not safe and when you want to display a fallback value. + +Use it as follows: + +```html +{{ someValue | number:2 | default:'No value is available.' }}
+``` + +```javascript + $scope.returnValue = $filter('default') + ($filter('number')($scope.someValue, 2), 'No value is available.'); +``` + +### firstNotNull + +The `firstNotNull` filter returns the **first element from an array** that is neither `null` or `undefined`. This means it returns all numbers and strings, even if empty. It returns `undefined` if all values aren't set or if the array is empty. + +Use it as follows: + +```html +{{ myValues | firstNotNull }}
+``` + +```javascript + $scope.firstValue = $filter('firstNotNull')($scope.myValues); +``` + +### lastNotNull + +The `lastNotNull` filter returns the **last element from an array** that is neither `null` or `undefined`. This means it returns all numbers and strings, even if empty. It returns `undefined` if all values aren't set or if the array is empty. + +Use it as follows: + +```html +{{ myValues | lastNotNull }}
+``` + +```javascript + $scope.firstValue = $filter('lastNotNull')($scope.myValues); +``` + +### max + +The `max` filter returns the **maximum value from an array** that is neither `null` or `undefined`. It returns `undefined` if all values aren't set or if the array is empty. + +Use it as follows: + +```html +{{ myValues | max }}
+``` + +```javascript + $scope.maxValue = $filter('max')($scope.myValues); +``` + +### min + +The `min` filter returns the **minimum value from an array** that is neither `null` or `undefined`. It returns `undefined` if all values aren't set or if the array is empty. + +Use it as follows: + +```html +{{ myValues | min }}
+``` + +```javascript + $scope.minValue = $filter('min')($scope.myValues); +``` + +### property + +The `property` filter returns an **array with only the specified property from the original objects**, not altering the `null` or `undefined` values. + +Use it as follows: + +```html +{{ myObjects | property:'myText' }}
+``` + +```javascript + $scope.allTheTexts = $filter('property')($scope.myObjects, 'myText'); +``` + +### join + +The `join` filter returns **the original array as a string, with its elements joined with the specified separator**, if any, otherwise defaulting to the comma `,`. + +Use it as follows: + +```html +{{ myValues | join:', ' }}
+``` + +```javascript + $scope.joinedValues = $filter('join')($scope.myValues, ', '); +``` + +## Development + +### Test and build + +To test and build the distribution files yourself, do the following: + +```shell +npm install -g grunt-cli karma bower +npm install +bower install +grunt +``` + +These are the available grunt task: + +* `karma:travis`, run karma tests once, on PhantomJS +* `karma:local`, run karma tests once, on Chrome +* `karma:dev`, run karma tests indefinitely after every file change, on Chrome +* `jshint:src`, run jshint on every source file +* `jshint:test`, run jshint on every test file +* `clean:dist`, clean the distribution directory +* `clean:temp`, clean the temporary directory +* `ngmin`, prepares every angular file into the `dist/.temp` directory +* `concat`, concatenates the module declaration and the `ngmin`-ified file from the `dist/.temp` into the `dist` directory, adding the banner +* `uglify`, minifies the output file in the `dist` directory, adding the banner +* `build`, builds the regular and minified file +* `test-travis`, runs `jshint` and `karma:travis` + +Use the default task by calling `grunt` to run tests on PhantomJS and builds the regular and minified file. + +### Contribute + +To contribute, please follow the generic [AngularJS Contributing Guidelines](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md), with the only exception to send the PR to the `develop` branch instead of `master`. + +## License + +``` + Copyright 2014 Francesco Pontillo + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +``` \ No newline at end of file diff --git a/awx/ui/static/lib/angular-filters/bower.json b/awx/ui/static/lib/angular-filters/bower.json new file mode 100644 index 0000000000..51426c2e12 --- /dev/null +++ b/awx/ui/static/lib/angular-filters/bower.json @@ -0,0 +1,21 @@ +{ + "author": "Francesco Pontillo", + "name": "angular-filters", + "description": "A collection of filters for AngularJS.", + "version": "1.1.0", + "homepage": "https://github.com/frapontillo/angular-filters", + "repository": { + "type": "git", + "url": "git://github.com/frapontillo/angular-filters.git" + }, + "main": "./dist/angular-filters.min.js", + "dependencies": { + "angular": "1.2.10" + }, + "devDependencies": { + "angular-mocks": "1.2.10" + }, + "resolutions": { + "angular": "1.2.10" + } +} diff --git a/awx/ui/static/lib/angular-filters/common/module.js b/awx/ui/static/lib/angular-filters/common/module.js new file mode 100644 index 0000000000..4a284259ee --- /dev/null +++ b/awx/ui/static/lib/angular-filters/common/module.js @@ -0,0 +1,2 @@ +angular.module('frapontillo.ex.filters', []); +angular.module('frapontillo', ['ex.filters']); \ No newline at end of file diff --git a/awx/ui/static/lib/angular-filters/dist/angular-filters.js b/awx/ui/static/lib/angular-filters/dist/angular-filters.js new file mode 100644 index 0000000000..b6a6e7f663 --- /dev/null +++ b/awx/ui/static/lib/angular-filters/dist/angular-filters.js @@ -0,0 +1,101 @@ +/** + * A collection of filters for AngularJS. + * @version v1.1.0 - 2014-01-30 + * @author Francesco Pontillo + * @link https://github.com/frapontillo/angular-filters + * @license Apache License 2.0 +**/ + +'use strict'; +// Source: common/module.js +angular.module('frapontillo.ex.filters', []); +angular.module('frapontillo', ['ex.filters']); +// Source: dist/.temp/filters/bool/bool.js +angular.module('frapontillo.ex.filters').filter('bool', function () { + return function (input, valueTrue, valueFalse) { + return input !== true ? valueFalse : valueTrue; + }; +}); +// Source: dist/.temp/filters/default/default.js +angular.module('frapontillo.ex.filters').filter('default', function () { + return function (input, value) { + if (input !== null && input !== undefined && (input !== '' || angular.isNumber(input))) { + return input; + } + return value || ''; + }; +}); +// Source: dist/.temp/filters/firstNotNull/firstNotNull.js +angular.module('frapontillo.ex.filters').filter('firstNotNull', function () { + return function (input) { + if (input) { + var l = input.length - 1; + for (var i = 0; i <= l; i++) { + if (input[i] !== undefined && input[i] !== null) { + return input[i]; + } + } + } + }; +}); +// Source: dist/.temp/filters/join/join.js +angular.module('frapontillo.ex.filters').filter('join', function () { + return function (array, separator) { + if (!array) { + return ''; + } + return array.join(separator); + }; +}); +// Source: dist/.temp/filters/lastNotNull/lastNotNull.js +angular.module('frapontillo.ex.filters').filter('lastNotNull', function () { + return function (input) { + if (input) { + var l = input.length - 1; + for (var i = l; i >= 0; i--) { + if (input[i] !== undefined) { + return input[i]; + } + } + } + }; +}); +// Source: dist/.temp/filters/max/max.js +angular.module('frapontillo.ex.filters').filter('max', function () { + return function (input) { + var out; + if (input) { + for (var i in input) { + if (input[i] > out || out === undefined || out === null) { + out = input[i]; + } + } + } + return out; + }; +}); +// Source: dist/.temp/filters/min/min.js +angular.module('frapontillo.ex.filters').filter('min', function () { + return function (input) { + var out; + if (input) { + for (var i in input) { + if (input[i] < out || out === undefined || out === null) { + out = input[i]; + } + } + } + return out; + }; +}); +// Source: dist/.temp/filters/property/property.js +angular.module('frapontillo.ex.filters').filter('property', function () { + return function (array, property) { + var newArray = []; + angular.forEach(array, function (element) { + var evalProperty = element[property]; + newArray.push(evalProperty); + }); + return newArray; + }; +}); \ No newline at end of file diff --git a/awx/ui/static/lib/angular-filters/dist/angular-filters.min.js b/awx/ui/static/lib/angular-filters/dist/angular-filters.min.js new file mode 100644 index 0000000000..a4c177364b --- /dev/null +++ b/awx/ui/static/lib/angular-filters/dist/angular-filters.min.js @@ -0,0 +1,9 @@ +/** + * A collection of filters for AngularJS. + * @version v1.1.0 - 2014-01-30 + * @author Francesco Pontillo + * @link https://github.com/frapontillo/angular-filters + * @license Apache License 2.0 +**/ + +"use strict";angular.module("frapontillo.ex.filters",[]),angular.module("frapontillo",["ex.filters"]),angular.module("frapontillo.ex.filters").filter("bool",function(){return function(a,b,c){return a!==!0?c:b}}),angular.module("frapontillo.ex.filters").filter("default",function(){return function(a,b){return null===a||void 0===a||""===a&&!angular.isNumber(a)?b||"":a}}),angular.module("frapontillo.ex.filters").filter("firstNotNull",function(){return function(a){if(a)for(var b=a.length-1,c=0;b>=c;c++)if(void 0!==a[c]&&null!==a[c])return a[c]}}),angular.module("frapontillo.ex.filters").filter("join",function(){return function(a,b){return a?a.join(b):""}}),angular.module("frapontillo.ex.filters").filter("lastNotNull",function(){return function(a){if(a)for(var b=a.length-1,c=b;c>=0;c--)if(void 0!==a[c])return a[c]}}),angular.module("frapontillo.ex.filters").filter("max",function(){return function(a){var b;if(a)for(var c in a)(a[c]>b||void 0===b||null===b)&&(b=a[c]);return b}}),angular.module("frapontillo.ex.filters").filter("min",function(){return function(a){var b;if(a)for(var c in a)(a[c]= 0; i--) { + if (input[i] !== undefined) { + return input[i]; + } + } + } + }; + } +); \ No newline at end of file diff --git a/awx/ui/static/lib/angular-filters/src/filters/max/max.js b/awx/ui/static/lib/angular-filters/src/filters/max/max.js new file mode 100644 index 0000000000..435d4f6d6b --- /dev/null +++ b/awx/ui/static/lib/angular-filters/src/filters/max/max.js @@ -0,0 +1,17 @@ +'use strict'; + +angular.module('frapontillo.ex.filters') + .filter('max', function() { + return function(input) { + var out; + if (input) { + for (var i in input) { + if (input[i] > out || out === undefined || out === null) { + out = input[i]; + } + } + } + return out; + }; + } +); \ No newline at end of file diff --git a/awx/ui/static/lib/angular-filters/src/filters/min/min.js b/awx/ui/static/lib/angular-filters/src/filters/min/min.js new file mode 100644 index 0000000000..bfbae9ef8c --- /dev/null +++ b/awx/ui/static/lib/angular-filters/src/filters/min/min.js @@ -0,0 +1,17 @@ +'use strict'; + +angular.module('frapontillo.ex.filters') + .filter('min', function() { + return function(input) { + var out; + if (input) { + for (var i in input) { + if (input[i] < out || out === undefined || out === null) { + out = input[i]; + } + } + } + return out; + }; + } +); \ No newline at end of file diff --git a/awx/ui/static/lib/angular-filters/src/filters/property/property.js b/awx/ui/static/lib/angular-filters/src/filters/property/property.js new file mode 100644 index 0000000000..5f1c1bdc15 --- /dev/null +++ b/awx/ui/static/lib/angular-filters/src/filters/property/property.js @@ -0,0 +1,15 @@ +'use strict'; + +angular.module('frapontillo.ex.filters') + .filter('property', function() { + return function(array, property) { + var newArray = []; + // for each object in the array + angular.forEach(array, function(element) { + var evalProperty = element[property]; + newArray.push(evalProperty); + }); + return newArray; + }; + } +); \ No newline at end of file diff --git a/awx/ui/static/lib/angular-filters/test/.jshintrc b/awx/ui/static/lib/angular-filters/test/.jshintrc new file mode 100644 index 0000000000..aa37e7a4d0 --- /dev/null +++ b/awx/ui/static/lib/angular-filters/test/.jshintrc @@ -0,0 +1,35 @@ +{ + "node": true, + "browser": true, + "esnext": true, + "bitwise": true, + "camelcase": true, + "curly": true, + "eqeqeq": true, + "immed": true, + "indent": 2, + "latedef": true, + "newcap": true, + "noarg": true, + "quotmark": "single", + "regexp": true, + "undef": true, + "unused": true, + "strict": true, + "trailing": true, + "smarttabs": true, + "globals": { + "after": false, + "afterEach": false, + "angular": false, + "before": false, + "beforeEach": false, + "browser": false, + "describe": false, + "expect": false, + "inject": false, + "it": false, + "spyOn": false + } +} + diff --git a/awx/ui/static/lib/angular-filters/test/bool/boolSpec.js b/awx/ui/static/lib/angular-filters/test/bool/boolSpec.js new file mode 100644 index 0000000000..5a3807636f --- /dev/null +++ b/awx/ui/static/lib/angular-filters/test/bool/boolSpec.js @@ -0,0 +1,34 @@ +'use strict'; + +describe('bool', function () { + var boolFilter; + + beforeEach(module('frapontillo.ex.filters')); + beforeEach(inject(function ($filter) { + boolFilter = $filter('bool'); + })); + + it('should match the true value', function () { + expect(boolFilter(true, 1, 0)).toEqual(1); + }); + + it('should match the false value', function () { + expect(boolFilter(false, 1, 0)).toEqual(0); + }); + + it('should match a string to the false value', function () { + expect(boolFilter('true', 1, 0)).toEqual(0); + }); + + it('should match the empty string to the false value', function () { + expect(boolFilter('', 1, 0)).toEqual(0); + }); + + it('should match undefined to the false value', function () { + expect(boolFilter(undefined, 1, 0)).toEqual(0); + }); + + it('should match null to the false value', function () { + expect(boolFilter(null, 1, 0)).toEqual(0); + }); +}); \ No newline at end of file diff --git a/awx/ui/static/lib/angular-filters/test/default/defaultSpec.js b/awx/ui/static/lib/angular-filters/test/default/defaultSpec.js new file mode 100644 index 0000000000..3ac2e6d032 --- /dev/null +++ b/awx/ui/static/lib/angular-filters/test/default/defaultSpec.js @@ -0,0 +1,47 @@ +'use strict'; + +describe('default', function () { + var defaultFilter; + var numberFilter; + + beforeEach(module('frapontillo.ex.filters')); + beforeEach(inject(function ($filter) { + defaultFilter = $filter('default'); + numberFilter = $filter('number'); + })); + + it('should return the number 1337', function () { + var inputVal = 1337; + expect(defaultFilter(inputVal)).toEqual(1337); + }); + + it('should return a "default" string', function () { + var inputVal; + var defaultVal = 'default'; + expect(defaultFilter(inputVal, defaultVal)).toEqual('default'); + }); + + it('should return a "default" string', function () { + var inputVal = null; + var defaultVal = 'default'; + expect(defaultFilter(inputVal, defaultVal)).toEqual('default'); + }); + + it('should return the number 0', function () { + var inputVal = 0; + var defaultVal = 'default'; + expect(defaultFilter(inputVal, defaultVal)).toEqual(0); + }); + + it('should return the string "13.37"', function () { + var inputVal = '13.3678787'; + var defaultVal = 'N.A.'; + expect(defaultFilter(numberFilter(inputVal, 2), defaultVal)).toEqual('13.37'); + }); + + it('should return a "N.A." string', function () { + var inputVal; + var defaultVal = 'N.A.'; + expect(defaultFilter(numberFilter(inputVal, 2), defaultVal)).toEqual(defaultVal); + }); +}); \ No newline at end of file diff --git a/awx/ui/static/lib/angular-filters/test/firstNotNull/firstNotNullSpec.js b/awx/ui/static/lib/angular-filters/test/firstNotNull/firstNotNullSpec.js new file mode 100644 index 0000000000..6c91e274b3 --- /dev/null +++ b/awx/ui/static/lib/angular-filters/test/firstNotNull/firstNotNullSpec.js @@ -0,0 +1,28 @@ +'use strict'; + +describe('firstNotNull', function () { + var firstNotNullFilter; + + beforeEach(module('frapontillo.ex.filters')); + beforeEach(inject(function ($filter) { + firstNotNullFilter = $filter('firstNotNull'); + })); + + it('should return the number 1337', function () { + expect(firstNotNullFilter([ + null, undefined, 1337, 0 + ])).toEqual(1337); + }); + + it('should return the number 0', function () { + expect(firstNotNullFilter([ + null, 0, undefined, 3 + ])).toEqual(0); + }); + + it('should return undefined', function () { + expect(firstNotNullFilter([ + null, undefined + ])).toEqual(undefined); + }); +}); \ No newline at end of file diff --git a/awx/ui/static/lib/angular-filters/test/join/joinSpec.js b/awx/ui/static/lib/angular-filters/test/join/joinSpec.js new file mode 100644 index 0000000000..558713c0ee --- /dev/null +++ b/awx/ui/static/lib/angular-filters/test/join/joinSpec.js @@ -0,0 +1,30 @@ +'use strict'; + +describe('join', function () { + var joinFilter; + + beforeEach(module('frapontillo.ex.filters')); + beforeEach(inject(function ($filter) { + joinFilter = $filter('join'); + })); + + it('should return \'this is a simple test\'', function () { + expect(joinFilter(['this', 'is', 'a', 'simple', 'test'], ' ')).toEqual('this is a simple test'); + }); + + it('should return the empty string for an undefined array', function () { + expect(joinFilter(undefined, '')).toEqual(''); + }); + + it('should return the empty string for an empty array', function () { + expect(joinFilter([], '')).toEqual(''); + }); + + it('should return \'0123456789\'', function () { + expect(joinFilter([0,1,2,3,4,5,6,7,8,9], '')).toEqual('0123456789'); + }); + + it('should default to the comma separator and return \'0,1,2,3,4,5,6,7,8,9\'', function () { + expect(joinFilter([0,1,2,3,4,5,6,7,8,9])).toEqual('0,1,2,3,4,5,6,7,8,9'); + }); +}); \ No newline at end of file diff --git a/awx/ui/static/lib/angular-filters/test/lastNotNull/lastNotNullSpec.js b/awx/ui/static/lib/angular-filters/test/lastNotNull/lastNotNullSpec.js new file mode 100644 index 0000000000..1bb60e7c3e --- /dev/null +++ b/awx/ui/static/lib/angular-filters/test/lastNotNull/lastNotNullSpec.js @@ -0,0 +1,28 @@ +'use strict'; + +describe('lastNotNull', function () { + var lastNotNullFilter; + + beforeEach(module('frapontillo.ex.filters')); + beforeEach(inject(function ($filter) { + lastNotNullFilter = $filter('lastNotNull'); + })); + + it('should return the number 0', function () { + expect(lastNotNullFilter([ + null, undefined, 1337, 0 + ])).toEqual(0); + }); + + it('should return the number 1337', function () { + expect(lastNotNullFilter([ + null, 0, 1337, undefined + ])).toEqual(1337); + }); + + it('should return undefined', function () { + expect(lastNotNullFilter([ + null, undefined + ])).toEqual(undefined); + }); +}); \ No newline at end of file diff --git a/awx/ui/static/lib/angular-filters/test/max/maxSpec.js b/awx/ui/static/lib/angular-filters/test/max/maxSpec.js new file mode 100644 index 0000000000..1924bb4b87 --- /dev/null +++ b/awx/ui/static/lib/angular-filters/test/max/maxSpec.js @@ -0,0 +1,28 @@ +'use strict'; + +describe('max', function () { + var maxFilter; + + beforeEach(module('frapontillo.ex.filters')); + beforeEach(inject(function ($filter) { + maxFilter = $filter('max'); + })); + + it('should return the number 1337', function () { + expect(maxFilter([ + null, undefined, 1337, 0 + ])).toEqual(1337); + }); + + it('should return the number 1337', function () { + expect(maxFilter([ + null, 0, 1337, undefined + ])).toEqual(1337); + }); + + it('should return undefined', function () { + expect(maxFilter([ + null, undefined + ])).toEqual(undefined); + }); +}); \ No newline at end of file diff --git a/awx/ui/static/lib/angular-filters/test/min/minSpec.js b/awx/ui/static/lib/angular-filters/test/min/minSpec.js new file mode 100644 index 0000000000..b357834153 --- /dev/null +++ b/awx/ui/static/lib/angular-filters/test/min/minSpec.js @@ -0,0 +1,28 @@ +'use strict'; + +describe('min', function () { + var minFilter; + + beforeEach(module('frapontillo.ex.filters')); + beforeEach(inject(function ($filter) { + minFilter = $filter('min'); + })); + + it('should return the number 0', function () { + expect(minFilter([ + null, undefined, 1337, 0 + ])).toEqual(0); + }); + + it('should return the number 1', function () { + expect(minFilter([ + null, 1, 1337, undefined + ])).toEqual(1); + }); + + it('should return undefined', function () { + expect(minFilter([ + null, undefined + ])).toEqual(undefined); + }); +}); \ No newline at end of file diff --git a/awx/ui/static/lib/angular-filters/test/property/propertySpec.js b/awx/ui/static/lib/angular-filters/test/property/propertySpec.js new file mode 100644 index 0000000000..da80421f42 --- /dev/null +++ b/awx/ui/static/lib/angular-filters/test/property/propertySpec.js @@ -0,0 +1,42 @@ +'use strict'; + +describe('property', function () { + var propertyFilter; + + var testArray = [ + {id:0, text:'zero'}, + {id:1, text:'one'}, + {id:2, text:'two'}, + {id:3, text:'three'}, + {id:4, text:'four'}, + {id:5, text:'five'}, + {id:6, text:'six'} + ]; + + var makeArray = function() { + return angular.copy(testArray); + }; + + beforeEach(module('frapontillo.ex.filters')); + beforeEach(inject(function ($filter) { + propertyFilter = $filter('property'); + })); + + it('should return the \'id\' properties', function () { + var filteredArray = propertyFilter(makeArray(), 'id'); + expect(filteredArray[0]).toEqual(0); + expect(filteredArray.length).toEqual(7); + }); + + it('should return elements with only the \'text\' property', function () { + var filteredArray = propertyFilter(makeArray(), 'text'); + expect(filteredArray[0]).toEqual('zero'); + expect(filteredArray.length).toEqual(7); + }); + + it('should return empty elements', function () { + var filteredArray = propertyFilter(makeArray(), 'something else'); + expect(filteredArray[0]).toEqual(undefined); + expect(filteredArray.length).toEqual(7); + }); +}); \ No newline at end of file diff --git a/awx/ui/static/lib/angular-resource/.bower.json b/awx/ui/static/lib/angular-resource/.bower.json index 7af7ddcdc3..dbf41c64b7 100644 --- a/awx/ui/static/lib/angular-resource/.bower.json +++ b/awx/ui/static/lib/angular-resource/.bower.json @@ -1,19 +1,18 @@ { "name": "angular-resource", - "version": "1.2.12", + "version": "1.2.15-build.2398+sha.4bab3d8", "main": "./angular-resource.js", "dependencies": { - "angular": "1.2.12" + "angular": "1.2.15-build.2398+sha.4bab3d8" }, "homepage": "https://github.com/angular/bower-angular-resource", - "_release": "1.2.12", + "_release": "1.2.15-build.2398+sha.4bab3d8", "_resolution": { "type": "version", - "tag": "v1.2.12", - "commit": "4d368199bfbab887f1c1622bb47d4d0924d6a8ed" + "tag": "v1.2.15-build.2398+sha.4bab3d8", + "commit": "c20e7f87b0f788322c1c1920f1646a116389fa8d" }, "_source": "git://github.com/angular/bower-angular-resource.git", "_target": "~1.2.12", - "_originalSource": "angular-resource", - "_direct": true + "_originalSource": "angular-resource" } \ No newline at end of file diff --git a/awx/ui/static/lib/angular-resource/angular-resource.js b/awx/ui/static/lib/angular-resource/angular-resource.js index 4988910c84..73a31070f3 100644 --- a/awx/ui/static/lib/angular-resource/angular-resource.js +++ b/awx/ui/static/lib/angular-resource/angular-resource.js @@ -1,5 +1,5 @@ /** - * @license AngularJS v1.2.12 + * @license AngularJS v1.2.15-build.2398+sha.4bab3d8 * (c) 2010-2014 Google, Inc. http://angularjs.org * License: MIT */ @@ -49,7 +49,7 @@ function shallowClearAndCopy(src, dst) { } /** - * @ngdoc overview + * @ngdoc module * @name ngResource * @description * @@ -58,7 +58,6 @@ function shallowClearAndCopy(src, dst) { * The `ngResource` module provides interaction support with RESTful services * via the $resource service. * - * {@installModule resource} * * * @@ -66,8 +65,8 @@ function shallowClearAndCopy(src, dst) { */ /** - * @ngdoc object - * @name ngResource.$resource + * @ngdoc service + * @name $resource * @requires $http * * @description @@ -103,8 +102,8 @@ function shallowClearAndCopy(src, dst) { * If the parameter value is prefixed with `@` then the value of that parameter is extracted from * the data object (useful for non-GET operations). * - * @param {Object.