From 9959678c0b7b9c3b3d8a16c90840fef07a5aa352 Mon Sep 17 00:00:00 2001 From: jeznorth Date: Mon, 11 Sep 2023 11:01:03 -0700 Subject: [PATCH 1/5] Front-end polish and content updates --- app/src/features/surveys/CreateSurveyPage.tsx | 4 +- .../features/surveys/components/BlockForm.tsx | 32 ++++----- .../components/CreateSurveyBlockDialog.tsx | 5 +- .../components/EditSurveyBlockDialog.tsx | 5 +- .../surveys/components/SurveyBlockSection.tsx | 69 +++++++++++-------- .../surveys/components/SurveyUserForm.tsx | 4 +- .../features/surveys/edit/EditSurveyForm.tsx | 4 +- 7 files changed, 62 insertions(+), 61 deletions(-) diff --git a/app/src/features/surveys/CreateSurveyPage.tsx b/app/src/features/surveys/CreateSurveyPage.tsx index 4d65d2a87c..93430e05f7 100644 --- a/app/src/features/surveys/CreateSurveyPage.tsx +++ b/app/src/features/surveys/CreateSurveyPage.tsx @@ -380,8 +380,8 @@ const CreateSurveyPage = () => { } /> diff --git a/app/src/features/surveys/components/BlockForm.tsx b/app/src/features/surveys/components/BlockForm.tsx index bb1e68b7b8..cc2492057f 100644 --- a/app/src/features/surveys/components/BlockForm.tsx +++ b/app/src/features/surveys/components/BlockForm.tsx @@ -1,4 +1,3 @@ -import Typography from '@mui/material/Typography'; import { Box } from '@mui/system'; import CustomTextField from 'components/fields/CustomTextField'; import React from 'react'; @@ -12,25 +11,20 @@ export interface IBlockData { const BlockForm: React.FC = () => { return (
- - - Name and Description - - - - - + + + ); }; diff --git a/app/src/features/surveys/components/CreateSurveyBlockDialog.tsx b/app/src/features/surveys/components/CreateSurveyBlockDialog.tsx index 7069429f4d..250250d86d 100644 --- a/app/src/features/surveys/components/CreateSurveyBlockDialog.tsx +++ b/app/src/features/surveys/components/CreateSurveyBlockDialog.tsx @@ -20,9 +20,6 @@ const CreateSurveyBlockDialog: React.FC = (props) => { <> = (props) => { message={ <> - Block {blockName} has been added. + Block '{blockName}' has been added. } diff --git a/app/src/features/surveys/components/EditSurveyBlockDialog.tsx b/app/src/features/surveys/components/EditSurveyBlockDialog.tsx index 570c03020a..1cb1b8df19 100644 --- a/app/src/features/surveys/components/EditSurveyBlockDialog.tsx +++ b/app/src/features/surveys/components/EditSurveyBlockDialog.tsx @@ -21,10 +21,7 @@ const EditSurveyBlockDialog: React.FC = (props) => { return ( <> { sx={{ marginBottom: '14px' }}> - Define Blocks + Define Blocks (optional) { sx={{ maxWidth: '90ch' }}> - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam at porttitor sem. Aliquam erat volutpat. Donec - placerat nisl magna, et faucibus arcu condimentum sed. + Enter a name and description for each block used in this survey. {
+ {values.blocks.map((item, index) => { + return ( + + ) => + handleMenuClick(event, index) + } + aria-label="settings"> + + + } + title={item.name} + subheader={item.description} + /> + + ); + })} - - {values.blocks.map((item, index) => { - return ( - - ) => - handleMenuClick(event, index) - } - aria-label="settings"> - - - } - title={item.name} - subheader={item.description} - /> - - ); - })} -
); diff --git a/app/src/features/surveys/components/SurveyUserForm.tsx b/app/src/features/surveys/components/SurveyUserForm.tsx index 178f39a621..483feb796a 100644 --- a/app/src/features/surveys/components/SurveyUserForm.tsx +++ b/app/src/features/surveys/components/SurveyUserForm.tsx @@ -146,7 +146,9 @@ const SurveyUserForm: React.FC = (props) => {
{errors?.['participants'] && selectedUsers.length > 0 && ( - + + + )} = (props) => { } /> From 0651fa7353e8db64206794353d0857008c7a5c51 Mon Sep 17 00:00:00 2001 From: jeznorth Date: Mon, 11 Sep 2023 11:20:49 -0700 Subject: [PATCH 2/5] Front-end polish and content updates --- app/src/features/surveys/CreateSurveyPage.tsx | 2 +- .../surveys/components/SurveyBlockSection.tsx | 66 ++++++++++--------- 2 files changed, 36 insertions(+), 32 deletions(-) diff --git a/app/src/features/surveys/CreateSurveyPage.tsx b/app/src/features/surveys/CreateSurveyPage.tsx index 93430e05f7..11cc7a80fa 100644 --- a/app/src/features/surveys/CreateSurveyPage.tsx +++ b/app/src/features/surveys/CreateSurveyPage.tsx @@ -381,7 +381,7 @@ const CreateSurveyPage = () => { } /> diff --git a/app/src/features/surveys/components/SurveyBlockSection.tsx b/app/src/features/surveys/components/SurveyBlockSection.tsx index fcb9068b6f..966db9ce48 100644 --- a/app/src/features/surveys/components/SurveyBlockSection.tsx +++ b/app/src/features/surveys/components/SurveyBlockSection.tsx @@ -13,6 +13,8 @@ import React, { useState } from 'react'; import yup from 'utils/YupSchema'; import CreateSurveyBlockDialog from './CreateSurveyBlockDialog'; import EditSurveyBlockDialog from './EditSurveyBlockDialog'; +import { TransitionGroup } from 'react-transition-group'; +import Collapse from '@mui/material/Collapse'; export const SurveyBlockInitialValues = { blocks: [] @@ -98,6 +100,7 @@ const SurveyBlockSection: React.FC = () => { variant="body1" color="textSecondary" sx={{ + mb: 2, maxWidth: '90ch' }}> Enter a name and description for each block used in this survey. @@ -127,41 +130,42 @@ const SurveyBlockSection: React.FC = () => { Remove +
- {values.blocks.map((item, index) => { - return ( - - ) => - handleMenuClick(event, index) + + {values.blocks.map((item, index) => { + return ( + + - - - } - title={item.name} - subheader={item.description} - /> - - ); - })} + }} + > + ) => + handleMenuClick(event, index) + } + aria-label="settings"> + + + } + title={item.name} + subheader={item.description} + /> + + + ); + })} +