Skip to content

Commit

Permalink
fix: some frontend bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
SaintShit committed Jul 30, 2024
1 parent 582b2bb commit 2f2cbd1
Show file tree
Hide file tree
Showing 13 changed files with 1,255 additions and 1,113 deletions.
2 changes: 1 addition & 1 deletion app/dashboard/build/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<meta name="msapplication-TileColor" content="#2b5797" />
<meta name="msapplication-config" content="/favicon/browserconfig.xml" />
<meta name="theme-color" content="#3B81F6" />
<script type="module" crossorigin src="/dashboard/assets/index.a97b5769.js"></script>
<script type="module" crossorigin src="/dashboard/assets/index.9b159dc0.js"></script>
<link rel="modulepreload" crossorigin href="/dashboard/assets/vendor.8aa8dc93.js">
<link rel="stylesheet" href="/dashboard/assets/index.59de2328.css">
</head>
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion app/dashboard/build/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<meta name="msapplication-TileColor" content="#2b5797" />
<meta name="msapplication-config" content="/favicon/browserconfig.xml" />
<meta name="theme-color" content="#3B81F6" />
<script type="module" crossorigin src="/dashboard/assets/index.a97b5769.js"></script>
<script type="module" crossorigin src="/dashboard/assets/index.9b159dc0.js"></script>
<link rel="modulepreload" crossorigin href="/dashboard/assets/vendor.8aa8dc93.js">
<link rel="stylesheet" href="/dashboard/assets/index.59de2328.css">
</head>
Expand Down
297 changes: 151 additions & 146 deletions app/dashboard/build/locales/en.json

Large diffs are not rendered by default.

299 changes: 157 additions & 142 deletions app/dashboard/build/locales/fa.json

Large diffs are not rendered by default.

292 changes: 152 additions & 140 deletions app/dashboard/build/locales/ru.json

Large diffs are not rendered by default.

275 changes: 155 additions & 120 deletions app/dashboard/build/locales/zh.json

Large diffs are not rendered by default.

297 changes: 151 additions & 146 deletions app/dashboard/public/locales/en.json

Large diffs are not rendered by default.

299 changes: 157 additions & 142 deletions app/dashboard/public/locales/fa.json

Large diffs are not rendered by default.

292 changes: 152 additions & 140 deletions app/dashboard/public/locales/ru.json

Large diffs are not rendered by default.

275 changes: 155 additions & 120 deletions app/dashboard/public/locales/zh.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion app/dashboard/src/components/StatusBadge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const StatusBadge: FC<UserStatusProps> = ({
fontWeight="medium"
letterSpacing="tighter"
>
{userStatus === "on_hold" ? t(userStatus) : userStatus}
{userStatus && t(`status.${userStatus}`)}
{extraText && `: ${extraText}`}
</Text>
)}
Expand Down
30 changes: 19 additions & 11 deletions app/dashboard/src/components/UserDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,18 @@ const schema = z.discriminatedUnion("status", [
status: z.literal("active"),
...baseSchema,
}),
z.object({
z.object({
status: z.literal("disabled"),
...baseSchema,
}),
z.object({
status: z.literal("limited"),
...baseSchema,
}),
z.object({
status: z.literal("expired"),
...baseSchema,
}),
z.object({
status: z.literal("on_hold"),
on_hold_expire_duration: z.coerce
Expand Down Expand Up @@ -292,8 +300,8 @@ export const UserDialog: FC<UserDialogProps> = () => {
: "no_reset",
status:
values.status === "active" ||
values.status === "disabled" ||
values.status === "on_hold"
values.status === "disabled" ||
values.status === "on_hold"
? values.status
: "active",
};
Expand Down Expand Up @@ -412,7 +420,7 @@ export const UserDialog: FC<UserDialogProps> = () => {
return (
<Tooltip
placement="top"
label={"status: " + t(field.value)}
label={"status: " + t(`status.${field.value}`)}
textTransform="capitalize"
>
<Box>
Expand Down Expand Up @@ -603,13 +611,13 @@ export const UserDialog: FC<UserDialogProps> = () => {
target: {
value: date
? dayjs(
dayjs(date)
.set("hour", 23)
.set("minute", 59)
.set("second", 59)
)
.utc()
.valueOf() / 1000
dayjs(date)
.set("hour", 23)
.set("minute", 59)
.set("second", 59)
)
.utc()
.valueOf() / 1000
: 0,
name: "expire",
},
Expand Down

0 comments on commit 2f2cbd1

Please sign in to comment.