|
@@ -189,108 +189,112 @@ class InputEvaluasi extends Component {
|
|
|
validationSchema={evaluasiSchema}
|
|
validationSchema={evaluasiSchema}
|
|
|
onSubmit={this.onSubmit}
|
|
onSubmit={this.onSubmit}
|
|
|
>
|
|
>
|
|
|
- <Form className="form-horizontal">
|
|
|
|
|
- <FormGroup row>
|
|
|
|
|
- <label className="col-md-2 col-form-label">Tanggal Dokumen</label>
|
|
|
|
|
- <div className="col-md-10">
|
|
|
|
|
- <Field name="tanggal">
|
|
|
|
|
- {({ field, form }) => (
|
|
|
|
|
- <Datetime
|
|
|
|
|
- timeFormat={false}
|
|
|
|
|
- inputProps={{ className: "form-control" }}
|
|
|
|
|
- value={field.value}
|
|
|
|
|
- onChange={(e) => {
|
|
|
|
|
- form.setFieldValue(field.name, e);
|
|
|
|
|
- }}
|
|
|
|
|
- />
|
|
|
|
|
- )}
|
|
|
|
|
- </Field>
|
|
|
|
|
- <ErrorMessage name="tanggal" component="div" className="form-text text-danger" />
|
|
|
|
|
- </div>
|
|
|
|
|
- </FormGroup>
|
|
|
|
|
- <FormGroup row>
|
|
|
|
|
- <label className="col-md-2 col-form-label">Judul Dokumen</label>
|
|
|
|
|
- <div className="col-md-10">
|
|
|
|
|
- <Field name="judul">{({ field, form }) => <Input type="text" placeholder="judul" {...field} />}</Field>
|
|
|
|
|
- <ErrorMessage name="judul" component="div" className="form-text text-danger" />
|
|
|
|
|
- </div>
|
|
|
|
|
- </FormGroup>
|
|
|
|
|
- <FormGroup row>
|
|
|
|
|
- <label className="col-md-2 col-form-label">Upload File Pendukung<span className="text-danger">*</span></label>
|
|
|
|
|
- <div className="col-md-10">
|
|
|
|
|
- <Field name="dokumen">
|
|
|
|
|
- {({ field, form, meta }) => (
|
|
|
|
|
- <DropzoneWrapper
|
|
|
|
|
- className=""
|
|
|
|
|
- onDrop={(e) => {
|
|
|
|
|
- this.onDrop(e);
|
|
|
|
|
- form.setFieldValue(field.name, e);
|
|
|
|
|
- }}
|
|
|
|
|
- >
|
|
|
|
|
- {({ getRootProps, getInputProps, isDragActive }) => {
|
|
|
|
|
- return (
|
|
|
|
|
- <div {...getRootProps()} className={"dropzone card" + (isDragActive ? "dropzone-drag-active" : "")}>
|
|
|
|
|
- <input name="dokumen" {...getInputProps()} />
|
|
|
|
|
- <div className="dropzone-style-1">
|
|
|
|
|
- <div className="center-ver-hor dropzone-previews flex">{this.state.files.length > 0 ?
|
|
|
|
|
- <div className="text-center fa-2x icon-cloud-upload mr-2 ">
|
|
|
|
|
- <h5 className="text-center dz-default dz-message">Klik untuk tambah file</h5>
|
|
|
|
|
- </div> :
|
|
|
|
|
- <div className="text-center fa-2x icon-cloud-upload mr-2 ">
|
|
|
|
|
- <h5 className="text-center dz-default dz-message">Klik untuk upload dokumen</h5>
|
|
|
|
|
|
|
+ {({ isSubmitting }) => (
|
|
|
|
|
+ <Form className="form-horizontal">
|
|
|
|
|
+ <FormGroup row>
|
|
|
|
|
+ <label className="col-md-2 col-form-label">Tanggal Dokumen</label>
|
|
|
|
|
+ <div className="col-md-10">
|
|
|
|
|
+ <Field name="tanggal">
|
|
|
|
|
+ {({ field, form }) => (
|
|
|
|
|
+ <Datetime
|
|
|
|
|
+ timeFormat={false}
|
|
|
|
|
+ inputProps={{ className: "form-control" }}
|
|
|
|
|
+ value={field.value}
|
|
|
|
|
+ onChange={(e) => {
|
|
|
|
|
+ form.setFieldValue(field.name, e);
|
|
|
|
|
+ }}
|
|
|
|
|
+ />
|
|
|
|
|
+ )}
|
|
|
|
|
+ </Field>
|
|
|
|
|
+ <ErrorMessage name="tanggal" component="div" className="form-text text-danger" />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </FormGroup>
|
|
|
|
|
+ <FormGroup row>
|
|
|
|
|
+ <label className="col-md-2 col-form-label">Judul Dokumen</label>
|
|
|
|
|
+ <div className="col-md-10">
|
|
|
|
|
+ <Field name="judul">{({ field, form }) => <Input type="text" placeholder="judul" {...field} />}</Field>
|
|
|
|
|
+ <ErrorMessage name="judul" component="div" className="form-text text-danger" />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </FormGroup>
|
|
|
|
|
+ <FormGroup row>
|
|
|
|
|
+ <label className="col-md-2 col-form-label">Upload File Pendukung<span className="text-danger">*</span></label>
|
|
|
|
|
+ <div className="col-md-10">
|
|
|
|
|
+ <Field name="dokumen">
|
|
|
|
|
+ {({ field, form, meta }) => (
|
|
|
|
|
+ <DropzoneWrapper
|
|
|
|
|
+ className=""
|
|
|
|
|
+ onDrop={(e) => {
|
|
|
|
|
+ this.onDrop(e);
|
|
|
|
|
+ form.setFieldValue(field.name, e);
|
|
|
|
|
+ }}
|
|
|
|
|
+ >
|
|
|
|
|
+ {({ getRootProps, getInputProps, isDragActive }) => {
|
|
|
|
|
+ return (
|
|
|
|
|
+ <div {...getRootProps()} className={"dropzone card" + (isDragActive ? "dropzone-drag-active" : "")}>
|
|
|
|
|
+ <input name="dokumen" {...getInputProps()} />
|
|
|
|
|
+ <div className="dropzone-style-1">
|
|
|
|
|
+ <div className="center-ver-hor dropzone-previews flex">{this.state.files.length > 0 ?
|
|
|
|
|
+ <div className="text-center fa-2x icon-cloud-upload mr-2 ">
|
|
|
|
|
+ <h5 className="text-center dz-default dz-message">Klik untuk tambah file</h5>
|
|
|
|
|
+ </div> :
|
|
|
|
|
+ <div className="text-center fa-2x icon-cloud-upload mr-2 ">
|
|
|
|
|
+ <h5 className="text-center dz-default dz-message">Klik untuk upload dokumen</h5>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ }
|
|
|
</div>
|
|
</div>
|
|
|
- }
|
|
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div className="d-flex align-items-center">
|
|
|
|
|
+ <small className="ml-auto">
|
|
|
|
|
+ <button
|
|
|
|
|
+ type="button"
|
|
|
|
|
+ className="btn btn-link"
|
|
|
|
|
+ onClick={(e) => {
|
|
|
|
|
+ this.clearFiles(e);
|
|
|
|
|
+ form.setFieldValue(field.name, []);
|
|
|
|
|
+ }}
|
|
|
|
|
+ >
|
|
|
|
|
+ Reset dokumen
|
|
|
|
|
+ </button>
|
|
|
|
|
+ </small>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <div className="d-flex align-items-center">
|
|
|
|
|
- <small className="ml-auto">
|
|
|
|
|
- <button
|
|
|
|
|
- type="button"
|
|
|
|
|
- className="btn btn-link"
|
|
|
|
|
- onClick={(e) => {
|
|
|
|
|
- this.clearFiles(e);
|
|
|
|
|
- form.setFieldValue(field.name, []);
|
|
|
|
|
- }}
|
|
|
|
|
- >
|
|
|
|
|
- Reset dokumen
|
|
|
|
|
- </button>
|
|
|
|
|
- </small>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- );
|
|
|
|
|
- }}
|
|
|
|
|
- </DropzoneWrapper>
|
|
|
|
|
- )}
|
|
|
|
|
- </Field>
|
|
|
|
|
- {thumbs}
|
|
|
|
|
- <ErrorMessage name="dokumen" component="div" className="form-text text-danger" />
|
|
|
|
|
- <p className="mrgn-top-5 font-color-black">
|
|
|
|
|
- Ukuran setiap dokumen maksimal 15mb
|
|
|
|
|
- </p>
|
|
|
|
|
- </div>
|
|
|
|
|
- </FormGroup>
|
|
|
|
|
- {this.props.user?.role.id === 2021 ? (
|
|
|
|
|
- <FormGroup row>
|
|
|
|
|
- <label className="col-md-2 col-form-label">Delegasi ke dikti</label>
|
|
|
|
|
- <div className="col-md-10 mt-2">
|
|
|
|
|
- <div className="checkbox c-checkbox">
|
|
|
|
|
- <label>
|
|
|
|
|
- <Input type="checkbox" onChange={this.handlechecklist} defaultChecked={this.state.delegasichecklist} />
|
|
|
|
|
- <span className="fa fa-check"></span></label>
|
|
|
|
|
|
|
+ );
|
|
|
|
|
+ }}
|
|
|
|
|
+ </DropzoneWrapper>
|
|
|
|
|
+ )}
|
|
|
|
|
+ </Field>
|
|
|
|
|
+ {thumbs}
|
|
|
|
|
+ <ErrorMessage name="dokumen" component="div" className="form-text text-danger" />
|
|
|
|
|
+ <p className="mrgn-top-5 font-color-black">
|
|
|
|
|
+ Ukuran setiap dokumen maksimal 15mb
|
|
|
|
|
+ </p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </FormGroup>
|
|
|
|
|
+ {this.props.user?.role.id === 2021 ? (
|
|
|
|
|
+ <FormGroup row>
|
|
|
|
|
+ <label className="col-md-2 col-form-label">Delegasi ke dikti</label>
|
|
|
|
|
+ <div className="col-md-10 mt-2">
|
|
|
|
|
+ <div className="checkbox c-checkbox">
|
|
|
|
|
+ <label>
|
|
|
|
|
+ <Input type="checkbox" onChange={this.handlechecklist} defaultChecked={this.state.delegasichecklist} />
|
|
|
|
|
+ <span className="fa fa-check"></span></label>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ </FormGroup>
|
|
|
|
|
+ ) : ("")}
|
|
|
|
|
+ <FormGroup row>
|
|
|
|
|
+ <div className="col-xl-10">
|
|
|
|
|
+ <Button color className="btn-login" type="submit" disabled={isSubmitting}>
|
|
|
|
|
+ <span className="font-color-white">
|
|
|
|
|
+ Simpan Evaluasi
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </Button>
|
|
|
</div>
|
|
</div>
|
|
|
</FormGroup>
|
|
</FormGroup>
|
|
|
- ) : ("")}
|
|
|
|
|
- <FormGroup row>
|
|
|
|
|
- <div className="col-xl-10">
|
|
|
|
|
- <Button color className="btn-login" type="submit">
|
|
|
|
|
- <span className="font-color-white">
|
|
|
|
|
- Simpan Evaluasi
|
|
|
|
|
- </span>
|
|
|
|
|
- </Button>
|
|
|
|
|
- </div>
|
|
|
|
|
- </FormGroup>
|
|
|
|
|
- </Form>
|
|
|
|
|
|
|
+ </Form>
|
|
|
|
|
+
|
|
|
|
|
+ )}
|
|
|
|
|
+
|
|
|
</Formik>
|
|
</Formik>
|
|
|
</>
|
|
</>
|
|
|
);
|
|
);
|