import { ArrayModel, ChoiceModel, FormModel, NumberModel, SelectModel, TextModel, type IFieldBase } from "./Models"; export const rootId = "root"; export const createAccount = [ new TextModel({ id: 'createAccount_emailId', parentId: "onboardingStream", placeholder: "What's your email?", imageUrl: '', type: "text", subType: 'singleLine', name: "Email", description: "Please type your email", label: "", value: [], fork: null, validation: [ { operator: 'email', anchorValues: [1], message: 'This is not a valid email address' } ], waitForHowManyMSBeforeSubmit: 1000, debounceFor: 300 }), new TextModel({ id: 'createAccount_passwordId', parentId: "onboardingStream", placeholder: "What's your password?", imageUrl: '', type: "text", subType: 'singleLine', name: "Password", description: "What's your password?", label: "", value: [], fork: null, validation: [ { operator: 'required', anchorValues: [1], message: 'A password is required' }, { operator: 'length', anchorValues: [1, 10], message: 'A password is required of between 1 and 10 characters' } ], waitForHowManyMSBeforeSubmit: 1000, debounceFor: 300 }), new TextModel({ id: 'createAccount_confirmPasswordId', parentId: "onboardingStream", placeholder: 'Type confirm your password', imageUrl: '', type: "text", subType: 'singleLine', name: "Confirm password", description: "Please confirm your password", label: "", value: [], fork: null, validation: [ // TODO: this needs to perfectly match a given value, or a dataSource value, in this instance 'password' above { operator: 'required', anchorValues: [1], message: 'A password is required' }, { operator: 'length', anchorValues: [1, 3], message: 'A password is required of between 1 and 10 characters' } ], waitForHowManyMSBeforeSubmit: 1000, debounceFor: 300 }), new FormModel({ id: 'onboardingStream', parentId: rootId, name: 'onboarding', subType: 'stepper', autosubmit: true, order: 1 }) ] export const details_stream = [ new TextModel({ id: 'createAccount_emailId', parentId: "detailStream", placeholder: "What's your name?", imageUrl: '', type: "text", subType: 'singleLine', name: "Name", description: "Please type your name", label: "", value: [], fork: null, validation: [ { operator: 'required', anchorValues: [1], message: 'This is not a valid email address' } ], waitForHowManyMSBeforeSubmit: 1000, debounceFor: 300 }), new TextModel({ id: 'createAccount_passwordId', parentId: "detailStream", placeholder: "And your surname?", imageUrl: '', type: "text", subType: 'singleLine', name: "Surname", description: "And your surname?", label: "", value: [], fork: null, validation: [ { operator: 'required', anchorValues: [1], message: 'A surname is required' } ], waitForHowManyMSBeforeSubmit: 1000, debounceFor: 300 }), new ChoiceModel({ id: 'checkboxId', parentId: "detailStream", placeholder: 'Pick from one of the options!', imageUrl: '', type: "choice", subType: 'checkbox', name: "Select Profession", description: "What kind of crew are you?", label: "", value: [], fork: { "deck_options": { operator: 'equalTo', anchorValues: ['Deck'], message: 'This field is required'}, "engineering_options": { operator: 'equalTo', anchorValues: ['Engineering'], message: 'This field is required'}, "kitchen_options": { operator: 'equalTo', anchorValues: ['Kitchen'], message: 'This field is required'}, }, validation: [ { operator: 'chosenAtLeast', anchorValues: [1], message: 'we can try' } ], waitForHowManyMSBeforeSubmit: 1000, data: [ { name: 'Deck' }, { name: 'Engineering' }, { name: 'Kitchen' } ], scale: [], dataKey: 'name', }), new ChoiceModel({ id: "deck_options", parentId: "detailStream", placeholder: "Pick from one of the options!", imageUrl: '', type: "choice", subType: 'checkbox', name: "Select deck position", description: "What best describes your position?", label: "", value: [], fork: {}, validation: [ { operator: 'chosenAtLeast', anchorValues: [1], message: 'we can try' } ], waitForHowManyMSBeforeSubmit: 1000, data: [ { name: 'Captain'}, { name: 'First mate'}, { name: 'A Deckhand!'} ], scale: [], dataKey: 'name', }), new ChoiceModel({ id: 'kitchen_options', parentId: "detailStream", placeholder: 'Pick from one of the options!', imageUrl: '', type: "choice", subType: 'checkbox', name: "Select kitchen position", description: "What best describes your position?", label: "", value: [], fork: {}, validation: [ { operator: 'chosenAtLeast', anchorValues: [1], message: 'we can try' } ], waitForHowManyMSBeforeSubmit: 1000, data: [ { name: 'Head chef'}, { name: 'Sous chef'}, { name: 'Pastry chef'}, { name: 'Kitchen porter'} ], scale: [], dataKey: 'name', }), new FormModel({ id: 'engineering_options', parentId: 'detailStream', name: 'onboarding', subType: 'stepper', autosubmit: true, order: 1 }), new ChoiceModel({ id: 'engineering_options_1', parentId: "engineering_options", placeholder: 'Pick from one of the options!', imageUrl: '', type: "choice", subType: 'checkbox', name: "engineering options 1", description: "What best describes your position?", label: "", value: [], fork: {}, validation: [ { operator: 'chosenAtLeast', anchorValues: [1], message: 'we can try' } ], waitForHowManyMSBeforeSubmit: 1000, data: [ { name: 'Chief engineer'}, { name: '2nd engineer'}, { name: '3rd engineer'}, { name: 'QMed'} ], scale: [], dataKey: 'name', }), new ChoiceModel({ id: 'engineering_options_2', parentId: "engineering_options", placeholder: 'Pick from one of the options!', imageUrl: '', type: "choice", subType: 'checkbox', name: "engineering options 2", description: "What best describes your position?", label: "", value: [], fork: { }, validation: [ { operator: 'chosenAtLeast', anchorValues: [1], message: 'we can try' } ], waitForHowManyMSBeforeSubmit: 1000, data: [ { name: '1st Second question'}, { name: '2nd Second question'}, { name: '3rd Second question'} ], scale: [], dataKey: 'name', }), new FormModel({ id: 'detailStream', name: 'onboarding', subType: 'stepper', autosubmit: true, order: 1 }) ] export const experience_stream = [ new ArrayModel({ id: 'arrayId', placeholder: 'Type your name here', imageUrl: '', type: 'array', subType: 'array', name: 'builderArrayName', description: 'Please type your name', label: '', value: [], fork: null, validation: [{ operator: 'chosenAtLeast', anchorValues: [1], message: 'we can try' }], waitForHowManyMSBeforeSubmit: 1000, classExample: () => [ new FormModel({ id: 'experience_description', parentId: '', name: 'Description', subType: 'stepper', autosubmit: true, order: 1 }), new TextModel({ id: 'experience_job_title', parentId: 'experience_description', placeholder: 'Job title', imageUrl: '', type: "text", subType: 'singleLine', name: "Job title", description: "Please specify the job title", label: "", value: "", fork: {}, validation: [ { operator: 'required', anchorValues: [], message: 'This field is required'}], waitForHowManyMSBeforeSubmit: 1000, debounceFor: 300 }), new TextModel({ id: 'experience_vessel_name', parentId: 'experience_description', placeholder: 'Vessel name', imageUrl: '', type: "text", subType: 'singleLine', name: "Vessel name", description: "Please type the vessel name", label: "", value: [], fork: null, validation: [], waitForHowManyMSBeforeSubmit: 1000, debounceFor: 300 }), new ChoiceModel({ id: 'experience_contract_type', parentId: 'experience_description', placeholder: '', imageUrl: '', type: 'choice', subType: 'radio', name: 'Contract type', description: 'Please choose your type', label: '', value: [], fork: null, validation: [{ operator: 'chosenAtLeast', anchorValues: [1], message: 'we can try' }], waitForHowManyMSBeforeSubmit: 1000, data: [ { typeName: 'Temp' }, { typeName: 'Permanent' } ], dataKey: 'typeName', scale: [], order: 1 }), new FormModel({ id: 'experience_date_start', parentId: '', name: 'Start date', subType: 'stepper', autosubmit: true, order: 1 }), new ChoiceModel({ id: 'experience_date_start_1', parentId: "experience_date_start", placeholder: 'Pick from one of the options!', imageUrl: '', type: "choice", subType: 'checkbox', name: "What month did you start?", description: "What best describes your position?", label: "", value: [], fork: {}, validation: [ { operator: 'chosenAtLeast', anchorValues: [1], message: 'we can try' } ], waitForHowManyMSBeforeSubmit: 1000, data: [ { name: 'January'}, { name: 'February'}, { name: 'March'}, { name: 'April'}, { name: 'May'}, { name: 'June'}, { name: 'July'}, { name: 'August'}, { name: 'September'}, { name: 'October'}, { name: 'November'}, { name: 'December'} ], scale: [], dataKey: 'name', }), new NumberModel({ id: 'experience_date_start_2', parentId: "experience_date_start", placeholder: 'Write the year here.', name: "What year did you start?", description: "What best describes your position?", label: "", value: [], fork: {}, validation: [ { operator: 'equalToOrGreaterThan', anchorValues: [1980], message: 'we can try' }, { operator: 'equalToOrLessThan', anchorValues: [ (new Date()).getFullYear() ], message: 'we can try' } ], waitForHowManyMSBeforeSubmit: 1000, }), new FormModel({ id: 'experience_date_end', parentId: '', name: 'End date', subType: 'stepper', autosubmit: true, order: 1 }), new ChoiceModel({ id: 'experience_date_end_1', parentId: "experience_date_end", placeholder: 'Pick from one of the options!', imageUrl: '', type: "choice", subType: 'checkbox', name: "What month did you end?", description: "What best describes your position?", label: "", value: [], fork: {}, validation: [ { operator: 'chosenAtLeast', anchorValues: [1], message: 'we can try' } ], waitForHowManyMSBeforeSubmit: 1000, data: [ { name: 'January'}, { name: 'February'}, { name: 'March'}, { name: 'April'}, { name: 'May'}, { name: 'June'}, { name: 'July'}, { name: 'August'}, { name: 'September'}, { name: 'October'}, { name: 'November'}, { name: 'December'} ], scale: [], dataKey: 'name', }), new NumberModel({ id: 'experience_date_end_2', parentId: "experience_date_end", placeholder: 'Write the year here.', name: "What year did you end?", description: "What best describes your position?", label: "", value: [], fork: {}, validation: [ { operator: 'equalToOrGreaterThan', anchorValues: [1980], message: 'we can try' }, { operator: 'equalToOrLessThan', anchorValues: [ (new Date()).getFullYear() ], message: 'we can try' } ], waitForHowManyMSBeforeSubmit: 1000, }), new ChoiceModel({ id: 'experience_currently_at_job', parentId: 'experience_description', placeholder: '', imageUrl: '', type: 'choice', subType: 'radio', name: 'Do you currently hold this position', description: 'Do you currently hold this position', label: '', value: [], fork: null, validation: [{ operator: 'chosenAtLeast', anchorValues: [1], message: 'we can try' }], waitForHowManyMSBeforeSubmit: 1000, data: [ { typeName: 'Yes' }, { typeName: 'No' } ], dataKey: 'typeName', scale: [], order: 1 }), new TextModel({ id: 'experience_responsibilities', parentId: 'experience_description', placeholder: 'Responsiblities', imageUrl: '', type: "text", subType: 'multiLine', name: "Responsiblities", description: "Please tell us about the responsiblities", label: "", value: [], fork: null, validation: [], waitForHowManyMSBeforeSubmit: 1000, debounceFor: 300 }), ], wrangleResult: (result: { arr: IFieldBase[]; acc: any }) => result.acc }) ] // import { ArrayModel, ChoiceModel, FormModel, NumberModel, SelectModel, TextModel, type IFieldBase } from "./Models"; // export const rootId = "root"; // export const createAccount = [ // new TextModel({ // id: 'createAccount_emailId', // parentId: "onboardingStream", // placeholder: "What's your email?", // imageUrl: '', // type: "text", // subType: 'singleLine', // name: "Email", // description: "Please type your email", // label: "", // value: [], // fork: null, // validation: [ { operator: 'email', anchorValues: [1], message: 'This is not a valid email address' } ], // waitForHowManyMSBeforeSubmit: 1000, // debounceFor: 300 // }), // new TextModel({ // id: 'createAccount_passwordId', // parentId: "onboardingStream", // placeholder: "What's your password?", // imageUrl: '', // type: "text", // subType: 'singleLine', // name: "Password", // description: "What's your password?", // label: "", // value: [], // fork: null, // validation: [ // { operator: 'required', anchorValues: [1], message: 'A password is required' }, // { operator: 'length', anchorValues: [1, 10], message: 'A password is required of between 1 and 10 characters' } // ], // waitForHowManyMSBeforeSubmit: 1000, // debounceFor: 300 // }), // new TextModel({ // id: 'createAccount_confirmPasswordId', // parentId: "onboardingStream", // placeholder: 'Type confirm your password', // imageUrl: '', // type: "text", // subType: 'singleLine', // name: "Confirm password", // description: "Please confirm your password", // label: "", // value: [], // fork: null, // validation: [ // // TODO: this needs to perfectly match a given value, or a dataSource value, in this instance 'password' above // { operator: 'required', anchorValues: [1], message: 'A password is required' }, // { operator: 'length', anchorValues: [1, 3], message: 'A password is required of between 1 and 10 characters' } // ], // waitForHowManyMSBeforeSubmit: 1000, // debounceFor: 300 // }), // new FormModel({ // id: 'onboardingStream', // parentId: rootId, // name: 'onboarding', // subType: 'stepper', // autosubmit: true, // order: 1 // }) // ] // export const details_stream = [ // new TextModel({ // id: 'createAccount_emailId', // parentId: "detailStream", // placeholder: "What's your name?", // imageUrl: '', // type: "text", // subType: 'singleLine', // name: "Name", // description: "Please type your name", // label: "", // value: [], // fork: null, // validation: [ { operator: 'required', anchorValues: [1], message: 'This is not a valid email address' } ], // waitForHowManyMSBeforeSubmit: 1000, // debounceFor: 300 // }), // new TextModel({ // id: 'createAccount_passwordId', // parentId: "detailStream", // placeholder: "And your surname?", // imageUrl: '', // type: "text", // subType: 'singleLine', // name: "Surname", // description: "And your surname?", // label: "", // value: [], // fork: null, // validation: [ // { operator: 'required', anchorValues: [1], message: 'A surname is required' } // ], // waitForHowManyMSBeforeSubmit: 1000, // debounceFor: 300 // }), // new ChoiceModel({ // id: 'checkboxId', // parentId: "detailStream", // placeholder: 'Pick from one of the options!', // imageUrl: '', // type: "choice", // subType: 'checkbox', // name: "Select Profession", // description: "What kind of crew are you?", // label: "", // value: [], // fork: { // "deck_options": { operator: 'equalTo', anchorValues: ['Deck'], message: 'This field is required'}, // "engineering_options": { operator: 'equalTo', anchorValues: ['Engineering'], message: 'This field is required'}, // "kitchen_options": { operator: 'equalTo', anchorValues: ['Kitchen'], message: 'This field is required'}, // }, // validation: [ { operator: 'chosenAtLeast', anchorValues: [1], message: 'we can try' } ], // waitForHowManyMSBeforeSubmit: 1000, // data: [ // { name: 'Deck' }, // { name: 'Engineering' }, // { name: 'Kitchen' } // ], // scale: [], // dataKey: 'name', // }), // new ChoiceModel({ // id: "deck_options", // parentId: "detailStream", // placeholder: "Pick from one of the options!", // imageUrl: '', // type: "choice", // subType: 'checkbox', // name: "Select deck position", // description: "What best describes your position?", // label: "", // value: [], // fork: {}, // validation: [ { operator: 'chosenAtLeast', anchorValues: [1], message: 'we can try' } ], // waitForHowManyMSBeforeSubmit: 1000, // data: [ // { name: 'Captain'}, // { name: 'First mate'}, // { name: 'A Deckhand!'} // ], // scale: [], // dataKey: 'name', // }), // new ChoiceModel({ // id: 'kitchen_options', // parentId: "detailStream", // placeholder: 'Pick from one of the options!', // imageUrl: '', // type: "choice", // subType: 'checkbox', // name: "Select kitchen position", // description: "What best describes your position?", // label: "", // value: [], // fork: {}, // validation: [ { operator: 'chosenAtLeast', anchorValues: [1], message: 'we can try' } ], // waitForHowManyMSBeforeSubmit: 1000, // data: [ // { name: 'Head chef'}, // { name: 'Sous chef'}, // { name: 'Pastry chef'}, // { name: 'Kitchen porter'} // ], // scale: [], // dataKey: 'name', // }), // new FormModel({ // id: 'engineering_options', // parentId: 'detailStream', // name: 'onboarding', // subType: 'stepper', // autosubmit: true, // order: 1 // }), // new ChoiceModel({ // id: 'engineering_options_1', // parentId: "engineering_options", // placeholder: 'Pick from one of the options!', // imageUrl: '', // type: "choice", // subType: 'checkbox', // name: "engineering options 1", // description: "What best describes your position?", // label: "", // value: [], // fork: {}, // validation: [ { operator: 'chosenAtLeast', anchorValues: [1], message: 'we can try' } ], // waitForHowManyMSBeforeSubmit: 1000, // data: [ // { name: 'Chief engineer'}, // { name: '2nd engineer'}, // { name: '3rd engineer'}, // { name: 'QMed'} // ], // scale: [], // dataKey: 'name', // }), // new ChoiceModel({ // id: 'engineering_options_2', // parentId: "engineering_options", // placeholder: 'Pick from one of the options!', // imageUrl: '', // type: "choice", // subType: 'checkbox', // name: "engineering options 2", // description: "What best describes your position?", // label: "", // value: [], // fork: { }, // validation: [ { operator: 'chosenAtLeast', anchorValues: [1], message: 'we can try' } ], // waitForHowManyMSBeforeSubmit: 1000, // data: [ // { name: '1st Second question'}, // { name: '2nd Second question'}, // { name: '3rd Second question'} // ], // scale: [], // dataKey: 'name', // }), // new FormModel({ // id: 'detailStream', // name: 'onboarding', // subType: 'stepper', // autosubmit: true, // order: 1 // }) // ] // export const experience_stream = [ // new ArrayModel({ // id: 'arrayId', // placeholder: 'Type your name here', // imageUrl: '', // type: 'array', // subType: 'array', // name: 'builderArrayName', // description: 'Please type your name', // label: '', // value: [], // fork: null, // validation: [{ operator: 'chosenAtLeast', anchorValues: [1], message: 'we can try' }], // waitForHowManyMSBeforeSubmit: 1000, // classExample: () => [ // new FormModel({ // id: 'experience_description', // parentId: '', // name: 'Description', // subType: 'stepper', // autosubmit: true, // order: 1 // }), // new TextModel({ // id: 'experience_job_title', // parentId: 'experience_description', // placeholder: 'Job title', // imageUrl: '', // type: "text", // subType: 'singleLine', // name: "Job title", // description: "Please specify the job title", // label: "", // value: "", // fork: {}, // validation: [ { operator: 'required', anchorValues: [], message: 'This field is required'}], // waitForHowManyMSBeforeSubmit: 1000, // debounceFor: 300 // }), // new TextModel({ // id: 'experience_vessel_name', // parentId: 'experience_description', // placeholder: 'Vessel name', // imageUrl: '', // type: "text", // subType: 'singleLine', // name: "Vessel name", // description: "Please type the vessel name", // label: "", // value: [], // fork: null, // validation: [], // waitForHowManyMSBeforeSubmit: 1000, // debounceFor: 300 // }), // new ChoiceModel({ // id: 'experience_contract_type', // parentId: 'experience_description', // placeholder: '', // imageUrl: '', // type: 'choice', // subType: 'radio', // name: 'Contract type', // description: 'Please choose your type', // label: '', // value: [], // fork: null, // validation: [{ operator: 'chosenAtLeast', anchorValues: [1], message: 'we can try' }], // waitForHowManyMSBeforeSubmit: 1000, // data: [ // { typeName: 'Temp' }, // { typeName: 'Permanent' } // ], // dataKey: 'typeName', // scale: [], // order: 1 // }), // new FormModel({ // id: 'experience_date_start', // parentId: '', // name: 'Start date', // subType: 'stepper', // autosubmit: true, // order: 1 // }), // new ChoiceModel({ // id: 'experience_date_start_1', // parentId: "experience_date_start", // placeholder: 'Pick from one of the options!', // imageUrl: '', // type: "choice", // subType: 'checkbox', // name: "What month did you start?", // description: "What best describes your position?", // label: "", // value: [], // fork: {}, // validation: [ { operator: 'chosenAtLeast', anchorValues: [1], message: 'we can try' } ], // waitForHowManyMSBeforeSubmit: 1000, // data: [ // { name: 'January'}, // { name: 'February'}, // { name: 'March'}, // { name: 'April'}, // { name: 'May'}, // { name: 'June'}, // { name: 'July'}, // { name: 'August'}, // { name: 'September'}, // { name: 'October'}, // { name: 'November'}, // { name: 'December'} // ], // scale: [], // dataKey: 'name', // }), // new NumberModel({ // id: 'experience_date_start_2', // parentId: "experience_date_start", // placeholder: 'Write the year here.', // name: "What year did you start?", // description: "What best describes your position?", // label: "", // value: [], // fork: {}, // validation: [ // { operator: 'equalToOrGreaterThan', anchorValues: [1980], message: 'we can try' }, // { operator: 'equalToOrLessThan', anchorValues: [ (new Date()).getFullYear() ], message: 'we can try' } // ], // waitForHowManyMSBeforeSubmit: 1000, // }), // new FormModel({ // id: 'experience_date_end', // parentId: '', // name: 'End date', // subType: 'stepper', // autosubmit: true, // order: 1 // }), // new ChoiceModel({ // id: 'experience_date_end_1', // parentId: "experience_date_end", // placeholder: 'Pick from one of the options!', // imageUrl: '', // type: "choice", // subType: 'checkbox', // name: "What month did you end?", // description: "What best describes your position?", // label: "", // value: [], // fork: {}, // validation: [ { operator: 'chosenAtLeast', anchorValues: [1], message: 'we can try' } ], // waitForHowManyMSBeforeSubmit: 1000, // data: [ // { name: 'January'}, // { name: 'February'}, // { name: 'March'}, // { name: 'April'}, // { name: 'May'}, // { name: 'June'}, // { name: 'July'}, // { name: 'August'}, // { name: 'September'}, // { name: 'October'}, // { name: 'November'}, // { name: 'December'} // ], // scale: [], // dataKey: 'name', // }), // new NumberModel({ // id: 'experience_date_end_2', // parentId: "experience_date_end", // placeholder: 'Write the year here.', // name: "What year did you end?", // description: "What best describes your position?", // label: "", // value: [], // fork: {}, // validation: [ // { operator: 'equalToOrGreaterThan', anchorValues: [1980], message: 'we can try' }, // { operator: 'equalToOrLessThan', anchorValues: [ (new Date()).getFullYear() ], message: 'we can try' } // ], // waitForHowManyMSBeforeSubmit: 1000, // }), // new ChoiceModel({ // id: 'experience_currently_at_job', // parentId: 'experience_description', // placeholder: '', // imageUrl: '', // type: 'choice', // subType: 'radio', // name: 'Do you currently hold this position', // description: 'Do you currently hold this position', // label: '', // value: [], // fork: null, // validation: [{ operator: 'chosenAtLeast', anchorValues: [1], message: 'we can try' }], // waitForHowManyMSBeforeSubmit: 1000, // data: [ // { typeName: 'Yes' }, // { typeName: 'No' } // ], // dataKey: 'typeName', // scale: [], // order: 1 // }), // new TextModel({ // id: 'experience_responsibilities', // parentId: 'experience_description', // placeholder: 'Responsiblities', // imageUrl: '', // type: "text", // subType: 'multiLine', // name: "Responsiblities", // description: "Please tell us about the responsiblities", // label: "", // value: [], // fork: null, // validation: [], // waitForHowManyMSBeforeSubmit: 1000, // debounceFor: 300 // }), // ], // wrangleResult: (result: { arr: IFieldBase[]; acc: any }) => result.acc // }) // ]