Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 1461 Rev 1897
Línea 84... Línea 84...
84
  }
84
  }
Línea 85... Línea 85...
85
 
85
 
86
  useEffect(() => {
86
  useEffect(() => {
Línea 87... Línea 87...
87
    getCategories()
87
    getCategories()
88
 
88
 
-
 
89
    register('description', { required: 'Este campo es requerido.' })
-
 
90
    register('category_id', {
-
 
91
      required: 'Este campo es requerido.',
-
 
92
      validate: (val) =>
89
    register('description', { required: true })
93
        val.length > 0 || 'Por favor, seleccione una categoria.'
Línea 90... Línea 94...
90
    register('category_id', { required: true })
94
    })
91
  }, [])
95
  }, [])
Línea 136... Línea 140...
136
      title={`${isEdit ? labels.edit : labels.add} ${labels.question}`}
140
      title={`${isEdit ? labels.edit : labels.add} ${labels.question}`}
137
      show={show}
141
      show={show}
138
      onClose={onClose}
142
      onClose={onClose}
139
      onAccept={onSubmit}
143
      onAccept={onSubmit}
140
    >
144
    >
-
 
145
      <Box mt={2}>
-
 
146
        <TagsInput
-
 
147
          suggestions={questionsCategories}
-
 
148
          settedTags={currentCategories}
-
 
149
          onChange={onTagsChange}
-
 
150
        />
-
 
151
        {errors.category_id && (
-
 
152
          <FormErrorFeedback>{errors.category_id?.message}</FormErrorFeedback>
-
 
153
        )}
-
 
154
      </Box>
-
 
155
 
141
      <Form.Group>
156
      <Form.Group>
142
        <Form.Label>{labels.title}</Form.Label>
157
        <Form.Label>{labels.title}</Form.Label>
143
        <Form.Control
158
        <Form.Control
144
          type='text'
159
          type='text'
145
          name='title'
160
          name='title'
Línea 158... Línea 173...
158
      />
173
      />
159
      {errors.description && (
174
      {errors.description && (
160
        <FormErrorFeedback>{labels.error_field_empty}</FormErrorFeedback>
175
        <FormErrorFeedback>{labels.error_field_empty}</FormErrorFeedback>
161
      )}
176
      )}
Línea 162... Línea 177...
162
 
177
 
-
 
178
      {loading && (
163
      <Box mt={2}>
179
        <Box
164
        <TagsInput
180
          sx={{
-
 
181
            position: 'absolute',
-
 
182
            width: '100%',
-
 
183
            height: '100%',
-
 
184
            top: 0,
165
          suggestions={questionsCategories}
185
            left: 0,
166
          settedTags={currentCategories}
186
            display: 'grid',
167
          onChange={onTagsChange}
187
            placeItems: 'center'
168
        />
188
          }}
169
      </Box>
-
 
170
 
189
        >
-
 
190
          <Spinner />
-
 
191
        </Box>
171
      {loading && <Spinner />}
192
      )}
172
    </Modal>
193
    </Modal>
173
  )
194
  )
Línea 174... Línea 195...
174
}
195
}