{
}}
>
}
title={
-
- {store.user.data.username}
-
- {store.authentication.userData.username}
-
-
+
+ {store.user.data.username}
+
+ {store.authentication.userData.username}
+
+
}
trigger="click"
visible={clicked}
@@ -455,45 +462,45 @@ export const DesktopLayout = observer(() => {
autoAdjustOverflow={true}
placement="bottomRight"
content={
-
+ {store.authentication.userData.role !== "Admin" && (
+
+
+
+ Profile
+
+
+ )}
+ {
+ store.authentication.logout();
+ history.push("/login");
+ }}
>
- {store.authentication.userData.role !== "Admin" && (
-
-
-
- Profile
-
-
- )}
- {
- store.authentication.logout();
- history.push("/login");
- }}
- >
-
- Sign out
-
-
+
+
Sign out
+
+
}
title={
-
- {store.authentication.userData.username}
-
+
+ {store.authentication.userData.username}
+
}
trigger="click"
diff --git a/src/pages/App/MenuList.js b/src/pages/App/MenuList.js
index db26d51..b0aac5b 100644
--- a/src/pages/App/MenuList.js
+++ b/src/pages/App/MenuList.js
@@ -1,34 +1,33 @@
-import React, {useEffect, useState} from "react";
-import {Menu} from "antd";
-import {Link} from "react-router-dom";
+import React, { useEffect, useState } from "react";
+import { Menu } from "antd";
+import { Link } from "react-router-dom";
import {
- AppstoreOutlined,
- DatabaseOutlined,
- FileAddOutlined,
- FileProtectOutlined,
- FileSyncOutlined,
- HomeOutlined,
- MenuUnfoldOutlined,
- MoneyCollectOutlined,
- ProfileOutlined,
- ProjectOutlined,
- ShoppingCartOutlined,
- UserOutlined,
+ AppstoreOutlined,
+ DatabaseOutlined,
+ FileAddOutlined,
+ FileProtectOutlined,
+ FileSyncOutlined,
+ HomeOutlined,
+ MenuUnfoldOutlined,
+ MoneyCollectOutlined,
+ ProfileOutlined,
+ ProjectOutlined,
+ ShoppingCartOutlined,
+ UserOutlined,
} from "@ant-design/icons";
-import {observer} from "mobx-react-lite";
-import {useStore} from "../../utils/useStore";
-import {LINKS} from "../../routes/app";
+import { observer } from "mobx-react-lite";
+import { useStore } from "../../utils/useStore";
+import { LINKS } from "../../routes/app";
-const {SubMenu} = Menu;
+const { SubMenu } = Menu;
export const MenuList = observer((props) => {
- const store = useStore();
- useEffect(() => {
- }, []);
+ const store = useStore();
+ useEffect(() => {}, []);
- const [setKeys, setSetKeys] = useState(["dashboard"]);
+ const [setKeys, setSetKeys] = useState(["dashboard"]);
- return (
+ return (
{
overflowedIndicator={0}
forceSubMenuRender={true}
>
-
-
-
- Beranda
-
-
- {store.authentication.userData.role !== "Retail" && (
-
-
-
- Keanggotaan
+ {store.authentication.userData.role === "Admin" && (
+
+
+
+ Beranda
)}
+ {store.authentication.userData.role !== "Retail" &&
+ store.authentication.userData.role !== "Admin Partner" && (
+
+
+
+ Keanggotaan
+
+
+ )}
{store.authentication.userData.role === "Admin" && (
} title="Config">
@@ -109,6 +111,14 @@ export const MenuList = observer((props) => {
)}
)}
+ {store.authentication.userData.role === "Admin Partner" && (
+
+
+
+ Produk
+
+
+ )}
{store.authentication.userData.role === "Supervisor" && (
@@ -117,37 +127,45 @@ export const MenuList = observer((props) => {
)}
- {store.authentication.userData.role === "Retail" && (
-
-
-
- Transaksi
-
-
- )}
- } title="Pembayaran">
- {store.authentication.userData.role !== "Retail" && (
-
-
-
- Konfirmasi
+ {store.authentication.userData.role === "Retail" ||
+ (store.authentication.userData.role === "Admin Partner" && (
+
+
+
+ Transaksi
- )}
- {store.authentication.userData.role !== "Admin" && (
-
-
-
+ ))}
+ {store.authentication.userData.role !== "Retail" &&
+ store.authentication.userData.role !== "Admin Partner" && (
+ }
+ title="Pembayaran"
+ >
+ {store.authentication.userData.role !== "Retail" && (
+
+
+
+ Konfirmasi
+
+
+ )}
+ {store.authentication.userData.role !== "Admin" && (
+
+
+
Dibuat oleh Saya
-
-
+
+
+ )}
+
)}
-
{store.authentication.userData.role !== "Admin" && (
-
- Profil
+
+ Profil
)}
diff --git a/src/pages/Config/Commission.js b/src/pages/Config/Commission.js
index baa91c9..ea51153 100644
--- a/src/pages/Config/Commission.js
+++ b/src/pages/Config/Commission.js
@@ -38,7 +38,7 @@ export const Commission = observer(() => {
const routeData = [
{
route: LINKS.HOME,
- name: "Home",
+ name: "Beranda",
},
{
route: LINKS.COMMISSION,
diff --git a/src/pages/Config/Partner.js b/src/pages/Config/Partner.js
index c43e6b6..9e85a1d 100644
--- a/src/pages/Config/Partner.js
+++ b/src/pages/Config/Partner.js
@@ -36,7 +36,7 @@ export const Partner = observer(() => {
const routeData = [
{
route: LINKS.HOME,
- name: "Home",
+ name: "Beranda",
},
{
route: LINKS.PARTNER,
diff --git a/src/pages/Config/Supplier.js b/src/pages/Config/Supplier.js
index e009362..3cd403b 100644
--- a/src/pages/Config/Supplier.js
+++ b/src/pages/Config/Supplier.js
@@ -51,7 +51,7 @@ export const Supplier = observer(() => {
const routeData = [
{
route: LINKS.HOME,
- name: "Home",
+ name: "Beranda",
},
{
route: LINKS.SUPPLIER,
diff --git a/src/pages/Home/Home.js b/src/pages/Home/Home.js
index 5a96c09..c8f2718 100644
--- a/src/pages/Home/Home.js
+++ b/src/pages/Home/Home.js
@@ -1,25 +1,123 @@
import React from "react";
-import {Button, PageHeader} from "antd";
-import {store} from "../../utils/useStore";
-import {observer} from "mobx-react-lite";
+import { Button, PageHeader, Card, Row, Col, List } from "antd";
+import { store } from "../../utils/useStore";
+import { observer } from "mobx-react-lite";
+import { FilterOutlined, TransactionOutlined } from "@ant-design/icons";
export const Home = observer(() => {
- return
-
+ {store.ui.mediaQuery.isDesktop && (
+
-
-
- Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusamus aut recusandae velit! Consequatur corporis,
- eum fuga, harum incidunt laboriosam minus necessitatibus neque non nostrum pariatur tempore. Dignissimos impedit
- rem tempora!
+
+ Total Transaksi}>
+ Total Transaksi : 25 Transaksi
+
+
+
+ Total Keuntungan}>
+ Rp.30.000.000
+
+
+
+ Saldo}>
+ Rp.200.000.000
+
+
+
+ )}
+ {store.ui.mediaQuery.isMobile && (
+
+
+ Total Transaksi}>
+ Total Transaksi :
+
+
+
+ Total Keuntungan}>
+ Rp.30.000.000
+
+
+
+ Saldo}>
+ Rp.200.000.000
+
+
+
+ )}
+ );
+ // return
+ //
+ //
+ //
+ // Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusamus aut recusandae velit! Consequatur corporis,
+ // eum fuga, harum incidunt laboriosam minus necessitatibus neque non nostrum pariatur tempore. Dignissimos impedit
+ // rem tempora!
+ //
});
diff --git a/src/pages/Membership/Membership.js b/src/pages/Membership/Membership.js
index 2e3ea61..5c0ad17 100644
--- a/src/pages/Membership/Membership.js
+++ b/src/pages/Membership/Membership.js
@@ -174,7 +174,7 @@ export const Membership = observer(() => {
const routeData = [
{
route: LINKS.HOME,
- name: "Home",
+ name: "Beranda",
},
{
route: LINKS.MEMBERSHIP,
diff --git a/src/pages/Payback/Payback.js b/src/pages/Payback/Payback.js
index e7b716d..cffe75b 100644
--- a/src/pages/Payback/Payback.js
+++ b/src/pages/Payback/Payback.js
@@ -163,7 +163,7 @@ export const Payback = observer(() => {
const routeData = [
{
route: LINKS.HOME,
- name: "Home",
+ name: "Beranda",
},
{
route: LINKS.PAYBACK,
@@ -175,15 +175,23 @@ export const Payback = observer(() => {
modalLoader.setLoading(true);
try {
const response = await store.payback.confirmPayback(id, type);
- if (response.body.status !== 201) {
- message.error(
- response?.body?.message || `Failed ${capitalize(type)} Payback`
- );
- } else {
- message.success(
- response?.body?.message || `Success ${capitalize(type)} Payback`
- );
- }
+ console.log(response)
+ response.body.statusCode !== 201 && response.body.statusCode !== 200
+ ? message.error(
+ response?.body?.message || `Failed ${capitalize(type)} Payback`
+ )
+ : message.success(
+ response?.body?.message || `Success ${capitalize(type)} Payback`
+ );
+ // if (response.body.status !== 201 ) {
+ // message.error(
+ // response?.body?.message || `Failed ${capitalize(type)} Payback`
+ // );
+ // } else {
+ // message.success(
+ // response?.body?.message || `Success ${capitalize(type)} Payback`
+ // );
+ // }
} catch (e) {
console.error(e, "apa errornya");
message.error(
@@ -200,10 +208,10 @@ export const Payback = observer(() => {
- */}
{/* {
const routeData = [
{
route: LINKS.HOME,
- name: "Home",
+ name: "Beranda",
},
{
route: LINKS.PAYBACK_CREATED,
diff --git a/src/pages/Product/Category.js b/src/pages/Product/Category.js
index c2dd230..ca64fd7 100644
--- a/src/pages/Product/Category.js
+++ b/src/pages/Product/Category.js
@@ -37,7 +37,7 @@ export const Category = observer(() => {
const routeData = [
{
route: LINKS.HOME,
- name: "Home",
+ name: "Beranda",
},
{
route: LINKS.CATEGORY,
diff --git a/src/pages/Product/Product.js b/src/pages/Product/Product.js
index 7cdd86e..d9bb8d5 100644
--- a/src/pages/Product/Product.js
+++ b/src/pages/Product/Product.js
@@ -30,6 +30,7 @@ export const Product = observer(() => {
store.supplier.getData(),
store.category.getData(),
store.product.getDataSubCategories(),
+ store.product.getProductPartner()
]);
await store.product.getData();
modalLoader.setLoading(false);
@@ -53,7 +54,7 @@ export const Product = observer(() => {
const routeData = [
{
route: LINKS.HOME,
- name: "Home",
+ name: "Beranda",
},
{
route: LINKS.PRODUCT,
diff --git a/src/pages/Product/ProductDetail.js b/src/pages/Product/ProductDetail.js
index e30aa91..0d6e884 100644
--- a/src/pages/Product/ProductDetail.js
+++ b/src/pages/Product/ProductDetail.js
@@ -18,7 +18,7 @@ export const ProductDetail = observer(() => {
const routeData = [
{
route: LINKS.HOME,
- name: "Home",
+ name: "Beranda",
},
{
route: LINKS.PRODUCT,
diff --git a/src/pages/Product/Subcategory.js b/src/pages/Product/Subcategory.js
index 08e26cb..0594a68 100644
--- a/src/pages/Product/Subcategory.js
+++ b/src/pages/Product/Subcategory.js
@@ -41,7 +41,7 @@ export const Subcategory = observer(() => {
const routeData = [
{
route: LINKS.HOME,
- name: "Home",
+ name: "Beranda",
},
{
route: LINKS.SUBCATEGORY,
diff --git a/src/pages/Profile/Profile.js b/src/pages/Profile/Profile.js
index c346341..7bbab08 100644
--- a/src/pages/Profile/Profile.js
+++ b/src/pages/Profile/Profile.js
@@ -138,12 +138,12 @@ export const Profile = observer(() => {
History User Transaction
-
{
+ {/* {
console.log('clicked filter')
}}>
Filter
-
+ */}
{
const routeData = [
{
route: LINKS.HOME,
- name: "Home",
+ name: "Beranda",
},
{
route: LINKS.TRANSACTION,
diff --git a/src/store/partner.js b/src/store/partner.js
index f804b6e..95ddcda 100644
--- a/src/store/partner.js
+++ b/src/store/partner.js
@@ -27,7 +27,7 @@ export class Partner {
async getData() {
try {
const response = await http.get(`/users/partner?page=${this.page}&pageSize=${this.pageSize}`);
-
+ //console.log(response)
this.data = response.body.data.map((item, idx) => {
item.key = idx;
return item
@@ -59,11 +59,12 @@ export class Partner {
}
}
- // async updateStatus(id, data) {
- // const response = await http.put(`/users/partner/${id}`).send(data);
- // await this.getData();
- // return response;
- // }
+ async updatePassword(id, data) {
+ const response = await http.put(`/users/change-password-partner/${id}`).send(data);
+ console.log(response)
+ await this.getData();
+ return response;
+ }
async delete(id) {
try {
diff --git a/src/store/product.js b/src/store/product.js
index 5697d10..b7d6e7c 100644
--- a/src/store/product.js
+++ b/src/store/product.js
@@ -26,9 +26,11 @@ export class Product {
dataPriceHistory = [];
totalDataPriceHistory = 0;
pagePriceHistory = 0;
+ pageProductPartner = 0;
pageSizePriceHistory = 10
dataDetailProduct = {};
+ dataProductPartner=[]
constructor(ctx) {
this.ctx = ctx;
@@ -94,6 +96,16 @@ export class Product {
}
}
+ async getProductPartner(id) {
+ try {
+ const response = await http.get(`/product/by-categories?page=${this.pageProductPartner}&sub-category=${id}`);
+ console.log(response)
+ this.dataProductPartner = response.body.data
+ } catch (e) {
+ console.error(e);
+ }
+ }
+
async create(data) {
try {
const response = await http.post('/product').send(data);