Name question fields
This commit is contained in:
@@ -44,7 +44,7 @@ class OptionsWidget extends React.Component<OptionsWidgetProps, OptionsWidgetSta
|
||||
throw new SignupQuestionError(`Question widget type "${type}" not in types array.`);
|
||||
}
|
||||
|
||||
if (type === "text" || type === "email") {
|
||||
if (type === "text" || type === "email" || type === "name") {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,8 @@ type OptionTypes =
|
||||
"integer" |
|
||||
"radiobutton" |
|
||||
"checkbox" |
|
||||
"email";
|
||||
"email" |
|
||||
"name";
|
||||
|
||||
export const optionTypes = [
|
||||
"text",
|
||||
@@ -28,7 +29,8 @@ export const optionTypes = [
|
||||
"integer",
|
||||
"radiobutton",
|
||||
"checkbox",
|
||||
"email"
|
||||
"email",
|
||||
"name"
|
||||
];
|
||||
|
||||
export class SignupQuestionError extends Error { }
|
||||
|
||||
@@ -5,7 +5,7 @@ import { EMAIL_REGEX } from "@utils/regexes";
|
||||
|
||||
const questionToSchemaProp = (question: Question): {} => {
|
||||
let obj: any;
|
||||
if (question.type === "text") {
|
||||
if (question.type === "text" || question.type === "name") {
|
||||
obj = {
|
||||
type: "string",
|
||||
title: question.name,
|
||||
@@ -104,7 +104,7 @@ const questionToUISchemaProp = (question: Question): {} => {
|
||||
}
|
||||
|
||||
const questionToValidationSchema = (question: Question) => {
|
||||
if (question.type === "text") {
|
||||
if (question.type === "text" || question.type === "name") {
|
||||
return {
|
||||
type: "string",
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user