From c23f415d5d254600788bc06dd9afda0c64477b6d Mon Sep 17 00:00:00 2001
From: Nabila Febri Viola
Date: Tue, 2 Jun 2020 20:29:17 +0700
Subject: [PATCH 01/36] [REFACTOR] Change password validation
---
frontend/src/components/form-validation-schema.js | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/frontend/src/components/form-validation-schema.js b/frontend/src/components/form-validation-schema.js
index d40e866..8636058 100644
--- a/frontend/src/components/form-validation-schema.js
+++ b/frontend/src/components/form-validation-schema.js
@@ -9,10 +9,10 @@ const AccountSchema = yup.object().shape({
password: yup
.string()
.required("Masukkan password.")
- .min(8, "Password terlalu pendek - setidaknya harus 8 karakter.")
+ .min(9, "Password terlalu pendek - setidaknya harus 9 karakter.")
.matches(
- /^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#$%^&*])(?=.{8,})/, // NOSONAR
- "Password harus terdiri dari minimal 1 huruf kecil, 1 huruf kapital, 1 angka, dan 1 karakter spesial (!@#$%^&*)."
+ /^(?=.*[a-zA-Z])(?=.*\d)[\w.,/\\+\-!?@#$%^&* ]{9,}$/, // NOSONAR
+ "Password harus terdiri dari minimal 1 huruf atau 1 angka."
),
passwordConfirmation: yup
.string()
@@ -70,10 +70,10 @@ export const ChangePasswordSchema = yup.object().shape({
new_password: yup
.string()
.required("Masukkan password.")
- .min(8, "Password terlalu pendek - setidaknya harus 8 karakter.")
+ .min(9, "Password terlalu pendek - setidaknya harus 9 karakter.")
.matches(
- /^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#$%^&*])(?=.{8,})/, // NOSONAR
- "Password harus terdiri dari minimal 1 huruf kecil, 1 huruf kapital, 1 angka, dan 1 karakter spesial (!@#$%^&*)."
+ /^(?=.*[a-zA-Z])(?=.*\d)[\w.,/\\+\-!?@#$%^&* ]{9,}$/, // NOSONAR
+ "Password harus terdiri dari minimal 1 huruf atau 1 angka."
),
confirm_password: yup
.string()
--
GitLab
From f202dfbcafe2c61d445b86934902ab25d7a27103 Mon Sep 17 00:00:00 2001
From: Nabila Febri Viola
Date: Tue, 2 Jun 2020 21:51:21 +0700
Subject: [PATCH 02/36] [REFACTOR] Fix acara donor status in riwayat acara
donor
---
.../migrations/0002_auto_20200602_2055.py | 18 ++++++++++++++++++
backend/acara_donor/models.py | 2 +-
backend/acara_donor/serializers.py | 3 ++-
frontend/src/pages/profile.js | 10 +++++++---
4 files changed, 28 insertions(+), 5 deletions(-)
create mode 100644 backend/acara_donor/migrations/0002_auto_20200602_2055.py
diff --git a/backend/acara_donor/migrations/0002_auto_20200602_2055.py b/backend/acara_donor/migrations/0002_auto_20200602_2055.py
new file mode 100644
index 0000000..cde608c
--- /dev/null
+++ b/backend/acara_donor/migrations/0002_auto_20200602_2055.py
@@ -0,0 +1,18 @@
+# Generated by Django 3.0.5 on 2020-06-02 13:55
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('acara_donor', '0001_initial'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='acaradonor',
+ name='status',
+ field=models.BooleanField(default=None, null=True),
+ ),
+ ]
diff --git a/backend/acara_donor/models.py b/backend/acara_donor/models.py
index 09ecce3..73b7f96 100644
--- a/backend/acara_donor/models.py
+++ b/backend/acara_donor/models.py
@@ -7,7 +7,7 @@ from donor.models import JadwalDonor
class AcaraDonor(models.Model):
user = models.ForeignKey(User, on_delete=models.CASCADE)
- status = models.BooleanField(null=True)
+ status = models.BooleanField(null=True, default=None)
nama_institusi = models.CharField(max_length=95)
alamat_institusi = models.CharField(max_length=140)
diff --git a/backend/acara_donor/serializers.py b/backend/acara_donor/serializers.py
index 8f241dc..ccce4f8 100644
--- a/backend/acara_donor/serializers.py
+++ b/backend/acara_donor/serializers.py
@@ -26,4 +26,5 @@ class AcaraDonorSerializer(serializers.ModelSerializer):
class Meta:
model = AcaraDonor
exclude = ["user", ]
- extra_kwargs = {'foto_lokasi': {'required': False}}
+ extra_kwargs = {'foto_lokasi': {'required': False},
+ 'status': {'default': None}}
diff --git a/frontend/src/pages/profile.js b/frontend/src/pages/profile.js
index 09c03c7..b501846 100644
--- a/frontend/src/pages/profile.js
+++ b/frontend/src/pages/profile.js
@@ -248,10 +248,14 @@ const Profile = () => {
).format(" - HH:mm)")}
- {riwayatAcaraDonor.status ? (
- Diterima
+ {riwayatAcaraDonor.status == null ? (
+ Diajukan
+ ) : riwayatAcaraDonor.status ? (
+ Diterima
) : (
- Ditolak
+
+ Ditolak
+
)}
|
--
GitLab
From 5e7f88daf1108a3cfa839d9acc1d45007a2ac839 Mon Sep 17 00:00:00 2001
From: Nabila Febri Viola
Date: Tue, 2 Jun 2020 21:56:48 +0700
Subject: [PATCH 03/36] [REFACTOR] Change status acara donor color schemes
---
frontend/src/pages/profile.js | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/frontend/src/pages/profile.js b/frontend/src/pages/profile.js
index b501846..d06d1e8 100644
--- a/frontend/src/pages/profile.js
+++ b/frontend/src/pages/profile.js
@@ -253,9 +253,7 @@ const Profile = () => {
) : riwayatAcaraDonor.status ? (
Diterima
) : (
-
- Ditolak
-
+ Ditolak
)}
--
GitLab
From 2f4057865daeaa7ca5c0ef937dea2f18899f8e96 Mon Sep 17 00:00:00 2001
From: Nabila Febri Viola
Date: Tue, 2 Jun 2020 23:00:40 +0700
Subject: [PATCH 04/36] [CHORES] Add tooltip for lupa password
---
frontend/src/components/ModalLogin.js | 14 ++++++++++----
frontend/src/styles/global.css | 11 +++++++++++
2 files changed, 21 insertions(+), 4 deletions(-)
diff --git a/frontend/src/components/ModalLogin.js b/frontend/src/components/ModalLogin.js
index 3ff22e7..aa78c6c 100644
--- a/frontend/src/components/ModalLogin.js
+++ b/frontend/src/components/ModalLogin.js
@@ -1,5 +1,5 @@
import React, { useState } from "react"
-import { Button, Form, Modal } from "react-bootstrap"
+import { Button, Form, Modal, OverlayTrigger, Tooltip } from "react-bootstrap"
import { GoogleLogin } from "react-google-login"
import { useForm } from "react-hook-form"
import { useAuth } from "../hooks/authenticate"
@@ -141,9 +141,15 @@ const ModalLogin = ({ show, handleClose, handleSuccess }) => {
-
+ Silakan hubungi admin ;)
+ }
+ >
+
+
diff --git a/frontend/src/styles/global.css b/frontend/src/styles/global.css
index bc4a19e..0372bd3 100644
--- a/frontend/src/styles/global.css
+++ b/frontend/src/styles/global.css
@@ -196,6 +196,17 @@ input {
box-shadow: var(--bottom-shadow);
}
+.tooltip {
+ font-weight: bold;
+}
+.arrow::before {
+ border-right-color: var(--red) !important;
+}
+.tooltip-inner {
+ color: var(--cream);
+ background-color: var(--red);
+}
+
@media (max-width: 1024px) {
.form-control {
font-size: 15px;
--
GitLab
From 15c14fac573129ff0e3ef71ec7cca7728ebc8c25 Mon Sep 17 00:00:00 2001
From: Nabila Febri Viola
Date: Tue, 2 Jun 2020 23:19:19 +0700
Subject: [PATCH 05/36] [CHORES] Add test for checking acara donor status
---
frontend/src/pages/acara-donor.factory.js | 2 +-
frontend/src/pages/profile.test.js | 23 +++++++++++++++++++++++
2 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/frontend/src/pages/acara-donor.factory.js b/frontend/src/pages/acara-donor.factory.js
index 7d6a676..0fef56e 100644
--- a/frontend/src/pages/acara-donor.factory.js
+++ b/frontend/src/pages/acara-donor.factory.js
@@ -5,7 +5,7 @@ const idGenerator = idGeneratorFactory(1)
export const acaraDonorFactory = override => ({
id: idGenerator(),
- status: "false",
+ status: false,
alamat_institusi: "Pacilkom",
alamat_lokasi_donor: "Sekre Pacil",
email_kantor: "pacil@cs.ui.ac.id",
diff --git a/frontend/src/pages/profile.test.js b/frontend/src/pages/profile.test.js
index 79f9d0b..7e39805 100644
--- a/frontend/src/pages/profile.test.js
+++ b/frontend/src/pages/profile.test.js
@@ -323,6 +323,29 @@ describe("Riwayat Acara Donor", () => {
)
})
+ it("shows correct status for acara donor", async () => {
+ const acara_donor1 = acaraDonorFactory({
+ status: null,
+ })
+ const acara_donor2 = acaraDonorFactory({
+ status: false,
+ })
+ const acara_donor3 = acaraDonorFactory({
+ status: true,
+ })
+ getRiwayatAcaraDonor.mockResolvedValueOnce({
+ data: {
+ count: 3,
+ results: [acara_donor1, acara_donor2, acara_donor3],
+ },
+ })
+ renderAuthenticated()
+ await screen.findByText("Alamat")
+ expect(screen.getByText("Diajukan")).toBeInTheDocument()
+ expect(screen.getByText("Ditolak")).toBeInTheDocument()
+ expect(screen.getByText("Diterima")).toBeInTheDocument()
+ })
+
it("has clickable pagination", async () => {
const acara_donor1 = acaraDonorFactory({
alamat_lokasi_donor: "Yuli Pacil",
--
GitLab
From 2fe0ecd2e98b3e37753b5ed9a838403a076c32f8 Mon Sep 17 00:00:00 2001
From: Nabila Febri Viola
Date: Wed, 3 Jun 2020 09:51:46 +0700
Subject: [PATCH 06/36] [REFACTOR] Change datetimepicker styling
---
.../components/ModalEventDonorSubmission.js | 3 +++
frontend/src/components/complete-profile.js | 1 +
frontend/src/styles/global.css | 10 +++++++++
frontend/src/styles/theme.js | 21 +++++++++++++++++++
4 files changed, 35 insertions(+)
diff --git a/frontend/src/components/ModalEventDonorSubmission.js b/frontend/src/components/ModalEventDonorSubmission.js
index 7e56c1d..2249a01 100644
--- a/frontend/src/components/ModalEventDonorSubmission.js
+++ b/frontend/src/components/ModalEventDonorSubmission.js
@@ -421,6 +421,7 @@ const ModalEventDonorSubmission = ({ show, handleClose }) => {
disablePast
required
variant="inline"
+ inputVariant="outlined"
format="DD/MM/YYYY"
placeholder="DD/MM/YYYY"
views={["year", "month", "date"]}
@@ -459,6 +460,7 @@ const ModalEventDonorSubmission = ({ show, handleClose }) => {
fullWidth
required
variant="inline"
+ inputVariant="outlined"
placeholder="HH:mm"
InputAdornmentProps={{ position: "start" }}
inputProps={{ id: "formEventStartTime" }}
@@ -492,6 +494,7 @@ const ModalEventDonorSubmission = ({ show, handleClose }) => {
fullWidth
required
variant="inline"
+ inputVariant="outlined"
placeholder="HH:mm"
InputAdornmentProps={{ position: "start" }}
inputProps={{ id: "formEventEndTime" }}
diff --git a/frontend/src/components/complete-profile.js b/frontend/src/components/complete-profile.js
index 89e956a..04cbbc3 100644
--- a/frontend/src/components/complete-profile.js
+++ b/frontend/src/components/complete-profile.js
@@ -160,6 +160,7 @@ function CompleteProfile({
disableFuture
required
variant="inline"
+ inputVariant="outlined"
format="DD/MM/YYYY"
placeholder="DD/MM/YYYY"
views={["year", "month", "date"]}
diff --git a/frontend/src/styles/global.css b/frontend/src/styles/global.css
index 0372bd3..bd84db4 100644
--- a/frontend/src/styles/global.css
+++ b/frontend/src/styles/global.css
@@ -20,6 +20,16 @@ body {
background-color: var(--cream);
}
+.MuiOutlinedInput-input {
+ padding: 10px 14px !important;
+}
+.MuiInputBase-input:hover {
+ text-shadow: 0.7px 0 0 currentColor;
+}
+.MuiInputBase-input:focus {
+ text-shadow: 0.7px 0 0 currentColor;
+}
+
.form-control {
color: var(--blue);
background-color: var(--white);
diff --git a/frontend/src/styles/theme.js b/frontend/src/styles/theme.js
index 5e7454b..8f23375 100644
--- a/frontend/src/styles/theme.js
+++ b/frontend/src/styles/theme.js
@@ -30,6 +30,27 @@ const theme = createMuiTheme({
color: BLUE,
},
},
+ MuiOutlinedInput: {
+ root: {
+ position: "relative",
+ "& $notchedOutline": {
+ borderColor: RED,
+ },
+ "&:hover:not($disabled):not($focused):not($error) $notchedOutline": {
+ borderColor: DARK_RED,
+ boxShadow: "0 0 2px 1px #8a1324 !important",
+ // Reset on touch devices, it doesn't add specificity
+ "#media (hover: none)": {
+ borderColor: DARK_RED,
+ boxShadow: "0 0 2px 1px #8a1324 !important",
+ },
+ },
+ "&$focused $notchedOutline": {
+ borderColor: DARK_RED,
+ boxShadow: "4px 4px #8a1324 !important",
+ },
+ },
+ },
MuiPickersBasePicker: {
pickerView: {
backgroundColor: CREAM,
--
GitLab
From a03ab2f5cc6623a6a30fc2a7d292604b8ffa85f9 Mon Sep 17 00:00:00 2001
From: Nabila Febri Viola
Date: Wed, 3 Jun 2020 09:58:21 +0700
Subject: [PATCH 07/36] [REFACTOR] Make navbar sticky
---
frontend/src/components/navbar.js | 1 +
1 file changed, 1 insertion(+)
diff --git a/frontend/src/components/navbar.js b/frontend/src/components/navbar.js
index b918b9f..da5208d 100644
--- a/frontend/src/components/navbar.js
+++ b/frontend/src/components/navbar.js
@@ -25,6 +25,7 @@ const Navbar = () => {
bg="red"
variant="red"
className="mb-4"
+ sticky="top"
>
--
GitLab
From 88702a3dc342cea9ba30bcc74113865ff82af9f3 Mon Sep 17 00:00:00 2001
From: Nabila Febri Viola
Date: Wed, 3 Jun 2020 11:07:58 +0700
Subject: [PATCH 08/36] [CHORES] Add PMI Depok IG ref
---
frontend/src/components/footer.js | 24 +++++++++++++++++++-----
frontend/src/images/ig.svg | 6 ++++++
2 files changed, 25 insertions(+), 5 deletions(-)
create mode 100644 frontend/src/images/ig.svg
diff --git a/frontend/src/components/footer.js b/frontend/src/components/footer.js
index f7c2768..88fbf14 100644
--- a/frontend/src/components/footer.js
+++ b/frontend/src/components/footer.js
@@ -1,13 +1,27 @@
import React from "react"
+import logo from "src/images/ig.svg"
const Footer = () => (