Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 7054 Rev 7055
Línea 17... Línea 17...
17
  onClose,
17
  onClose,
18
  isEdit,
18
  isEdit,
19
}) => {
19
}) => {
20
  const [loading, setLoading] = useState(false)
20
  const [loading, setLoading] = useState(false)
21
  const labels = useSelector(({ intl }) => intl.labels)
21
  const labels = useSelector(({ intl }) => intl.labels)
-
 
22
  const [initialData, setInitialData] = useState('')
22
  const dispatch = useDispatch()
23
  const dispatch = useDispatch()
Línea 23... Línea 24...
23
 
24
 
24
  const { handleSubmit, register, setValue, errors, getValues, watch } =
-
 
25
    useForm()
-
 
26
 
-
 
Línea 27... Línea 25...
27
  const watchDescription = watch('description', '<p></p>')
25
  const { handleSubmit, register, setValue, errors, getValues } = useForm()
28
 
26
 
29
  const onSubmit = handleSubmit((data) => {
27
  const onSubmit = handleSubmit((data) => {
30
    setLoading(true)
28
    setLoading(true)
Línea 86... Línea 84...
86
          })
84
          })
87
        )
85
        )
88
        return
86
        return
89
      }
87
      }
Línea -... Línea 88...
-
 
88
 
90
 
89
      setValue('title', data.title)
91
      setValue('category_id', data.category_id)
90
      setValue('category_id', data.category_id)
92
      setValue('description', data.description)
91
      setValue('description', data.description)
93
      setValue('title', data.title)
92
      setInitialData(data.description)
94
    })
93
    })
Línea 95... Línea 94...
95
  }, [url, show])
94
  }, [url, show])
96
 
95
 
Línea 140... Línea 139...
140
            {errors.title && (
139
            {errors.title && (
141
              <FormErrorFeedback>{labels.error_field_empty}</FormErrorFeedback>
140
              <FormErrorFeedback>{labels.error_field_empty}</FormErrorFeedback>
142
            )}
141
            )}
143
          </Form.Group>
142
          </Form.Group>
Línea 144... Línea -...
144
 
-
 
145
          {show && (
143
 
146
            <CKEditor
144
          <CKEditor
147
              onChange={(e) => setValue('description', e.editor.getData())}
145
            onChange={(e) => setValue('description', e.editor.getData())}
148
              onInstanceReady={(e) => e.editor.setData(watchDescription)}
146
            initData={initialData}
149
              config={CKEDITOR_OPTIONS}
147
            config={CKEDITOR_OPTIONS}
150
            />
148
          />
151
          )}
149
 
152
          {errors.description && (
150
          {errors.description && (
153
            <FormErrorFeedback>{labels.error_field_empty}</FormErrorFeedback>
151
            <FormErrorFeedback>{labels.error_field_empty}</FormErrorFeedback>
Línea 154... Línea 152...
154
          )}
152
          )}