From 03dd11d29237f8e349b5ed5201a00f59aac224d0 Mon Sep 17 00:00:00 2001 From: Michael Abashian Date: Tue, 7 Jun 2016 14:39:11 -0400 Subject: [PATCH] Added the ability to set tooltips on form generator buttons. Added tooltip to the ADD SURVEY button on the job templates form. --- awx/ui/client/src/forms/JobTemplates.js | 4 +++- awx/ui/client/src/shared/form-generator.js | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/awx/ui/client/src/forms/JobTemplates.js b/awx/ui/client/src/forms/JobTemplates.js index c22db173f1..1e86e0f744 100644 --- a/awx/ui/client/src/forms/JobTemplates.js +++ b/awx/ui/client/src/forms/JobTemplates.js @@ -317,7 +317,9 @@ export default add_survey: { ngClick: 'addSurvey()', ngShow: 'job_type.value !== "scan" && !survey_exists', - awFeature: 'surveys' + awFeature: 'surveys', + awToolTip: 'Surveys allow users to be prompted at job launch with a series of questions related to the job', + dataPlacement: 'top' }, edit_survey: { ngClick: 'editSurvey()', diff --git a/awx/ui/client/src/shared/form-generator.js b/awx/ui/client/src/shared/form-generator.js index 73032b281f..e5055c491e 100644 --- a/awx/ui/client/src/shared/form-generator.js +++ b/awx/ui/client/src/shared/form-generator.js @@ -1718,6 +1718,9 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat //html += "\" "; } } + if(button.awToolTip) { + html += " aw-tool-tip='" + button.awToolTip + "' data-placement='" + button.dataPlacement + "' data-tip-watch='" + button.dataTipWatch + "'"; + } html += ">"; html += " " + button.label + "\n"; }