Просмотр исходного кода

:memo: More notes on adding survey steps in prep for refactor

tags/0.0.3^2
tomit4 3 лет назад
Родитель
Сommit
1ece487871

+ 2
- 0
frontend/src/entities/survey/survey.answer.schema.js Просмотреть файл

@@ -23,6 +23,8 @@ const answersSchema = {
23 23
         blurb: Joi.string(),
24 24
         // TO ADD: add Joi validator for all new survey steps
25 25
         test: Joi.string(),
26
+        // TO ADD DROP DOWN: add Joi validator for all new survey with drop down steps
27
+        testOptions: Joi.string(),
26 28
         aspects: Joi.array().items(Joi.number().allow(null))
27 29
     }),
28 30
     validate(instance) {

+ 14
- 3
frontend/src/utils/lang.js Просмотреть файл

@@ -19,6 +19,8 @@ const allSteps = {
19 19
         blurb: 'blurb',
20 20
         // TO ADD: when creating a new step, place before aspects
21 21
         test: 'test',
22
+        // TO ADD DROP DOWN: when creating a new step, place before aspects
23
+        testOptions: 'testOptions',
22 24
         aspects: 'aspects',
23 25
         // experience: 'experience',
24 26
         // roles: 'role',
@@ -53,6 +55,9 @@ possible.usa = {
53 55
     presence: ['remote', 'in_person', 'hybrid', 'flexible'],
54 56
     // key 10
55 57
     duration: ['full-time', 'part-time', 'contract', 'flexible'],
58
+    // TO ADD DROP DOWN: When adding new survey Form Drop Down step, add all
59
+    // options in array
60
+    testOptions: ['test-option-1', 'test-option-2', 'test-option-3'],
56 61
     // Experience and roles concat, key: 14
57 62
     experience: ['associate', 'junior', 'mid-level', 'senior', 'staff'],
58 63
     roles: {
@@ -99,7 +104,9 @@ const promptOverrides = {
99 104
     language: "What language is your native language?[break] I consider [break] language as my native language.",
100 105
     distance: "What distance from your home are you looking to work in?[break] Preferably, I'd like to work [break] from my place of residence.",
101 106
     // TO ADD: add new prompt for new survey steps here
102
-    test: 'this[break]is just[break] a test.'
107
+    test: 'this[break]is just[break] a test.',
108
+    // TO ADD DROP DOWN: add new prompt for new survey steps here
109
+    testOptions: 'this[break]is another[break] test with options.'
103 110
 }
104 111
 
105 112
 const inputPlaceholders = {
@@ -110,7 +117,9 @@ const inputPlaceholders = {
110 117
     blurb: 'my backstory starts long long ago...',
111 118
     distance: '5 mi',
112 119
     // TO ADD: add new input place holder here
113
-    test: 'test'
120
+    test: 'test',
121
+    // TO ADD DROP DOWN: add new input place holder here
122
+    testOptions: 'testOptions'
114 123
 }
115 124
 
116 125
 const invalidInputPrompts = {
@@ -128,7 +137,9 @@ const invalidInputPrompts = {
128 137
     language: "We try our best to provide results in the language of your choosing. ¿Prefieres ver resultados en español? Or would you prefer to see results in english?",
129 138
     distance: "Whoa! You either left this field blank or tried to input an astronomically large distance you'd like to see results from. Please input a distance you'd like to see results in.",
130 139
     // TO ADD: add new input invalid message here
131
-    test: 'oh goodness, why test this!'
140
+    test: 'oh goodness, why test this!',
141
+    // TO ADD DROP DOWN: add new input invalid message here
142
+    testOptions: 'oh goodness, why test this with Options!'
132 143
 }
133 144
 
134 145
 export {

+ 2
- 0
frontend/src/utils/survey.js Просмотреть файл

@@ -19,6 +19,8 @@ const promptToComponent = {
19 19
     blurb: 'FormInput',
20 20
     // TO ADD: Add Component Type for new survey step here
21 21
     test: 'FormInput',
22
+    // TO ADD DROP DOWN: Add Component Type for new survey step here
23
+    testOptions: 'FormDropdown',
22 24
     aspects: 'Aspects',
23 25
     // experience: 'FormTags',
24 26
     // role: 'FormDropdown',

Загрузка…
Отмена
Сохранить