From 804bd840f1300141b041d6b4e97bfaa76290054b Mon Sep 17 00:00:00 2001 From: nixocio Date: Wed, 23 Jun 2021 16:08:33 -0400 Subject: [PATCH] Encode/decode question variables Encode/decode question variables See: https://github.com/ansible/awx/issues/7524 --- awx/ui_next/src/screens/Template/Survey/SurveyListItem.jsx | 6 +++++- .../src/screens/Template/Survey/SurveyQuestionEdit.jsx | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/awx/ui_next/src/screens/Template/Survey/SurveyListItem.jsx b/awx/ui_next/src/screens/Template/Survey/SurveyListItem.jsx index 6626ff73cd..deed64736f 100644 --- a/awx/ui_next/src/screens/Template/Survey/SurveyListItem.jsx +++ b/awx/ui_next/src/screens/Template/Survey/SurveyListItem.jsx @@ -98,7 +98,11 @@ function SurveyListItem({ dataListCells={[ <> - + {question.question_name} {question.required && ( diff --git a/awx/ui_next/src/screens/Template/Survey/SurveyQuestionEdit.jsx b/awx/ui_next/src/screens/Template/Survey/SurveyQuestionEdit.jsx index 16e0df584d..aec9564d23 100644 --- a/awx/ui_next/src/screens/Template/Survey/SurveyQuestionEdit.jsx +++ b/awx/ui_next/src/screens/Template/Survey/SurveyQuestionEdit.jsx @@ -15,7 +15,9 @@ export default function SurveyQuestionEdit({ survey, updateSurvey }) { const match = useRouteMatch(); const { search } = useLocation(); const queryParams = new URLSearchParams(search); - const questionVariable = queryParams.get('question_variable'); + const questionVariable = decodeURIComponent( + queryParams.get('question_variable') + ); if (!survey) { return ;