Fakultas Ilmu Komputer UI

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

Merge branch 'pbi-9' into 'staging'

Pbi 9

See merge request ppl-fasilkom-ui/itproject-2020/group-b/pilar-web!100
parents 50eb7ef9 a43332f0
Pipeline #61257 failed with stages
in 11 minutes and 49 seconds
This diff is collapsed.
......@@ -11,24 +11,128 @@ afterEach(cleanup);
test("Test detail pengguna renders", async () => {
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({
id: "8e9a8f94-cb5c-4b2d-b4f1-81ccfb9f1b0a",
donation_number: "7NGVBN",
user: "45897cc5-968c-44cf-931d-e646b095fcaf",
user_username: "admin-staging",
program: "6d7462da-6a85-4e2b-9930-69567090a5d5",
program_code: "3MXZ9T",
user_full_name: "Hello",
user_phone_number: "012345",
program_name: "dummy 2",
amount: "10000.00",
donation_status: "001",
readable_donation_status: "Menunggu konfirmasi admin",
proof_of_bank_transfer: "a",
user_bank_account_name: "Jeffrey",
user_bank_account_number: "12345678",
created_at: "2020-04-28T21:34:15.565614+07:00",
updated_at: "2020-04-28T21:34:15.565651+07:00",
"count": 1,
"next": null,
"previous": null,
"results": [{
"id": "5bebd436-ba6a-4972-903b-87bea966939c",
"donation_number": "345JC4",
"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": "CSH",
"donation_status": "002",
"amount": "888.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(
JSON.stringify({
......
......@@ -105,28 +105,39 @@ const DetailBatch = ({ batchId }) => {
</div>
<div>{stringToCurrency(batch.shipping_cost)}</div>
</div>
<div className="container-fluid row">
<div className="col-12">
<div css={css`flex-grow: 1;`}>
<LinkYellow css={css`border: 3px solid #3c8dbc; margin-bottom:10px;`} to="ubah">
UBAH
</LinkYellow>
<div className="container-fluid row">
<div className="col-6">
<div
css={css`
flex-grow: 1;
`}
>
<LinkYellow
css={css`
border: 3px solid #3c8dbc;
`}
to="ubah"
>
UBAH
</LinkYellow>
</div>
</div>
<div
css={css`
flex-grow: 1;
`}
>
<ButtonDeleteStyled
data-testid="button-delete-category-modal"
onClick={() => deleteBatch()}
<div className="col-6">
<div
css={css`
flex-grow: 1;
`}
>
HAPUS
</ButtonDeleteStyled>
<ButtonDeleteStyled
data-testid="button-delete-product-modal"
onClick={() => deleteBatch()}
>
HAPUS
</ButtonDeleteStyled>
</div>
</div>
</div>
</div>
</div>
)
}
......
......@@ -15,6 +15,9 @@ import {
} from "../../component/TableUtils";
import TableComponent from "../../component/TableComponent";
import { donationToColoredStatus } from "../../component/TableUtils";
import {
itemDonationStatus
} from "../../component/TableUtils";
const DetailPengguna = ({ userId }) => {
const url = `${process.env.REACT_APP_BASE_URL}/users/${userId}/`;
......@@ -51,8 +54,8 @@ const DetailPengguna = ({ userId }) => {
},
],
};
const data_donasi = {
url: `${process.env.REACT_APP_BASE_URL}/program-donations/`,
const dataDonasiUang = {
url: `${process.env.REACT_APP_BASE_URL}/program-donations/csh`,
pageDefault: 1,
argument: `user=${userId}`,
title: "",
......@@ -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 (
<div
data-testid="page-profile"
......@@ -280,7 +309,39 @@ const DetailPengguna = ({ userId }) => {
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
......@@ -289,7 +350,7 @@ const DetailPengguna = ({ userId }) => {
flex-direction: column;
`}
>
<TableComponent {...data_donasi} />
<TableComponent {...dataDonasiBarang} />
</div>
</div>
</div>
......
......@@ -13,10 +13,10 @@ const ListProduk = () => {
keyValuePairs: [
["id", "id"],
["name", "Nama Produk"],
["", "Stok", preorderStock],
["price", "Harga", stringToCurrency],
["profit", "Keuntungan/Produk", stringToCurrency],
["total_profit", "Keuntungan Total", stringToCurrency],
["", "Stok", preorderStock],
["total_profit", "Keuntungan Penjualan", stringToCurrency],
],
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