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

feat: use textarea for providing checkbox options #962

Merged
merged 5 commits into from
Feb 17, 2021

Conversation

jia1
Copy link
Member

@jia1 jia1 commented Dec 29, 2020

Problem

We may expect users to have many Checkbox options and adding them one-by-one to FormSG is troublesome. As such, we want Checkbox options to follow Dropdown options so that Checkbox options can be edited by a textarea with each option in each line in the textarea.

Closes #743

Solution

Only frontend changes. Edit the conditional rendering (i.e. ng-if) such that Dropdown and Checkbox show the same textarea for Options and Radio button will show its usual one-by-one options.

In the controller, edit the if clauses so that we now transform fieldOptions into fieldOptionsFromText when rendering Options and we check for fieldOptionsFromText instead of manualOptions when saving fieldOptions.

Before & After Screenshots

BEFORE:

Screenshot 2020-12-29 at 8 08 43 PM

AFTER:

Screenshot 2020-12-29 at 8 08 59 PM

Note: I have not checked for test breakages yet.

@jia1 jia1 self-assigned this Jan 2, 2021
@jia1 jia1 force-pushed the feat/use-textarea-for-checkbox-options branch from 0cb0bb5 to 8c530bc Compare January 3, 2021 07:07
@jia1 jia1 added the contribute free for contributors to pick up label Feb 4, 2021
@karrui karrui force-pushed the feat/use-textarea-for-checkbox-options branch from 8530dce to 2077676 Compare February 17, 2021 02:10
@karrui karrui marked this pull request as ready for review February 17, 2021 02:10
@karrui karrui changed the title Use textarea for Checkbox options feat: use textarea for providing checkbox options Feb 17, 2021
Copy link
Contributor

@karrui karrui left a comment

Choose a reason for hiding this comment

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

lgtm

@karrui karrui merged commit 8be1d9c into develop Feb 17, 2021
@karrui karrui deleted the feat/use-textarea-for-checkbox-options branch February 17, 2021 02:44
@karrui karrui mentioned this pull request Feb 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribute free for contributors to pick up
Projects
None yet
Development

Successfully merging this pull request may close these issues.

List input for checkboxes
3 participants