diff --git a/awx/ui_next/src/components/RoutedTabs/RoutedTabs.jsx b/awx/ui_next/src/components/RoutedTabs/RoutedTabs.jsx index 27a0bf2940..a41ac3ea0a 100644 --- a/awx/ui_next/src/components/RoutedTabs/RoutedTabs.jsx +++ b/awx/ui_next/src/components/RoutedTabs/RoutedTabs.jsx @@ -12,6 +12,12 @@ function RoutedTabs(props) { if (match) { return match.id; } + const subpathMatch = tabsArray.find(tab => + history.location.pathname.startsWith(tab.link) + ); + if (subpathMatch) { + return subpathMatch.id; + } return 0; }; diff --git a/awx/ui_next/src/screens/Template/shared/SurveyList.jsx b/awx/ui_next/src/screens/Template/Survey/SurveyList.jsx similarity index 100% rename from awx/ui_next/src/screens/Template/shared/SurveyList.jsx rename to awx/ui_next/src/screens/Template/Survey/SurveyList.jsx diff --git a/awx/ui_next/src/screens/Template/shared/SurveyList.test.jsx b/awx/ui_next/src/screens/Template/Survey/SurveyList.test.jsx similarity index 100% rename from awx/ui_next/src/screens/Template/shared/SurveyList.test.jsx rename to awx/ui_next/src/screens/Template/Survey/SurveyList.test.jsx diff --git a/awx/ui_next/src/screens/Template/shared/SurveyListItem.jsx b/awx/ui_next/src/screens/Template/Survey/SurveyListItem.jsx similarity index 100% rename from awx/ui_next/src/screens/Template/shared/SurveyListItem.jsx rename to awx/ui_next/src/screens/Template/Survey/SurveyListItem.jsx diff --git a/awx/ui_next/src/screens/Template/shared/SurveyListItem.test.jsx b/awx/ui_next/src/screens/Template/Survey/SurveyListItem.test.jsx similarity index 100% rename from awx/ui_next/src/screens/Template/shared/SurveyListItem.test.jsx rename to awx/ui_next/src/screens/Template/Survey/SurveyListItem.test.jsx diff --git a/awx/ui_next/src/screens/Template/shared/SurveyQuestionAdd.jsx b/awx/ui_next/src/screens/Template/Survey/SurveyQuestionAdd.jsx similarity index 100% rename from awx/ui_next/src/screens/Template/shared/SurveyQuestionAdd.jsx rename to awx/ui_next/src/screens/Template/Survey/SurveyQuestionAdd.jsx diff --git a/awx/ui_next/src/screens/Template/shared/SurveyQuestionEdit.jsx b/awx/ui_next/src/screens/Template/Survey/SurveyQuestionEdit.jsx similarity index 100% rename from awx/ui_next/src/screens/Template/shared/SurveyQuestionEdit.jsx rename to awx/ui_next/src/screens/Template/Survey/SurveyQuestionEdit.jsx diff --git a/awx/ui_next/src/screens/Template/shared/SurveyQuestionForm.jsx b/awx/ui_next/src/screens/Template/Survey/SurveyQuestionForm.jsx similarity index 100% rename from awx/ui_next/src/screens/Template/shared/SurveyQuestionForm.jsx rename to awx/ui_next/src/screens/Template/Survey/SurveyQuestionForm.jsx diff --git a/awx/ui_next/src/screens/Template/shared/SurveyToolbar.jsx b/awx/ui_next/src/screens/Template/Survey/SurveyToolbar.jsx similarity index 100% rename from awx/ui_next/src/screens/Template/shared/SurveyToolbar.jsx rename to awx/ui_next/src/screens/Template/Survey/SurveyToolbar.jsx diff --git a/awx/ui_next/src/screens/Template/shared/SurveyToolbar.test.jsx b/awx/ui_next/src/screens/Template/Survey/SurveyToolbar.test.jsx similarity index 100% rename from awx/ui_next/src/screens/Template/shared/SurveyToolbar.test.jsx rename to awx/ui_next/src/screens/Template/Survey/SurveyToolbar.test.jsx diff --git a/awx/ui_next/src/screens/Template/Survey/index.js b/awx/ui_next/src/screens/Template/Survey/index.js new file mode 100644 index 0000000000..eaa4f40fae --- /dev/null +++ b/awx/ui_next/src/screens/Template/Survey/index.js @@ -0,0 +1,3 @@ +export { default as SurveyList } from './SurveyList'; +export { default as SurveyQuestionAdd } from './SurveyQuestionAdd'; +export { default as SurveyQuestionEdit } from './SurveyQuestionEdit'; diff --git a/awx/ui_next/src/screens/Template/TemplateSurvey.jsx b/awx/ui_next/src/screens/Template/TemplateSurvey.jsx index ae735bd3fb..daa672fe0f 100644 --- a/awx/ui_next/src/screens/Template/TemplateSurvey.jsx +++ b/awx/ui_next/src/screens/Template/TemplateSurvey.jsx @@ -7,9 +7,7 @@ import ContentError from '@components/ContentError'; import AlertModal from '@components/AlertModal'; import ErrorDetail from '@components/ErrorDetail'; import useRequest, { useDismissableError } from '@util/useRequest'; -import SurveyList from './shared/SurveyList'; -import SurveyQuestionAdd from './shared/SurveyQuestionAdd'; -import SurveyQuestionEdit from './shared/SurveyQuestionEdit'; +import { SurveyList, SurveyQuestionAdd, SurveyQuestionEdit } from './Survey'; function TemplateSurvey({ template, i18n }) { const [surveyEnabled, setSurveyEnabled] = useState(template.survey_enabled);