8000 fix: Cyclic dependencies for reactive queries run behavior changes by ankitakinger · Pull Request #40481 · appsmithorg/appsmith · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: Cyclic dependencies for reactive queries run behavior changes #40481

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
isPluginActionSettingsOpen,
openPluginActionSettings,
} from "../../store";
import { THEME } from "../../constants/PluginActionConstants";
import { THEME } from "../../types/PluginActionTypes";
import { type DocsLink, openDoc } from "constants/DocumentationLinks";
import { ToolbarSettingsPopover } from "IDE";

Expand Down
2 changes: 1 addition & 1 deletion app/client/src/actions/pluginActionActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import type { EventLocation } from "ee/utils/analyticsUtilTypes";
import type { GenerateDestinationIdInfoReturnType } from "ee/sagas/helpers";
import type { Span } from "instrumentation/types";
import type { EvaluationReduxAction } from "./EvaluationReduxActionTypes";
import type { ActionRunBehaviourType } from "PluginActionEditor/constants/PluginActionConstants";
import type { ActionRunBehaviourType } from "PluginActionEditor/types/PluginActionTypes";

export const createActionRequest = (
payload: Partial<Action>,
Expand Down
2 changes: 1 addition & 1 deletion app/client/src/api/ActionAPI.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import type { APIRequest } from "constants/AppsmithActionConstants/ActionConstan
import type { WidgetType } from "constants/WidgetConstants";
import type { ActionParentEntityTypeInterface } from "ee/entities/Engine/actionHelpers";
import type { PostActionRunConfig } from "./types";
import type { ActionRunBehaviourType } from "PluginActionEditor/constants/PluginActionConstants";
import type { ActionRunBehaviourType } from "PluginActionEditor/types/PluginActionTypes";

export interface Property {
key: string;
Expand Down
2 changes: 1 addition & 1 deletion app/client/src/api/PageApi.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type {
import type { DSLWidget } from "WidgetProvider/constants";
import type { FetchApplicationResponse } from "ee/api/ApplicationApi";
import type { APP_MODE } from "entities/App";
import type { ActionRunBehaviourType } from "PluginActionEditor/constants/PluginActionConstants";
import type { ActionRunBehaviourType } from "PluginActionEditor/types/PluginActionTypes";

export interface FetchPageRequest {
pageId: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type {
FieldEntityInformation,
TEditorModes,
} from "components/editorComponents/CodeEditor/EditorConfig";
import type { EntityNavigationData } from "selectors/navigationSelectors";
import type { EntityNavigationData } from "entities/DataTree/dataTreeTypes";
import React from "react";
import type CodeMirror from "codemirror";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import type {
UpdateActionPropertyActionPayload,
} from "actions/pluginActionActions";
import { klona } from "klona";
import type { ActionRunBehaviourType } from "PluginActionEditor/constants/PluginActionConstants";
import type { ActionRunBehaviourType } from "PluginActionEditor/types/PluginActionTypes";

export interface ActionData {
isLoading: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
import { set, keyBy, findIndex, unset } from "lodash";
import { create } from "mutative";
import { klona } from "klona";
import type { ActionRunBehaviourType } from "PluginActionEditor/constants/PluginActionConstants";
import type { ActionRunBehaviourType } from "PluginActionEditor/types/PluginActionTypes";

export const initialState: JSCollectionDataState = [];

Expand Down
2 changes: 1 addition & 1 deletion app/client/src/ce/utils/moduleInstanceNavigationData.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ModuleInstance } from "ee/constants/ModuleInstanceConstants";
import type { EntityNavigationData } from "selectors/navigationSelectors";
import type { EntityNavigationData } from "entities/DataTree/dataTreeTypes";

export const getModuleInstanceNavigationData = (
/* eslint-disable @typescript-eslint/no-unused-vars */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import type CodeMirror from "codemirror";
import type { EntityTypeValue } from "ee/entities/DataTree/types";
import type { DataTree } from "entities/DataTree/dataTreeTypes";
import type {
DataTree,
EntityNavigationData,
} from "entities/DataTree/dataTreeTypes";
import type { AutocompleteDataType } from "utils/autocomplete/AutocompleteDataType";
import type { EntityNavigationData } from "selectors/navigationSelectors";
import type { ExpectedValueExample } from "utils/validation/common";

import { editorSQLModes } from "./sql/config";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type {
EntityNavigationData,
NavigationData,
} from "selectors/navigationSelectors";
} from "entities/DataTree/dataTreeTypes";
import type { MarkHelper } from "../EditorConfig";

export const NAVIGATE_TO_ATTRIBUTE = "data-navigate-to";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import type { FeatureFlags } from "ee/entities/FeatureFlag";
import type {
EntityNavigationData,
NavigationData,
} from "selectors/navigationSelectors";
} from "entities/DataTree/dataTreeTypes";
import { getAIContext } from "ee/components/editorComponents/GPT/trigger";
import type { Plugin } from "entities/Plugin";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { APPSMITH_AI } from "ee/components/editorComponents/GPT/trigger";
import { DatasourceCreateEntryPoints } from "constants/Datasource";
import AnalyticsUtil from "ee/utils/AnalyticsUtil";
import BetaCard from "../BetaCard";
import type { NavigationData } from "selectors/navigationSelectors";
import type { NavigationData } from "entities/DataTree/dataTreeTypes";
import type { AIEditorContext } from "ee/components/editorComponents/GPT";
import type { EntityTypeValue } from "ee/entities/DataTree/types";
import history, { NavigationMethod } from "utils/history";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ import { updateCustomDef } from "utils/autocomplete/customDefUtils";
import { shouldFocusOnPropertyControl } from "utils/editorContextUtils";
import { getEntityLintErrors } from "selectors/lintingSelectors";
import { getCodeCommentKeyMap, handleCodeComment } from "./utils/codeComment";
import type { EntityNavigationData } from "selectors/navigationSelectors";
import type { EntityNavigationData } from "entities/DataTree/dataTreeTypes";
import { getEntitiesForNavigation } from "selectors/navigationSelectors";
import history, { NavigationMethod } from "utils/history";
import { CursorPositionOrigin } from "ee/reducers/uiReducers/editorContextReducer";
Expand Down
2 changes: 1 addition & 1 deletion app/client/src/components/editorComponents/utils.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getJSResponseViewState, JSResponseState } from "./utils";
import { ActionRunBehaviour } from "PluginActionEditor/constants/PluginActionConstants";
import { ActionRunBehaviour } from "PluginActionEditor/types/PluginActionTypes";

const TEST_JS_FUNCTION_ID = "627ccff468e1fa5185b7f901";
const TEST_JS_FUNCTION_BASE_ID = "627ccff468e1fa5185b7f912";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
import {
RUN_BEHAVIOR,
RUN_BEHAVIOR_VALUES,
} from "PluginActionEditor/constants/PluginActionConstants";
} from "PluginActionEditor/types/PluginActionTypes";

export default [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
RUN_BEHAVIOR,
RUN_BEHAVIOR_VALUES,
} from "PluginActionEditor/constants/PluginActionConstants";
} from "PluginActionEditor/types/PluginActionTypes";

