pull/5324/head
bunsenstraat 4 weeks ago
parent d6d059445b
commit e7213b127d
  1. 4
      libs/remix-ui/scriptrunner/src/lib/custom-script-runner.tsx
  2. 6
      libs/remix-ui/scriptrunner/src/lib/script-runner-ui.tsx
  3. 8
      libs/remix-ui/scriptrunner/src/types/index.ts

@ -4,7 +4,6 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faToggleOff, faToggleOn, faTrash } from "@fortawesome/free-solid-svg-icons";
import { CustomTooltip } from "@remix-ui/helper";
export interface ScriptRunnerUIProps {
publishedConfigurations: ProjectConfiguration[];
openCustomConfig: () => any;
@ -25,7 +24,7 @@ export const CustomScriptRunner = (props: ScriptRunnerUIProps) => {
const { customConfig } = props;
useEffect(() => {
if(!customConfig) return;
if (!customConfig) return;
setDependencies(customConfig.dependencies);
setBaseConfig(customConfig.baseConfiguration);
},[customConfig])
@ -46,7 +45,6 @@ export const CustomScriptRunner = (props: ScriptRunnerUIProps) => {
setDependencies(updatedDependencies);
};
const handleSaveToFile = () => {
const fileData = JSON.stringify(dependencies, null, 2);
console.log(fileData, baseConfig);

@ -22,7 +22,7 @@ export const ScriptRunnerUI = (props: ScriptRunnerUIProps) => {
const [activeKey, setActiveKey] = useState('default');
useEffect(() => {
if(activeConfig) {
if (activeConfig) {
setActiveKey(activeConfig.name)
}
},[activeConfig])
@ -31,8 +31,6 @@ export const ScriptRunnerUI = (props: ScriptRunnerUIProps) => {
return <div>Loading...</div>;
}
return (
<div className="px-1">
<Accordion activeKey={activeKey} defaultActiveKey="default">
@ -78,7 +76,6 @@ export const ScriptRunnerUI = (props: ScriptRunnerUIProps) => {
</div>
</div>
<Accordion.Collapse className="px-4" eventKey={config.name}>
<>
<p><strong>Description: </strong>{config.description}</p>
@ -104,4 +101,3 @@ export const ScriptRunnerUI = (props: ScriptRunnerUIProps) => {
);
};

@ -9,11 +9,11 @@ export interface Dependency {
windowImport?: boolean;
}
export interface Replacements {
export interface Replacements {
[key: string]: string;
}
export interface ProjectConfiguration {
export interface ProjectConfiguration {
name: string;
publish: boolean;
description: string;
@ -25,12 +25,12 @@ export interface Dependency {
isLoading: boolean;
}
export interface customScriptRunnerConfig {
export interface customScriptRunnerConfig {
baseConfiguration: string;
dependencies: Dependency[];
}
export interface ScriptRunnerConfig {
export interface ScriptRunnerConfig {
defaultConfig: string,
customConfig: customScriptRunnerConfig
}

Loading…
Cancel
Save