From ed3b6385f156ed079a0b6b3f647f68801cb21333 Mon Sep 17 00:00:00 2001 From: Alex Corey Date: Fri, 27 Mar 2020 10:25:32 -0400 Subject: [PATCH 1/3] Fixes several things about Survey List Aligns Select All with other select buttons Add required asterisk to those items that are required Adds label for the Default and Question Type column Adds chips for multiselect items. Adds RBAC to add and edit survey. Also fixes a bug where the survey was not reloading properly after edit --- .../PaginatedDataList/ToolbarAddButton.jsx | 3 +- .../screens/Template/Survey/SurveyList.jsx | 3 + .../Template/Survey/SurveyList.test.jsx | 38 +++++++- .../Template/Survey/SurveyListItem.jsx | 59 ++++++++++-- .../Template/Survey/SurveyListItem.test.jsx | 93 +++++++++++++++++++ .../Template/Survey/SurveyQuestionForm.jsx | 3 + .../screens/Template/Survey/SurveyToolbar.jsx | 16 +++- .../Template/Survey/SurveyToolbar.test.jsx | 28 ++++++ awx/ui_next/src/screens/Template/Template.jsx | 10 +- .../src/screens/Template/TemplateSurvey.jsx | 32 +++++-- .../screens/Template/WorkflowJobTemplate.jsx | 10 +- 11 files changed, 269 insertions(+), 26 deletions(-) diff --git a/awx/ui_next/src/components/PaginatedDataList/ToolbarAddButton.jsx b/awx/ui_next/src/components/PaginatedDataList/ToolbarAddButton.jsx index 6819581c93..19ae9a68c9 100644 --- a/awx/ui_next/src/components/PaginatedDataList/ToolbarAddButton.jsx +++ b/awx/ui_next/src/components/PaginatedDataList/ToolbarAddButton.jsx @@ -5,7 +5,7 @@ import { Button, Tooltip } from '@patternfly/react-core'; import { withI18n } from '@lingui/react'; import { t } from '@lingui/macro'; -function ToolbarAddButton({ linkTo, onClick, i18n }) { +function ToolbarAddButton({ linkTo, onClick, i18n, isDisabled }) { if (!linkTo && !onClick) { throw new Error( 'ToolbarAddButton requires either `linkTo` or `onClick` prop' @@ -15,6 +15,7 @@ function ToolbarAddButton({ linkTo, onClick, i18n }) { return (