diff --git a/awx/ui/client/legacy-styles/forms.less b/awx/ui/client/legacy-styles/forms.less index 5f69f25d47..aca378c746 100644 --- a/awx/ui/client/legacy-styles/forms.less +++ b/awx/ui/client/legacy-styles/forms.less @@ -173,7 +173,8 @@ } .Form-formGroup--fullWidth { - max-width: none; + max-width: none !important; + width: 100% !important; } .Form-formGroup--checkbox{ @@ -289,7 +290,7 @@ } .Form-dropDown { - height: 30px !important; + min-height: 30px !important; border-radius: 5px !important; border:1px solid @field-border!important; color: @field-input-text!important; diff --git a/awx/ui/client/src/access/roleList.block.less b/awx/ui/client/src/access/roleList.block.less index 0723c3451d..9b185148b0 100644 --- a/awx/ui/client/src/access/roleList.block.less +++ b/awx/ui/client/src/access/roleList.block.less @@ -37,7 +37,7 @@ border-top-left-radius: 0px; border-bottom-left-radius: 0px; border-right: 0; - max-wdith: ~"calc(100% - 23px)"; + max-width: ~"calc(100% - 23px)"; margin-right: 5px; } diff --git a/awx/ui/client/src/bread-crumb/bread-crumb.directive.js b/awx/ui/client/src/bread-crumb/bread-crumb.directive.js index 180bce2ab9..e74ccfaaf3 100644 --- a/awx/ui/client/src/bread-crumb/bread-crumb.directive.js +++ b/awx/ui/client/src/bread-crumb/bread-crumb.directive.js @@ -1,5 +1,5 @@ export default - [ 'templateUrl', '$state', 'FeaturesService', 'ProcessErrors', 'Store', 'Empty', function(templateUrl, $state, FeaturesService, ProcessErrors, Store, Empty) { + [ 'templateUrl', '$state', 'FeaturesService', 'ProcessErrors', 'Store', 'Empty', '$log', function(templateUrl, $state, FeaturesService, ProcessErrors, Store, Empty, $log) { return { restrict: 'E', templateUrl: templateUrl('bread-crumb/bread-crumb'), @@ -75,6 +75,7 @@ export default scope.licenseType = licenseInfo ? licenseInfo.license_type : null; if (!licenseInfo) { console.warn("License info not loaded correctly"); // jshint ignore:line + $log.error("License info not loaded correctly"); } }) .catch(function (response) { diff --git a/awx/ui/client/src/forms/JobTemplates.js b/awx/ui/client/src/forms/JobTemplates.js index 7a9065af2b..b8ef68962e 100644 --- a/awx/ui/client/src/forms/JobTemplates.js +++ b/awx/ui/client/src/forms/JobTemplates.js @@ -224,41 +224,6 @@ export default text: 'Prompt on launch' } }, - labels: { - label: 'Labels', - type: 'select', - ngOptions: 'label.label for label in labelOptions track by label.value', - multiSelect: true, - addRequired: false, - editRequired: false, - dataTitle: 'Labels', - dataPlacement: 'right', - awPopOver: 'You can add labels to a job template to aid in filtering', - dataContainer: 'body' - }, - variables: { - label: 'Extra Variables', - type: 'textarea', - class: 'Form-textAreaLabel Form-formGroup--fullWidth', - rows: 6, - addRequired: false, - editRequired: false, - "default": "---", - column: 2, - awPopOver: "

Pass extra command line variables to the playbook. This is the -e or --extra-vars command line parameter " + - "for ansible-playbook. Provide key/value pairs using either YAML or JSON.

" + - "JSON:
\n" + - "
{
 \"somevar\": \"somevalue\",
 \"password\": \"magic\"
}
\n" + - "YAML:
\n" + - "
---
somevar: somevalue
password: magic
\n", - dataTitle: 'Extra Variables', - dataPlacement: 'right', - dataContainer: "body", - subCheckbox: { - variable: 'ask_variables_on_launch', - text: 'Prompt on launch' - } - }, become_enabled: { label: 'Enable Privilege Escalation', type: 'checkbox', @@ -309,6 +274,49 @@ export default dataPlacement: 'right', dataTitle: "Host Config Key", dataContainer: "body" + }, + survey: { + type: 'custom', + column: 2, + ngHide: "job_type.value === 'scan'" , + control: ''+ + '' + }, + labels: { + label: 'Labels', + type: 'select', + class: 'Form-formGroup--fullWidth', + ngOptions: 'label.label for label in labelOptions track by label.value', + multiSelect: true, + addRequired: false, + editRequired: false, + dataTitle: 'Labels', + dataPlacement: 'right', + awPopOver: 'You can add labels to a job template to aid in filtering', + dataContainer: 'body' + }, + variables: { + label: 'Extra Variables', + type: 'textarea', + class: 'Form-textAreaLabel Form-formGroup--fullWidth', + rows: 6, + addRequired: false, + editRequired: false, + "default": "---", + column: 2, + awPopOver: "

Pass extra command line variables to the playbook. This is the -e or --extra-vars command line parameter " + + "for ansible-playbook. Provide key/value pairs using either YAML or JSON.

" + + "JSON:
\n" + + "
{
 \"somevar\": \"somevalue\",
 \"password\": \"magic\"
}
\n" + + "YAML:
\n" + + "
---
somevar: somevalue
password: magic
\n", + dataTitle: 'Extra Variables', + dataPlacement: 'right', + dataContainer: "body", + subCheckbox: { + variable: 'ask_variables_on_launch', + text: 'Prompt on launch' + } } }, diff --git a/awx/ui/client/src/job-templates/edit/job-templates-edit.controller.js b/awx/ui/client/src/job-templates/edit/job-templates-edit.controller.js index 89c9425a2e..b6cfed90b6 100644 --- a/awx/ui/client/src/job-templates/edit/job-templates-edit.controller.js +++ b/awx/ui/client/src/job-templates/edit/job-templates-edit.controller.js @@ -419,25 +419,48 @@ export default Rest.setUrl('api/v1/labels'); Wait("start"); Rest.get() - .success(function (data) { - $scope.labelOptions = data.results - .map((i) => ({label: i.name, value: i.id})); - $scope.$emit("choicesReady"); + .success(function () { + var seeMoreResolve = $q.defer(); + + var getNext = function(data, arr, resolve) { + Rest.setUrl(data.next); + Rest.get() + .success(function (data) { + if (data.next) { + getNext(data, arr.concat(data.results), resolve); + } else { + resolve.resolve(arr.concat(data.results)); + } + }); + }; + Rest.setUrl(defaultUrl + $state.params.template_id + "/labels"); Rest.get() .success(function(data) { - var opts = data.results - .map(i => ({id: i.id + "", - test: i.name})); - CreateSelect2({ - element:'#job_templates_labels', - multiple: true, - addNew: true, - opts: opts + if (data.next) { + getNext(data, data.results, seeMoreResolve); + } else { + seeMoreResolve.resolve(data.results); + } + + seeMoreResolve.promise.then(function (labels) { + $scope.labelOptions = labels + .map((i) => ({label: i.name, value: i.id})); + $scope.$emit("choicesReady"); + var opts = labels + .map(i => ({id: i.id + "", + test: i.name})); + CreateSelect2({ + element:'#job_templates_labels', + multiple: true, + addNew: true, + opts: opts + }); + Wait("stop"); }); - Wait("stop"); }); + CreateSelect2({ element:'#job_templates_verbosity', multiple: false diff --git a/awx/ui/client/src/job-templates/labels/labelsList.block.less b/awx/ui/client/src/job-templates/labels/labelsList.block.less index 4e99567eaa..f7abaf79a7 100644 --- a/awx/ui/client/src/job-templates/labels/labelsList.block.less +++ b/awx/ui/client/src/job-templates/labels/labelsList.block.less @@ -7,7 +7,8 @@ align-items: flex-start; } -.LabelList-tagContainer { +.LabelList-tagContainer, +.LabelList-seeMore { display: flex; max-width: 100%; } @@ -16,11 +17,10 @@ border-radius: 5px; padding: 2px 10px; margin: 4px 0px; - border: 1px solid @d7grey; font-size: 12px; - color: @default-interface-txt; + color: @default-bg; text-transform: uppercase; - background-color: @default-bg; + background-color: @default-link; margin-right: 5px; max-width: 100%; white-space: nowrap; @@ -28,23 +28,36 @@ overflow: hidden; } +.LabelList-seeMore { + color: @default-link; + margin: 4px 0px; + text-transform: uppercase; + padding: 2px 0px; + cursor: pointer; + border-radius: 5px; + font-size: 11px; +} + +.LabelList-seeMore:hover { + color: @default-link-hov; +} + .LabelList-tag--deletable { margin-right: 0px; - border-top-right-radius: 0px; - border-bottom-right-radius: 0px; + border-top-left-radius: 0px; + border-bottom-left-radius: 0px; border-right: 0; - max-wdith: ~"calc(100% - 23px)"; + max-width: ~"calc(100% - 23px)"; + margin-right: 5px; } .LabelList-deleteContainer { - border: 1px solid @d7grey; - border-left-color: @default-bg; - background-color: @default-bg; - border-top-right-radius: 5px; - border-bottom-right-radius: 5px; + background-color: @default-link; + border-top-left-radius: 5px; + border-bottom-left-radius: 5px; + color: @default-bg; padding: 0 5px; margin: 4px 0px; - margin-right: 5px; align-items: center; display: flex; cursor: pointer; @@ -52,7 +65,7 @@ .LabelList-tagDelete { font-size: 13px; - color: @default-icon; + color: @default-bg; } .LabelList-name { diff --git a/awx/ui/client/src/job-templates/labels/labelsList.directive.js b/awx/ui/client/src/job-templates/labels/labelsList.directive.js index 6df8b36025..4fb8225f3b 100644 --- a/awx/ui/client/src/job-templates/labels/labelsList.directive.js +++ b/awx/ui/client/src/job-templates/labels/labelsList.directive.js @@ -6,14 +6,50 @@ export default 'GetBasePath', 'ProcessErrors', 'Prompt', - function(templateUrl, Wait, Rest, GetBasePath, ProcessErrors, Prompt) { + '$q', + function(templateUrl, Wait, Rest, GetBasePath, ProcessErrors, Prompt, $q) { return { restrict: 'E', scope: false, templateUrl: templateUrl('job-templates/labels/labelsList'), link: function(scope, element, attrs) { + scope.seeMoreInactive = true; + scope.labels = scope. - job_template.summary_fields.labels; + job_template.summary_fields.labels.results; + + scope.count = scope. + job_template.summary_fields.labels.count; + + var getNext = function(data, arr, resolve) { + Rest.setUrl(data.next); + Rest.get() + .success(function (data) { + if (data.next) { + getNext(data, arr.concat(data.results), resolve); + } else { + resolve.resolve(arr.concat(data.results)); + } + }); + }; + + scope.seeMore = function () { + var seeMoreResolve = $q.defer(); + Rest.setUrl(scope.job_template.related.labels); + Rest.get() + .success(function(data) { + if (data.next) { + getNext(data, data.results, seeMoreResolve); + } else { + seeMoreResolve.resolve(data.results); + } + }); + + seeMoreResolve.promise.then(function (labels) { + scope.labels = labels; + scope.seeMoreInactive = false; + }); + }; scope.deleteLabel = function(templateId, templateName, labelId, labelName) { var action = function () { diff --git a/awx/ui/client/src/job-templates/labels/labelsList.partial.html b/awx/ui/client/src/job-templates/labels/labelsList.partial.html index 901ff98109..0ad0a00eda 100644 --- a/awx/ui/client/src/job-templates/labels/labelsList.partial.html +++ b/awx/ui/client/src/job-templates/labels/labelsList.partial.html @@ -1,10 +1,11 @@ -
-
- {{ label.name }} -
+
+
+ {{ label.name }} +
+
View More