Fakultas Ilmu Komputer UI

Commit a43332f0 authored by Wan Muhammad Rayhan Arwindra's avatar Wan Muhammad Rayhan Arwindra 🤸🏽
Browse files

Revert "Merge branch 'PBI-6-Ray' into 'master'"

This reverts commit 0a5a7921, reversing
changes made to 980c3fbe.
parent 50eb7ef9
This diff is collapsed.
...@@ -11,24 +11,128 @@ afterEach(cleanup); ...@@ -11,24 +11,128 @@ afterEach(cleanup);
test("Test detail pengguna renders", async () => { test("Test detail pengguna renders", async () => {
fetch fetch
.once({
"count": 3,
"next": null,
"previous": null,
"results": [
{
"id": "d757a4ba-1fdb-4f28-858c-7aa8848bbabe",
"donation_number": "42R5W9",
"program": "846eb9a9-28ff-438d-82bb-1fe562ed9b31",
"program_code": "5FBT64",
"user": "f26c3bcd-f9d3-469e-b466-57610d9acdcb",
"user_username": "sarah",
"user_full_name": "sarah",
"user_phone_number": "+6287772418324",
"program_name": "Program Berdonasi",
"donation_type": "GDS",
"donation_status": "001",
"amount": null,
"readable_donation_status": "Menunggu konfirmasi admin",
"proof_of_bank_transfer": null,
"user_bank_name": null,
"user_bank_account_name": null,
"bank_account_transfer_destination": null,
"transfer_destination_bank_name": null,
"transfer_destination_bank_account_name": null,
"transfer_destination_bank_account_number": null,
"goods_quantity": "1",
"goods_description": "barang",
"delivery_method": "DLV",
"delivery_address": null,
"created_at": "2020-11-24T19:50:22.652985+07:00",
"updated_at": "2020-11-24T19:50:22.653013+07:00"
},
{
"id": "e2ca9570-d477-4913-811b-240344147fd0",
"donation_number": "9KG9T2",
"program": "846eb9a9-28ff-438d-82bb-1fe562ed9b31",
"program_code": "5FBT64",
"user": "f26c3bcd-f9d3-469e-b466-57610d9acdcb",
"user_username": "sarah",
"user_full_name": "sarah",
"user_phone_number": "+6287772418324",
"program_name": "Program Berdonasi",
"donation_type": "GDS",
"donation_status": "002",
"amount": null,
"readable_donation_status": "Selesai",
"proof_of_bank_transfer": null,
"user_bank_name": null,
"user_bank_account_name": null,
"bank_account_transfer_destination": null,
"transfer_destination_bank_name": null,
"transfer_destination_bank_account_name": null,
"transfer_destination_bank_account_number": null,
"goods_quantity": "1",
"goods_description": "barang",
"delivery_method": "DLV",
"delivery_address": null,
"created_at": "2020-11-24T17:53:13.623299+07:00",
"updated_at": "2020-11-24T17:58:41.737740+07:00"
},
{
"id": "4fe5d059-b551-435a-9bda-51e33103204b",
"donation_number": "7S99ZV",
"program": "846eb9a9-28ff-438d-82bb-1fe562ed9b31",
"program_code": "5FBT64",
"user": "f26c3bcd-f9d3-469e-b466-57610d9acdcb",
"user_username": "sarah",
"user_full_name": "sarah",
"user_phone_number": "+6287772418324",
"program_name": "Program Berdonasi",
"donation_type": "GDS",
"donation_status": "002",
"amount": null,
"readable_donation_status": "Selesai",
"proof_of_bank_transfer": null,
"user_bank_name": null,
"user_bank_account_name": null,
"bank_account_transfer_destination": null,
"transfer_destination_bank_name": null,
"transfer_destination_bank_account_name": null,
"transfer_destination_bank_account_number": null,
"goods_quantity": "1",
"goods_description": "barang",
"delivery_method": "DLV",
"delivery_address": null,
"created_at": "2020-11-24T17:52:39.843104+07:00",
"updated_at": "2020-11-24T17:52:48.863209+07:00"
}]
})
.once({ .once({
id: "8e9a8f94-cb5c-4b2d-b4f1-81ccfb9f1b0a", "count": 1,
donation_number: "7NGVBN", "next": null,
user: "45897cc5-968c-44cf-931d-e646b095fcaf", "previous": null,
user_username: "admin-staging", "results": [{
program: "6d7462da-6a85-4e2b-9930-69567090a5d5", "id": "5bebd436-ba6a-4972-903b-87bea966939c",
program_code: "3MXZ9T", "donation_number": "345JC4",
user_full_name: "Hello", "program": "846eb9a9-28ff-438d-82bb-1fe562ed9b31",
user_phone_number: "012345", "program_code": "5FBT64",
program_name: "dummy 2", "user": "f26c3bcd-f9d3-469e-b466-57610d9acdcb",
amount: "10000.00", "user_username": "sarah",
donation_status: "001", "user_full_name": "sarah",
readable_donation_status: "Menunggu konfirmasi admin", "user_phone_number": "+6287772418324",
proof_of_bank_transfer: "a", "program_name": "Program Berdonasi",
user_bank_account_name: "Jeffrey", "donation_type": "CSH",
user_bank_account_number: "12345678", "donation_status": "002",
created_at: "2020-04-28T21:34:15.565614+07:00", "amount": "888.00",
updated_at: "2020-04-28T21:34:15.565651+07:00", "readable_donation_status": "Selesai",
"proof_of_bank_transfer": "https://industripilar-api-staging.s3.amazonaws.com/media/uploads/programdonation/WqhpWBLkD3Wz22eoXwErsA_df46d070-2d02-4638-ad92-e8b873dd83052043775300869.jpg",
"user_bank_name": "bca",
"user_bank_account_name": "sarah",
"bank_account_transfer_destination": "d225b55b-3b25-4b4a-bd5a-152c308840fb",
"transfer_destination_bank_name": "Bank BCA",
"transfer_destination_bank_account_name": "Admin",
"transfer_destination_bank_account_number": "1234578990",
"goods_quantity": null,
"goods_description": null,
"delivery_method": null,
"delivery_address": null,
"created_at": "2020-11-24T18:00:44.003751+07:00",
"updated_at": "2020-11-24T18:05:06.551801+07:00"
}]
}) })
.once( .once(
JSON.stringify({ JSON.stringify({
......
...@@ -105,28 +105,39 @@ const DetailBatch = ({ batchId }) => { ...@@ -105,28 +105,39 @@ const DetailBatch = ({ batchId }) => {
</div> </div>
<div>{stringToCurrency(batch.shipping_cost)}</div> <div>{stringToCurrency(batch.shipping_cost)}</div>
</div> </div>
<div className="container-fluid row"> <div className="container-fluid row">
<div className="col-12"> <div className="col-6">
<div css={css`flex-grow: 1;`}> <div
<LinkYellow css={css`border: 3px solid #3c8dbc; margin-bottom:10px;`} to="ubah"> css={css`
UBAH flex-grow: 1;
</LinkYellow> `}
>
<LinkYellow
css={css`
border: 3px solid #3c8dbc;
`}
to="ubah"
>
UBAH
</LinkYellow>
</div>
</div> </div>
<div <div className="col-6">
css={css` <div
flex-grow: 1; css={css`
`} flex-grow: 1;
> `}
<ButtonDeleteStyled
data-testid="button-delete-category-modal"
onClick={() => deleteBatch()}
> >
HAPUS <ButtonDeleteStyled
</ButtonDeleteStyled> data-testid="button-delete-product-modal"
onClick={() => deleteBatch()}
>
HAPUS
</ButtonDeleteStyled>
</div>
</div> </div>
</div> </div>
</div> </div>
</div>
) )
} }
......
...@@ -15,6 +15,9 @@ import { ...@@ -15,6 +15,9 @@ import {
} from "../../component/TableUtils"; } from "../../component/TableUtils";
import TableComponent from "../../component/TableComponent"; import TableComponent from "../../component/TableComponent";
import { donationToColoredStatus } from "../../component/TableUtils"; import { donationToColoredStatus } from "../../component/TableUtils";
import {
itemDonationStatus
} from "../../component/TableUtils";
const DetailPengguna = ({ userId }) => { const DetailPengguna = ({ userId }) => {
const url = `${process.env.REACT_APP_BASE_URL}/users/${userId}/`; const url = `${process.env.REACT_APP_BASE_URL}/users/${userId}/`;
...@@ -51,8 +54,8 @@ const DetailPengguna = ({ userId }) => { ...@@ -51,8 +54,8 @@ const DetailPengguna = ({ userId }) => {
}, },
], ],
}; };
const data_donasi = { const dataDonasiUang = {
url: `${process.env.REACT_APP_BASE_URL}/program-donations/`, url: `${process.env.REACT_APP_BASE_URL}/program-donations/csh`,
pageDefault: 1, pageDefault: 1,
argument: `user=${userId}`, argument: `user=${userId}`,
title: "", title: "",
...@@ -80,6 +83,32 @@ const DetailPengguna = ({ userId }) => { ...@@ -80,6 +83,32 @@ const DetailPengguna = ({ userId }) => {
}, },
], ],
}; };
const dataDonasiBarang = {
url: `${process.env.REACT_APP_BASE_URL}/program-donations/gds`,
pageDefault: 1,
title: "",
keyValuePairs: [
["id", "id"],
["donation_number", "ID Donasi"],
["user_username", "Username"],
["program_name", "Nama Program"],
["", "Status", itemDonationStatus],
],
link: "/donasi-barang/",
filter: [
["updated_at_date_range_after", "Updated from", "date"],
["updated_at_date_range_before", "Updated before", "date"],
{
donation_status: {
label: "Status Donasi",
choices: [
{ "001": "Dalam Proses" },
{ "002": "Donasi Diterima" },
],
},
},
],
};
return ( return (
<div <div
data-testid="page-profile" data-testid="page-profile"
...@@ -280,7 +309,39 @@ const DetailPengguna = ({ userId }) => { ...@@ -280,7 +309,39 @@ const DetailPengguna = ({ userId }) => {
font-weight: bold; font-weight: bold;
`} `}
> >
Riwayat Donasi Riwayat Donasi Uang
</div>
</div>
<div
css={css`
display: flex;
flex-direction: column;
`}
>
<TableComponent {...dataDonasiUang} />
</div>
</div>
<div
css={css`
font-style: normal;
font-weight: normal;
font-size: 15px;
line-height: 25px;
margin-top: 1rem;
`}
>
<div
css={css`
display: flex;
`}
>
<ScheduleIcon style={{ fontSize: 25, color: "FFC80A" }} />
<div
css={css`
font-weight: bold;
`}
>
Riwayat Donasi Barang
</div> </div>
</div> </div>
<div <div
...@@ -289,7 +350,7 @@ const DetailPengguna = ({ userId }) => { ...@@ -289,7 +350,7 @@ const DetailPengguna = ({ userId }) => {
flex-direction: column; flex-direction: column;
`} `}
> >
<TableComponent {...data_donasi} /> <TableComponent {...dataDonasiBarang} />
</div> </div>
</div> </div>
</div> </div>
......
...@@ -13,10 +13,10 @@ const ListProduk = () => { ...@@ -13,10 +13,10 @@ const ListProduk = () => {
keyValuePairs: [ keyValuePairs: [
["id", "id"], ["id", "id"],
["name", "Nama Produk"], ["name", "Nama Produk"],
["", "Stok", preorderStock],
["price", "Harga", stringToCurrency], ["price", "Harga", stringToCurrency],
["profit", "Keuntungan/Produk", stringToCurrency], ["profit", "Keuntungan/Produk", stringToCurrency],
["total_profit", "Keuntungan Total", stringToCurrency], ["total_profit", "Keuntungan Penjualan", stringToCurrency],
["", "Stok", preorderStock],
], ],
link: "", link: "",
}; };
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment