* Add action settings tab to api and query pane - Ask for confirmation before running an action * Update property of actions basedon the updateLayout response Prevent confirmation dialog for Action run, until property of action is true Send an API Request when the user toggles the property of an Action * update http method to toggle executeOnLoad for an action to PUT * Fix save layout response type * Remove console.log * If updating executeOnLoad, avoid calling update action API Co-authored-by: Abhinav Jha <abhinav@appsmith.com>
38 lines
1.0 KiB
TypeScript
38 lines
1.0 KiB
TypeScript
import React from "react";
|
|
import FormControlFactory from "utils/FormControlFactory";
|
|
import { ControlProps } from "components/formControls/BaseControl";
|
|
|
|
interface ActionSettingsProps {
|
|
actionSettingsConfig: any;
|
|
}
|
|
|
|
const ActionSettings = (props: ActionSettingsProps): JSX.Element => {
|
|
return <>{props.actionSettingsConfig.map(renderEachConfig)}</>;
|
|
};
|
|
|
|
const renderEachConfig = (section: any): any => {
|
|
return section.children.map((propertyControlOrSection: ControlProps) => {
|
|
if ("children" in propertyControlOrSection) {
|
|
return renderEachConfig(propertyControlOrSection);
|
|
} else {
|
|
try {
|
|
const { configProperty } = propertyControlOrSection;
|
|
return (
|
|
<div key={configProperty} style={{ marginTop: "18px" }}>
|
|
{FormControlFactory.createControl(
|
|
{ ...propertyControlOrSection },
|
|
{},
|
|
false,
|
|
)}
|
|
</div>
|
|
);
|
|
} catch (e) {
|
|
console.log(e);
|
|
}
|
|
}
|
|
return null;
|
|
});
|
|
};
|
|
|
|
export default ActionSettings;
|