Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 10853 Rev 10856
Línea 5... Línea 5...
5
import { useDispatch } from 'react-redux'
5
import { useDispatch } from 'react-redux'
6
import { useHistory, useParams } from 'react-router-dom'
6
import { useHistory, useParams } from 'react-router-dom'
7
import { addNotification } from '../../../redux/notification/notification.actions'
7
import { addNotification } from '../../../redux/notification/notification.actions'
Línea 8... Línea 8...
8
 
8
 
Línea 9... Línea 9...
9
 
9
 
10
const FormView = ({ actionLink, type_link, vacancy_link, vacancies }) => {
10
const FormView = ({ actionLink, type_link, vacancy_link, vacancies, add_link, setActionLink }) => {
11
 
11
 
12
	// States
12
	// States
Línea 51... Línea 51...
51
	const dispatch = useDispatch()
51
	const dispatch = useDispatch()
52
	const { action } = useParams()
52
	const { action } = useParams()
Línea 53... Línea 53...
53
 
53
 
Línea -... Línea 54...
-
 
54
	const onSubmit = () => {
54
	const onSubmit = () => {
55
 
55
 
56
		const content = []
56
		const content = competencies.map(competency => competency.behaviors.map(behavior => {
57
		competencies.forEach(competency => competency.behaviors.forEach(behavior => {
57
			return {
58
			content.push({
58
				competencyUuid: behavior.competency_uuid,
59
				competencyUuid: behavior.competency_uuid,
59
				behaviorUuid: behavior.uuid,
60
				behaviorUuid: behavior.uuid,
60
				comment: watch(`${behavior.competency_uuid}_${behavior.uuid}-comment`),
61
				comment: watch(`${behavior.competency_uuid}_${behavior.uuid}-comment`),
61
				evaluation: watch(`${behavior.competency_uuid}_${behavior.uuid}-points`)
62
				evaluation: watch(`${behavior.competency_uuid}_${behavior.uuid}-points`)
Línea 62... Línea 63...
62
			}
63
			})
63
		}))
64
		}))
64
 
65
 
65
		const submitData = new FormData()
66
		const submitData = new FormData()
66
		submitData.append('content', content)
67
		submitData.append('content', content)
67
		submitData.append('candidate_uuid', watch('candidate'))
68
		submitData.append('candidate_uuid', watch('candidate'))
Línea 68... Línea 69...
68
		submitData.append('points', watch('points'))
69
		submitData.append('points', watch('points'))
69
		submitData.append('comment', watch('comment'))
70
		submitData.append('comment', watch('comment'))
70
		submitData.append('status', watch('status'))
71
		submitData.append('status', watch('status'))
71
 
72
 
Línea 72... Línea 73...
72
		console.log(content)
73
		console.log(content)
73
		console.log(submitData)
74
		console.log(submitData.values)
Línea 177... Línea 178...
177
										<div className="tab-pane fade show active" id="home" role="tabpanel" aria-labelledby="home-tab">
178
										<div className="tab-pane fade show active" id="home" role="tabpanel" aria-labelledby="home-tab">
178
											<div className="row p-3 justify-content-between">
179
											<div className="row p-3 justify-content-between">
179
												<div className="col-6">
180
												<div className="col-6">
180
													<div className="form-group">
181
													<div className="form-group">
181
														<label>Vacantes</label>
182
														<label>Vacantes</label>
-
 
183
														<select
-
 
184
															className='form-control'
-
 
185
															name='vacancy' ref={register}
-
 
186
															disabled={action === 'edit'}
-
 
187
															onChange={(e) => {
182
														<select className='form-control' name='vacancy' ref={register} disabled={action === 'edit'} onChange={(e) => setVacancyUrl(vacancy_link.replace('UUID_PLACEHOLDER', e.target.value))}>
188
																setVacancyUrl(vacancy_link.replace('UUID_PLACEHOLDER', e.target.value))
-
 
189
																setActionLink(add_link.replace('UUID_PLACEHOLDER', e.target.value))
-
 
190
															}}>
183
															{
191
															{
184
																vacancyOptions.map(({ name, uuid }) => (
192
																vacancyOptions.map(({ name, uuid }) => (
185
																	<option selected={generalOptions.name === name} key={uuid} value={uuid}>{name}</option>
193
																	<option selected={generalOptions.name === name} key={uuid} value={uuid}>{name}</option>
186
																))
194
																))
187
															}
195
															}