|
@@ -1,4 +1,4 @@
|
1
|
|
-import React, { useEffect, useState } from 'react'
|
|
1
|
+import React, { useEffect, useState, useRef } from 'react'
|
2
|
2
|
import $ from 'jquery'
|
3
|
3
|
import { Row, Col } from 'react-bootstrap'
|
4
|
4
|
|
|
@@ -54,50 +54,26 @@ export function Pruebas() {
|
54
|
54
|
|
55
|
55
|
let navigate = useNavigate()
|
56
|
56
|
|
57
|
|
- var inteligencia = [
|
58
|
|
- 'TERMAN',
|
59
|
|
- 'BETAIIR',
|
60
|
|
- 'BETAIII',
|
61
|
|
- 'IE',
|
62
|
|
- 'RAVEN',
|
63
|
|
- 'DOMINOS',
|
64
|
|
- 'WONDERLIC',
|
65
|
|
- 'COIR',
|
66
|
|
- ]
|
|
57
|
+ var inteligencia = [ 'TERMAN', 'BETAIIR', 'BETAIII', 'IE', 'RAVEN', 'DOMINOS', 'WONDERLIC', 'COIR', ]
|
67
|
58
|
|
68
|
|
- var comportamiento = [
|
69
|
|
- 'CLEAVER',
|
70
|
|
- 'ESTILO',
|
71
|
|
- 'VALORES',
|
72
|
|
- 'VALORES COMP',
|
73
|
|
- 'MOSS',
|
74
|
|
- 'KOSTICK',
|
75
|
|
- 'ZAVIC',
|
76
|
|
- 'VALPER',
|
77
|
|
- 'LIFO',
|
78
|
|
- ]
|
|
59
|
+ var comportamiento = [ 'CLEAVER', 'ESTILO', 'VALORES', 'VALORES COMP', 'MOSS', 'KOSTICK', 'ZAVIC', 'VALPER', 'LIFO', ]
|
79
|
60
|
|
80
|
|
- var personalidad = [
|
81
|
|
- 'LUSCHER',
|
82
|
|
- 'CPI',
|
83
|
|
- 'PGV',
|
84
|
|
- 'BFQ',
|
85
|
|
- '16FP',
|
86
|
|
- 'PIP',
|
87
|
|
- 'IMP',
|
88
|
|
- 'PVC',
|
89
|
|
- 'NIC',
|
90
|
|
- ]
|
|
61
|
+ var personalidad = [ 'LUSCHER', 'CPI', 'PGV', 'BFQ', '16FP', 'PIP', 'IMP', 'PVC', 'NIC', ]
|
91
|
62
|
|
92
|
63
|
const all = [...inteligencia, ...comportamiento, ...personalidad]
|
93
|
64
|
|
94
|
|
- useEffect(() => {
|
95
|
|
- setPruebas(all)
|
96
|
|
- console.log('Pruebas >> ',pruebas)
|
97
|
|
- },[])
|
98
|
65
|
|
99
|
66
|
let [nombre, setNombre] = useState(null)
|
100
|
67
|
let [pruebas, setPruebas] = useState([])
|
|
68
|
+
|
|
69
|
+ let main = useRef(null);
|
|
70
|
+
|
|
71
|
+ useEffect(() => {
|
|
72
|
+ if(pruebas.lenght !== all.lenght ){
|
|
73
|
+ console.log(main.current)
|
|
74
|
+ }
|
|
75
|
+ setPruebas(all)
|
|
76
|
+ },[])
|
101
|
77
|
|
102
|
78
|
return (
|
103
|
79
|
<section>
|
|
@@ -105,22 +81,18 @@ export function Pruebas() {
|
105
|
81
|
<div className="main main_pruebas_list">
|
106
|
82
|
<h1>Listado de pruebas psicométricas</h1>
|
107
|
83
|
|
108
|
|
- <div className="row">
|
109
|
|
- <Col md='6' className="busqueda_prueba">
|
|
84
|
+ <Row>
|
|
85
|
+ <Col md='9' className="busqueda_prueba">
|
110
|
86
|
<Row>
|
111
|
|
- <Col md="6">
|
|
87
|
+ <Col md="8">
|
112
|
88
|
<input
|
113
|
89
|
onChange={(event) => {
|
114
|
90
|
let nombre = event.target.value
|
115
|
|
- console.log('NOMBRE >>',nombre)
|
116
|
91
|
if(nombre){
|
117
|
|
- // let temp = pruebas.filter( prueba => prueba.search(nombre) )
|
118
|
92
|
let temp = pruebas.filter( prueba => {
|
119
|
93
|
let isset = prueba.toUpperCase().includes( nombre.toUpperCase())
|
120
|
|
- console.log('ISET >>',prueba,isset )
|
121
|
94
|
return isset
|
122
|
95
|
})
|
123
|
|
- console.log('TEMP >>', temp)
|
124
|
96
|
setPruebas(temp)
|
125
|
97
|
setNombre(nombre)
|
126
|
98
|
}else{
|
|
@@ -132,24 +104,28 @@ export function Pruebas() {
|
132
|
104
|
name="nombreprueba"
|
133
|
105
|
placeholder="Escribe el nombre de la prueba que deseas consultar"/>
|
134
|
106
|
</Col>
|
135
|
|
- <Col md="6">
|
|
107
|
+ <Col md="4">
|
136
|
108
|
<div className="buscar_prueba">
|
137
|
109
|
<button className="btn_buscar_prueba">BUSCAR</button>
|
138
|
110
|
</div>
|
139
|
111
|
</Col>
|
140
|
112
|
</Row>
|
141
|
113
|
</Col>
|
142
|
|
- <Col md="6">
|
|
114
|
+ <Col md="3">
|
143
|
115
|
<div className="crear_nueva_prueba">
|
144
|
|
- <span onClick={ () => navigate('/dashboard/pruebas/crear') } className="btn_crear_prueba">CREAR PRUEBA</span>
|
|
116
|
+ <span
|
|
117
|
+ onClick={ () => navigate('/dashboard/pruebas/crear') }
|
|
118
|
+ className="btn_crear_prueba">CREAR PRUEBA
|
|
119
|
+ </span>
|
145
|
120
|
</div>
|
146
|
121
|
</Col>
|
147
|
|
- </div>
|
|
122
|
+ </Row>
|
148
|
123
|
|
149
|
124
|
<div className="tabs_pruebas">
|
150
|
125
|
<Row >
|
151
|
126
|
<Col md="3">
|
152
|
127
|
<div
|
|
128
|
+ ref={main}
|
153
|
129
|
className="test_tab active"
|
154
|
130
|
id="todaspruebas"
|
155
|
131
|
onClick={() => setPruebas(all)}
|