fix
This commit is contained in:
parent
3cf32576bc
commit
07dac276b8
|
|
@ -7,6 +7,7 @@ import { AlertTriangle, Check, ChevronLeft, Loader2, Plus } from "lucide-react";
|
||||||
import { FMLocal, FMProps } from "../typings";
|
import { FMLocal, FMProps } from "../typings";
|
||||||
import { editorFormData } from "./ed-data";
|
import { editorFormData } from "./ed-data";
|
||||||
import { formError } from "./error";
|
import { formError } from "./error";
|
||||||
|
import { lang } from "lib/lang";
|
||||||
|
|
||||||
export const formInit = (fm: FMLocal, props: FMProps) => {
|
export const formInit = (fm: FMLocal, props: FMProps) => {
|
||||||
for (const [k, v] of Object.entries(props)) {
|
for (const [k, v] of Object.entries(props)) {
|
||||||
|
|
@ -289,7 +290,7 @@ export const formInit = (fm: FMLocal, props: FMProps) => {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
toastSuccess({ addNewText: "Add New" });
|
toastSuccess({ addNewText: lang.t("Add New") });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return success;
|
return success;
|
||||||
|
|
|
||||||
|
|
@ -93,14 +93,14 @@ export const generateMDForm = async (
|
||||||
];
|
];
|
||||||
|
|
||||||
if (isEditor) {
|
if (isEditor) {
|
||||||
breads.push({ label: "Add New" });
|
breads.push({ label: lang.t("Add New") });
|
||||||
} else {
|
} else {
|
||||||
if (
|
if (
|
||||||
md.selected &&
|
md.selected &&
|
||||||
typeof md.selected === "object"
|
typeof md.selected === "object"
|
||||||
) {
|
) {
|
||||||
if (Object.keys(md.selected).length === 0){
|
if (Object.keys(md.selected).length === 0){
|
||||||
breads.push({ label: "Add New" });
|
breads.push({ label: lang.t("Add New") });
|
||||||
} else {
|
} else {
|
||||||
breads.push({ label: guessLabel(md.selected) || "Detail" });
|
breads.push({ label: guessLabel(md.selected) || "Detail" });
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,7 @@ export { FieldLoading } from "@/comps/ui/field-loading";
|
||||||
export { fetchLinkParams } from "@/comps/form/field/type/TypeLink";
|
export { fetchLinkParams } from "@/comps/form/field/type/TypeLink";
|
||||||
export { prasi_gen } from "./gen/prasi_gen";
|
export { prasi_gen } from "./gen/prasi_gen";
|
||||||
export { guessLabel } from "./utils/guess-label";
|
export { guessLabel } from "./utils/guess-label";
|
||||||
export { lang } from "@/lang/lang";
|
export { lang } from "lib/lang";
|
||||||
|
|
||||||
import __get from "lodash.get";
|
import __get from "lodash.get";
|
||||||
import { sum } from "./utils/sum";
|
import { sum } from "./utils/sum";
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue