Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 13072 | Rev 13074 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 13072 Rev 13073
Línea 9... Línea 9...
9
import DescriptionInput from '../../../shared/DescriptionInput'
9
import DescriptionInput from '../../../shared/DescriptionInput'
10
import SectionModal from '../components/SectionModal'
10
import SectionModal from '../components/SectionModal'
11
import DeleteModal from '../../../shared/DeleteModal'
11
import DeleteModal from '../../../shared/DeleteModal'
12
import QuestionModal from '../components/QuestionModal'
12
import QuestionModal from '../components/QuestionModal'
13
import OptionModal from '../components/OptionModal'
13
import OptionModal from '../components/OptionModal'
-
 
14
import { async } from 'postcss-js'
Línea 14... Línea 15...
14
 
15
 
15
const sectionTypeOptions = {
16
const sectionTypeOptions = {
16
	open: 'Abierto',
17
	open: 'Abierto',
17
	simple: 'Simple',
18
	simple: 'Simple',
Línea 319... Línea 320...
319
		}
320
		}
320
	}
321
	}
Línea 321... Línea 322...
321
 
322
 
322
	const validate = () => {
323
	const validate = () => {
-
 
324
		const sectionError = content.find(section => !section.questions.length)
-
 
325
		const questionsToOptions = content.map(section => section.questions.map(question => question.type !== 'open'))
323
		const sectionError = content.find(section => !section.questions.length)
326
 
324
		if (sectionError.name) {
327
		if (sectionError.name) {
325
			dispatch(addNotification({
328
			dispatch(addNotification({
326
				style: 'danger',
329
				style: 'danger',
327
				msg: `La sección ${sectionError.name} no tiene preguntas`
330
				msg: `La sección ${sectionError.name} no tiene preguntas`
Línea 328... Línea 331...
328
			}))
331
			}))
329
 
332
 
Línea 330... Línea -...
330
			return false
-
 
331
		}
-
 
332
 
333
			return false
-
 
334
		}
333
		const questionError = content.map(section =>
335
 
334
			section.questions.find(question => {
-
 
335
				if (!question.options.length && question.type !== 'open') {
-
 
Línea 336... Línea -...
336
					return question
-
 
337
				}
-
 
338
			}))
-
 
339
 
336
		const questionError = questionsToOptions.find(question => !question.options.length)
Línea 340... Línea 337...
340
		if (questionError.name) {
337
 
Línea 341... Línea 338...
341
			console.log(questionError)
338
		console.log(questionError)