Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 14843 Rev 15098
Línea 1... Línea 1...
1
/* eslint-disable no-mixed-spaces-and-tabs */
1
/* eslint-disable no-mixed-spaces-and-tabs */
2
import React, { useState, useEffect } from 'react'
2
import React, { useState, useEffect } from 'react'
3
import axios from 'axios'
3
import axios from 'axios'
4
import { Card } from 'react-bootstrap'
4
import { Card } from 'react-bootstrap'
5
import { useDispatch } from 'react-redux'
5
import { useDispatch } from 'react-redux'
6
import { useHistory } from 'react-router-dom'
-
 
7
import { LengthFilter, SearchInput, Table, TablePagination } from '../../../recruitment_and_selection/components/TableComponents'
6
import { LengthFilter, SearchInput, Table, TablePagination } from '../../../recruitment_and_selection/components/TableComponents'
8
import { addNotification } from '../../../redux/notification/notification.actions'
7
import { addNotification } from '../../../redux/notification/notification.actions'
9
import DeleteModal from '../../../shared/DeleteModal'
8
import DeleteModal from '../../../shared/DeleteModal'
10
import AddModal from '../components/AddModal'
9
import AddModal from '../components/AddModal'
Línea 21... Línea 20...
21
	add_link,
20
	add_link,
22
	table_link,
21
	table_link,
23
	permisions,
22
	permisions,
24
	actionLink,
23
	actionLink,
25
	setActionLink,
24
	setActionLink,
26
	email_link
25
	email_link,
-
 
26
	setAction
27
}) => {
27
}) => {
Línea 28... Línea 28...
28
 
28
 
29
	//Hooks
29
	//Hooks
30
	const dispatch = useDispatch()
-
 
Línea 31... Línea 30...
31
	const history = useHistory()
30
	const dispatch = useDispatch()
32
 
31
 
33
	//State
32
	//State
34
	const [modalToShow, setModalToShow] = useState('')
33
	const [modalToShow, setModalToShow] = useState('')
Línea 149... Línea 148...
149
									</div>
148
									</div>
150
								</Card.Header>
149
								</Card.Header>
151
								<Card.Body>
150
								<Card.Body>
152
									<div className="table-responsive">
151
									<div className="table-responsive">
153
										<Table data={items} headers={headers} setData={setItems}>
152
										<Table data={items} headers={headers} setData={setItems}>
154
											{
-
 
155
												items.length
153
											{!!items.length &&
156
												&&
-
 
157
												items.map((item, index) => (
154
												items.map((item, index) => (
158
													<tr key={index}>
155
													<tr key={index}>
159
														<td className='text-vertical-middle'>{item.last_date}</td>
156
														<td className='text-vertical-middle'>{item.last_date}</td>
160
														<td className='text-vertical-middle'>
157
														<td className='text-vertical-middle'>
161
															{item.form}
158
															{item.form}
Línea 175... Línea 172...
175
																	:
172
																	:
176
																	<button
173
																	<button
177
																		className="btn btn-info btn-sm"
174
																		className="btn btn-info btn-sm"
178
																		onClick={() => {
175
																		onClick={() => {
179
																			setActionLink(item.actions.link_both)
176
																			setActionLink(item.actions.link_both)
180
																			history.push('evaluations/both')
177
																			setAction('both')
181
																		}}
178
																		}}
182
																	>
179
																	>
183
																		<i className="fa fa-external-link" />
180
																		<i className="fa fa-external-link" />
184
																		Evaluacion en conjunto
181
																		Evaluacion en conjunto
185
																	</button>
182
																	</button>
186
															}
183
															}
Línea 187... Línea 184...
187
 
184
 
188
														</td>
185
														</td>
189
														<td className='text-vertical-middle'>
186
														<td className='text-vertical-middle'>
190
															{item.supervisor}
-
 
191
															{
187
															{item.supervisor}
192
																item.actions.link_report_superviser
-
 
193
																	?
188
															{item.actions.link_report_superviser
194
																	<div>
189
																? <div>
195
																		<a
-
 
196
																			className="btn btn-info btn-sm"
-
 
197
																			href={item.actions.link_report_superviser}
-
 
198
																			target="_blank" rel="noreferrer" >
-
 
199
																			<i className="fa fa-file-o" />
-
 
200
																			PDF de evaluacion del supervisor
-
 
201
																		</a>
-
 
202
																	</div>
-
 
203
																	:
-
 
204
																	<button
190
																	<a
-
 
191
																		className="btn btn-info btn-sm"
205
																		className="btn btn-info btn-sm"
192
																		href={item.actions.link_report_superviser}
206
																		onClick={() => {
193
																		target="_blank" rel="noreferrer" >
207
																			setActionLink(item.actions.link_superviser)
194
																		<i className="fa fa-file-o" />
208
																			history.push('evaluations/superviser')
195
																		PDF de evaluacion del supervisor
-
 
196
																	</a>
-
 
197
																</div>
-
 
198
																: <button
-
 
199
																	className="btn btn-info btn-sm"
-
 
200
																	onClick={() => {
-
 
201
																		setActionLink(item.actions.link_superviser)
209
																		}}
202
																		setAction('superviser')
210
																	>
203
																	}}>
211
																		<i className="fa fa-external-link" />
204
																	<i className="fa fa-external-link" />
212
																		Evaluacion del supervisor
205
																	Evaluacion del supervisor
213
																	</button>
206
																</button>
214
															}
207
															}
215
														</td>
208
														</td>
216
														<td className='text-vertical-middle'>
209
														<td className='text-vertical-middle'>
217
															{`${item.first_name} ${item.last_name}`}
210
															{`${item.first_name} ${item.last_name}`}
Línea 230... Línea 223...
230
																	:
223
																	:
231
																	<button
224
																	<button
232
																		className="btn btn-info btn-sm"
225
																		className="btn btn-info btn-sm"
233
																		onClick={() => {
226
																		onClick={() => {
234
																			setActionLink(item.actions.link_self)
227
																			setActionLink(item.actions.link_self)
235
																			history.push('evaluations/self')
228
																			setAction('self')
236
																		}}
229
																		}}
237
																	>
230
																	>
238
																		<i className="fa fa-external-link" />
231
																		<i className="fa fa-external-link" />
239
																		Autoevaluación
232
																		Autoevaluación
240
																	</button>
233
																	</button>