This commit is contained in:
ajat91 2021-12-16 18:58:04 +07:00
commit ba01132cd4
6 changed files with 30 additions and 8 deletions

View File

@ -26,7 +26,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<title>PPOB</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>

View File

@ -1,6 +1,6 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"short_name": "PPOB",
"name": "PPOB",
"icons": [
{
"src": "favicon.ico",

View File

@ -106,8 +106,9 @@ export const Membership = observer(() => {
const columns = [
{
title: "Name",
dataIndex: "username",
key: "username",
dataIndex: "name",
key: "name",
render: (text, record) => record?.name ?? record?.username,
},
{
title: "Username",
@ -138,7 +139,7 @@ export const Membership = observer(() => {
render: (text, record) => (
<Space size="middle">
<Button
type={record?.status === true ? "danger" : "primary"}
type={record?.isActive === true ? "danger" : "primary"}
onClick={() => changeStatus(record?.id, record?.isActive)}
>
{record?.isActive === true ? "Inactive" : "Active"}

View File

@ -52,6 +52,15 @@ export const MembershipModal = ({
initialValues={initialData}
>
{((initialData.id && !initialData.isChangePassword) || !initialData.id) && (
<Form.Item
name="name"
label="Name"
rules={[{ required: true, message: "Please input Name!" }]}
>
<Input />
</Form.Item>
)}
{!initialData.id && (
<Form.Item
name="username"
label="Username"

View File

@ -5,6 +5,7 @@ import {LINKS} from "../../routes/app";
import {useStore} from "../../utils/useStore";
import {observer} from "mobx-react-lite";
import {FilterOutlined} from "@ant-design/icons";
import {format, parseISO} from "date-fns";
const {Title, Text} = Typography;
@ -47,6 +48,11 @@ export const Profile = observer(() => {
title: 'Transaction Date',
dataIndex: 'created_at',
key: 'created_at',
render: (text, record) => {
return (
<Text>{format(parseISO(record.created_at), 'dd MMMM yyyy HH:mm')}</Text>
)
},
},
]

View File

@ -17,9 +17,13 @@ export class Membership {
this.data = response.body.data.map((item, idx) => {
item.key = idx;
item.roleName = item.roles.name;
item.name = item?.user_detail?.name;
item.roleId = item?.roles.id;
item.roleName = item?.roles.name;
return item
}) ?? []
console.log(JSON.stringify(this.data), "DATA");
this.total_data = response.body.total_data ?? 0
}
@ -28,7 +32,9 @@ export class Membership {
const response = await http.get(`/users/find-by-supperior?page=${this.page}&pageSize=${this.pageSize}`);
this.data = response.body.data.map((item, idx) => {
item.key = idx;
item.roleName = item.roles.name;
item.name = item?.user_detail?.name;
item.roleId = item?.roles.id;
item.roleName = item?.roles?.name;
return item
}) ?? []