Reparing Menu

This commit is contained in:
ajat91.sudrajat 2021-12-23 17:05:03 +07:00
parent 1a0a1756b0
commit bd2696efca
4 changed files with 61 additions and 145 deletions

View File

@ -34,32 +34,6 @@ export const CategoryComponent = observer((props) => {
dataIndex: "name",
key: "name",
},
// {
// title: "Gangguan",
// dataIndex: "status",
// key: "status",
// render: (text, record) => (
// <Tag
// color={record?.status === "ACTIVE" ? "blue" : "#E3E8EE"}
// style={{color: "#4F566B"}}
// >
// {capitalize(record?.status)}
// </Tag>
// ),
// },
// {
// title: "Tersedia",
// dataIndex: "tersedia",
// key: "tersedia",
// render: (text, record) => (
// <Tag
// color={record?.status === "ACTIVE" ? "blue" : "#E3E8EE"}
// style={{color: "#4F566B"}}
// >
// {record?.status === "ACTIVE" ? " Ya" : "Tidak"}
// </Tag>
// ),
// },
{
title: "Action",
key: "action",

View File

@ -79,23 +79,16 @@ export const ProductComponent = observer((props) => {
currency: "IDR",
}).format(text),
},
// {
// title: "Gangguan",
// dataIndex: "status",
// key: "status",
// render: (text, record) => (
// <Tag
// color={record?.status === "ACTIVE" ? "blue" : "#E3E8EE"}
// style={{color: "#4F566B"}}
// >
// {capitalize(record?.status)}
// </Tag>
// ),
// },
{
title: "Supplier",
dataIndex: "supplier",
key: "supplier",
dataIndex: "supplier_name",
key: "supplier_name",
},
{
title: "Sub Category",
dataIndex: "sub_categories_name",
key: "sub_categories_name",
},
{
title: "Tersedia",
@ -128,6 +121,8 @@ export const ProductComponent = observer((props) => {
},
];
if (store.authentication.userData.role !== "Admin") columns.pop();
//if (store.authentication.userData.role !== "Admin") columns.shift();
if (store.authentication.userData.role !== "Admin") delete columns[4];
const deleteData = async (id) => {
try {
console.log(id);

View File

@ -143,7 +143,7 @@ export const DetailUser = observer(() => {
},
{
route: LINKS.USER_DETAIL,
name: <span style={{ fontWeight: "bold" }}>Detail User</span>,
name: <span style={{ fontWeight: "bold" }}>Detail Anggota</span>,
},
];

View File

@ -1,5 +1,19 @@
import React, { useContext, useEffect, useState } from "react";
import {Button, Card, Col, Divider, Form, InputNumber, List, message, Modal, Row, Space, Table, Tag} from "antd";
import {
Button,
Card,
Col,
Divider,
Form,
InputNumber,
List,
message,
Modal,
Row,
Space,
Table,
Tag,
} from "antd";
import { useStore } from "../../utils/useStore";
import { observer } from "mobx-react-lite";
import { DownloadOutlined, PlusSquareOutlined } from "@ant-design/icons";
@ -129,75 +143,11 @@ export const Membership = observer(() => {
currency: "IDR",
}).format(text),
},
{
title: "Status",
dataIndex: "isActive",
key: "isActive",
render: (text, record) => (
<Tag
color={record?.isActive === true ? "processing" : "#E3E8EE"}
style={{ color: "#4F566B" }}
>
{record?.isActive === true ? " ACTIVE" : "INACTIVE"}
</Tag>
),
},
{
title: "Action",
key: "action",
render: (text, record) => (
<Space size="middle">
{/* {store.authentication.userData.role === "Admin" && */}
<Button
type={record?.isActive === true ? "danger" : "primary"}
onClick={() => changeStatus(record?.id, record?.isActive)}
>
{record?.isActive === true ? "Inactive" : "Active"}
</Button>
{/* } */}
{/* <Button
onClick={() => {
setDestination(record?.id);
console.log(record?.id);
setIsVisibleTopUpModal(true);
}}
>
<DownloadOutlined/> Top Up Saldo
</Button> */}
{/* {store.authentication.userData.role === "Admin" && */}
<Button
onClick={() => {
let record2 = record;
delete record2.password;
record2.isChangePassword = false;
setInitialData({
...record2,
// roleId: record.roles.id,
});
setVisibleModal(true);
}}
>
Edit
</Button>
{/* }
{store.authentication.userData.role === "Admin" && */}
<Button
onClick={() => {
let record2 = record;
delete record2.password;
record2.isChangePassword = true;
setInitialData({
...record2,
// roleId: record.roles.id,
});
setVisibleModal(true);
}}
>
Ganti Password
</Button>
{/* } */}
<Button
onClick={() => {
setDestination(record?.id);
@ -207,7 +157,6 @@ export const Membership = observer(() => {
>
<DownloadOutlined /> Top Up Saldo
</Button>
{/* {store.authentication.userData.role === "Admin" && ( */}
<Button
onClick={async () => {
await store.transaction.getDataHistoryTopUp(record.id);
@ -217,8 +166,6 @@ export const Membership = observer(() => {
>
Detail
</Button>
{/* ) */}
{/* } */}
</Space>
),
},