Переглянути джерело

:pencil2: A bit of cleaning up before merge

tabs-content
tomit4 3 роки тому
джерело
коміт
dbd7fcb326

+ 11
- 10
frontend/src/entities/survey/survey.answer.validator.js Переглянути файл

7
         minDomainSegments: 2,
7
         minDomainSegments: 2,
8
         tlds: { allow: domains },
8
         tlds: { allow: domains },
9
     }),
9
     }),
10
-    // TODO: password validation is a moving target with regex,
11
-    // consider using a more robust library?
12
-    password: Joi.string()
13
-        .min(14)
14
-        .max(30)
15
-        .pattern(
16
-            new RegExp(
17
-                '^(?=.*[!@#$%^&*()_+\\-=[\\]{};\':"\\\\|,.<>\\/?])(?=.*[!@#$%^&*()_+\\-=[\\]{};\':"\\\\|,.<>\\/?])[a-zA-Z0-9!@#$%^&*()_+\\-=[\\]{};\':"\\\\|,.<>\\/?]{14,}$',
18
-            ),
19
-        ),
10
+    // Comment out and uncomment below for more robust password testing
11
+    password: Joi.string().min(14).max(30),
12
+    // TODO: consider using a more robust library for password validation
13
+    // password: Joi.string()
14
+        // .min(14)
15
+        // .max(30)
16
+        // .pattern(
17
+            // new RegExp(
18
+                // '^(?=.*[!@#$%^&*()_+\\-=[\\]{};\':"\\\\|,.<>\\/?])(?=.*[!@#$%^&*()_+\\-=[\\]{};\':"\\\\|,.<>\\/?])[a-zA-Z0-9!@#$%^&*()_+\\-=[\\]{};\':"\\\\|,.<>\\/?]{14,}$',
19
+            // ),
20
+        // ),
20
     // TODO: Change if going international (only works in usa)
21
     // TODO: Change if going international (only works in usa)
21
     zipcode: Joi.string().min(5).max(5).pattern(new RegExp('^[0-9]{5}$')),
22
     zipcode: Joi.string().min(5).max(5).pattern(new RegExp('^[0-9]{5}$')),
22
     seeking: Joi.string(),
23
     seeking: Joi.string(),

+ 0
- 2
frontend/src/utils/survey.js Переглянути файл

7
         this.questionsFromDb = []
7
         this.questionsFromDb = []
8
     }
8
     }
9
     _addResponses(responseKeys, possibleResponsesByCategory) {
9
     _addResponses(responseKeys, possibleResponsesByCategory) {
10
-        console.log('possibleResponsesByCategory >>', possibleResponsesByCategory)
11
         Object.keys(possibleResponsesByCategory).forEach(categoryKey => {
10
         Object.keys(possibleResponsesByCategory).forEach(categoryKey => {
12
-            console.log('categoryKey >>', categoryKey)
13
             responseKeys.forEach(responseKey => {
11
             responseKeys.forEach(responseKey => {
14
                 if (possibleResponsesByCategory[categoryKey].length) {
12
                 if (possibleResponsesByCategory[categoryKey].length) {
15
                     responseKey.responses = possibleResponsesByCategory[categoryKey]
13
                     responseKey.responses = possibleResponsesByCategory[categoryKey]

Завантаження…
Відмінити
Зберегти