Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 14230 Rev 14231
Línea 1... Línea 1...
1
/* eslint-disable no-mixed-spaces-and-tabs */
1
/* eslint-disable no-mixed-spaces-and-tabs */
2
import axios from 'axios'
2
import axios from 'axios'
-
 
3
import { CKEditor } from 'ckeditor4-react'
3
import React, { useEffect, useState } from 'react'
4
import React, { useEffect, useState } from 'react'
4
import { useForm } from 'react-hook-form'
5
import { useForm } from 'react-hook-form'
5
import { useDispatch } from 'react-redux'
6
import { useDispatch } from 'react-redux'
6
import { useHistory, useParams } from 'react-router-dom'
7
import { useHistory, useParams } from 'react-router-dom'
7
import { addNotification } from '../../redux/notification/notification.actions'
8
import { addNotification } from '../../redux/notification/notification.actions'
-
 
9
import { config } from '../../shared/helpers/ckeditor_config'
8
import ToggleComponent from '../../shared/ToggleComponent'
10
import ToggleComponent from '../../shared/ToggleComponent'
Línea 9... Línea 11...
9
 
11
 
10
const FormView = ({
12
const FormView = ({
11
	actionLink = '',
13
	actionLink = '',
Línea 58... Línea 60...
58
			})
60
			})
59
	}
61
	}
Línea 60... Línea 62...
60
 
62
 
61
	useEffect(() => {
63
	useEffect(() => {
-
 
64
		register('status')
-
 
65
		register('objectives')
62
		register('status')
66
		register('functions')
Línea 63... Línea 67...
63
	}, [])
67
	}, [])
64
 
68
 
65
	useEffect(() => {
69
	useEffect(() => {
Línea 77... Línea 81...
77
						key: option.name,
81
						key: option.name,
78
						value: option.uuid
82
						value: option.uuid
79
					}
83
					}
80
				}))
84
				}))
81
				setValue('name', data.data['name'])
85
				setValue('name', data.data['name'])
-
 
86
				setValue('status', data.data['status'])
82
				setValue('job_description_id_boss', data.data['job_description_id_boss'])
87
				setValue('job_description_id_boss', data.data['job_description_id_boss'])
Línea 83... Línea 88...
83
 
88
 
84
			})
89
			})
Línea 88... Línea 93...
88
		<section className="content">
93
		<section className="content">
89
			<div className="container-fluid">
94
			<div className="container-fluid">
90
				<div className="row">
95
				<div className="row">
91
					<div className="col-12">
96
					<div className="col-12">
92
						<form onSubmit={handleSubmit(onSubmit)}>
97
						<form onSubmit={handleSubmit(onSubmit)}>
93
							<div className='card'>
98
							<div className='card px-2'>
94
								<div className="card-header">
99
								<div className="card-header">
95
									<ul className="nav nav-tabs" id="myTab" role="tablist">
100
									<ul className="nav nav-tabs" id="myTab" role="tablist">
96
										<li className="nav-item" role="presentation">
101
										<li className="nav-item" role="presentation">
97
											<button className="nav-link active" id="home-tab" data-toggle="tab" data-target="#home" type="button" role="tab" aria-controls="home" aria-selected="true">General</button>
102
											<button className="nav-link active" id="home-tab" data-toggle="tab" data-target="#home" type="button" role="tab" aria-controls="home" aria-selected="true">General</button>
98
										</li>
103
										</li>
Línea 128... Línea 133...
128
															</select>
133
															</select>
129
														</div>
134
														</div>
130
													</div>
135
													</div>
131
													<div className="col-4">
136
													<div className="col-4">
132
														<div className="form-group">
137
														<div className="form-group">
133
															<label>Nombre</label>
138
															<label>Estatus</label>
134
															<ToggleComponent
139
															<ToggleComponent
135
																setValue={(e) => setValue('status', e)}
140
																setValue={(e) => setValue('status', e)}
136
															/>
141
															/>
137
														</div>
142
														</div>
138
													</div>
143
													</div>
139
												</div>
144
												</div>
-
 
145
												<div className="row">
-
 
146
													<div className="form-group">
-
 
147
														<label>Objetivo</label>
-
 
148
														<CKEditor
-
 
149
															onChange={(e) => setValue('objectives', e.editor.getData())}
-
 
150
															initData={watch('objectives')}
-
 
151
															config={config}
-
 
152
															name="objectives"
-
 
153
														/>
-
 
154
													</div>
-
 
155
												</div>
-
 
156
												<div className="row">
-
 
157
													<div className="form-group">
-
 
158
														<label>Funciones</label>
-
 
159
														<CKEditor
-
 
160
															onChange={(e) => setValue('functions', e.editor.getData())}
-
 
161
															initData={watch('functions')}
-
 
162
															config={config}
-
 
163
															name="functions"
-
 
164
														/>
-
 
165
													</div>
-
 
166
												</div>
140
											</div>
167
											</div>
141
										</div>
168
										</div>
142
										<div className="tab-pane fade" id="profile" role="tabpanel" aria-labelledby="profile-tab">
169
										<div className="tab-pane fade" id="profile" role="tabpanel" aria-labelledby="profile-tab">
Línea 143... Línea 170...
143
 
170