mirror of
https://github.com/rowyio/rowy.git
synced 2025-12-29 00:16:39 +01:00
Derivatives: don't list current field in listener field options
This commit is contained in:
@@ -2,7 +2,7 @@ import { useState, Suspense, useMemo, createElement } from "react";
|
||||
import _set from "lodash/set";
|
||||
import { IMenuModalProps } from "..";
|
||||
|
||||
import { Typography, Divider, Stack } from "@mui/material";
|
||||
import { Typography, Stack } from "@mui/material";
|
||||
|
||||
import Modal from "components/Modal";
|
||||
import { getFieldProp } from "components/fields";
|
||||
@@ -79,6 +79,7 @@ export default function FieldSettings(props: IMenuModalProps) {
|
||||
{createElement(customFieldSettings, {
|
||||
config: newConfig,
|
||||
handleChange,
|
||||
fieldName,
|
||||
})}
|
||||
</Stack>
|
||||
)}
|
||||
|
||||
@@ -1,22 +1,29 @@
|
||||
import { lazy, Suspense } from "react";
|
||||
import { ISettingsProps } from "../types";
|
||||
|
||||
import { Grid, InputLabel } from "@mui/material";
|
||||
import MultiSelect from "@rowy/multiselect";
|
||||
import FieldSkeleton from "components/SideDrawer/Form/FieldSkeleton";
|
||||
import { FieldType } from "constants/fields";
|
||||
import FieldsDropdown from "components/Table/ColumnMenu/FieldsDropdown";
|
||||
import { useProjectContext } from "contexts/ProjectContext";
|
||||
import CodeEditorHelper from "@src/components/CodeEditor/CodeEditorHelper";
|
||||
|
||||
import { FieldType } from "constants/fields";
|
||||
import { useProjectContext } from "contexts/ProjectContext";
|
||||
import { WIKI_LINKS } from "constants/externalLinks";
|
||||
|
||||
const CodeEditor = lazy(
|
||||
() => import("components/CodeEditor" /* webpackChunkName: "CodeEditor" */)
|
||||
);
|
||||
|
||||
const Settings = ({ config, handleChange }) => {
|
||||
export default function Settings({
|
||||
config,
|
||||
handleChange,
|
||||
fieldName,
|
||||
}: ISettingsProps) {
|
||||
const { tableState } = useProjectContext();
|
||||
if (!tableState?.columns) return <></>;
|
||||
const columnOptions = Object.values(tableState.columns)
|
||||
.filter((column) => column.fieldName !== fieldName)
|
||||
.filter((column) => column.type !== FieldType.subTable)
|
||||
.map((c) => ({ label: c.name, value: c.key }));
|
||||
|
||||
@@ -65,5 +72,4 @@ const Settings = ({ config, handleChange }) => {
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
export default Settings;
|
||||
}
|
||||
|
||||
@@ -61,9 +61,7 @@ export interface ISideDrawerFieldProps {
|
||||
export interface ISettingsProps {
|
||||
handleChange: (key: string) => (value: any) => void;
|
||||
config: Record<string, any>;
|
||||
// TODO: WRITE TYPES
|
||||
tables: any;
|
||||
[key: string]: any;
|
||||
fieldName: string;
|
||||
}
|
||||
|
||||
// TODO: WRITE TYPES
|
||||
|
||||
Reference in New Issue
Block a user