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

: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
         blurb: Joi.string(),
23
         blurb: Joi.string(),
24
         // TO ADD: add Joi validator for all new survey steps
24
         // TO ADD: add Joi validator for all new survey steps
25
         test: Joi.string(),
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
         aspects: Joi.array().items(Joi.number().allow(null))
28
         aspects: Joi.array().items(Joi.number().allow(null))
27
     }),
29
     }),
28
     validate(instance) {
30
     validate(instance) {

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

19
         blurb: 'blurb',
19
         blurb: 'blurb',
20
         // TO ADD: when creating a new step, place before aspects
20
         // TO ADD: when creating a new step, place before aspects
21
         test: 'test',
21
         test: 'test',
22
+        // TO ADD DROP DOWN: when creating a new step, place before aspects
23
+        testOptions: 'testOptions',
22
         aspects: 'aspects',
24
         aspects: 'aspects',
23
         // experience: 'experience',
25
         // experience: 'experience',
24
         // roles: 'role',
26
         // roles: 'role',
53
     presence: ['remote', 'in_person', 'hybrid', 'flexible'],
55
     presence: ['remote', 'in_person', 'hybrid', 'flexible'],
54
     // key 10
56
     // key 10
55
     duration: ['full-time', 'part-time', 'contract', 'flexible'],
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
     // Experience and roles concat, key: 14
61
     // Experience and roles concat, key: 14
57
     experience: ['associate', 'junior', 'mid-level', 'senior', 'staff'],
62
     experience: ['associate', 'junior', 'mid-level', 'senior', 'staff'],
58
     roles: {
63
     roles: {
99
     language: "What language is your native language?[break] I consider [break] language as my native language.",
104
     language: "What language is your native language?[break] I consider [break] language as my native language.",
100
     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.",
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
     // TO ADD: add new prompt for new survey steps here
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
 const inputPlaceholders = {
112
 const inputPlaceholders = {
110
     blurb: 'my backstory starts long long ago...',
117
     blurb: 'my backstory starts long long ago...',
111
     distance: '5 mi',
118
     distance: '5 mi',
112
     // TO ADD: add new input place holder here
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
 const invalidInputPrompts = {
125
 const invalidInputPrompts = {
128
     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?",
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
     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.",
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
     // TO ADD: add new input invalid message here
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
 export {
145
 export {

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

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

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