Skip to content

Commit

Permalink
Revert "added skills question as checkbox"
Browse files Browse the repository at this point in the history
This reverts commit 48cc614.
  • Loading branch information
Dennis Li committed Aug 3, 2023
1 parent 48cc614 commit 62e01f7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 33 deletions.
3 changes: 1 addition & 2 deletions src/pages/admin/DynamicForm/FormCreate.js
Original file line number Diff line number Diff line change
Expand Up @@ -801,8 +801,7 @@ const FormCreate = (props) => {
type: Yup.mixed().oneOf(["TEXT", "SELECT", "CHECKBOX", "UPLOAD"]).required(),
label: Yup.string().required("Question is a required field"),
choices: Yup.string(),
required: Yup.boolean().required(),
isSkillsQuestion: Yup.boolean()
required: Yup.boolean().required()
});

const validationSchema = Yup.object({
Expand Down
44 changes: 13 additions & 31 deletions src/pages/admin/DynamicForm/components/CustomQuestion.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const CustomQuestion = (props) => {
} = props;

const {
type, label, choices, questionImageUrl, charLimit, required, isSkillsQuestion
type, label, choices, questionImageUrl, charLimit, required
} = props.data;
const questionStyles = {
// -------- QUESTION COMPONENT STYLES ----------
Expand Down Expand Up @@ -100,16 +100,11 @@ const CustomQuestion = (props) => {
flexDirection: "column",
justifyContent: "center"
},
checkboxContainer: {
requiredContainer: {
display: "flex",
justifyContent: "flex-end",
alignItems: "center",
color: "rgba(255,255,255,0.8)"
},
checkboxWrapper: {
display: "flex",
flexDirection: "row",
justifyContent: "flex-end"
}
};

Expand Down Expand Up @@ -245,31 +240,18 @@ const CustomQuestion = (props) => {
value={choices}
/>
)}
<div style={questionStyles.checkboxWrapper}>
<div style={questionStyles.checkboxContainer}>
Skills Question?
<Checkbox
id={`${id}.isSkillsQuestion`}
name={`${name}.isSkillsQuestion`}
color="primary"
aria-label="Skills question?"
checked={isSkillsQuestion}
onChange={handleChange}
onBlur={handleBlur}
/>
</div>
<div style={questionStyles.checkboxContainer}>

<div style={questionStyles.requiredContainer}>
Required?
<Checkbox
id={`${id}.required`}
name={`${name}.required`}
color="primary"
aria-label="Required question?"
checked={required}
onChange={handleChange}
onBlur={handleBlur}
/>
</div>
<Checkbox
id={`${id}.required`}
name={`${name}.required`}
color="primary"
aria-label="Required question?"
checked={required}
onChange={handleChange}
onBlur={handleBlur}
/>
</div>
</div>
</div>
Expand Down

0 comments on commit 62e01f7

Please sign in to comment.