Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 7059 Rev 7060
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('<p></p>')
-
 
23
  const dispatch = useDispatch()
22
  const dispatch = useDispatch()
Línea 24... Línea 23...
24
 
23
 
Línea 25... Línea 24...
25
  const { handleSubmit, register, setValue, errors, getValues } = useForm()
24
  const { handleSubmit, register, setValue, errors, getValues } = useForm()
Línea 87... Línea 86...
87
      }
86
      }
Línea 88... Línea 87...
88
 
87
 
89
      setValue('title', data.title)
88
      setValue('title', data.title)
90
      setValue('category_id', data.category_id)
89
      setValue('category_id', data.category_id)
91
      setValue('description', data.description)
-
 
92
      setInitialData(data.description)
90
      setValue('description', data.description)
93
    })
91
    })
Línea 94... Línea 92...
94
  }, [url, show, isEdit])
92
  }, [url, show, isEdit])
95
 
93
 
96
  useEffect(() => {
94
  useEffect(() => {
97
    if (!show) {
95
    if (!show) {
98
      setValue('category_id', '')
96
      setValue('category_id', '')
99
      setValue('description', '')
97
      setValue('description', '')
100
      setValue('title', '')
-
 
101
      setValue('image', '')
98
      setValue('title', '')
102
      setInitialData('<p></p>')
99
      setValue('image', '')
Línea 103... Línea 100...
103
    }
100
    }
104
  }, [show])
101
  }, [show])
Línea 149... Línea 146...
149
              )}
146
              )}
150
            </Form.Group>
147
            </Form.Group>
Línea 151... Línea 148...
151
 
148
 
152
            <CKEditor
149
            <CKEditor
153
              onChange={(e) => setValue('description', e.editor.getData())}
150
              onChange={(e) => setValue('description', e.editor.getData())}
154
              onInstanceReady={(e) => e.editor.setData(initialData)}
151
              initData={getValues('description')}
155
              config={CKEDITOR_OPTIONS}
152
              config={CKEDITOR_OPTIONS}
Línea 156... Línea 153...
156
            />
153
            />
157
 
154