mirror of
https://github.com/rowyio/rowy.git
synced 2025-12-29 00:16:39 +01:00
Table settings: Show collection name in Copy columns from existing table dropdown
This commit is contained in:
@@ -35,7 +35,6 @@ export default function FieldSettings(props: IMenuModalProps) {
|
||||
) {
|
||||
setShowRebuildPrompt(true);
|
||||
}
|
||||
console.log(key, update);
|
||||
const updatedConfig = _set({ ...newConfig }, key, update);
|
||||
setNewConfig(updatedConfig);
|
||||
};
|
||||
@@ -48,7 +47,6 @@ export default function FieldSettings(props: IMenuModalProps) {
|
||||
[newConfig.renderFieldType, type]
|
||||
);
|
||||
if (!open) return null;
|
||||
console.log(newConfig);
|
||||
|
||||
return (
|
||||
<Modal
|
||||
|
||||
@@ -13,7 +13,9 @@ export const tableSettings = (
|
||||
mode: TableSettingsDialogModes | null,
|
||||
roles: string[] | undefined,
|
||||
sections: string[] | undefined,
|
||||
tables: { label: string; value: any }[] | undefined,
|
||||
tables:
|
||||
| { label: string; value: any; section: string; collection: string }[]
|
||||
| undefined,
|
||||
collections: string[]
|
||||
): Field[] =>
|
||||
[
|
||||
@@ -271,10 +273,15 @@ export const tableSettings = (
|
||||
options: tables,
|
||||
clearable: true,
|
||||
freeText: false,
|
||||
itemRenderer: (option: { value: string; label: string }) => (
|
||||
itemRenderer: (option: {
|
||||
value: string;
|
||||
label: string;
|
||||
section: string;
|
||||
collection: string;
|
||||
}) => (
|
||||
<>
|
||||
{option.label}{" "}
|
||||
<code style={{ marginLeft: "auto" }}>{option.value}</code>
|
||||
{option.section} > {option.label}{" "}
|
||||
<code style={{ marginLeft: "auto" }}>{option.collection}</code>
|
||||
</>
|
||||
),
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import useSWR from "swr";
|
||||
import _find from "lodash/find";
|
||||
import _sortBy from "lodash/sortBy";
|
||||
|
||||
import { Stack, Button, DialogContentText } from "@mui/material";
|
||||
|
||||
@@ -120,7 +121,15 @@ export default function TableSettingsDialog({
|
||||
mode,
|
||||
roles,
|
||||
sectionNames,
|
||||
tables?.map((table) => ({ label: table.name, value: table.id })),
|
||||
_sortBy(
|
||||
tables?.map((table) => ({
|
||||
label: table.name,
|
||||
value: table.id,
|
||||
section: table.section,
|
||||
collection: table.collection,
|
||||
})),
|
||||
["section", "label"]
|
||||
),
|
||||
collections
|
||||
)}
|
||||
customComponents={{
|
||||
|
||||
Reference in New Issue
Block a user