Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 12301 Rev 14843
Línea 43... Línea 43...
43
		submitData.append('comment', watch('comment'))
43
		submitData.append('comment', watch('comment'))
Línea 44... Línea 44...
44
 
44
 
45
		axios.post(actionLink, submitData)
45
		axios.post(actionLink, submitData)
46
			.then(({ data }) => {
46
			.then(({ data }) => {
-
 
47
				if (!data.success) {
-
 
48
					typeof data.data === 'string'
47
				if (!data.success) {
49
						?
48
					return dispatch(addNotification({
50
						dispatch(addNotification({
49
						style: 'danger',
51
							style: 'danger',
-
 
52
							msg: data.data
-
 
53
						}))
50
						msg: typeof data.data === 'string'
54
						: Object.entries(data.data).map(([key, value]) =>
-
 
55
							value.map(err =>
-
 
56
								dispatch(addNotification({
51
							? data.data
57
									style: 'danger',
-
 
58
									msg: `${key}: ${err}`
52
							: 'Ha ocurrido un error'
59
								}))
-
 
60
							)
-
 
61
						)
53
					}))
62
					return
Línea 54... Línea 63...
54
				}
63
				}
55
 
64
 
56
				history.goBack()
65
				history.goBack()
Línea 132... Línea 141...
132
											</div>
141
											</div>
133
										</div>
142
										</div>
134
										<div className="tab-pane fade" id="profile" role="tabpanel" aria-labelledby="profile-tab">
143
										<div className="tab-pane fade" id="profile" role="tabpanel" aria-labelledby="profile-tab">
135
											{
144
											{
136
												jobDescription.competencies?.length > 0
145
												jobDescription.competencies?.length > 0
137
                                                &&
146
												&&
138
                                                jobDescription.competencies.map((competency) => (
147
												jobDescription.competencies.map((competency) => (
139
                                                	<div className="card" key={competency.competency_uuid}>
148
													<div className="card" key={competency.competency_uuid}>
140
                                                		<div className="card-header">
149
														<div className="card-header">
141
                                                			<h5>{competency.competency_name} - {competency.competency_type_name}</h5>
150
															<h5>{competency.competency_name} - {competency.competency_type_name}</h5>
142
                                                		</div>
151
														</div>
143
                                                		<div className="card-body">
152
														<div className="card-body">
144
                                                			<div className="table-responsive">
153
															<div className="table-responsive">
145
                                                				{
154
																{
146
                                                					competency.behaviors
155
																	competency.behaviors
147
                                                                    &&
156
																	&&
148
                                                                    competency.behaviors.map((behavior) => (
157
																	competency.behaviors.map((behavior) => (
149
                                                                    	<table key={behavior.uuid} className="table table-hover">
158
																		<table key={behavior.uuid} className="table table-hover">
150
                                                                    		<thead>
159
																			<thead>
151
                                                                    			<tr>
160
																				<tr>
152
                                                                    				<th style={{ width: '20%' }}>Conducta Observable</th>
161
																					<th style={{ width: '20%' }}>Conducta Observable</th>
153
                                                                    				<th style={{ width: '60%' }}>Comentario</th>
162
																					<th style={{ width: '60%' }}>Comentario</th>
154
                                                                    				<th style={{ width: '20%' }}>Evaluación</th>
163
																					<th style={{ width: '20%' }}>Evaluación</th>
155
                                                                    			</tr>
164
																				</tr>
156
                                                                    		</thead>
165
																			</thead>
157
                                                                    		<tbody>
166
																			<tbody>
158
                                                                    			<tr>
167
																				<tr>
159
                                                                    				<td style={{ width: '20%' }}>{behavior.description}</td>
168
																					<td style={{ width: '20%' }}>{behavior.description}</td>
160
                                                                    				<td style={{ width: '60%' }}>
169
																					<td style={{ width: '60%' }}>
161
                                                                    					<textarea
170
																						<textarea
162
                                                                    						name={`${behavior.competency_uuid}-${behavior.uuid}-comment`}
171
																							name={`${behavior.competency_uuid}-${behavior.uuid}-comment`}
163
                                                                    						cols="30"
172
																							cols="30"
164
                                                                    						rows="3"
173
																							rows="3"
165
                                                                    						ref={register}
174
																							ref={register}
166
                                                                    						className='form-control w100'
175
																							className='form-control w100'
167
                                                                    					/>
176
																						/>
168
                                                                    				</td>
177
																					</td>
169
                                                                    				<td style={{ width: '20%' }}>
178
																					<td style={{ width: '20%' }}>
170
                                                                    					<select className='form-control' name={`select-${behavior.competency_uuid}-${behavior.uuid}`} ref={register}>
179
																						<select className='form-control' name={`select-${behavior.competency_uuid}-${behavior.uuid}`} ref={register}>
171
                                                                    						{
180
																							{
172
                                                                    							pointsOptions.map(({ label, value }) => {
181
																								pointsOptions.map(({ label, value }) => {
173
                                                                    								return <option selected={watch(`select-${behavior.competency_uuid}-${behavior.uuid}`) === value} key={value} value={value}>{label}</option>
182
																									return <option selected={watch(`select-${behavior.competency_uuid}-${behavior.uuid}`) === value} key={value} value={value}>{label}</option>
174
                                                                    							})
183
																								})
175
                                                                    						}
184
																							}
176
                                                                    					</select>
185
																						</select>
177
                                                                    				</td>
186
																					</td>
178
                                                                    			</tr>
187
																				</tr>
179
                                                                    		</tbody>
188
																			</tbody>
180
                                                                    	</table>
189
																		</table>
181
                                                                    ))
190
																	))
182
                                                				}
191
																}
183
                                                			</div>
192
															</div>
184
                                                		</div>
193
														</div>
185
                                                	</div>
194
													</div>
186
                                                ))
195
												))
187
											}
196
											}
188
										</div>
197
										</div>
189
										<div className="tab-pane fade" id="contact" role="tabpanel" aria-labelledby="contact-tab">
198
										<div className="tab-pane fade" id="contact" role="tabpanel" aria-labelledby="contact-tab">
190
											<div className="form-group">
199
											<div className="form-group">
191
												<label>Comentario</label>
200
												<label>Comentario</label>
Línea 203... Línea 212...
203
											</div>
212
											</div>
204
										</div>
213
										</div>
205
									</div>
214
									</div>
206
									<div className="form-group">
215
									<div className="form-group">
207
										<button type="submit" className="btn btn-primary btn-form-save-close mr-2">
216
										<button type="submit" className="btn btn-primary btn-form-save-close mr-2">
208
                                            Guardar & Cerrar
217
											Guardar & Cerrar
209
										</button>
218
										</button>
210
										<button
219
										<button
211
											type="button"
220
											type="button"
212
											className="btn btn-secondary btn-edit-cancel"
221
											className="btn btn-secondary btn-edit-cancel"
213
											onClick={() => history.goBack()}
222
											onClick={() => history.goBack()}
214
										>
223
										>
215
                                            Cancelar
224
											Cancelar
216
										</button>
225
										</button>
217
									</div>
226
									</div>
218
								</div>
227
								</div>
219
							</div>
228
							</div>
220
						</form>
229
						</form>