chore: added automatic option to run behaviour behind feature flag (#40608)

This commit is contained in:
Aman Agarwal 2025-05-16 16:29:31 +05:30 committed by GitHub
parent 4f21580471
commit 5ffafd7fce
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
28 changed files with 317 additions and 48 deletions

View File

@ -8,12 +8,13 @@ import type { Action } from "entities/Action";
import type { Plugin } from "entities/Plugin"; import type { Plugin } from "entities/Plugin";
import type { Datasource, EmbeddedRestDatasource } from "entities/Datasource"; import type { Datasource, EmbeddedRestDatasource } from "entities/Datasource";
import type { ActionResponse } from "api/ActionAPI"; import type { ActionResponse } from "api/ActionAPI";
import type { ActionSettingsConfig } from "./types/PluginActionTypes";
interface PluginActionContextType { interface PluginActionContextType {
action: Action; action: Action;
actionResponse?: ActionResponse; actionResponse?: ActionResponse;
editorConfig?: unknown[]; editorConfig?: unknown[];
settingsConfig?: unknown[]; settingsConfig?: ActionSettingsConfig[];
plugin: Plugin; plugin: Plugin;
datasource?: EmbeddedRestDatasource | Datasource; datasource?: EmbeddedRestDatasource | Datasource;
} }

View File

@ -7,6 +7,7 @@ import { getPathAndValueFromActionDiffObject } from "utils/getPathAndValueFromAc
import { setActionProperty } from "actions/pluginActionActions"; import { setActionProperty } from "actions/pluginActionActions";
import { usePluginActionContext } from "../../../../../PluginActionContext"; import { usePluginActionContext } from "../../../../../PluginActionContext";
import { useDispatch } from "react-redux"; import { useDispatch } from "react-redux";
import type { ActionSettingsConfig } from "PluginActionEditor/types/PluginActionTypes";
export const useGoogleSheetsSetDefaultProperty = () => { export const useGoogleSheetsSetDefaultProperty = () => {
const { const {
@ -30,7 +31,7 @@ export const useGoogleSheetsSetDefaultProperty = () => {
merge( merge(
initialValues, initialValues,
getConfigInitialValues(settingsConfig as Record<string, unknown>[]), getConfigInitialValues(settingsConfig as ActionSettingsConfig[]),
); );
// initialValues contains merge of action, editorConfig, settingsConfig and will be passed to redux form // initialValues contains merge of action, editorConfig, settingsConfig and will be passed to redux form

View File

@ -6,6 +6,10 @@ import type { EditorTheme } from "components/editorComponents/CodeEditor/EditorC
import styled from "styled-components"; import styled from "styled-components";
import { Text } from "@appsmith/ads"; import { Text } from "@appsmith/ads";
import CenteredWrapper from "components/designSystems/appsmith/CenteredWrapper"; import CenteredWrapper from "components/designSystems/appsmith/CenteredWrapper";
import { useSelector, type DefaultRootState } from "react-redux";
import { selectFeatureFlagCheck } from "ee/selectors/featureFlagsSelectors";
import { updateRunBehaviourForActionSettings } from "utils/PluginUtils";
import { FEATURE_FLAG } from "ee/entities/FeatureFlag";
interface ActionSettingsProps { interface ActionSettingsProps {
// TODO: Fix this the next time the file is edited // TODO: Fix this the next time the file is edited
@ -41,9 +45,21 @@ const ActionSettingsWrapper = styled.div`
`; `;
function ActionSettings(props: ActionSettingsProps): JSX.Element { function ActionSettings(props: ActionSettingsProps): JSX.Element {
const featureFlagEnabled: boolean = useSelector((state: DefaultRootState) =>
selectFeatureFlagCheck(
state,
FEATURE_FLAG.release_reactive_actions_enabled,
),
);
const updateSettingsConfig = updateRunBehaviourForActionSettings(
props.actionSettingsConfig || [],
featureFlagEnabled,
);
return ( return (
<ActionSettingsWrapper> <ActionSettingsWrapper>
{!props.actionSettingsConfig ? ( {!updateSettingsConfig ? (
<CenteredWrapper> <CenteredWrapper>
<Text color="var(--ads-v2-color-fg-error)" kind="heading-m"> <Text color="var(--ads-v2-color-fg-error)" kind="heading-m">
Error: No settings config found Error: No settings config found
@ -52,7 +68,7 @@ function ActionSettings(props: ActionSettingsProps): JSX.Element {
) : ( ) : (
/* TODO: Fix this the next time the file is edited */ /* TODO: Fix this the next time the file is edited */
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */ /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
props.actionSettingsConfig.map((section: any) => updateSettingsConfig.map((section: any) =>
renderEachConfig(section, props.formName), renderEachConfig(section, props.formName),
) )
)} )}

View File

@ -5,23 +5,26 @@ export const THEME = EditorTheme.LIGHT;
export enum ActionRunBehaviour { export enum ActionRunBehaviour {
ON_PAGE_LOAD = "ON_PAGE_LOAD", ON_PAGE_LOAD = "ON_PAGE_LOAD",
MANUAL = "MANUAL", MANUAL = "MANUAL",
AUTOMATIC = "AUTOMATIC",
} }
export const RUN_BEHAVIOR = {
ON_PAGE_LOAD: {
label: "On page load",
subText: "Query runs when the page loads or when manually triggered",
value: ActionRunBehaviour.ON_PAGE_LOAD,
children: "On page load",
},
MANUAL: {
label: "Manual",
subText: "Query only runs when called in an event or JS with .run()",
value: ActionRunBehaviour.MANUAL,
children: "Manual",
},
};
export const RUN_BEHAVIOR_VALUES = Object.values(RUN_BEHAVIOR);
export type ActionRunBehaviourType = `${ActionRunBehaviour}`; export type ActionRunBehaviourType = `${ActionRunBehaviour}`;
export interface ActionSettingsConfigChildren {
label: string;
configProperty: string;
controlType: string;
initialValue?: string | boolean;
options?: Array<{ label: string; value: string }>;
tooltipText?: string;
placeholder?: string;
dataType?: string;
subtitle?: string;
name?: string;
}
export interface ActionSettingsConfig {
sectionName: string;
id: number;
children: ActionSettingsConfigChildren[];
}

View File

@ -58,6 +58,7 @@ export const FEATURE_FLAG = {
"license_external_saas_plugins_enabled", "license_external_saas_plugins_enabled",
release_computation_cache_enabled: "release_computation_cache_enabled", release_computation_cache_enabled: "release_computation_cache_enabled",
release_ai_chat_integrations_enabled: "release_ai_chat_integrations_enabled", release_ai_chat_integrations_enabled: "release_ai_chat_integrations_enabled",
release_reactive_actions_enabled: "release_reactive_actions_enabled",
license_ai_agent_instance_enabled: "license_ai_agent_instance_enabled", license_ai_agent_instance_enabled: "license_ai_agent_instance_enabled",
} as const; } as const;
@ -107,6 +108,7 @@ export const DEFAULT_FEATURE_FLAG_VALUE: FeatureFlags = {
license_external_saas_plugins_enabled: false, license_external_saas_plugins_enabled: false,
release_computation_cache_enabled: false, release_computation_cache_enabled: false,
release_ai_chat_integrations_enabled: false, release_ai_chat_integrations_enabled: false,
release_reactive_actions_enabled: false,
license_ai_agent_instance_enabled: false, license_ai_agent_instance_enabled: false,
}; };

View File

@ -10043,6 +10043,12 @@ export const defaultAppState = {
controlType: "DROP_DOWN", controlType: "DROP_DOWN",
initialValue: "MANUAL", initialValue: "MANUAL",
options: [ options: [
{
label: "Automatic",
subText:
"Query runs on page load or when a variable it depends on changes",
value: "AUTOMATIC",
},
{ {
label: "On page load", label: "On page load",
subText: subText:
@ -10094,6 +10100,12 @@ export const defaultAppState = {
controlType: "DROP_DOWN", controlType: "DROP_DOWN",
initialValue: "MANUAL", initialValue: "MANUAL",
options: [ options: [
{
label: "Automatic",
subText:
"Query runs on page load or when a variable it depends on changes",
value: "AUTOMATIC",
},
{ {
label: "On page load", label: "On page load",
subText: subText:
@ -10145,6 +10157,12 @@ export const defaultAppState = {
controlType: "DROP_DOWN", controlType: "DROP_DOWN",
initialValue: "MANUAL", initialValue: "MANUAL",
options: [ options: [
{
label: "Automatic",
subText:
"Query runs on page load or when a variable it depends on changes",
value: "AUTOMATIC",
},
{ {
label: "On page load", label: "On page load",
subText: subText:
@ -10225,6 +10243,12 @@ export const defaultAppState = {
controlType: "DROP_DOWN", controlType: "DROP_DOWN",
initialValue: "MANUAL", initialValue: "MANUAL",
options: [ options: [
{
label: "Automatic",
subText:
"Query runs on page load or when a variable it depends on changes",
value: "AUTOMATIC",
},
{ {
label: "On page load", label: "On page load",
subText: subText:

View File

@ -8,6 +8,7 @@ import saasActionSettingsConfig from "constants/AppsmithActionConstants/formConf
import apiActionDependencyConfig from "constants/AppsmithActionConstants/formConfig/ApiDependencyConfigs"; import apiActionDependencyConfig from "constants/AppsmithActionConstants/formConfig/ApiDependencyConfigs";
import apiActionDatasourceFormButtonConfig from "constants/AppsmithActionConstants/formConfig/ApiDatasourceFormsButtonConfig"; import apiActionDatasourceFormButtonConfig from "constants/AppsmithActionConstants/formConfig/ApiDatasourceFormsButtonConfig";
import type { EntityTypeValue } from "ee/entities/DataTree/types"; import type { EntityTypeValue } from "ee/entities/DataTree/types";
import type { ActionSettingsConfig } from "PluginActionEditor/types/PluginActionTypes";
export interface ExecuteActionPayloadEvent { export interface ExecuteActionPayloadEvent {
type: EventType; type: EventType;
@ -166,18 +167,17 @@ export const POSTMAN = "POSTMAN";
export const CURL = "CURL"; export const CURL = "CURL";
export const Swagger = "Swagger"; export const Swagger = "Swagger";
// TODO: Fix this the next time the file is edited export const defaultActionSettings: Record<PluginType, ActionSettingsConfig[]> =
// eslint-disable-next-line @typescript-eslint/no-explicit-any {
export const defaultActionSettings: Record<PluginType, any> = { [PluginType.API]: apiActionSettingsConfig,
[PluginType.API]: apiActionSettingsConfig, [PluginType.DB]: queryActionSettingsConfig,
[PluginType.DB]: queryActionSettingsConfig, [PluginType.SAAS]: saasActionSettingsConfig,
[PluginType.SAAS]: saasActionSettingsConfig, [PluginType.REMOTE]: saasActionSettingsConfig,
[PluginType.REMOTE]: saasActionSettingsConfig, [PluginType.JS]: [],
[PluginType.JS]: [], [PluginType.AI]: saasActionSettingsConfig,
[PluginType.AI]: saasActionSettingsConfig, [PluginType.INTERNAL]: saasActionSettingsConfig,
[PluginType.INTERNAL]: saasActionSettingsConfig, [PluginType.EXTERNAL_SAAS]: saasActionSettingsConfig,
[PluginType.EXTERNAL_SAAS]: saasActionSettingsConfig, };
};
// TODO: Fix this the next time the file is edited // TODO: Fix this the next time the file is edited
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any

View File

@ -7,9 +7,10 @@ import {
HTTP_PROTOCOL_VERSIONS, HTTP_PROTOCOL_VERSIONS,
} from "PluginActionEditor/constants/CommonApiConstants"; } from "PluginActionEditor/constants/CommonApiConstants";
import { import {
RUN_BEHAVIOR,
RUN_BEHAVIOR_VALUES, RUN_BEHAVIOR_VALUES,
} from "PluginActionEditor/types/PluginActionTypes"; RUN_BEHAVIOR_CONFIG_PROPERTY,
} from "constants/AppsmithActionConstants/formConfig/PluginSettings";
import { ActionRunBehaviour } from "PluginActionEditor/types/PluginActionTypes";
export default [ export default [
{ {
@ -18,9 +19,9 @@ export default [
children: [ children: [
{ {
label: "Run behavior", label: "Run behavior",
configProperty: "runBehaviour", configProperty: RUN_BEHAVIOR_CONFIG_PROPERTY,
controlType: "DROP_DOWN", controlType: "DROP_DOWN",
initialValue: RUN_BEHAVIOR.MANUAL.label, initialValue: ActionRunBehaviour.MANUAL,
options: RUN_BEHAVIOR_VALUES, options: RUN_BEHAVIOR_VALUES,
}, },
{ {

View File

@ -1,7 +1,8 @@
import { import {
RUN_BEHAVIOR,
RUN_BEHAVIOR_VALUES, RUN_BEHAVIOR_VALUES,
} from "PluginActionEditor/types/PluginActionTypes"; RUN_BEHAVIOR_CONFIG_PROPERTY,
} from "constants/AppsmithActionConstants/formConfig/PluginSettings";
import { ActionRunBehaviour } from "PluginActionEditor/types/PluginActionTypes";
export default [ export default [
{ {
@ -10,9 +11,9 @@ export default [
children: [ children: [
{ {
label: "Run behavior", label: "Run behavior",
configProperty: "runBehaviour", configProperty: RUN_BEHAVIOR_CONFIG_PROPERTY,
controlType: "DROP_DOWN", controlType: "DROP_DOWN",
initialValue: RUN_BEHAVIOR.MANUAL.label, initialValue: ActionRunBehaviour.MANUAL,
options: RUN_BEHAVIOR_VALUES, options: RUN_BEHAVIOR_VALUES,
}, },
{ {

View File

@ -0,0 +1,24 @@
import { ActionRunBehaviour } from "PluginActionEditor/types/PluginActionTypes";
export const RUN_BEHAVIOR_CONFIG_PROPERTY = "runBehaviour";
export const RUN_BEHAVIOR_VALUES = [
{
label: "Automatic",
subText: "Query runs on page load or when a variable it depends on changes",
value: ActionRunBehaviour.AUTOMATIC,
children: "Automatic",
},
{
label: "On page load",
subText: "Query runs when the page loads or when manually triggered",
value: ActionRunBehaviour.ON_PAGE_LOAD,
children: "On page load",
},
{
label: "Manual",
subText: "Query only runs when called in an event or JS with .run()",
value: ActionRunBehaviour.MANUAL,
children: "Manual",
},
];

View File

@ -1,7 +1,8 @@
import { import {
RUN_BEHAVIOR,
RUN_BEHAVIOR_VALUES, RUN_BEHAVIOR_VALUES,
} from "PluginActionEditor/types/PluginActionTypes"; RUN_BEHAVIOR_CONFIG_PROPERTY,
} from "constants/AppsmithActionConstants/formConfig/PluginSettings";
import { ActionRunBehaviour } from "PluginActionEditor/types/PluginActionTypes";
export default [ export default [
{ {
@ -10,9 +11,9 @@ export default [
children: [ children: [
{ {
label: "Run behavior", label: "Run behavior",
configProperty: "runBehaviour", configProperty: RUN_BEHAVIOR_CONFIG_PROPERTY,
controlType: "DROP_DOWN", controlType: "DROP_DOWN",
initialValue: RUN_BEHAVIOR.MANUAL.label, initialValue: ActionRunBehaviour.MANUAL,
options: RUN_BEHAVIOR_VALUES, options: RUN_BEHAVIOR_VALUES,
}, },
{ {

View File

@ -15,10 +15,13 @@ import {
import AnalyticsUtil from "ee/utils/AnalyticsUtil"; import AnalyticsUtil from "ee/utils/AnalyticsUtil";
import type { OnUpdateSettingsProps } from "../types"; import type { OnUpdateSettingsProps } from "../types";
import { import {
RUN_BEHAVIOR_VALUES, ActionRunBehaviour,
type ActionRunBehaviourType, type ActionRunBehaviourType,
} from "PluginActionEditor/types/PluginActionTypes"; } from "PluginActionEditor/types/PluginActionTypes";
import styled from "styled-components"; import styled from "styled-components";
import { RUN_BEHAVIOR_VALUES } from "constants/AppsmithActionConstants/formConfig/PluginSettings";
import { useFeatureFlag } from "utils/hooks/useFeatureFlag";
import { FEATURE_FLAG } from "ee/entities/FeatureFlag";
const OptionLabel = styled(Text)` const OptionLabel = styled(Text)`
color: var(--ads-v2-color-fg); color: var(--ads-v2-color-fg);
@ -55,7 +58,14 @@ interface FunctionSettingsRowProps extends Omit<Props, "actions"> {
const FunctionSettingRow = (props: FunctionSettingsRowProps) => { const FunctionSettingRow = (props: FunctionSettingsRowProps) => {
const [runBehaviour, setRunBehaviour] = useState(props.action.runBehaviour); const [runBehaviour, setRunBehaviour] = useState(props.action.runBehaviour);
const options = RUN_BEHAVIOR_VALUES as SelectOptionProps[]; const flagValueForReactiveActions = useFeatureFlag(
FEATURE_FLAG.release_reactive_actions_enabled,
);
const options = RUN_BEHAVIOR_VALUES.filter(
(option) =>
flagValueForReactiveActions ||
option.value !== ActionRunBehaviour.AUTOMATIC,
) as SelectOptionProps[];
const selectedValue = options.find((opt) => opt.value === runBehaviour); const selectedValue = options.find((opt) => opt.value === runBehaviour);
const onSelectOptions = useCallback( const onSelectOptions = useCallback(
@ -90,7 +100,6 @@ const FunctionSettingRow = (props: FunctionSettingsRowProps) => {
</FunctionName> </FunctionName>
<StyledSelect <StyledSelect
data-testid={`t--dropdown-runBehaviour`} data-testid={`t--dropdown-runBehaviour`}
defaultValue={selectedValue}
id={props.action.id} id={props.action.id}
isDisabled={props.disabled} isDisabled={props.disabled}
listHeight={240} listHeight={240}

View File

@ -2548,6 +2548,11 @@
"controlType": "DROP_DOWN", "controlType": "DROP_DOWN",
"initialValue": "MANUAL", "initialValue": "MANUAL",
"options": [ "options": [
{
"label": "Automatic",
"subText": "Query runs on page load or when a variable it depends on changes",
"value": "AUTOMATIC"
},
{ {
"label": "On page load", "label": "On page load",
"subText": "Query runs when the page loads or when manually triggered", "subText": "Query runs when the page loads or when manually triggered",
@ -2594,6 +2599,11 @@
"controlType": "DROP_DOWN", "controlType": "DROP_DOWN",
"initialValue": "MANUAL", "initialValue": "MANUAL",
"options": [ "options": [
{
"label": "Automatic",
"subText": "Query runs on page load or when a variable it depends on changes",
"value": "AUTOMATIC"
},
{ {
"label": "On page load", "label": "On page load",
"subText": "Query runs when the page loads or when manually triggered", "subText": "Query runs when the page loads or when manually triggered",
@ -2640,6 +2650,11 @@
"controlType": "DROP_DOWN", "controlType": "DROP_DOWN",
"initialValue": "MANUAL", "initialValue": "MANUAL",
"options": [ "options": [
{
"label": "Automatic",
"subText": "Query runs on page load or when a variable it depends on changes",
"value": "AUTOMATIC"
},
{ {
"label": "On page load", "label": "On page load",
"subText": "Query runs when the page loads or when manually triggered", "subText": "Query runs when the page loads or when manually triggered",
@ -2692,6 +2707,11 @@
"controlType": "DROP_DOWN", "controlType": "DROP_DOWN",
"initialValue": "MANUAL", "initialValue": "MANUAL",
"options": [ "options": [
{
"label": "Automatic",
"subText": "Query runs on page load or when a variable it depends on changes",
"value": "AUTOMATIC"
},
{ {
"label": "On page load", "label": "On page load",
"subText": "Query runs when the page loads or when manually triggered", "subText": "Query runs when the page loads or when manually triggered",
@ -2731,6 +2751,11 @@
"controlType": "DROP_DOWN", "controlType": "DROP_DOWN",
"initialValue": "MANUAL", "initialValue": "MANUAL",
"options": [ "options": [
{
"label": "Automatic",
"subText": "Query runs on page load or when a variable it depends on changes",
"value": "AUTOMATIC"
},
{ {
"label": "On page load", "label": "On page load",
"subText": "Query runs when the page loads or when manually triggered", "subText": "Query runs when the page loads or when manually triggered",
@ -2777,6 +2802,11 @@
"controlType": "DROP_DOWN", "controlType": "DROP_DOWN",
"initialValue": "MANUAL", "initialValue": "MANUAL",
"options": [ "options": [
{
"label": "Automatic",
"subText": "Query runs on page load or when a variable it depends on changes",
"value": "AUTOMATIC"
},
{ {
"label": "On page load", "label": "On page load",
"subText": "Query runs when the page loads or when manually triggered", "subText": "Query runs when the page loads or when manually triggered",
@ -2823,6 +2853,11 @@
"controlType": "DROP_DOWN", "controlType": "DROP_DOWN",
"initialValue": "MANUAL", "initialValue": "MANUAL",
"options": [ "options": [
{
"label": "Automatic",
"subText": "Query runs on page load or when a variable it depends on changes",
"value": "AUTOMATIC"
},
{ {
"label": "On page load", "label": "On page load",
"subText": "Query runs when the page loads or when manually triggered", "subText": "Query runs when the page loads or when manually triggered",

View File

@ -2547,6 +2547,11 @@
"controlType": "DROP_DOWN", "controlType": "DROP_DOWN",
"initialValue": "MANUAL", "initialValue": "MANUAL",
"options": [ "options": [
{
"label": "Automatic",
"subText": "Query runs on page load or when a variable it depends on changes",
"value": "AUTOMATIC"
},
{ {
"label": "On page load", "label": "On page load",
"subText": "Query runs when the page loads or when manually triggered", "subText": "Query runs when the page loads or when manually triggered",
@ -2593,6 +2598,11 @@
"controlType": "DROP_DOWN", "controlType": "DROP_DOWN",
"initialValue": "MANUAL", "initialValue": "MANUAL",
"options": [ "options": [
{
"label": "Automatic",
"subText": "Query runs on page load or when a variable it depends on changes",
"value": "AUTOMATIC"
},
{ {
"label": "On page load", "label": "On page load",
"subText": "Query runs when the page loads or when manually triggered", "subText": "Query runs when the page loads or when manually triggered",
@ -2639,6 +2649,11 @@
"controlType": "DROP_DOWN", "controlType": "DROP_DOWN",
"initialValue": "MANUAL", "initialValue": "MANUAL",
"options": [ "options": [
{
"label": "Automatic",
"subText": "Query runs on page load or when a variable it depends on changes",
"value": "AUTOMATIC"
},
{ {
"label": "On page load", "label": "On page load",
"subText": "Query runs when the page loads or when manually triggered", "subText": "Query runs when the page loads or when manually triggered",
@ -2691,6 +2706,11 @@
"controlType": "DROP_DOWN", "controlType": "DROP_DOWN",
"initialValue": "MANUAL", "initialValue": "MANUAL",
"options": [ "options": [
{
"label": "Automatic",
"subText": "Query runs on page load or when a variable it depends on changes",
"value": "AUTOMATIC"
},
{ {
"label": "On page load", "label": "On page load",
"subText": "Query runs when the page loads or when manually triggered", "subText": "Query runs when the page loads or when manually triggered",
@ -2730,6 +2750,11 @@
"controlType": "DROP_DOWN", "controlType": "DROP_DOWN",
"initialValue": "MANUAL", "initialValue": "MANUAL",
"options": [ "options": [
{
"label": "Automatic",
"subText": "Query runs on page load or when a variable it depends on changes",
"value": "AUTOMATIC"
},
{ {
"label": "On page load", "label": "On page load",
"subText": "Query runs when the page loads or when manually triggered", "subText": "Query runs when the page loads or when manually triggered",
@ -2776,6 +2801,11 @@
"controlType": "DROP_DOWN", "controlType": "DROP_DOWN",
"initialValue": "MANUAL", "initialValue": "MANUAL",
"options": [ "options": [
{
"label": "Automatic",
"subText": "Query runs on page load or when a variable it depends on changes",
"value": "AUTOMATIC"
},
{ {
"label": "On page load", "label": "On page load",
"subText": "Query runs when the page loads or when manually triggered", "subText": "Query runs when the page loads or when manually triggered",
@ -2822,6 +2852,11 @@
"controlType": "DROP_DOWN", "controlType": "DROP_DOWN",
"initialValue": "MANUAL", "initialValue": "MANUAL",
"options": [ "options": [
{
"label": "Automatic",
"subText": "Query runs on page load or when a variable it depends on changes",
"value": "AUTOMATIC"
},
{ {
"label": "On page load", "label": "On page load",
"subText": "Query runs when the page loads or when manually triggered", "subText": "Query runs when the page loads or when manually triggered",

View File

@ -0,0 +1,36 @@
import { RUN_BEHAVIOR_CONFIG_PROPERTY } from "constants/AppsmithActionConstants/formConfig/PluginSettings";
import {
ActionRunBehaviour,
type ActionSettingsConfig,
type ActionSettingsConfigChildren,
} from "PluginActionEditor/types/PluginActionTypes";
export const updateRunBehaviourForActionSettings = (
actionSettings: ActionSettingsConfig[],
flagValueForReactiveActions: boolean,
): ActionSettingsConfig[] => {
return actionSettings.map((settings) => ({
...settings,
children: settings.children.map(
(settings: ActionSettingsConfigChildren) => {
if (
settings.configProperty === RUN_BEHAVIOR_CONFIG_PROPERTY &&
settings.options
) {
return {
...settings,
options: [
...settings.options.filter(
(option) =>
flagValueForReactiveActions ||
option.value !== ActionRunBehaviour.AUTOMATIC,
),
],
};
}
return settings;
},
),
}));
};

View File

@ -6957,6 +6957,11 @@ export default {
controlType: "DROP_DOWN", controlType: "DROP_DOWN",
initialValue: "MANUAL", initialValue: "MANUAL",
options: [ options: [
{
label: "Automatic",
subText: "Query runs on page load or when a variable it depends on changes",
value: "AUTOMATIC"
},
{ {
label: "On page load", label: "On page load",
subText: subText:
@ -7037,6 +7042,11 @@ export default {
controlType: "DROP_DOWN", controlType: "DROP_DOWN",
initialValue: "MANUAL", initialValue: "MANUAL",
options: [ options: [
{
label: "Automatic",
subText: "Query runs on page load or when a variable it depends on changes",
value: "AUTOMATIC"
},
{ {
label: "On page load", label: "On page load",
subText: subText:
@ -7117,6 +7127,11 @@ export default {
controlType: "DROP_DOWN", controlType: "DROP_DOWN",
initialValue: "MANUAL", initialValue: "MANUAL",
options: [ options: [
{
label: "Automatic",
subText: "Query runs on page load or when a variable it depends on changes",
value: "AUTOMATIC"
},
{ {
label: "On page load", label: "On page load",
subText: subText:
@ -7161,6 +7176,11 @@ export default {
controlType: "DROP_DOWN", controlType: "DROP_DOWN",
initialValue: "MANUAL", initialValue: "MANUAL",
options: [ options: [
{
label: "Automatic",
subText: "Query runs on page load or when a variable it depends on changes",
value: "AUTOMATIC"
},
{ {
label: "On page load", label: "On page load",
subText: subText:

View File

@ -10,6 +10,11 @@
"controlType": "DROP_DOWN", "controlType": "DROP_DOWN",
"initialValue": "MANUAL", "initialValue": "MANUAL",
"options": [ "options": [
{
"label": "Automatic",
"subText": "Query runs on page load or when a variable it depends on changes",
"value": "AUTOMATIC"
},
{ {
"label": "On page load", "label": "On page load",
"subText": "Query runs when the page loads or when manually triggered", "subText": "Query runs when the page loads or when manually triggered",

View File

@ -10,6 +10,11 @@
"controlType": "DROP_DOWN", "controlType": "DROP_DOWN",
"initialValue": "MANUAL", "initialValue": "MANUAL",
"options": [ "options": [
{
"label": "Automatic",
"subText": "Query runs on page load or when a variable it depends on changes",
"value": "AUTOMATIC"
},
{ {
"label": "On page load", "label": "On page load",
"subText": "Query runs when the page loads or when manually triggered", "subText": "Query runs when the page loads or when manually triggered",

View File

@ -10,6 +10,11 @@
"controlType": "DROP_DOWN", "controlType": "DROP_DOWN",
"initialValue": "MANUAL", "initialValue": "MANUAL",
"options": [ "options": [
{
"label": "Automatic",
"subText": "Query runs on page load or when a variable it depends on changes",
"value": "AUTOMATIC"
},
{ {
"label": "On page load", "label": "On page load",
"subText": "Query runs when the page loads or when manually triggered", "subText": "Query runs when the page loads or when manually triggered",

View File

@ -10,6 +10,11 @@
"controlType": "DROP_DOWN", "controlType": "DROP_DOWN",
"initialValue": "MANUAL", "initialValue": "MANUAL",
"options": [ "options": [
{
"label": "Automatic",
"subText": "Query runs on page load or when a variable it depends on changes",
"value": "AUTOMATIC"
},
{ {
"label": "On page load", "label": "On page load",
"subText": "Query runs when the page loads or when manually triggered", "subText": "Query runs when the page loads or when manually triggered",

View File

@ -10,6 +10,11 @@
"controlType": "DROP_DOWN", "controlType": "DROP_DOWN",
"initialValue": "MANUAL", "initialValue": "MANUAL",
"options": [ "options": [
{
"label": "Automatic",
"subText": "Query runs on page load or when a variable it depends on changes",
"value": "AUTOMATIC"
},
{ {
"label": "On page load", "label": "On page load",
"subText": "Query runs when the page loads or when manually triggered", "subText": "Query runs when the page loads or when manually triggered",

View File

@ -10,6 +10,11 @@
"controlType": "DROP_DOWN", "controlType": "DROP_DOWN",
"initialValue": "MANUAL", "initialValue": "MANUAL",
"options": [ "options": [
{
"label": "Automatic",
"subText": "Query runs on page load or when a variable it depends on changes",
"value": "AUTOMATIC"
},
{ {
"label": "On page load", "label": "On page load",
"subText": "Query runs when the page loads or when manually triggered", "subText": "Query runs when the page loads or when manually triggered",

View File

@ -10,6 +10,11 @@
"controlType": "DROP_DOWN", "controlType": "DROP_DOWN",
"initialValue": "MANUAL", "initialValue": "MANUAL",
"options": [ "options": [
{
"label": "Automatic",
"subText": "Query runs on page load or when a variable it depends on changes",
"value": "AUTOMATIC"
},
{ {
"label": "On page load", "label": "On page load",
"subText": "Query runs when the page loads or when manually triggered", "subText": "Query runs when the page loads or when manually triggered",

View File

@ -10,6 +10,11 @@
"controlType": "DROP_DOWN", "controlType": "DROP_DOWN",
"initialValue": "MANUAL", "initialValue": "MANUAL",
"options": [ "options": [
{
"label": "Automatic",
"subText": "Query runs on page load or when a variable it depends on changes",
"value": "AUTOMATIC"
},
{ {
"label": "On page load", "label": "On page load",
"subText": "Query runs when the page loads or when manually triggered", "subText": "Query runs when the page loads or when manually triggered",

View File

@ -10,6 +10,11 @@
"controlType": "DROP_DOWN", "controlType": "DROP_DOWN",
"initialValue": "MANUAL", "initialValue": "MANUAL",
"options": [ "options": [
{
"label": "Automatic",
"subText": "Query runs on page load or when a variable it depends on changes",
"value": "AUTOMATIC"
},
{ {
"label": "On page load", "label": "On page load",
"subText": "Query runs when the page loads or when manually triggered", "subText": "Query runs when the page loads or when manually triggered",

View File

@ -10,6 +10,11 @@
"controlType": "DROP_DOWN", "controlType": "DROP_DOWN",
"initialValue": "MANUAL", "initialValue": "MANUAL",
"options": [ "options": [
{
"label": "Automatic",
"subText": "Query runs on page load or when a variable it depends on changes",
"value": "AUTOMATIC"
},
{ {
"label": "On page load", "label": "On page load",
"subText": "Query runs when the page loads or when manually triggered", "subText": "Query runs when the page loads or when manually triggered",

View File

@ -10,6 +10,11 @@
"controlType": "DROP_DOWN", "controlType": "DROP_DOWN",
"initialValue": "MANUAL", "initialValue": "MANUAL",
"options": [ "options": [
{
"label": "Automatic",
"subText": "Query runs on page load or when a variable it depends on changes",
"value": "AUTOMATIC"
},
{ {
"label": "On page load", "label": "On page load",
"subText": "Query runs when the page loads or when manually triggered", "subText": "Query runs when the page loads or when manually triggered",

View File

@ -10,6 +10,11 @@
"controlType": "DROP_DOWN", "controlType": "DROP_DOWN",
"initialValue": "MANUAL", "initialValue": "MANUAL",
"options": [ "options": [
{
"label": "Automatic",
"subText": "Query runs on page load or when a variable it depends on changes",
"value": "AUTOMATIC"
},
{ {
"label": "On page load", "label": "On page load",
"subText": "Query runs when the page loads or when manually triggered", "subText": "Query runs when the page loads or when manually triggered",