Merge branch 'develop' of https://gitlab.com/empatnusabangsa/ppob/ppob-frontend into develop
This commit is contained in:
commit
ba01132cd4
|
@ -26,7 +26,7 @@
|
||||||
work correctly both with client-side routing and a non-root public URL.
|
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`.
|
Learn how to configure a non-root public URL by running `npm run build`.
|
||||||
-->
|
-->
|
||||||
<title>React App</title>
|
<title>PPOB</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"short_name": "React App",
|
"short_name": "PPOB",
|
||||||
"name": "Create React App Sample",
|
"name": "PPOB",
|
||||||
"icons": [
|
"icons": [
|
||||||
{
|
{
|
||||||
"src": "favicon.ico",
|
"src": "favicon.ico",
|
||||||
|
|
|
@ -106,8 +106,9 @@ export const Membership = observer(() => {
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
title: "Name",
|
title: "Name",
|
||||||
dataIndex: "username",
|
dataIndex: "name",
|
||||||
key: "username",
|
key: "name",
|
||||||
|
render: (text, record) => record?.name ?? record?.username,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Username",
|
title: "Username",
|
||||||
|
@ -138,7 +139,7 @@ export const Membership = observer(() => {
|
||||||
render: (text, record) => (
|
render: (text, record) => (
|
||||||
<Space size="middle">
|
<Space size="middle">
|
||||||
<Button
|
<Button
|
||||||
type={record?.status === true ? "danger" : "primary"}
|
type={record?.isActive === true ? "danger" : "primary"}
|
||||||
onClick={() => changeStatus(record?.id, record?.isActive)}
|
onClick={() => changeStatus(record?.id, record?.isActive)}
|
||||||
>
|
>
|
||||||
{record?.isActive === true ? "Inactive" : "Active"}
|
{record?.isActive === true ? "Inactive" : "Active"}
|
||||||
|
|
|
@ -52,6 +52,15 @@ export const MembershipModal = ({
|
||||||
initialValues={initialData}
|
initialValues={initialData}
|
||||||
>
|
>
|
||||||
{((initialData.id && !initialData.isChangePassword) || !initialData.id) && (
|
{((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
|
<Form.Item
|
||||||
name="username"
|
name="username"
|
||||||
label="Username"
|
label="Username"
|
||||||
|
|
|
@ -5,6 +5,7 @@ import {LINKS} from "../../routes/app";
|
||||||
import {useStore} from "../../utils/useStore";
|
import {useStore} from "../../utils/useStore";
|
||||||
import {observer} from "mobx-react-lite";
|
import {observer} from "mobx-react-lite";
|
||||||
import {FilterOutlined} from "@ant-design/icons";
|
import {FilterOutlined} from "@ant-design/icons";
|
||||||
|
import {format, parseISO} from "date-fns";
|
||||||
|
|
||||||
const {Title, Text} = Typography;
|
const {Title, Text} = Typography;
|
||||||
|
|
||||||
|
@ -47,6 +48,11 @@ export const Profile = observer(() => {
|
||||||
title: 'Transaction Date',
|
title: 'Transaction Date',
|
||||||
dataIndex: 'created_at',
|
dataIndex: 'created_at',
|
||||||
key: 'created_at',
|
key: 'created_at',
|
||||||
|
render: (text, record) => {
|
||||||
|
return (
|
||||||
|
<Text>{format(parseISO(record.created_at), 'dd MMMM yyyy HH:mm')}</Text>
|
||||||
|
)
|
||||||
|
},
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -17,10 +17,14 @@ export class Membership {
|
||||||
|
|
||||||
this.data = response.body.data.map((item, idx) => {
|
this.data = response.body.data.map((item, idx) => {
|
||||||
item.key = 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
|
return item
|
||||||
}) ?? []
|
}) ?? []
|
||||||
|
|
||||||
|
console.log(JSON.stringify(this.data), "DATA");
|
||||||
|
|
||||||
this.total_data = response.body.total_data ?? 0
|
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}`);
|
const response = await http.get(`/users/find-by-supperior?page=${this.page}&pageSize=${this.pageSize}`);
|
||||||
this.data = response.body.data.map((item, idx) => {
|
this.data = response.body.data.map((item, idx) => {
|
||||||
item.key = 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
|
return item
|
||||||
}) ?? []
|
}) ?? []
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user