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