From 605432dda2bbdb4288bb85dc716b9157397a8799 Mon Sep 17 00:00:00 2001 From: Marliana Lara Date: Fri, 4 Aug 2017 13:58:08 -0400 Subject: [PATCH] Pull Credential input and injector help_text from API --- awx/ui/client/src/credential-types/add/add.controller.js | 3 +++ awx/ui/client/src/credential-types/credential-types.form.js | 4 ++-- awx/ui/client/src/credential-types/edit/edit.controller.js | 3 +++ awx/ui/client/src/shared/form-generator.js | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/awx/ui/client/src/credential-types/add/add.controller.js b/awx/ui/client/src/credential-types/add/add.controller.js index 0c404e51db..3b4e1f6d1f 100644 --- a/awx/ui/client/src/credential-types/add/add.controller.js +++ b/awx/ui/client/src/credential-types/add/add.controller.js @@ -37,6 +37,9 @@ export default ['Rest', 'Wait', callback: 'loadCredentialKindOptions' }); + $scope.inputs_help_text = options.actions.POST.inputs.help_text; + $scope.injectors_help_text = options.actions.POST.injectors.help_text; + if (!options.actions.POST) { $state.go("^"); Alert('Permission Error', 'You do not have permission to add a credential type.', 'alert-info'); diff --git a/awx/ui/client/src/credential-types/credential-types.form.js b/awx/ui/client/src/credential-types/credential-types.form.js index fdc3963e0b..6f55465478 100644 --- a/awx/ui/client/src/credential-types/credential-types.form.js +++ b/awx/ui/client/src/credential-types/credential-types.form.js @@ -43,7 +43,7 @@ export default ['i18n', function(i18n) { default: '---', showParseTypeToggle: true, parseTypeName: 'parseTypeInputs', - awPopOver: i18n._("Enter inputs using either JSON or YAML syntax. Use the radio button to toggle between the two. Refer to the Ansible Tower documentation for example syntax."), + awPopOverWatch: "inputs_help_text", dataTitle: i18n._('Input Configuration'), dataPlacement: 'right', dataContainer: "body", @@ -57,7 +57,7 @@ export default ['i18n', function(i18n) { default: '---', showParseTypeToggle: true, parseTypeName: 'parseTypeInjectors', - awPopOver: i18n._("Enter injectors using either JSON or YAML syntax. Use the radio button to toggle between the two. Refer to the Ansible Tower documentation for example syntax."), + awPopOverWatch: "injectors_help_text", dataTitle: i18n._('Injector Configuration'), dataPlacement: 'right', dataContainer: "body", diff --git a/awx/ui/client/src/credential-types/edit/edit.controller.js b/awx/ui/client/src/credential-types/edit/edit.controller.js index 32f4578d6c..1ecef2061e 100644 --- a/awx/ui/client/src/credential-types/edit/edit.controller.js +++ b/awx/ui/client/src/credential-types/edit/edit.controller.js @@ -35,6 +35,9 @@ export default ['Rest', 'Wait', options: options, callback: 'choicesReadyCredentialTypes' }); + + $scope.inputs_help_text = options.actions.POST.inputs.help_text; + $scope.injectors_help_text = options.actions.POST.injectors.help_text; }); } diff --git a/awx/ui/client/src/shared/form-generator.js b/awx/ui/client/src/shared/form-generator.js index b332dc0f27..2991a138a0 100644 --- a/awx/ui/client/src/shared/form-generator.js +++ b/awx/ui/client/src/shared/form-generator.js @@ -658,7 +658,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat } else { html += "\t\t\n\t\t\t" + field.label + "\n\t\t"; } - html += (field.awPopOver && !field.awPopOverRight) ? Attr(field, 'awPopOver', fld) : ""; + html += ((field.awPopOver || field.awPopOverWatch) && !field.awPopOverRight) ? Attr(field, 'awPopOver', fld) : ""; html += (field.hintText) ? "\n\t\t\n\t\t\t\n\t\t\t\n\t\t\tHint: " + field.hintText + "\n\t\t" : ""; // Variable editing if (fld === "variables" || fld === "extra_vars" || _.last(fld.split('_')) === 'variables' || fld === 'source_vars' || field.showParseTypeToggle === true) {