show rowy run popup for connector and action fields

This commit is contained in:
Sidney Alcantara
2022-09-26 16:22:21 +10:00
parent d801c5ecc9
commit 83ee0e10a8
2 changed files with 21 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
import { lazy, Suspense, useState } from "react";
import { lazy, Suspense, useState, useEffect } from "react";
import { get } from "lodash-es";
import stringify from "json-stable-stringify-without-jsonify";
import { Link } from "react-router-dom";
@@ -37,6 +37,7 @@ import {
projectRolesAtom,
projectSettingsAtom,
compatibleRowyRunVersionAtom,
rowyRunModalAtom,
} from "@src/atoms/projectScope";
import { tableScope, tableColumnsOrderedAtom } from "@src/atoms/tableScope";
import { WIKI_LINKS } from "@src/constants/externalLinks";
@@ -68,6 +69,11 @@ const Settings = ({ config, onChange, fieldName }: ISettingsProps) => {
);
const [tableColumnsOrdered] = useAtom(tableColumnsOrderedAtom, tableScope);
const openRowyRunModal = useSetAtom(rowyRunModalAtom, projectScope);
useEffect(() => {
if (!settings.rowyRunUrl) openRowyRunModal({ feature: "Action fields" });
}, [settings.rowyRunUrl]);
// const [activeStep, setActiveStep] = useState<
// "requirements" | "friction" | "action" | "undo" | "customization"
// >("requirements");

View File

@@ -1,5 +1,5 @@
import { lazy, Suspense, useState } from "react";
import { get } from "lodash-es";
import { lazy, Suspense, useEffect } from "react";
import { useAtom, useSetAtom } from "jotai";
import {
Grid,
@@ -11,7 +11,6 @@ import {
Link,
} from "@mui/material";
import SteppedAccordion from "@src/components/SteppedAccordion";
import FieldSkeleton from "@src/components/SideDrawer/FieldSkeleton";
import CodeEditorHelper from "@src/components/CodeEditor/CodeEditorHelper";
import InlineOpenInNewIcon from "@src/components/InlineOpenInNewIcon";
@@ -21,6 +20,11 @@ import connectorDefs from "!!raw-loader!./connector.d.ts";
import { WIKI_LINKS } from "@src/constants/externalLinks";
import { baseFunction } from "./utils";
import { ISettingsProps } from "@src/components/fields/types";
import {
projectScope,
projectSettingsAtom,
rowyRunModalAtom,
} from "@src/atoms/projectScope";
//import typeDefs from "!!raw-loader!./types.d.ts";
const CodeEditor = lazy(
@@ -46,6 +50,13 @@ const diagnosticsOptions = {
};
export default function Settings({ config, onChange }: ISettingsProps) {
const [projectSettings] = useAtom(projectSettingsAtom, projectScope);
const openRowyRunModal = useSetAtom(rowyRunModalAtom, projectScope);
useEffect(() => {
if (!projectSettings.rowyRunUrl)
openRowyRunModal({ feature: "Connector fields" });
}, [projectSettings.rowyRunUrl]);
return (
<>
<div>