|
@@ -46,14 +46,14 @@ const laporanSchema = Yup.object().shape({
|
|
|
no_laporan: Yup.string().required("Harap Diisi"),
|
|
no_laporan: Yup.string().required("Harap Diisi"),
|
|
|
no_hp: Yup.number().required("Harap Diisi"),
|
|
no_hp: Yup.number().required("Harap Diisi"),
|
|
|
nama: Yup.string().notRequired(),
|
|
nama: Yup.string().notRequired(),
|
|
|
- setuju: Yup.boolean().isTrue(),
|
|
|
|
|
|
|
+ setuju: Yup.boolean().isTrue("Harap diceklis"),
|
|
|
alamat: Yup.string().min(3).max(200).notRequired(),
|
|
alamat: Yup.string().min(3).max(200).notRequired(),
|
|
|
keterangan: Yup.string().min(3).max(200).required("Harap Diisi"),
|
|
keterangan: Yup.string().min(3).max(200).required("Harap Diisi"),
|
|
|
email: Yup.string().email().notRequired(),
|
|
email: Yup.string().email().notRequired(),
|
|
|
pelanggaran_id: Yup.array().min(1).required("Harap Diisi"),
|
|
pelanggaran_id: Yup.array().min(1).required("Harap Diisi"),
|
|
|
pt_id: Yup.string().required("Harap Diisi"),
|
|
pt_id: Yup.string().required("Harap Diisi"),
|
|
|
foto: Yup.array().notRequired().test("filesize", "Maksimal ukuran foto 15mb", checkIfFilesAreTooBig).test("type", "harus jpeg/png", checkIfFilesAreCorrectType),
|
|
foto: Yup.array().notRequired().test("filesize", "Maksimal ukuran foto 15mb", checkIfFilesAreTooBig).test("type", "harus jpeg/png", checkIfFilesAreCorrectType),
|
|
|
- dokumen: Yup.array().nullable().notRequired().test("filesize", "Maksimal ukuran dokumen 15mb", checkIfFilesAreTooBig),
|
|
|
|
|
|
|
+ dokumen: Yup.array().min(1, "Minimal terdapat 1 dokumen").required().test("filesize", "Maksimal ukuran dokumen 15mb", checkIfFilesAreTooBig),
|
|
|
is_private: Yup.boolean().notRequired(),
|
|
is_private: Yup.boolean().notRequired(),
|
|
|
});
|
|
});
|
|
|
|
|
|
|
@@ -282,7 +282,9 @@ class App extends Component {
|
|
|
</div>
|
|
</div>
|
|
|
</FormGroup>
|
|
</FormGroup>
|
|
|
<FormGroup row>
|
|
<FormGroup row>
|
|
|
- <label className="col-md-2 col-form-label">Nomor Aktif</label>
|
|
|
|
|
|
|
+ <label className="col-md-2 col-form-label">
|
|
|
|
|
+ Nomor Aktif<span className="text-warning">*</span>
|
|
|
|
|
+ </label>
|
|
|
<div className="col-md-10">
|
|
<div className="col-md-10">
|
|
|
<Field name="no_hp">{({ field, form }) => <Input type="tel" {...field} />}</Field>
|
|
<Field name="no_hp">{({ field, form }) => <Input type="tel" {...field} />}</Field>
|
|
|
<ErrorMessage name="no_hp" component="div" className="form-text text-danger" />
|
|
<ErrorMessage name="no_hp" component="div" className="form-text text-danger" />
|
|
@@ -313,7 +315,7 @@ class App extends Component {
|
|
|
<label>
|
|
<label>
|
|
|
<Field name="is_private">{({ field }) => <Input type="checkbox" {...field} />}</Field>
|
|
<Field name="is_private">{({ field }) => <Input type="checkbox" {...field} />}</Field>
|
|
|
<span className="fa fa-check"></span>
|
|
<span className="fa fa-check"></span>
|
|
|
- <text>*</text>Klik jika ingin merahasiakan identitas anda
|
|
|
|
|
|
|
+ <text>Klik jika ingin merahasiakan identitas anda</text>
|
|
|
</label>
|
|
</label>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -330,7 +332,9 @@ class App extends Component {
|
|
|
</div>
|
|
</div>
|
|
|
</FormGroup>
|
|
</FormGroup>
|
|
|
<FormGroup row>
|
|
<FormGroup row>
|
|
|
- <label className="col-md-2 col-form-label">Perguruan Tinggi yang Dilaporkan</label>
|
|
|
|
|
|
|
+ <label className="col-md-2 col-form-label">
|
|
|
|
|
+ Perguruan Tinggi yang Dilaporkan<span className="text-warning">*</span>
|
|
|
|
|
+ </label>
|
|
|
<div className="col-md-10">
|
|
<div className="col-md-10">
|
|
|
<Field name="pt_id">
|
|
<Field name="pt_id">
|
|
|
{({ field, form }) => (
|
|
{({ field, form }) => (
|
|
@@ -350,7 +354,9 @@ class App extends Component {
|
|
|
</div>
|
|
</div>
|
|
|
</FormGroup>
|
|
</FormGroup>
|
|
|
<FormGroup row>
|
|
<FormGroup row>
|
|
|
- <label className="col-md-2 col-form-label">Jenis Pelanggaran</label>
|
|
|
|
|
|
|
+ <label className="col-md-2 col-form-label">
|
|
|
|
|
+ Jenis Pelanggaran<span className="text-warning">*</span>
|
|
|
|
|
+ </label>
|
|
|
<div className="col-md-10">
|
|
<div className="col-md-10">
|
|
|
<Field name="pelanggaran_id">
|
|
<Field name="pelanggaran_id">
|
|
|
{({ field, form }) => (
|
|
{({ field, form }) => (
|
|
@@ -374,16 +380,21 @@ class App extends Component {
|
|
|
</div>
|
|
</div>
|
|
|
</FormGroup>
|
|
</FormGroup>
|
|
|
<FormGroup row>
|
|
<FormGroup row>
|
|
|
- <label className="col-md-2 col-form-label">Keterangan Laporan</label>
|
|
|
|
|
|
|
+ <label className="col-md-2 col-form-label">
|
|
|
|
|
+ Keterangan Laporan<span className="text-warning">*</span>
|
|
|
|
|
+ </label>
|
|
|
<div className="col-md-10">
|
|
<div className="col-md-10">
|
|
|
<Field name="keterangan">{({ field }) => <Input type="textarea" {...field} />}</Field>
|
|
<Field name="keterangan">{({ field }) => <Input type="textarea" {...field} />}</Field>
|
|
|
<ErrorMessage name="keterangan" component="div" className="form-text text-danger" />
|
|
<ErrorMessage name="keterangan" component="div" className="form-text text-danger" />
|
|
|
</div>
|
|
</div>
|
|
|
</FormGroup>
|
|
</FormGroup>
|
|
|
<FormGroup row>
|
|
<FormGroup row>
|
|
|
- <label className="col-md-2 col-form-label">File Pendukung</label>
|
|
|
|
|
|
|
+ <label className="col-md-2 col-form-label">
|
|
|
|
|
+ File Pendukung<span className="text-warning">*</span>
|
|
|
|
|
+ </label>
|
|
|
<div className="col-md-10">
|
|
<div className="col-md-10">
|
|
|
<Field name="dokumen">{({ field, form }) => <Input type="file" multiple onChange={(e) => form.setFieldValue(field.name, Array.from(e.currentTarget.files))} />}</Field>
|
|
<Field name="dokumen">{({ field, form }) => <Input type="file" multiple onChange={(e) => form.setFieldValue(field.name, Array.from(e.currentTarget.files))} />}</Field>
|
|
|
|
|
+ <p>Ukuran maksimal tiap-tiap dokumen adalah 15mb</p>
|
|
|
<ErrorMessage name="dokumen" component="div" className="form-text text-danger" />
|
|
<ErrorMessage name="dokumen" component="div" className="form-text text-danger" />
|
|
|
</div>
|
|
</div>
|
|
|
</FormGroup>
|
|
</FormGroup>
|
|
@@ -393,7 +404,7 @@ class App extends Component {
|
|
|
<label>
|
|
<label>
|
|
|
<Field name="setuju">{({ field }) => <Input type="checkbox" {...field} />}</Field>
|
|
<Field name="setuju">{({ field }) => <Input type="checkbox" {...field} />}</Field>
|
|
|
<span className="fa fa-check"></span>
|
|
<span className="fa fa-check"></span>
|
|
|
- <text>*</text>Klik jika data yang anda laporkan sudah benar
|
|
|
|
|
|
|
+ <text>Klik jika data yang anda laporkan sudah benar</text>
|
|
|
<ErrorMessage name="setuju" component="div" className="form-text text-danger" />
|
|
<ErrorMessage name="setuju" component="div" className="form-text text-danger" />
|
|
|
</label>
|
|
</label>
|
|
|
</div>
|
|
</div>
|