Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 3278 Rev 3279
Línea 13... Línea 13...
13
import Select from '@components/UI/inputs/Select'
13
import Select from '@components/UI/inputs/Select'
14
import Ckeditor from '@components/common/ckeditor/Ckeditor'
14
import Ckeditor from '@components/common/ckeditor/Ckeditor'
15
import DropzoneComponent from '@components/dropzone/DropzoneComponent'
15
import DropzoneComponent from '@components/dropzone/DropzoneComponent'
16
import FormErrorFeedback from '@components/UI/form/FormErrorFeedback'
16
import FormErrorFeedback from '@components/UI/form/FormErrorFeedback'
17
import ConfirmModal from './ConfirmModal'
17
import ConfirmModal from './ConfirmModal'
-
 
18
import Form from '@components/common/form'
Línea 18... Línea 19...
18
 
19
 
19
const recomendationText = {
20
const recomendationText = {
20
  [shareModalTypes.IMAGE]: 'Tamaño recomendado: 720x720',
21
  [shareModalTypes.IMAGE]: 'Tamaño recomendado: 720x720',
21
  [shareModalTypes.FILE]: 'solo documentos PDF',
22
  [shareModalTypes.FILE]: 'solo documentos PDF',
Línea 110... Línea 111...
110
        show={show}
111
        show={show}
111
        title={labels.share_a_post}
112
        title={labels.share_a_post}
112
        labelAccept={labels.send}
113
        labelAccept={labels.send}
113
        labelReject={labels.cancel}
114
        labelReject={labels.cancel}
114
        loading={isSubmitting}
115
        loading={isSubmitting}
115
        onAccept={onSubmit}
-
 
116
        onClose={handleClose}
116
        onClose={handleClose}
-
 
117
        formId='share_modal-form'
117
      >
118
      >
-
 
119
        <Form onSubmit={onSubmit} id='share_modal-form'>
118
        {feedType === feedTypes.DASHBOARD && (
120
          {feedType === feedTypes.DASHBOARD && (
119
          <Select
121
            <Select
120
            name='shared_with'
122
              name='shared_with'
121
            defaultValue='p'
123
              defaultValue='p'
122
            control={control}
124
              control={control}
123
            options={[
125
              options={[
124
              { name: labels.public, value: 'p' },
126
                { name: labels.public, value: 'p' },
125
              { name: labels.connections, value: 'c' }
127
                { name: labels.connections, value: 'c' }
126
            ]}
128
              ]}
127
          />
129
            />
128
        )}
130
          )}
Línea 129... Línea 131...
129
 
131
 
130
        <Ckeditor
132
          <Ckeditor
131
          name='description'
-
 
132
          control={control}
-
 
133
          rules={{ required: 'La descripción es requerida' }}
-
 
134
          error={errors.description?.message}
-
 
135
        />
-
 
136
 
-
 
137
        {![shareModalTypes.POST, shareModalTypes.SHARE].includes(modalType) && (
-
 
138
          <Controller
-
 
139
            name='file'
133
            name='description'
140
            control={control}
134
            control={control}
141
            rules={{ required: 'El archivo es requerido' }}
-
 
142
            render={({ field: { value, onChange } }) => (
-
 
143
              <DropzoneComponent
-
 
144
                type={modalType}
135
            rules={{ required: 'La descripción es requerida' }}
145
                onUploaded={(file) => onChange(file)}
-
 
146
                settedFile={value}
-
 
147
                recomendationText={recomendationText[modalType] ?? ''}
-
 
148
              />
-
 
149
            )}
136
            error={errors.description?.message}
150
          />
-
 
Línea -... Línea 137...
-
 
137
          />
-
 
138
 
-
 
139
          {![shareModalTypes.POST, shareModalTypes.SHARE].includes(
-
 
140
            modalType
-
 
141
          ) && (
-
 
142
            <Controller
-
 
143
              name='file'
-
 
144
              control={control}
-
 
145
              rules={{ required: 'El archivo es requerido' }}
-
 
146
              render={({
-
 
147
                field: { value, onChange },
-
 
148
                fieldState: { error }
-
 
149
              }) => (
-
 
150
                <>
-
 
151
                  <DropzoneComponent
-
 
152
                    type={modalType}
-
 
153
                    onUploaded={onChange}
-
 
154
                    settedFile={value}
151
        )}
155
                    recomendationText={recomendationText[modalType] ?? ''}
152
 
156
                  />
-
 
157
                  {error && (
-
 
158
                    <FormErrorFeedback>{error.message}</FormErrorFeedback>
-
 
159
                  )}
-
 
160
                </>
153
        {errors.file && (
161
              )}
-
 
162
            />
154
          <FormErrorFeedback>{errors.file.message}</FormErrorFeedback>
163
          )}
155
        )}
164
        </Form>
156
      </Modal>
165
      </Modal>
157
      <ConfirmModal
166
      <ConfirmModal
158
        show={showConfirm}
167
        show={showConfirm}