export default [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
RUN_BEHAVIOR,
RUN_BEHAVIOR_VALUES,
} from "PluginActionEditor/constants/PluginActionConstants";
} from "PluginActionEditor/types/PluginActionTypes";

export default [
{
Expand Down
2 changes: 1 addition & 1 deletion app/client/src/entities/Action/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
type Plugin,
type PluginName,
} from "../Plugin";
import type { ActionRunBehaviourType } from "PluginActionEditor/constants/PluginActionConstants";
import type { ActionRunBehaviourType } from "PluginActionEditor/types/PluginActionTypes";

export enum PaginationType {
NONE = "NONE",
Expand Down
21 changes: 21 additions & 0 deletions app/client/src/entities/DataTree/dataTreeTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type {
DataTreeEntityObject,
UnEvalTreeEntityObject,
AppsmithEntity,
EntityTypeValue,
} from "ee/entities/DataTree/types";

export interface unEvalAndConfigTree {
Expand All @@ -23,3 +24,23 @@ export type UnEvalTreeEntity = UnEvalTreeEntityObject | AppsmithEntity;
export interface UnEvalTree {
[entityName: string]: UnEvalTreeEntity;
}

export interface NavigationData {
name: string;
id: string;
type: EntityTypeValue;
isfunction?: boolean;
url: string | undefined;
navigable: boolean;
children: EntityNavigationData;
key?: string;
pluginName?: string;
pluginId?: string;
isMock?: boolean;
datasourceId?: string;
actionType?: string;
widgetType?: string;
value?: boolean | string;
}

export type EntityNavigationData = Record<string, NavigationData>;
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import "@testing-library/jest-dom";
import { render, screen } from "test/testUtils";
import { JSFunctionSettings } from "./JSFunctionSettings";
import { JSObjectFactory } from "test/factories/Actions/JSObject";
import { ActionRunBehaviour } from "PluginActionEditor/constants/PluginActionConstants";
import { ActionRunBehaviour } from "PluginActionEditor/types/PluginActionTypes";

const JSObject = JSObjectFactory.build();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ import {
} from "ee/constants/messages";
import AnalyticsUtil from "ee/utils/AnalyticsUtil";
import type { OnUpdateSettingsProps } from "../types";
import type { ActionRunBehaviour } from "PluginActionEditor/constants/PluginActionConstants";
import { RUN_BEHAVIOR_VALUES } from "PluginActionEditor/constants/PluginActionConstants";
import {
RUN_BEHAVIOR_VALUES,
type ActionRunBehaviourType,
} from "PluginActionEditor/types/PluginActionTypes";
import styled from "styled-components";

const OptionLabel = styled(Text)`
Expand Down Expand Up @@ -49,7 +51,7 @@ const FunctionSettingRow = (props: FunctionSettingsRowProps) => {
const selectedValue = options.find((opt) => opt.value === runBehavior);

const >
(newRunBehavior: ActionRunBehaviour) => {
(newRunBehavior: ActionRunBehaviourType) => {
setRunBehavior(newRunBehavior);
props.onUpdateSettings?.({
value: newRunBehavior,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { JSAction } from "entities/JSCollection";
import type { DropdownOption } from "@appsmith/ads-old";
import type { ActionRunBehaviourType } from "PluginActionEditor/constants/PluginActionConstants";
import type { ActionRunBehaviourType } from "PluginActionEditor/types/PluginActionTypes";

export interface OnUpdateSettingsProps {
value: ActionRunBehaviourType;
Expand Down
2 changes: 1 addition & 1 deletion app/client/src/pages/Editor/JSEditor/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
getJSActionOption,
} from "./JSEditorToolbar/utils";
import { NO_FUNCTION_DROPDOWN_OPTION } from "./JSEditorToolbar/constants";
import { ActionRunBehaviour } from "PluginActionEditor/constants/PluginActionConstants";
import { ActionRunBehaviour } from "PluginActionEditor/types/PluginActionTypes";

const BASE_JS_OBJECT_BODY = `export default {
myVar1: [],
Expand Down
2 changes: 1 addition & 1 deletion app/client/src/sagas/ActionExecution/PluginActionSaga.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ import {
selectGitOpsModalOpen,
} from "selectors/gitModSelectors";
import { createActionExecutionResponse } from "./PluginActionSagaUtils";
import { ActionRunBehaviour } from "PluginActionEditor/constants/PluginActionConstants";
import { ActionRunBehaviour } from "PluginActionEditor/types/PluginActionTypes";
import { appsmithTelemetry } from "instrumentation";

interface FilePickerInstumentationObject {
Expand Down
2 changes: 1 addition & 1 deletion app/client/src/sagas/ActionSagas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ import {
import { handleQueryEntityRedirect } from "./IDESaga";
import type { EvaluationReduxAction } from "actions/EvaluationReduxActionTypes";
import { IDE_TYPE } from "ee/IDE/Interfaces/IDETypes";
import type { ActionRunBehaviourType } from "PluginActionEditor/constants/PluginActionConstants";
import type { ActionRunBehaviourType } from "PluginActionEditor/types/PluginActionTypes";

export const DEFAULT_PREFIX = {
QUERY: "Query",
Expand Down
2 changes: 1 addition & 1 deletion app/client/src/sagas/JSPaneSagas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ import { updateJSCollectionAPICall } from "ee/sagas/ApiCallerSagas";
import { convertToBasePageIdSelector } from "selectors/pageListSelectors";
import { getIsAnvilEnabledInCurrentApplication } from "layoutSystems/anvil/integrations/selectors";
import { fetchActionsForPage } from "actions/pluginActionActions";
import type { ActionRunBehaviourType } from "PluginActionEditor/constants/PluginActionConstants";
import type { ActionRunBehaviourType } from "PluginActionEditor/types/PluginActionTypes";

export interface GenerateDefaultJSObjectProps {
name: string;
Expand Down
22 changes: 1 addition & 21 deletions app/client/src/selectors/navigationSelectors.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type { EntityTypeValue } from "ee/entities/DataTree/types";
import {
ACTION_TYPE,
JSACTION_TYPE,
Expand Down Expand Up @@ -34,26 +33,7 @@ import { PluginType } from "entities/Plugin";
import type { StoredDatasource } from "entities/Action";
import type { Datasource } from "entities/Datasource";
import { getModuleInstanceNavigationData } from "ee/utils/moduleInstanceNavigationData";

export interface NavigationData {
name: string;
id: string;
type: EntityTypeValue;
isfunction?: boolean;
url: string | undefined;
navigable: boolean;
children: EntityNavigationData;
key?: string;
pluginName?: string;
pluginId?: string;
isMock?: boolean;
datasourceId?: string;
actionType?: string;
widgetType?: string;
value?: boolean | string;
}

export type EntityNavigationData = Record<string, NavigationData>;
import type { EntityNavigationData } from "entities/DataTree/dataTreeTypes";

export const getModulesData = createSelector(
getModuleInstances,
Expand Down
2 changes: 1 addition & 1 deletion app/client/src/utils/FilterInternalProperties/JsAction.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { JSActionEntity } from "ee/entities/DataTree/types";
import type { DataTree } from "entities/DataTree/dataTreeTypes";
import type { JSCollectionData } from "ee/reducers/entityReducers/jsActionsReducer";
import { ActionRunBehaviour } from "PluginActionEditor/constants/PluginActionConstants";
import { ActionRunBehaviour } from "PluginActionEditor/types/PluginActionTypes";

export const getJsActionPeekData = (
jsAction: JSCollectionData,
Expand Down
2 changes: 1 addition & 1 deletion app/client/src/utils/JSPaneUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { JSCollection, JSAction, Variable } from "entities/JSCollection";
import { ENTITY_TYPE } from "ee/entities/AppsmithConsole/utils";
import LOG_TYPE from "entities/AppsmithConsole/logtype";
import AppsmithConsole from "utils/AppsmithConsole";
import { ActionRunBehaviour } from "PluginActionEditor/constants/PluginActionConstants";
import { ActionRunBehaviour } from "PluginActionEditor/types/PluginActionTypes";

export interface ParsedJSSubAction {
name: string;
Expand Down
2 changes: 1 addition & 1 deletion app/client/src/utils/NavigationSelector/JsChildren.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { jsCollectionIdURL } from "ee/RouteBuilder";
import type {
EntityNavigationData,
NavigationData,
} from "selectors/navigationSelectors";
} from "entities/DataTree/dataTreeTypes";
import { createNavData } from "./common";

export const getJsChildrenNavData = (
Expand Down
2 changes: 1 addition & 1 deletion app/client/src/utils/NavigationSelector/WidgetChildren.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { WidgetEntity } from "ee/entities/DataTree/types";
import type { DataTree } from "entities/DataTree/dataTreeTypes";
import { ENTITY_TYPE } from "ee/entities/DataTree/types";
import { builderURL } from "ee/RouteBuilder";
import type { EntityNavigationData } from "selectors/navigationSelectors";
import type { EntityNavigationData } from "entities/DataTree/dataTreeTypes";
import { createNavData } from "./common";

export const getWidgetChildrenNavData = (
Expand Down
2 changes: 1 addition & 1 deletion app/client/src/utils/NavigationSelector/common.ts
487E
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { EntityTypeValue } from "ee/entities/DataTree/types";
import type {
EntityNavigationData,
NavigationData,
} from "selectors/navigationSelectors";
} from "entities/DataTree/dataTreeTypes";

export const createNavData = (general: {
name: string;
Expand Down
0