mirror of
https://github.com/drawdb-io/drawdb.git
synced 2025-08-29 02:25:26 +00:00
update date localization
This commit is contained in:
20
package-lock.json
generated
20
package-lock.json
generated
@@ -30,7 +30,7 @@
|
||||
"jspdf": "^3.0.1",
|
||||
"jszip": "^3.10.1",
|
||||
"lexical": "^0.12.5",
|
||||
"moment": "^2.30.1",
|
||||
"luxon": "^3.7.1",
|
||||
"nanoid": "^5.1.5",
|
||||
"node-sql-parser": "^5.3.11",
|
||||
"oracle-sql-parser": "^0.1.0",
|
||||
@@ -4205,6 +4205,15 @@
|
||||
"yallist": "^3.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/luxon": {
|
||||
"version": "3.7.1",
|
||||
"resolved": "https://registry.npmjs.org/luxon/-/luxon-3.7.1.tgz",
|
||||
"integrity": "sha512-RkRWjA926cTvz5rAb1BqyWkKbbjzCGchDUIKMCUvNi17j6f6j8uHGDV82Aqcqtzd+icoYpELmG3ksgGiFNNcNg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/markdown-extensions": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/markdown-extensions/-/markdown-extensions-2.0.0.tgz",
|
||||
@@ -5276,15 +5285,6 @@
|
||||
"node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/moment": {
|
||||
"version": "2.30.1",
|
||||
"resolved": "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz",
|
||||
"integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/monaco-editor": {
|
||||
"version": "0.52.2",
|
||||
"resolved": "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.52.2.tgz",
|
||||
|
@@ -32,8 +32,8 @@
|
||||
"jspdf": "^3.0.1",
|
||||
"jszip": "^3.10.1",
|
||||
"lexical": "^0.12.5",
|
||||
"luxon": "^3.7.1",
|
||||
"nanoid": "^5.1.5",
|
||||
"moment": "^2.30.1",
|
||||
"node-sql-parser": "^5.3.11",
|
||||
"oracle-sql-parser": "^0.1.0",
|
||||
"react": "^18.2.0",
|
||||
|
@@ -41,7 +41,5 @@ export async function getCommits(gistId, perPage = 20, page = 1) {
|
||||
},
|
||||
});
|
||||
|
||||
console.log(res)
|
||||
|
||||
return res.data;
|
||||
}
|
||||
|
@@ -66,7 +66,6 @@ export default function Share({ title, setModal }) {
|
||||
|
||||
useEffect(() => {
|
||||
const updateOrGenerateLink = async () => {
|
||||
setLoading(true);
|
||||
try {
|
||||
setLoading(true);
|
||||
if (!gistId || gistId === "") {
|
||||
|
@@ -8,20 +8,22 @@ import {
|
||||
IconChevronLeft,
|
||||
} from "@douyinfe/semi-icons";
|
||||
import { getCommits } from "../../../api/gists";
|
||||
import moment from "moment";
|
||||
import { DateTime } from "luxon";
|
||||
|
||||
export default function Revisions({ open }) {
|
||||
const { gistId } = useContext(IdContext);
|
||||
const { t } = useTranslation();
|
||||
const { t, i18n } = useTranslation();
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
const [revisions, setRevisions] = useState([]);
|
||||
|
||||
useEffect(() => {
|
||||
const getRevisions = async (gistId) => {
|
||||
setIsLoading(true);
|
||||
try {
|
||||
setIsLoading(true);
|
||||
const { data } = await getCommits(gistId);
|
||||
setRevisions(data);
|
||||
setRevisions(
|
||||
data.filter((version) => version.change_status.total !== 0),
|
||||
);
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
Toast.error(t("oops_smth_went_wrong"));
|
||||
@@ -47,36 +49,33 @@ export default function Revisions({ open }) {
|
||||
return (
|
||||
<div className="mx-5 relative h-full">
|
||||
<div className="sticky top-0 z-10 sidesheet-theme pb-2 flex gap-2">
|
||||
<IconButton icon={<IconChevronLeft />} />
|
||||
<IconButton icon={<IconChevronLeft />} title="Previous" />
|
||||
<Button icon={<IconPlus />} block onClick={() => {}}>
|
||||
{t("record_version")}
|
||||
</Button>
|
||||
<IconButton icon={<IconChevronRight />} />
|
||||
<IconButton icon={<IconChevronRight />} title="Next" />
|
||||
</div>
|
||||
{!gistId && <div className="my-3">{t("no_saved_revisions")}</div>}
|
||||
{gistId && (
|
||||
<div className="my-3 overflow-y-auto">
|
||||
<Steps
|
||||
direction="vertical"
|
||||
type="basic"
|
||||
onChange={(i) => console.log(i)}
|
||||
>
|
||||
<Steps direction="vertical" type="basic">
|
||||
{revisions.map((r, i) => (
|
||||
<Steps.Step
|
||||
key={r.version}
|
||||
onClick={() => {
|
||||
alert(r.version);
|
||||
}}
|
||||
title={
|
||||
<div className="flex justify-between items-center w-full">
|
||||
<span>{`${t("version")} ${revisions.length - i}`}</span>
|
||||
<Tag>{r.version.substring(0, 7)}</Tag>
|
||||
</div>
|
||||
}
|
||||
description={
|
||||
<div>
|
||||
<div>{`Commited on ${moment(
|
||||
new Date(r.committed_at),
|
||||
).format("MMMM Do YYYY, h:mm")}`}</div>
|
||||
</div>
|
||||
}
|
||||
description={`${t("commited_at")} ${DateTime.fromISO(
|
||||
r.committed_at,
|
||||
)
|
||||
.setLocale(i18n.language)
|
||||
.toLocaleString(DateTime.DATETIME_MED)}`}
|
||||
icon={<i className="text-sm fa-solid fa-asterisk" />}
|
||||
/>
|
||||
))}
|
||||
|
@@ -35,10 +35,10 @@ import { pl, polish } from "./locales/pl";
|
||||
import { no, norwegian } from "./locales/no";
|
||||
import { sv, swedish } from "./locales/sv-se";
|
||||
import { ur, urdu } from "./locales/ur";
|
||||
import { jp, japanese} from "./locales/jp"
|
||||
import {ne, nepali} from "./locales/ne"
|
||||
import {ug, uyghur} from "./locales/ug";
|
||||
import {pa_pk,punjabipk } from "./locales/pa-pk";
|
||||
import { jp, japanese } from "./locales/jp";
|
||||
import { ne, nepali } from "./locales/ne";
|
||||
import { ug, uyghur } from "./locales/ug";
|
||||
import { pa_pk, punjabipk } from "./locales/pa-pk";
|
||||
import { cz, czech } from "./locales/cz";
|
||||
|
||||
export const languages = [
|
||||
@@ -80,7 +80,7 @@ export const languages = [
|
||||
nepali,
|
||||
uyghur,
|
||||
punjabipk,
|
||||
czech
|
||||
czech,
|
||||
].sort((a, b) => a.name.localeCompare(b.name));
|
||||
|
||||
i18n
|
||||
@@ -130,8 +130,8 @@ i18n
|
||||
jp,
|
||||
ne,
|
||||
ug,
|
||||
"pa-PK":pa_pk,
|
||||
cz
|
||||
"pa-PK": pa_pk,
|
||||
cz,
|
||||
},
|
||||
});
|
||||
|
||||
|
@@ -9,7 +9,8 @@ const en = {
|
||||
report_bug: "Report a bug",
|
||||
import: "Import",
|
||||
inherits: "Inherits",
|
||||
merging_column_w_inherited_definition: "Column '{{fieldName}}' in table '{{tableName}}' with inherited definition will be merged",
|
||||
merging_column_w_inherited_definition:
|
||||
"Column '{{fieldName}}' in table '{{tableName}}' with inherited definition will be merged",
|
||||
import_from: "Import from",
|
||||
file: "File",
|
||||
new: "New",
|
||||
@@ -262,6 +263,7 @@ const en = {
|
||||
no_saved_revisions: "No saved revisions",
|
||||
version: "Version",
|
||||
record_version: "Record version",
|
||||
commited_at: "Commited at",
|
||||
},
|
||||
};
|
||||
|
||||
|
@@ -69,7 +69,7 @@
|
||||
|
||||
.semi-steps-item-content,
|
||||
.semi-steps-item-title {
|
||||
width: 100%;
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.semi-spin-wrapper {
|
||||
|
Reference in New Issue
Block a user