Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 16259 Rev 16261
Línea 12... Línea 12...
12
  timezones = {},
12
  timezones = {},
13
  zoomUrl = "",
13
  zoomUrl = "",
14
  onCreate = () => null,
14
  onCreate = () => null,
15
}) => {
15
}) => {
16
  const dt = new Date();
16
  const dt = new Date();
-
 
17
 
17
  const { handleSubmit, register, errors, reset } = useForm({ mode: "all" });
18
  const { handleSubmit, register, errors, reset } = useForm({ mode: "all" });
18
  const [date, setDate] = useState({
19
  const [date, setDate] = useState({
19
    year: dt.toLocaleString("default", { year: "numeric" }),
20
    year: dt.toLocaleString("default", { year: "numeric" }),
20
    month: dt.toLocaleString("default", { month: "2-digit" }),
21
    month: dt.toLocaleString("default", { month: "2-digit" }),
21
    day: dt.toLocaleString("default", { day: "2-digit" }),
22
    day: dt.toLocaleString("default", { day: "2-digit" }),
Línea 29... Línea 30...
29
  );
30
  );
30
  const [coferenceType, setConferenceType] = useState(1);
31
  const [coferenceType, setConferenceType] = useState(1);
31
  const [isShow, setIsShow] = useState(show);
32
  const [isShow, setIsShow] = useState(show);
32
  const dispatch = useDispatch();
33
  const dispatch = useDispatch();
Línea 33... Línea 34...
33
 
34
 
34
  useEffect(() => {
35
  const closeModal = () => {
35
    setIsShow(show);
36
    setIsShow(false);
36
  }, [show]);
-
 
37
 
-
 
Línea 38... Línea 37...
38
  const closeModal = () => setIsShow(false);
37
  };
-
 
38
 
-
 
39
  const handleChange = (value) => {
Línea 39... Línea 40...
39
 
40
    setConferenceType(value);
40
  const handleChange = (value) => setConferenceType(value);
41
  };
41
 
42
 
42
  const handleDateTime = (value) => {
43
  const handleDateTime = (value) => {
Línea 90... Línea 91...
90
        addNotification({ msg: "Ha ocurrido un error", style: "danger" })
91
        addNotification({ msg: "Ha ocurrido un error", style: "danger" })
91
      );
92
      );
92
    }
93
    }
93
  };
94
  };
Línea -... Línea 95...
-
 
95
 
-
 
96
  useEffect(() => {
-
 
97
    setIsShow(show);
-
 
98
  }, [show]);
94
 
99
 
95
  return (
100
  return (
96
    <Modal show={isShow} onHide={closeModal}>
101
    <Modal show={isShow} onHide={closeModal}>
97
      <Modal.Header closeButton>
102
      <Modal.Header closeButton>
98
        <Modal.Title>Crear Conferencia</Modal.Title>
103
        <Modal.Title>Crear Conferencia</Modal.Title>
99
      </Modal.Header>
-
 
100
      <Modal.Body>
-
 
101
        <form onSubmit={handleSubmit(onSubmit)} autoComplete="new-password">
-
 
102
          <div className="form-group">
-
 
103
            <label htmlFor="first_name">Título</label>
-
 
104
            <input
-
 
105
              type="text"
-
 
106
              name="title"
-
 
107
              className="form-control"
-
 
108
              maxLength={128}
-
 
109
              ref={register({ required: "Por favor ingrese un título" })}
-
 
110
            />
-
 
111
            {errors.title && (
-
 
112
              <FormErrorFeedback>{errors.title.message}</FormErrorFeedback>
-
 
113
            )}
-
 
114
          </div>
-
 
115
          <div className="form-group">
-
 
116
            <label htmlFor="first_name">Descripción</label>
-
 
117
            <input
-
 
118
              type="text"
-
 
119
              name="description"
-
 
120
              className="form-control"
-
 
121
              ref={register({ required: "Por favor ingrese una descripción" })}
-
 
122
            />
-
 
123
            {errors.description && (
-
 
124
              <FormErrorFeedback>
-
 
125
                {errors.description.message}
-
 
126
              </FormErrorFeedback>
-
 
127
            )}
-
 
128
          </div>
-
 
129
          <div className="form-group">
-
 
130
            <label htmlFor="timezone">Tipo de conferencia</label>
-
 
131
            <select
-
 
132
              name="type"
-
 
133
              className="form-control"
-
 
134
              onChange={({ target }) => handleChange(target.value)}
-
 
135
              ref={register}
-
 
136
            >
-
 
137
              <option value="i">Inmediata</option>
-
 
138
              <option value="s">Programada</option>
-
 
139
            </select>
-
 
140
          </div>
-
 
141
          `
-
 
142
          <div className="form-group">
-
 
143
            <label htmlFor="timezone">Zona horaria</label>
-
 
144
            <select
-
 
145
              className="form-control"
-
 
146
              name="timezone"
-
 
147
              ref={register({ required: "Por favor elige una Zona horaria" })}
-
 
148
            >
-
 
149
              <option value="" hidden>
-
 
150
                Zona horaria
-
 
151
              </option>
-
 
152
              {Object.entries(timezones).map(([key, value]) => (
-
 
153
                <option value={key} key={key}>
-
 
154
                  {value}
-
 
155
                </option>
-
 
156
              ))}
-
 
157
            </select>
-
 
158
            {errors.timezone && (
-
 
159
              <FormErrorFeedback>{errors.timezone.message}</FormErrorFeedback>
-
 
160
            )}
-
 
161
          </div>
-
 
162
          `
-
 
163
          <div className="form-group">
-
 
164
            <label htmlFor="timezone">Duración</label>
-
 
165
            <select className="form-control" name="duration" ref={register}>
-
 
166
              <option value={5}>5-min</option>
-
 
167
              <option value={10}>10-min</option>
-
 
168
              <option value={15}>15-min</option>
-
 
169
              <option value={20}>20-min</option>
-
 
170
              <option value={25}>25-min</option>
-
 
171
              <option value={30}>30-min</option>
-
 
172
              <option value={35}>35-min</option>
-
 
173
              <option value={40}>40-min</option>
-
 
174
              <option value={45}>45-min</option>
-
 
175
            </select>
-
 
176
          </div>
-
 
177
          <div className="form-group">
-
 
178
            <label htmlFor="first_name">Contraseña de ingreso</label>
-
 
179
            <input
-
 
180
              type="password"
-
 
181
              name="password"
-
 
182
              className="form-control"
-
 
183
              ref={register({
-
 
184
                required: "Por favor ingrese una contraseña",
-
 
185
                maxLength: {
-
 
186
                  value: 6,
-
 
187
                  message: "La contraseña debe tener al menos 6 digitos",
-
 
188
                },
-
 
189
              })}
-
 
190
            />
-
 
191
            {errors.password && (
-
 
192
              <FormErrorFeedback>{errors.password.message}</FormErrorFeedback>
-
 
193
            )}
-
 
194
          </div>
-
 
195
          <button className="btn btn-primary" type="submit">
-
 
196
            Crear
-
 
197
          </button>
-
 
198
        </form>
104
      </Modal.Header>
199
      </Modal.Body>
105
      <Modal.Body></Modal.Body>
200
    </Modal>
106
    </Modal>
201
  );
107
  );
Línea 202... Línea 108...
202
};
108
};