Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

General changes to surveys #3677

Merged
merged 3 commits into from Mar 15, 2023
Merged

General changes to surveys #3677

merged 3 commits into from Mar 15, 2023

Conversation

ivarnakken
Copy link
Member

Description

Minor changes to surveys pages

Add a "cancel" button to the editor and a "back" navigator.
Other than that just styling changes.


Rewrite survey editor to a functional component


Migrate survey editor to react-final-form

Testing

  • I have thoroughly tested my changes.

The changes to the <Field /> component has been checked with fields in redux-form forms using the onChange prop.

Editing works for the three different options; radio buttons, check boxes and text areas.


Related to ABA-54 (redux-form is still used on the actual survey form)

Add a "cancel" button to the editor and a "back" navigator.
Other than that just styling changes.
@ivarnakken ivarnakken added enhancement Pull requests that make enhancements, instead of just purely new features review-needed Pull requests that need review chore Pull requests that does something "boring", yet important, e.g. cleaning up code labels Mar 14, 2023
@ivarnakken ivarnakken self-assigned this Mar 14, 2023
Copy link
Member

@LudvigHz LudvigHz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
Types could be better, otherwise just small comments

updateRelativeIndexes: (arg0: number, arg1: number, arg2: Fields) => void;
fields: Fields;
updateRelativeIndexes: (arg0: number, arg1: number, arg2: any) => void;
fields: any;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😢

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are so difficult to type 😩

type State = {
templatePickerOpen: boolean;
templateTypeSelected: string;
initialValues: Record<string, any>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😢

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know how big that object is? I'm not typing that

<ul className={styles.questions} key="questions">
{fields.map((question, i) => (
<Question
key={i}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not me

@ivarnakken ivarnakken changed the title Minor changes to surveys pages General changes to surveys Mar 14, 2023
@ivarnakken ivarnakken added approved Pull requests that have been approved ready-to-merge Pull requests that have been approved and are ready to be merged and removed review-needed Pull requests that need review labels Mar 14, 2023
@ivarnakken ivarnakken merged commit 2908860 into master Mar 15, 2023
@ivarnakken ivarnakken deleted the survey-stuff branch March 15, 2023 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Pull requests that have been approved chore Pull requests that does something "boring", yet important, e.g. cleaning up code enhancement Pull requests that make enhancements, instead of just purely new features ready-to-merge Pull requests that have been approved and are ready to be merged
Projects
None yet
2 participants