chore: added automatic option to run behaviour behind feature flag (#40608)
This commit is contained in:
parent
4f21580471
commit
5ffafd7fce
|
|
@ -8,12 +8,13 @@ import type { Action } from "entities/Action";
|
|||
import type { Plugin } from "entities/Plugin";
|
||||
import type { Datasource, EmbeddedRestDatasource } from "entities/Datasource";
|
||||
import type { ActionResponse } from "api/ActionAPI";
|
||||
import type { ActionSettingsConfig } from "./types/PluginActionTypes";
|
||||
|
||||
interface PluginActionContextType {
|
||||
action: Action;
|
||||
actionResponse?: ActionResponse;
|
||||
editorConfig?: unknown[];
|
||||
settingsConfig?: unknown[];
|
||||
settingsConfig?: ActionSettingsConfig[];
|
||||
plugin: Plugin;
|
||||
datasource?: EmbeddedRestDatasource | Datasource;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import { getPathAndValueFromActionDiffObject } from "utils/getPathAndValueFromAc
|
|||
import { setActionProperty } from "actions/pluginActionActions";
|
||||
import { usePluginActionContext } from "../../../../../PluginActionContext";
|
||||
import { useDispatch } from "react-redux";
|
||||
import type { ActionSettingsConfig } from "PluginActionEditor/types/PluginActionTypes";
|
||||
|
||||
export const useGoogleSheetsSetDefaultProperty = () => {
|
||||
const {
|
||||
|
|
@ -30,7 +31,7 @@ export const useGoogleSheetsSetDefaultProperty = () => {
|
|||
|
||||
merge(
|
||||
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
|
||||
|
|
|
|||
|
|
@ -6,6 +6,10 @@ import type { EditorTheme } from "components/editorComponents/CodeEditor/EditorC
|
|||
import styled from "styled-components";
|
||||
import { Text } from "@appsmith/ads";
|
||||
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 {
|
||||
// TODO: Fix this the next time the file is edited
|
||||
|
|
@ -41,9 +45,21 @@ const ActionSettingsWrapper = styled.div`
|
|||
`;
|
||||
|
||||
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 (
|
||||
<ActionSettingsWrapper>
|
||||
{!props.actionSettingsConfig ? (
|
||||
{!updateSettingsConfig ? (
|
||||
<CenteredWrapper>
|
||||
<Text color="var(--ads-v2-color-fg-error)" kind="heading-m">
|
||||
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 */
|
||||
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
||||
props.actionSettingsConfig.map((section: any) =>
|
||||
updateSettingsConfig.map((section: any) =>
|
||||
renderEachConfig(section, props.formName),
|
||||
)
|
||||
)}
|
||||
|
|
|
|||
|
|
@ -5,23 +5,26 @@ export const THEME = EditorTheme.LIGHT;
|
|||
export enum ActionRunBehaviour {
|
||||
ON_PAGE_LOAD = "ON_PAGE_LOAD",
|
||||
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 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[];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@ export const FEATURE_FLAG = {
|
|||
"license_external_saas_plugins_enabled",
|
||||
release_computation_cache_enabled: "release_computation_cache_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",
|
||||
} as const;
|
||||
|
||||
|
|
@ -107,6 +108,7 @@ export const DEFAULT_FEATURE_FLAG_VALUE: FeatureFlags = {
|
|||
license_external_saas_plugins_enabled: false,
|
||||
release_computation_cache_enabled: false,
|
||||
release_ai_chat_integrations_enabled: false,
|
||||
release_reactive_actions_enabled: false,
|
||||
license_ai_agent_instance_enabled: false,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -10043,6 +10043,12 @@ export const defaultAppState = {
|
|||
controlType: "DROP_DOWN",
|
||||
initialValue: "MANUAL",
|
||||
options: [
|
||||
{
|
||||
label: "Automatic",
|
||||
subText:
|
||||
"Query runs on page load or when a variable it depends on changes",
|
||||
value: "AUTOMATIC",
|
||||
},
|
||||
{
|
||||
label: "On page load",
|
||||
subText:
|
||||
|
|
@ -10094,6 +10100,12 @@ export const defaultAppState = {
|
|||
controlType: "DROP_DOWN",
|
||||
initialValue: "MANUAL",
|
||||
options: [
|
||||
{
|
||||
label: "Automatic",
|
||||
subText:
|
||||
"Query runs on page load or when a variable it depends on changes",
|
||||
value: "AUTOMATIC",
|
||||
},
|
||||
{
|
||||
label: "On page load",
|
||||
subText:
|
||||
|
|
@ -10145,6 +10157,12 @@ export const defaultAppState = {
|
|||
controlType: "DROP_DOWN",
|
||||
initialValue: "MANUAL",
|
||||
options: [
|
||||
{
|
||||
label: "Automatic",
|
||||
subText:
|
||||
"Query runs on page load or when a variable it depends on changes",
|
||||
value: "AUTOMATIC",
|
||||
},
|
||||
{
|
||||
label: "On page load",
|
||||
subText:
|
||||
|
|
@ -10225,6 +10243,12 @@ export const defaultAppState = {
|
|||
controlType: "DROP_DOWN",
|
||||
initialValue: "MANUAL",
|
||||
options: [
|
||||
{
|
||||
label: "Automatic",
|
||||
subText:
|
||||
"Query runs on page load or when a variable it depends on changes",
|
||||
value: "AUTOMATIC",
|
||||
},
|
||||
{
|
||||
label: "On page load",
|
||||
subText:
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import saasActionSettingsConfig from "constants/AppsmithActionConstants/formConf
|
|||
import apiActionDependencyConfig from "constants/AppsmithActionConstants/formConfig/ApiDependencyConfigs";
|
||||
import apiActionDatasourceFormButtonConfig from "constants/AppsmithActionConstants/formConfig/ApiDatasourceFormsButtonConfig";
|
||||
import type { EntityTypeValue } from "ee/entities/DataTree/types";
|
||||
import type { ActionSettingsConfig } from "PluginActionEditor/types/PluginActionTypes";
|
||||
|
||||
export interface ExecuteActionPayloadEvent {
|
||||
type: EventType;
|
||||
|
|
@ -166,18 +167,17 @@ export const POSTMAN = "POSTMAN";
|
|||
export const CURL = "CURL";
|
||||
export const Swagger = "Swagger";
|
||||
|
||||
// TODO: Fix this the next time the file is edited
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export const defaultActionSettings: Record<PluginType, any> = {
|
||||
[PluginType.API]: apiActionSettingsConfig,
|
||||
[PluginType.DB]: queryActionSettingsConfig,
|
||||
[PluginType.SAAS]: saasActionSettingsConfig,
|
||||
[PluginType.REMOTE]: saasActionSettingsConfig,
|
||||
[PluginType.JS]: [],
|
||||
[PluginType.AI]: saasActionSettingsConfig,
|
||||
[PluginType.INTERNAL]: saasActionSettingsConfig,
|
||||
[PluginType.EXTERNAL_SAAS]: saasActionSettingsConfig,
|
||||
};
|
||||
export const defaultActionSettings: Record<PluginType, ActionSettingsConfig[]> =
|
||||
{
|
||||
[PluginType.API]: apiActionSettingsConfig,
|
||||
[PluginType.DB]: queryActionSettingsConfig,
|
||||
[PluginType.SAAS]: saasActionSettingsConfig,
|
||||
[PluginType.REMOTE]: saasActionSettingsConfig,
|
||||
[PluginType.JS]: [],
|
||||
[PluginType.AI]: saasActionSettingsConfig,
|
||||
[PluginType.INTERNAL]: saasActionSettingsConfig,
|
||||
[PluginType.EXTERNAL_SAAS]: saasActionSettingsConfig,
|
||||
};
|
||||
|
||||
// TODO: Fix this the next time the file is edited
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
|
|
|
|||
|
|
@ -7,9 +7,10 @@ import {
|
|||
HTTP_PROTOCOL_VERSIONS,
|
||||
} from "PluginActionEditor/constants/CommonApiConstants";
|
||||
import {
|
||||
RUN_BEHAVIOR,
|
||||
RUN_BEHAVIOR_VALUES,
|
||||
} from "PluginActionEditor/types/PluginActionTypes";
|
||||
RUN_BEHAVIOR_CONFIG_PROPERTY,
|
||||
} from "constants/AppsmithActionConstants/formConfig/PluginSettings";
|
||||
import { ActionRunBehaviour } from "PluginActionEditor/types/PluginActionTypes";
|
||||
|
||||
export default [
|
||||
{
|
||||
|
|
@ -18,9 +19,9 @@ export default [
|
|||
children: [
|
||||
{
|
||||
label: "Run behavior",
|
||||
configProperty: "runBehaviour",
|
||||
configProperty: RUN_BEHAVIOR_CONFIG_PROPERTY,
|
||||
controlType: "DROP_DOWN",
|
||||
initialValue: RUN_BEHAVIOR.MANUAL.label,
|
||||
initialValue: ActionRunBehaviour.MANUAL,
|
||||
options: RUN_BEHAVIOR_VALUES,
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
import {
|
||||
RUN_BEHAVIOR,
|
||||
RUN_BEHAVIOR_VALUES,
|
||||
} from "PluginActionEditor/types/PluginActionTypes";
|
||||
RUN_BEHAVIOR_CONFIG_PROPERTY,
|
||||
} from "constants/AppsmithActionConstants/formConfig/PluginSettings";
|
||||
import { ActionRunBehaviour } from "PluginActionEditor/types/PluginActionTypes";
|
||||
|
||||
export default [
|
||||
{
|
||||
|
|
@ -10,9 +11,9 @@ export default [
|
|||
children: [
|
||||
{
|
||||
label: "Run behavior",
|
||||
configProperty: "runBehaviour",
|
||||
configProperty: RUN_BEHAVIOR_CONFIG_PROPERTY,
|
||||
controlType: "DROP_DOWN",
|
||||
initialValue: RUN_BEHAVIOR.MANUAL.label,
|
||||
initialValue: ActionRunBehaviour.MANUAL,
|
||||
options: RUN_BEHAVIOR_VALUES,
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
},
|
||||
];
|
||||
|
|
@ -1,7 +1,8 @@
|
|||
import {
|
||||
RUN_BEHAVIOR,
|
||||
RUN_BEHAVIOR_VALUES,
|
||||
} from "PluginActionEditor/types/PluginActionTypes";
|
||||
RUN_BEHAVIOR_CONFIG_PROPERTY,
|
||||
} from "constants/AppsmithActionConstants/formConfig/PluginSettings";
|
||||
import { ActionRunBehaviour } from "PluginActionEditor/types/PluginActionTypes";
|
||||
|
||||
export default [
|
||||
{
|
||||
|
|
@ -10,9 +11,9 @@ export default [
|
|||
children: [
|
||||
{
|
||||
label: "Run behavior",
|
||||
configProperty: "runBehaviour",
|
||||
configProperty: RUN_BEHAVIOR_CONFIG_PROPERTY,
|
||||
controlType: "DROP_DOWN",
|
||||
initialValue: RUN_BEHAVIOR.MANUAL.label,
|
||||
initialValue: ActionRunBehaviour.MANUAL,
|
||||
options: RUN_BEHAVIOR_VALUES,
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -15,10 +15,13 @@ import {
|
|||
import AnalyticsUtil from "ee/utils/AnalyticsUtil";
|
||||
import type { OnUpdateSettingsProps } from "../types";
|
||||
import {
|
||||
RUN_BEHAVIOR_VALUES,
|
||||
ActionRunBehaviour,
|
||||
type ActionRunBehaviourType,
|
||||
} from "PluginActionEditor/types/PluginActionTypes";
|
||||
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)`
|
||||
color: var(--ads-v2-color-fg);
|
||||
|
|
@ -55,7 +58,14 @@ interface FunctionSettingsRowProps extends Omit<Props, "actions"> {
|
|||
|
||||
const FunctionSettingRow = (props: FunctionSettingsRowProps) => {
|
||||
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 onSelectOptions = useCallback(
|
||||
|
|
@ -90,7 +100,6 @@ const FunctionSettingRow = (props: FunctionSettingsRowProps) => {
|
|||
</FunctionName>
|
||||
<StyledSelect
|
||||
data-testid={`t--dropdown-runBehaviour`}
|
||||
defaultValue={selectedValue}
|
||||
id={props.action.id}
|
||||
isDisabled={props.disabled}
|
||||
listHeight={240}
|
||||
|
|
|
|||
|
|
@ -2548,6 +2548,11 @@
|
|||
"controlType": "DROP_DOWN",
|
||||
"initialValue": "MANUAL",
|
||||
"options": [
|
||||
{
|
||||
"label": "Automatic",
|
||||
"subText": "Query runs on page load or when a variable it depends on changes",
|
||||
"value": "AUTOMATIC"
|
||||
},
|
||||
{
|
||||
"label": "On page load",
|
||||
"subText": "Query runs when the page loads or when manually triggered",
|
||||
|
|
@ -2594,6 +2599,11 @@
|
|||
"controlType": "DROP_DOWN",
|
||||
"initialValue": "MANUAL",
|
||||
"options": [
|
||||
{
|
||||
"label": "Automatic",
|
||||
"subText": "Query runs on page load or when a variable it depends on changes",
|
||||
"value": "AUTOMATIC"
|
||||
},
|
||||
{
|
||||
"label": "On page load",
|
||||
"subText": "Query runs when the page loads or when manually triggered",
|
||||
|
|
@ -2640,6 +2650,11 @@
|
|||
"controlType": "DROP_DOWN",
|
||||
"initialValue": "MANUAL",
|
||||
"options": [
|
||||
{
|
||||
"label": "Automatic",
|
||||
"subText": "Query runs on page load or when a variable it depends on changes",
|
||||
"value": "AUTOMATIC"
|
||||
},
|
||||
{
|
||||
"label": "On page load",
|
||||
"subText": "Query runs when the page loads or when manually triggered",
|
||||
|
|
@ -2692,6 +2707,11 @@
|
|||
"controlType": "DROP_DOWN",
|
||||
"initialValue": "MANUAL",
|
||||
"options": [
|
||||
{
|
||||
"label": "Automatic",
|
||||
"subText": "Query runs on page load or when a variable it depends on changes",
|
||||
"value": "AUTOMATIC"
|
||||
},
|
||||
{
|
||||
"label": "On page load",
|
||||
"subText": "Query runs when the page loads or when manually triggered",
|
||||
|
|
@ -2731,6 +2751,11 @@
|
|||
"controlType": "DROP_DOWN",
|
||||
"initialValue": "MANUAL",
|
||||
"options": [
|
||||
{
|
||||
"label": "Automatic",
|
||||
"subText": "Query runs on page load or when a variable it depends on changes",
|
||||
"value": "AUTOMATIC"
|
||||
},
|
||||
{
|
||||
"label": "On page load",
|
||||
"subText": "Query runs when the page loads or when manually triggered",
|
||||
|
|
@ -2777,6 +2802,11 @@
|
|||
"controlType": "DROP_DOWN",
|
||||
"initialValue": "MANUAL",
|
||||
"options": [
|
||||
{
|
||||
"label": "Automatic",
|
||||
"subText": "Query runs on page load or when a variable it depends on changes",
|
||||
"value": "AUTOMATIC"
|
||||
},
|
||||
{
|
||||
"label": "On page load",
|
||||
"subText": "Query runs when the page loads or when manually triggered",
|
||||
|
|
@ -2823,6 +2853,11 @@
|
|||
"controlType": "DROP_DOWN",
|
||||
"initialValue": "MANUAL",
|
||||
"options": [
|
||||
{
|
||||
"label": "Automatic",
|
||||
"subText": "Query runs on page load or when a variable it depends on changes",
|
||||
"value": "AUTOMATIC"
|
||||
},
|
||||
{
|
||||
"label": "On page load",
|
||||
"subText": "Query runs when the page loads or when manually triggered",
|
||||
|
|
|
|||
|
|
@ -2547,6 +2547,11 @@
|
|||
"controlType": "DROP_DOWN",
|
||||
"initialValue": "MANUAL",
|
||||
"options": [
|
||||
{
|
||||
"label": "Automatic",
|
||||
"subText": "Query runs on page load or when a variable it depends on changes",
|
||||
"value": "AUTOMATIC"
|
||||
},
|
||||
{
|
||||
"label": "On page load",
|
||||
"subText": "Query runs when the page loads or when manually triggered",
|
||||
|
|
@ -2593,6 +2598,11 @@
|
|||
"controlType": "DROP_DOWN",
|
||||
"initialValue": "MANUAL",
|
||||
"options": [
|
||||
{
|
||||
"label": "Automatic",
|
||||
"subText": "Query runs on page load or when a variable it depends on changes",
|
||||
"value": "AUTOMATIC"
|
||||
},
|
||||
{
|
||||
"label": "On page load",
|
||||
"subText": "Query runs when the page loads or when manually triggered",
|
||||
|
|
@ -2639,6 +2649,11 @@
|
|||
"controlType": "DROP_DOWN",
|
||||
"initialValue": "MANUAL",
|
||||
"options": [
|
||||
{
|
||||
"label": "Automatic",
|
||||
"subText": "Query runs on page load or when a variable it depends on changes",
|
||||
"value": "AUTOMATIC"
|
||||
},
|
||||
{
|
||||
"label": "On page load",
|
||||
"subText": "Query runs when the page loads or when manually triggered",
|
||||
|
|
@ -2691,6 +2706,11 @@
|
|||
"controlType": "DROP_DOWN",
|
||||
"initialValue": "MANUAL",
|
||||
"options": [
|
||||
{
|
||||
"label": "Automatic",
|
||||
"subText": "Query runs on page load or when a variable it depends on changes",
|
||||
"value": "AUTOMATIC"
|
||||
},
|
||||
{
|
||||
"label": "On page load",
|
||||
"subText": "Query runs when the page loads or when manually triggered",
|
||||
|
|
@ -2730,6 +2750,11 @@
|
|||
"controlType": "DROP_DOWN",
|
||||
"initialValue": "MANUAL",
|
||||
"options": [
|
||||
{
|
||||
"label": "Automatic",
|
||||
"subText": "Query runs on page load or when a variable it depends on changes",
|
||||
"value": "AUTOMATIC"
|
||||
},
|
||||
{
|
||||
"label": "On page load",
|
||||
"subText": "Query runs when the page loads or when manually triggered",
|
||||
|
|
@ -2776,6 +2801,11 @@
|
|||
"controlType": "DROP_DOWN",
|
||||
"initialValue": "MANUAL",
|
||||
"options": [
|
||||
{
|
||||
"label": "Automatic",
|
||||
"subText": "Query runs on page load or when a variable it depends on changes",
|
||||
"value": "AUTOMATIC"
|
||||
},
|
||||
{
|
||||
"label": "On page load",
|
||||
"subText": "Query runs when the page loads or when manually triggered",
|
||||
|
|
@ -2822,6 +2852,11 @@
|
|||
"controlType": "DROP_DOWN",
|
||||
"initialValue": "MANUAL",
|
||||
"options": [
|
||||
{
|
||||
"label": "Automatic",
|
||||
"subText": "Query runs on page load or when a variable it depends on changes",
|
||||
"value": "AUTOMATIC"
|
||||
},
|
||||
{
|
||||
"label": "On page load",
|
||||
"subText": "Query runs when the page loads or when manually triggered",
|
||||
|
|
|
|||
36
app/client/src/utils/PluginUtils.ts
Normal file
36
app/client/src/utils/PluginUtils.ts
Normal 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;
|
||||
},
|
||||
),
|
||||
}));
|
||||
};
|
||||
|
|
@ -6957,6 +6957,11 @@ export default {
|
|||
controlType: "DROP_DOWN",
|
||||
initialValue: "MANUAL",
|
||||
options: [
|
||||
{
|
||||
label: "Automatic",
|
||||
subText: "Query runs on page load or when a variable it depends on changes",
|
||||
value: "AUTOMATIC"
|
||||
},
|
||||
{
|
||||
label: "On page load",
|
||||
subText:
|
||||
|
|
@ -7037,6 +7042,11 @@ export default {
|
|||
controlType: "DROP_DOWN",
|
||||
initialValue: "MANUAL",
|
||||
options: [
|
||||
{
|
||||
label: "Automatic",
|
||||
subText: "Query runs on page load or when a variable it depends on changes",
|
||||
value: "AUTOMATIC"
|
||||
},
|
||||
{
|
||||
label: "On page load",
|
||||
subText:
|
||||
|
|
@ -7117,6 +7127,11 @@ export default {
|
|||
controlType: "DROP_DOWN",
|
||||
initialValue: "MANUAL",
|
||||
options: [
|
||||
{
|
||||
label: "Automatic",
|
||||
subText: "Query runs on page load or when a variable it depends on changes",
|
||||
value: "AUTOMATIC"
|
||||
},
|
||||
{
|
||||
label: "On page load",
|
||||
subText:
|
||||
|
|
@ -7161,6 +7176,11 @@ export default {
|
|||
controlType: "DROP_DOWN",
|
||||
initialValue: "MANUAL",
|
||||
options: [
|
||||
{
|
||||
label: "Automatic",
|
||||
subText: "Query runs on page load or when a variable it depends on changes",
|
||||
value: "AUTOMATIC"
|
||||
},
|
||||
{
|
||||
label: "On page load",
|
||||
subText:
|
||||
|
|
|
|||
|
|
@ -10,6 +10,11 @@
|
|||
"controlType": "DROP_DOWN",
|
||||
"initialValue": "MANUAL",
|
||||
"options": [
|
||||
{
|
||||
"label": "Automatic",
|
||||
"subText": "Query runs on page load or when a variable it depends on changes",
|
||||
"value": "AUTOMATIC"
|
||||
},
|
||||
{
|
||||
"label": "On page load",
|
||||
"subText": "Query runs when the page loads or when manually triggered",
|
||||
|
|
|
|||
|
|
@ -10,6 +10,11 @@
|
|||
"controlType": "DROP_DOWN",
|
||||
"initialValue": "MANUAL",
|
||||
"options": [
|
||||
{
|
||||
"label": "Automatic",
|
||||
"subText": "Query runs on page load or when a variable it depends on changes",
|
||||
"value": "AUTOMATIC"
|
||||
},
|
||||
{
|
||||
"label": "On page load",
|
||||
"subText": "Query runs when the page loads or when manually triggered",
|
||||
|
|
|
|||
|
|
@ -10,6 +10,11 @@
|
|||
"controlType": "DROP_DOWN",
|
||||
"initialValue": "MANUAL",
|
||||
"options": [
|
||||
{
|
||||
"label": "Automatic",
|
||||
"subText": "Query runs on page load or when a variable it depends on changes",
|
||||
"value": "AUTOMATIC"
|
||||
},
|
||||
{
|
||||
"label": "On page load",
|
||||
"subText": "Query runs when the page loads or when manually triggered",
|
||||
|
|
|
|||
|
|
@ -10,6 +10,11 @@
|
|||
"controlType": "DROP_DOWN",
|
||||
"initialValue": "MANUAL",
|
||||
"options": [
|
||||
{
|
||||
"label": "Automatic",
|
||||
"subText": "Query runs on page load or when a variable it depends on changes",
|
||||
"value": "AUTOMATIC"
|
||||
},
|
||||
{
|
||||
"label": "On page load",
|
||||
"subText": "Query runs when the page loads or when manually triggered",
|
||||
|
|
|
|||
|
|
@ -10,6 +10,11 @@
|
|||
"controlType": "DROP_DOWN",
|
||||
"initialValue": "MANUAL",
|
||||
"options": [
|
||||
{
|
||||
"label": "Automatic",
|
||||
"subText": "Query runs on page load or when a variable it depends on changes",
|
||||
"value": "AUTOMATIC"
|
||||
},
|
||||
{
|
||||
"label": "On page load",
|
||||
"subText": "Query runs when the page loads or when manually triggered",
|
||||
|
|
|
|||
|
|
@ -10,6 +10,11 @@
|
|||
"controlType": "DROP_DOWN",
|
||||
"initialValue": "MANUAL",
|
||||
"options": [
|
||||
{
|
||||
"label": "Automatic",
|
||||
"subText": "Query runs on page load or when a variable it depends on changes",
|
||||
"value": "AUTOMATIC"
|
||||
},
|
||||
{
|
||||
"label": "On page load",
|
||||
"subText": "Query runs when the page loads or when manually triggered",
|
||||
|
|
|
|||
|
|
@ -10,6 +10,11 @@
|
|||
"controlType": "DROP_DOWN",
|
||||
"initialValue": "MANUAL",
|
||||
"options": [
|
||||
{
|
||||
"label": "Automatic",
|
||||
"subText": "Query runs on page load or when a variable it depends on changes",
|
||||
"value": "AUTOMATIC"
|
||||
},
|
||||
{
|
||||
"label": "On page load",
|
||||
"subText": "Query runs when the page loads or when manually triggered",
|
||||
|
|
|
|||
|
|
@ -10,6 +10,11 @@
|
|||
"controlType": "DROP_DOWN",
|
||||
"initialValue": "MANUAL",
|
||||
"options": [
|
||||
{
|
||||
"label": "Automatic",
|
||||
"subText": "Query runs on page load or when a variable it depends on changes",
|
||||
"value": "AUTOMATIC"
|
||||
},
|
||||
{
|
||||
"label": "On page load",
|
||||
"subText": "Query runs when the page loads or when manually triggered",
|
||||
|
|
|
|||
|
|
@ -10,6 +10,11 @@
|
|||
"controlType": "DROP_DOWN",
|
||||
"initialValue": "MANUAL",
|
||||
"options": [
|
||||
{
|
||||
"label": "Automatic",
|
||||
"subText": "Query runs on page load or when a variable it depends on changes",
|
||||
"value": "AUTOMATIC"
|
||||
},
|
||||
{
|
||||
"label": "On page load",
|
||||
"subText": "Query runs when the page loads or when manually triggered",
|
||||
|
|
|
|||
|
|
@ -10,6 +10,11 @@
|
|||
"controlType": "DROP_DOWN",
|
||||
"initialValue": "MANUAL",
|
||||
"options": [
|
||||
{
|
||||
"label": "Automatic",
|
||||
"subText": "Query runs on page load or when a variable it depends on changes",
|
||||
"value": "AUTOMATIC"
|
||||
},
|
||||
{
|
||||
"label": "On page load",
|
||||
"subText": "Query runs when the page loads or when manually triggered",
|
||||
|
|
|
|||
|
|
@ -10,6 +10,11 @@
|
|||
"controlType": "DROP_DOWN",
|
||||
"initialValue": "MANUAL",
|
||||
"options": [
|
||||
{
|
||||
"label": "Automatic",
|
||||
"subText": "Query runs on page load or when a variable it depends on changes",
|
||||
"value": "AUTOMATIC"
|
||||
},
|
||||
{
|
||||
"label": "On page load",
|
||||
"subText": "Query runs when the page loads or when manually triggered",
|
||||
|
|
|
|||
|
|
@ -10,6 +10,11 @@
|
|||
"controlType": "DROP_DOWN",
|
||||
"initialValue": "MANUAL",
|
||||
"options": [
|
||||
{
|
||||
"label": "Automatic",
|
||||
"subText": "Query runs on page load or when a variable it depends on changes",
|
||||
"value": "AUTOMATIC"
|
||||
},
|
||||
{
|
||||
"label": "On page load",
|
||||
"subText": "Query runs when the page loads or when manually triggered",
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user