Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 15060 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 15060 Rev 15131
Línea 3... Línea 3...
3
import React from 'react'
3
import React from 'react'
4
import { useState } from 'react'
4
import { useState } from 'react'
5
import { useForm } from 'react-hook-form'
5
import { useForm } from 'react-hook-form'
6
import { useDispatch } from 'react-redux'
6
import { useDispatch } from 'react-redux'
7
import { addNotification } from '../../../redux/notification/notification.actions'
7
import { addNotification } from '../../../redux/notification/notification.actions'
-
 
8
import { CKEditor } from 'ckeditor4-react'
-
 
9
import { useEffect } from 'react'
8
import DescriptionInput from '../../../shared/DescriptionInput'
10
import { config } from '../../../shared/helpers/ckeditor_config'
Línea 9... Línea 11...
9
 
11
 
Línea 10... Línea 12...
10
const AddModal = ({ closeModal, email_link, isOpen, add_link, onComplete }) => {
12
const AddModal = ({ closeModal, email_link, isOpen, add_link, onComplete }) => {
11
 
13
 
Línea 66... Línea 68...
66
				}))
68
				}))
67
			})
69
			})
68
	}
70
	}
Línea 69... Línea 71...
69
 
71
 
70
	const showSecondPage = () => {
72
	const showSecondPage = () => {
71
		if (watch('first_name') && watch('last_name') && watch('email')) {
-
 
72
			return setIsShowSecondPage(true)
-
 
Línea 73... Línea 73...
73
		}
73
		if (watch('first_name') && watch('last_name') && watch('email')) setIsShowSecondPage(true)
74
 
74
 
75
		setError('first_name', { message: 'Este campo es requerido' })
75
		setError('first_name', { message: 'Este campo es requerido' })
76
		setError('last_name', { message: 'Este campo es requerido' })
76
		setError('last_name', { message: 'Este campo es requerido' })
Línea 92... Línea 92...
92
				setValue('last_name', data.data.last_name)
92
				setValue('last_name', data.data.last_name)
93
				clearErrors()
93
				clearErrors()
94
			})
94
			})
95
	}
95
	}
Línea -... Línea 96...
-
 
96
 
-
 
97
	useEffect(() => register('coment'), [])
96
 
98
 
97
	return (
99
	return (
98
		<Modal size="md" onHide={closeModal} show={isOpen}>
100
		<Modal size="md" onHide={closeModal} show={isOpen}>
99
			<Modal.Header closeButton>
101
			<Modal.Header closeButton>
100
				<Modal.Title>Nuevo candidato</Modal.Title>
102
				<Modal.Title>Nuevo candidato</Modal.Title>
Línea 126... Línea 128...
126
						</div>
128
						</div>
127
					</div>
129
					</div>
128
					<div style={isShowSecondPage ? { display: 'block' } : { display: 'none' }}>
130
					<div style={isShowSecondPage ? { display: 'block' } : { display: 'none' }}>
129
						<div className='form-group'>
131
						<div className='form-group'>
130
							<label className="form-label">Comentario</label>
132
							<label className="form-label">Comentario</label>
131
							<DescriptionInput
133
							<CKEditor
132
								name='coment'
134
								onChange={(e) => setValue('coment', e.editor.getData())}
133
								onChange={setValue}
135
								config={config}
134
							/>
136
							/>
135
							{errors.coment && <p>{errors.coment.message}</p>}
137
							{errors.coment && <p>{errors.coment.message}</p>}
136
						</div>
138
						</div>
137
						<div className='form-group'>
139
						<div className='form-group'>
138
							<label className="form-label">Evaluación</label>
140
							<label className="form-label">Evaluación</label>
139
							<select className='form-control' name='evaluation' ref={register({ required: true })}>
141
							<select className='form-control' name='evaluation' ref={register({ required: true })}>
140
								{
-
 
141
									pointsOptions.map(({ label, value }) => {
142
								{pointsOptions.map(({ label, value }) =>
142
										return <option key={value} value={value}>{label}</option>
143
									<option key={value} value={value}>{label}</option>
143
									})
-
 
144
								}
144
								)}
145
							</select>
145
							</select>
146
							{errors.evaluation && <p>Este campo es requerido</p>}
146
							{errors.evaluation && <p>Este campo es requerido</p>}
147
						</div>
147
						</div>
148
						<div className='form-group'>
148
						<div className='form-group'>
149
							<label className="form-label">Resumen Curricular</label>
149
							<label className="form-label">Resumen Curricular</label>
Línea 157... Línea 157...
157
							/>
157
							/>
158
						</div>
158
						</div>
159
						<div className='form-group'>
159
						<div className='form-group'>
160
							<label className="form-label">Estatus</label>
160
							<label className="form-label">Estatus</label>
161
							<select className='form-control' name='status' ref={register({ required: true })}>
161
							<select className='form-control' name='status' ref={register({ required: true })}>
162
								{
-
 
163
									statusOptions.map(({ label, value }) => {
162
								{statusOptions.map(({ label, value }) =>
164
										return <option key={value} value={value}>{label}</option>
163
									<option key={value} value={value}>{label}</option>
165
									})
-
 
166
								}
164
								)}
167
							</select>
165
							</select>
168
							{errors.status && <p>Este campo es requerido</p>}
166
							{errors.status && <p>Este campo es requerido</p>}
169
						</div>
167
						</div>
170
					</div>
168
					</div>
171
				</Modal.Body>
169
				</Modal.Body>