Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 1898 Rev 1929
Línea 7... Línea 7...
7
 
7
 
8
import { CKEDITOR_OPTIONS, axios } from 'utils/index'
8
import { CKEDITOR_OPTIONS, axios } from 'utils/index'
Línea 9... Línea 9...
9
import { addNotification } from '../../redux/notification/notification.actions'
9
import { addNotification } from '../../redux/notification/notification.actions'
10
 
-
 
11
import Modal from 'components/UI/modal/Modal'
10
 
12
import Spinner from 'components/UI/Spinner'
11
import Modal from 'components/UI/modal/Modal'
Línea 13... Línea 12...
13
import TagsInput from 'components/UI/TagsInput'
12
import TagsInput from 'components/UI/TagsInput'
14
import FormErrorFeedback from 'components/UI/form/FormErrorFeedback'
-
 
15
 
13
import FormErrorFeedback from 'components/UI/form/FormErrorFeedback'
16
const QuestionModal = ({ show, url, isEdit, onClose, onComplete }) => {
14
 
17
  const [loading, setLoading] = useState(false)
15
const QuestionModal = ({ show, url, isEdit, onClose, onComplete }) => {
18
  const [questionsCategories, setQuestionsCategories] = useState([])
16
  const [questionsCategories, setQuestionsCategories] = useState([])
Línea 19... Línea 17...
19
  const [currentCategories, setCurrentCategories] = useState([])
17
  const [currentCategories, setCurrentCategories] = useState([])
Línea 20... Línea 18...
20
  const labels = useSelector(({ intl }) => intl.labels)
18
  const labels = useSelector(({ intl }) => intl.labels)
21
  const dispatch = useDispatch()
-
 
22
 
19
  const dispatch = useDispatch()
Línea 23... Línea 20...
23
  const { register, handleSubmit, getValues, setValue, errors } = useForm()
20
 
24
 
21
  const { register, handleSubmit, getValues, setValue, errors } = useForm()
Línea 45... Línea 42...
45
        }
42
        }
Línea 46... Línea 43...
46
 
43
 
47
        onComplete()
44
        onComplete()
48
        onClose()
45
        onClose()
49
      })
-
 
50
      .finally(() => setLoading(false))
46
      })
Línea 51... Línea 47...
51
  })
47
  })
52
 
48
 
53
  const getCategories = () => {
49
  const getCategories = () => {
Línea 173... Línea 169...
173
        config={CKEDITOR_OPTIONS}
169
        config={CKEDITOR_OPTIONS}
174
      />
170
      />
175
      {errors.description && (
171
      {errors.description && (
176
        <FormErrorFeedback>{labels.error_field_empty}</FormErrorFeedback>
172
        <FormErrorFeedback>{labels.error_field_empty}</FormErrorFeedback>
177
      )}
173
      )}
178
 
-
 
179
      {loading && (
-
 
180
        <Box
-
 
181
          sx={{
-
 
182
            position: 'absolute',
-
 
183
            width: '100%',
-
 
184
            height: '100%',
-
 
185
            top: 0,
-
 
186
            left: 0,
-
 
187
            display: 'grid',
-
 
188
            placeItems: 'center'
-
 
189
          }}
-
 
190
        >
-
 
191
          <Spinner />
-
 
192
        </Box>
-
 
193
      )}
-
 
194
    </Modal>
174
    </Modal>
195
  )
175
  )
196
}
176
}
Línea 197... Línea 177...
197
 
177