Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 7037 Rev 7038
Línea 56... Línea 56...
56
  useEffect(() => {
56
  useEffect(() => {
57
    register('description', { required: true })
57
    register('description', { required: true })
58
  }, [])
58
  }, [])
Línea 59... Línea 59...
59
 
59
 
-
 
60
  useEffect(() => {
-
 
61
    if (!url) return
60
  useEffect(() => {
62
 
61
    axios.get(url).then((response) => {
63
    axios.get(url).then((response) => {
Línea 62... Línea 64...
62
      const { data, success } = response
64
      const { data, success } = response.data
63
 
65
 
64
      if (!success) {
66
      if (!success) {
Línea 87... Línea 89...
87
      </Modal.Header>
89
      </Modal.Header>
88
      <Modal.Body>
90
      <Modal.Body>
89
        <Form onSubmit={onSubmit}>
91
        <Form onSubmit={onSubmit}>
90
          <Form.Group>
92
          <Form.Group>
91
            <Form.Label>{labels.category}</Form.Label>
93
            <Form.Label>{labels.category}</Form.Label>
-
 
94
            <Form.Control
-
 
95
              as="select"
92
            <Form.Control as="select" ref={register} name="category_id">
96
              ref={register({ required: true })}
-
 
97
              name="category_id"
-
 
98
            >
93
              {categories.map(({ name, uuid }) => (
99
              {categories.map(({ name, uuid }) => (
94
                <option key={uuid}>{name}</option>
100
                <option key={uuid}>{name}</option>
95
              ))}
101
              ))}
96
            </Form.Control>
102
            </Form.Control>
97
            {errors.category_id && (
103
            {errors.category_id && (
Línea 99... Línea 105...
99
            )}
105
            )}
100
          </Form.Group>
106
          </Form.Group>
Línea 101... Línea 107...
101
 
107
 
102
          <Form.Group>
108
          <Form.Group>
-
 
109
            <Form.Label>{labels.title}</Form.Label>
-
 
110
            <Form.Control
-
 
111
              type="text"
103
            <Form.Label>{labels.title}</Form.Label>
112
              name="title"
-
 
113
              ref={register({ required: true })}
104
            <Form.Control type="text" name="title" ref={register} />
114
            />
105
            {errors.title && (
115
            {errors.title && (
106
              <FormErrorFeedback>{labels.error_field_empty}</FormErrorFeedback>
116
              <FormErrorFeedback>{labels.error_field_empty}</FormErrorFeedback>
107
            )}
117
            )}
Línea 114... Línea 124...
114
          />
124
          />
115
          {errors.description && (
125
          {errors.description && (
116
            <FormErrorFeedback>{labels.error_field_empty}</FormErrorFeedback>
126
            <FormErrorFeedback>{labels.error_field_empty}</FormErrorFeedback>
117
          )}
127
          )}
Línea 118... Línea 128...
118
 
128
 
119
          <Button className="mt-3 mr-3" variant="primary" type="submit">
129
          <Button className="mt-3 mr-2" variant="primary" type="submit">
120
            {labels.accept}
130
            {labels.accept}
121
          </Button>
131
          </Button>
122
          <Button className="btn-secondary mt-3" onClick={onClose}>
132
          <Button className="btn-secondary mt-3" onClick={onClose}>
123
            {labels.cancel}
133
            {labels.cancel}