Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 1979 Rev 2521
Línea 1... Línea 1...
1
import React, { useEffect} from 'react'
1
import React, { useEffect } from 'react'
2
import { useLocation } from 'react-router-dom'
2
import { useLocation } from 'react-router-dom'
3
import { useDispatch } from 'react-redux'
3
import { useDispatch } from 'react-redux'
4
import { useForm } from 'react-hook-form'
4
import { useForm } from 'react-hook-form'
5
import { CKEditor } from 'ckeditor4-react'
-
 
Línea 6... Línea 5...
6
 
5
 
7
import { axios, CKEDITOR_OPTIONS } from '../../utils'
6
import { axios } from '../../utils'
Línea -... Línea 7...
-
 
7
import { addNotification } from '../../redux/notification/notification.actions'
8
import { addNotification } from '../../redux/notification/notification.actions'
8
 
9
 
9
import CKEditor from '@app/components/UI/Ckeditor'
Línea 10... Línea 10...
10
import FormErrorFeedback from 'components/UI/form/FormErrorFeedback'
10
import FormErrorFeedback from 'components/UI/form/FormErrorFeedback'
11
import Modal from 'components/UI/modal/Modal'
11
import Modal from 'components/UI/modal/Modal'
Línea 52... Línea 52...
52
      .catch((err) => {
52
      .catch((err) => {
53
        dispatch(addNotification({ style: 'danger', msg: err.message }))
53
        dispatch(addNotification({ style: 'danger', msg: err.message }))
54
      })
54
      })
55
  })
55
  })
Línea 56... Línea -...
56
 
-
 
57
  const removeModalTabIndex = () => {
-
 
58
    const modal = document.querySelector('.fade.modal.show')
-
 
59
    modal.removeAttribute('tabindex')
-
 
60
  }
-
 
61
 
56
 
62
  useEffect(() => {
57
  useEffect(() => {
63
    register('description', { required: 'Este campo es requerido' })
58
    register('description', { required: 'Este campo es requerido' })
Línea 64... Línea 59...
64
  }, [])
59
  }, [])
Línea 69... Línea 64...
69
      show={isOpen}
64
      show={isOpen}
70
      onClose={closeModal}
65
      onClose={closeModal}
71
      onAccept={onSubmit}
66
      onAccept={onSubmit}
72
    >
67
    >
73
      <CKEditor
68
      <CKEditor
74
        onChange={(e) => setValue('description', e.editor.getData())}
69
        onChange={(value) => setValue('description', value)}
75
        onInstanceReady={(e) => e.editor.setData(overview)}
-
 
76
        config={CKEDITOR_OPTIONS}
-
 
77
        onDialogShow={removeModalTabIndex}
70
        defaultValue={overview}
78
      />
71
      />
79
      {errors.description && (
72
      {errors.description && (
80
        <FormErrorFeedback>{errors.description.message}</FormErrorFeedback>
73
        <FormErrorFeedback>{errors.description.message}</FormErrorFeedback>
81
      )}
74
      )}
82
    </Modal>
75
    </Modal>