Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,12 @@
"@vitejs/plugin-react": "^4.0.0",
"eslint": "^8.41.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.32.2",
"lint-staged": "^13.2.2",
"prettier": "^2.8.8",
"react-dev-utils": "^12.0.1",
"sass": "^1.97.2",
"stylelint": "^14.16.1",
"stylelint-config-prettier": "^9.0.5",
"stylelint-prettier": "^3.0.0",
Expand Down
8,929 changes: 8,929 additions & 0 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
onlyBuiltDependencies:
- '@parcel/watcher'
- esbuild
4 changes: 2 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { BrowserRouter, Route, Routes } from 'react-router-dom'
import { BrowserRouter, Navigate, Route, Routes } from 'react-router-dom'
import './App.css'
import SignIn from './pages/Login/SignIn'
import Group from './pages/Group/Group'
Expand Down Expand Up @@ -28,7 +28,7 @@ export default class App extends React.Component {
<BrowserRouter>
<Routes>
<Route path="*" element={<NotFound />} />
<Route path="/" element={<SignIn />} /> {}
<Route path="/" element={<Navigate replace to="/dashboard" />} /> {}
<Route path="/login" element={<SignIn />} />
<Route path="/dashboard" element={<Dashboard />} />
<Route path="/dashboard/notice" element={<Notice />} />
Expand Down
3 changes: 3 additions & 0 deletions src/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ export interface UserDetailData {
notice?: NoticeData[]
pass: string
tokens?: TokenDetailData[]
antisocial_check?: boolean | null // null = 未同意, true = 同意済み
antisocial_check_at?: string | null // 反社チェック同意日時
}

export interface TokenDetailData {
Expand Down Expand Up @@ -801,6 +803,7 @@ export const DefaultUserDetailData: UserDetailData = {
notice: undefined,
pass: '',
tokens: undefined,
antisocial_check: null,
}
export const DefaultUserDetailDataArray: UserDetailData[] = [
DefaultUserDetailData,
Expand Down
9 changes: 2 additions & 7 deletions src/pages/Group/GroupDetail/Group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import {
GetSubscribeDashboard,
PostSubscribe,
} from '../../../api/Payment'
import { format } from 'date-fns';

function ChipAgree(props: { agree: boolean }) {
const { agree } = props
Expand Down Expand Up @@ -91,13 +92,7 @@ export function GroupProfileInfo(props: {
const membershipUpdate = () => {
let dateStr = null
if (memberExpiredDate != null) {
dateStr =
memberExpiredDate.getFullYear() +
'-' +
('00' + (memberExpiredDate.getMonth() + 1)).slice(-2) +
'-' +
('00' + memberExpiredDate.getDate()).slice(-2) +
'T00:00:00+09:00'
dateStr = format(memberExpiredDate, "yyyy-MM-dd'T'HH:mm:ss+09:00");
}
const req = {
coupon_id: paymentCoupon,
Expand Down
11 changes: 8 additions & 3 deletions src/pages/Group/GroupDetail/User.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,18 @@ export function StatusTable(props: { user: UserDetailData[] }) {
<TableCell style={{ width: 300 }} align="right">
{row.email}
</TableCell>
<TableCell style={{ width: 160 }} align="right">
<TableCell style={{ width: 250 }} align="right">
{row.mail_verify && (
<Chip size="small" color="primary" label="確認済" />
<Chip size="small" color="primary" label="確認済" sx={{ mr: 0.5 }} />
)}
{!row.mail_verify && (
<Chip size="small" color="secondary" label="未確認" />
<Chip size="small" color="secondary" label="未確認" sx={{ mr: 0.5 }} />
)}
<Chip
size="small"
color={row.antisocial_check === true ? 'success' : 'warning'}
label={row.antisocial_check === true ? '反社チェック済' : '反社未チェック'}
/>
</TableCell>
<TableCell style={{ width: 100 }} align="right">
<Button
Expand Down
38 changes: 17 additions & 21 deletions src/pages/Service/ServiceDetail/IP/IP.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,18 +165,17 @@ export function ServiceIPRow(props: {
setReload: Dispatch<SetStateAction<boolean>>
template: TemplateData
}) {
const { ip, serviceID, setReload, template } = props
const { ip: originalIP, serviceID, setReload, template } = props
const [open, setOpen] = React.useState(false)
const [lockInfo, setLockInfo] = React.useState(true)
const [ipCopy, setIPCopy] = useState(ip)
const [deleteIP, setDeleteIP] = useState(false)
const [ip, setIP] = useState(originalIP)
const { enqueueSnackbar } = useSnackbar()

const clickLockInfo = () => {
setLockInfo(!lockInfo)
}
const resetAction = () => {
setIPCopy(ip)
setIP(originalIP)
setLockInfo(true)
}

Expand All @@ -193,19 +192,16 @@ export function ServiceIPRow(props: {
})
}

useEffect(() => {
if (deleteIP) {
DeleteIP(ip.ID).then((res) => {
if (res.error === '') {
enqueueSnackbar('Request Success', { variant: 'success' })
} else {
enqueueSnackbar(String(res.error), { variant: 'error' })
}
setReload(true)
})
setDeleteIP(false)
}
}, [deleteIP])
const deleteIP = () => {
DeleteIP(ip.ID).then((res) => {
if (res.error === '') {
enqueueSnackbar('Request Success', { variant: 'success' })
} else {
enqueueSnackbar(String(res.error), { variant: 'error' })
}
setReload(true)
})
}

return (
<React.Fragment>
Expand Down Expand Up @@ -243,7 +239,7 @@ export function ServiceIPRow(props: {
}}
variant="outlined"
onChange={(event) => {
setIPCopy({ ...ipCopy, name: event.target.value })
setIP({ ...ip, name: event.target.value })
}}
/>
<StyledTextFieldShort
Expand All @@ -256,7 +252,7 @@ export function ServiceIPRow(props: {
}}
variant="outlined"
onChange={(event) => {
setIPCopy({ ...ipCopy, ip: event.target.value })
setIP({ ...ip, ip: event.target.value })
}}
/>
</StyledRootForm>
Expand All @@ -278,7 +274,7 @@ export function ServiceIPRow(props: {
Reset
</Button>
<IPOpenButton
ip={ipCopy}
ip={ip}
lockInfo={lockInfo}
setLockInfo={setLockInfo}
setReload={setReload}
Expand All @@ -291,7 +287,7 @@ export function ServiceIPRow(props: {
<Grid item xs={12} sm={4}>
<DeleteAlertDialog
key={'ip_delete_alert_dialog_' + ip.ID}
setDeleteProcess={setDeleteIP}
setDeleteProcess={deleteIP}
/>
</Grid>
</Grid>
Expand Down
13 changes: 13 additions & 0 deletions src/pages/User/User.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
Button,
CardActions,
CardContent,
Chip,
FormControl,
FormControlLabel,
Radio,
Expand Down Expand Up @@ -110,6 +111,18 @@ export default function User() {
{user.name} ({user.name_en})
</Typography>
<br />
<Chip
size="small"
label={user.expired_status === 0 ? '有効' : '無効'}
color={user.expired_status === 0 ? 'success' : 'error'}
sx={{ mr: 1 }}
/>
<Chip
size="small"
label={user.antisocial_check === true ? '反社チェック済' : '反社未チェック'}
color={user.antisocial_check === true ? 'success' : 'warning'}
sx={{ mr: 1 }}
/>
</CardContent>
<CardActions>
<Button
Expand Down
34 changes: 34 additions & 0 deletions src/pages/User/UserDetail/UserDetail.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import React, { useEffect, useState } from 'react'
import { format, parseISO } from 'date-fns'
import Dashboard from '../../../components/Dashboard/Dashboard'
import {
Button,
CardContent,
Chip,
CircularProgress,
Grid,
Paper,
Expand Down Expand Up @@ -127,6 +129,38 @@ export default function UserDetail() {
{user.level}
</TableCell>
</TableRow>
<TableRow
key={'antisocial_check'}
sx={{
'&:last-child td, &:last-child th': { border: 0 },
}}
>
<TableCell component="th" scope="row">
反社チェック
</TableCell>
<TableCell align="right" scope="row">
<Chip
size="small"
label={user.antisocial_check === true ? '同意済み' : '未同意'}
color={user.antisocial_check === true ? 'success' : 'warning'}
/>
</TableCell>
</TableRow>
<TableRow
key={'antisocial_check_at'}
sx={{
'&:last-child td, &:last-child th': { border: 0 },
}}
>
<TableCell component="th" scope="row">
反社チェック日時
</TableCell>
<TableCell align="right" scope="row">
{user.antisocial_check_at
? format(parseISO(user.antisocial_check_at), 'yyyy/MM/dd HH:mm:ss')
: '-'}
</TableCell>
</TableRow>
</TableBody>
</Table>
</TableContainer>
Expand Down