diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Widgets/Multiselect/MultiSelect2_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Widgets/Multiselect/MultiSelect2_spec.js index 9164cb67e1..6ad8d8b2fe 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Widgets/Multiselect/MultiSelect2_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Widgets/Multiselect/MultiSelect2_spec.js @@ -249,7 +249,7 @@ describe("MultiSelect Widget Functionality", function() { cy.openPropertyPane("multiselectwidgetv2"); // set options - propPane.UpdatePropertyFieldValue("Options", JSON.stringify(options)) + propPane.UpdatePropertyFieldValue("Options", JSON.stringify(options)); agHelper.Escape(); // set default value propPane.UpdatePropertyFieldValue( diff --git a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/RestApiOAuth2Validation_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/RestApiOAuth2Validation_spec.js index a9090f6d79..42d0789619 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/RestApiOAuth2Validation_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ServerSideTests/Datasources/RestApiOAuth2Validation_spec.js @@ -27,7 +27,7 @@ describe("Datasource form OAuth2 client credentials related tests", function() { }); it("3. Create an API with app url and save as Datasource for Authorization code details test", function() { - apiPage.CreateAndFillApi(testdata.appUrl, "TestOAuth") + apiPage.CreateAndFillApi(testdata.appUrl, "TestOAuth"); agHelper.GetNClick(apiPage._saveAsDS); agHelper.ValidateToastMessage("datasource created"); //verifying there is no error toast, Bug 14566 }); diff --git a/app/client/cypress/support/widgetCommands.js b/app/client/cypress/support/widgetCommands.js index b8c2027658..ecea7e3c6d 100644 --- a/app/client/cypress/support/widgetCommands.js +++ b/app/client/cypress/support/widgetCommands.js @@ -495,7 +495,7 @@ Cypress.Commands.add("updateCodeInput", ($selector, value) => { input.focus(); cy.wait(200); input.setValue(value); - cy.wait(200); //time for value to set + cy.wait(1000); //time for value to set //input.focus(); }); }); diff --git a/app/client/src/api/Api.ts b/app/client/src/api/Api.ts index c0cea0f163..3159b26fc6 100644 --- a/app/client/src/api/Api.ts +++ b/app/client/src/api/Api.ts @@ -1,6 +1,6 @@ import axios, { AxiosInstance, AxiosRequestConfig } from "axios"; import { REQUEST_TIMEOUT_MS } from "@appsmith/constants/ApiConstants"; -import { convertObjectToQueryParams } from "utils/AppsmithUtils"; +import { convertObjectToQueryParams } from "utils/URLUtils"; import { apiFailureResponseInterceptor, apiRequestInterceptor, diff --git a/app/client/src/ce/reducers/settingsReducer.ts b/app/client/src/ce/reducers/settingsReducer.ts index 3c360e2dbb..d08cd5e3b4 100644 --- a/app/client/src/ce/reducers/settingsReducer.ts +++ b/app/client/src/ce/reducers/settingsReducer.ts @@ -3,7 +3,7 @@ import { ReduxActionErrorTypes, ReduxActionTypes, } from "@appsmith/constants/ReduxActionConstants"; -import { createReducer } from "utils/AppsmithUtils"; +import { createReducer } from "utils/ReducerUtils"; export const initialState: SettingsReduxState = { isLoading: false, diff --git a/app/client/src/components/editorComponents/CloseEditor.tsx b/app/client/src/components/editorComponents/CloseEditor.tsx index 4b84cbc064..6dfb506990 100644 --- a/app/client/src/components/editorComponents/CloseEditor.tsx +++ b/app/client/src/components/editorComponents/CloseEditor.tsx @@ -7,7 +7,7 @@ import PerformanceTracker, { PerformanceTransactionName, } from "utils/PerformanceTracker"; import { INTEGRATION_TABS } from "constants/routes"; -import { getQueryParams } from "utils/AppsmithUtils"; +import { getQueryParams } from "utils/URLUtils"; import { getIsGeneratePageInitiator } from "utils/GenerateCrudUtil"; import { builderURL, diff --git a/app/client/src/components/editorComponents/CodeEditor/index.tsx b/app/client/src/components/editorComponents/CodeEditor/index.tsx index 90b953f5b8..79dbb566b7 100644 --- a/app/client/src/components/editorComponents/CodeEditor/index.tsx +++ b/app/client/src/components/editorComponents/CodeEditor/index.tsx @@ -102,8 +102,8 @@ import { interactionAnalyticsEvent } from "utils/AppsmithUtils"; import { AdditionalDynamicDataTree } from "utils/autocomplete/customTreeTypeDefCreator"; interface ReduxStateProps { - dynamicData: DataTree; datasources: any; + dynamicData: DataTree; pluginIdToImageLocation: Record; recentEntities: string[]; } @@ -353,37 +353,35 @@ class CodeEditor extends Component { window.addEventListener("keydown", this.handleKeydown); } + shouldComponentUpdate(nextProps: Props, nextState: State) { + if (this.props.dynamicData !== nextProps.dynamicData) + return nextState.isFocused || !!nextProps.isJSObject; + return true; + } + componentDidUpdate(prevProps: Props): void { this.editor.operation(() => { - if (!this.state.isFocused) { - // const currentMode = this.editor.getOption("mode"); - const editorValue = this.editor.getValue(); - // Safe update of value of the editor when value updated outside the editor - const inputValue = getInputValue(this.props.input.value); - const previousInputValue = getInputValue(prevProps.input.value); + if (this.state.isFocused) return; + // const currentMode = this.editor.getOption("mode"); + const editorValue = this.editor.getValue(); + // Safe update of value of the editor when value updated outside the editor + const inputValue = getInputValue(this.props.input.value); + const previousInputValue = getInputValue(prevProps.input.value); - if (!!inputValue || inputValue === "") { - if (inputValue !== editorValue && isString(inputValue)) { - this.editor.setValue(inputValue); - this.editor.clearHistory(); // when input gets updated on focus out clear undo/redo from codeMirror History - } else if (prevProps.isEditorHidden && !this.props.isEditorHidden) { - // Even if Editor is updated with new value, it cannot update without layour calcs. - //So, if it is hidden it does not reflect in UI, this code is to refresh editor if it was just made visible. - this.editor.refresh(); - } - } else if (previousInputValue !== inputValue) { - // handles case when inputValue changes from a truthy to a falsy value - this.editor.setValue(""); - } - CodeEditor.updateMarkings(this.editor, this.props.marking); - } else { - // Update the dynamic bindings for autocomplete - if (prevProps.dynamicData !== this.props.dynamicData) { - this.hinters.forEach( - (hinter) => hinter.update && hinter.update(this.props.dynamicData), - ); + if (!!inputValue || inputValue === "") { + if (inputValue !== editorValue && isString(inputValue)) { + this.editor.setValue(inputValue); + this.editor.clearHistory(); // when input gets updated on focus out clear undo/redo from codeMirror History + } else if (prevProps.isEditorHidden && !this.props.isEditorHidden) { + // Even if Editor is updated with new value, it cannot update without layour calcs. + //So, if it is hidden it does not reflect in UI, this code is to refresh editor if it was just made visible. + this.editor.refresh(); } + } else if (previousInputValue !== inputValue) { + // handles case when inputValue changes from a truthy to a falsy value + this.editor.setValue(""); } + CodeEditor.updateMarkings(this.editor, this.props.marking); }); } @@ -757,7 +755,6 @@ class CodeEditor extends Component { } getPropertyValidation = ( - dataTree: DataTree, dataTreePath?: string, ): { isInvalid: boolean; @@ -773,7 +770,7 @@ class CodeEditor extends Component { } const errors = _.get( - dataTree, + this.props.dynamicData, getEvalErrorPath(dataTreePath), [], ) as EvaluationError[]; @@ -792,7 +789,10 @@ class CodeEditor extends Component { this.state.hasLintError && this.setState({ hasLintError: false }); } - const pathEvaluatedValue = _.get(dataTree, getEvalValuePath(dataTreePath)); + const pathEvaluatedValue = _.get( + this.props.dynamicData, + getEvalValuePath(dataTreePath), + ); return { isInvalid: filteredLintErrors.length > 0, @@ -809,7 +809,6 @@ class CodeEditor extends Component { codeEditorVisibleOverflow, dataTreePath, disabled, - dynamicData, evaluatedValue, evaluationSubstitutionType, expected, @@ -823,14 +822,14 @@ class CodeEditor extends Component { theme, useValidationMessage, } = this.props; - const validations = this.getPropertyValidation(dynamicData, dataTreePath); + + const validations = this.getPropertyValidation(dataTreePath); let { errors, isInvalid } = validations; const { pathEvaluatedValue } = validations; let evaluated = evaluatedValue; if (dataTreePath) { evaluated = pathEvaluatedValue; } - const entityInformation = this.getEntityInformation(); /* Evaluation results for snippet arguments. The props below can be used to set the validation errors when computed from parent component */ if (this.props.errors) { @@ -840,7 +839,6 @@ class CodeEditor extends Component { isInvalid = Boolean(this.props.isInvalid); } /* Evaluation results for snippet snippets */ - this.lintCode(this.editor); const showEvaluatedValue = diff --git a/app/client/src/components/editorComponents/Debugger/EntityLink.tsx b/app/client/src/components/editorComponents/Debugger/EntityLink.tsx index a289d07a8a..ef3126ac87 100644 --- a/app/client/src/components/editorComponents/Debugger/EntityLink.tsx +++ b/app/client/src/components/editorComponents/Debugger/EntityLink.tsx @@ -17,7 +17,7 @@ import { import { getSelectedWidget } from "selectors/ui"; import AnalyticsUtil from "utils/AnalyticsUtil"; import history from "utils/history"; -import { getQueryParams } from "utils/AppsmithUtils"; +import { getQueryParams } from "utils/URLUtils"; import { datasourcesEditorIdURL, jsCollectionIdURL } from "RouteBuilder"; function ActionLink(props: EntityLinkProps) { diff --git a/app/client/src/components/editorComponents/GlobalSearch/index.tsx b/app/client/src/components/editorComponents/GlobalSearch/index.tsx index 8ec5f2366f..0958c2f0a1 100644 --- a/app/client/src/components/editorComponents/GlobalSearch/index.tsx +++ b/app/client/src/components/editorComponents/GlobalSearch/index.tsx @@ -57,7 +57,7 @@ import AnalyticsUtil from "utils/AnalyticsUtil"; import useRecentEntities from "./useRecentEntities"; import { get, noop } from "lodash"; import { getCurrentPageId } from "selectors/editorSelectors"; -import { getQueryParams } from "utils/AppsmithUtils"; +import { getQueryParams } from "utils/URLUtils"; import SnippetsFilter from "./SnippetsFilter"; import SnippetRefinements from "./SnippetRefinements"; import { Configure, Index } from "react-instantsearch-dom"; diff --git a/app/client/src/components/editorComponents/GlobalSearch/utils.tsx b/app/client/src/components/editorComponents/GlobalSearch/utils.tsx index 875944ee7f..35f4b114d5 100644 --- a/app/client/src/components/editorComponents/GlobalSearch/utils.tsx +++ b/app/client/src/components/editorComponents/GlobalSearch/utils.tsx @@ -20,7 +20,7 @@ import { CurlIconV2, JsFileIconV2 } from "pages/Editor/Explorer/ExplorerIcons"; import { createNewApiAction } from "actions/apiPaneActions"; import { createNewJSCollection } from "actions/jsPaneActions"; import { EventLocation } from "utils/AnalyticsUtil"; -import { getQueryParams } from "utils/AppsmithUtils"; +import { getQueryParams } from "utils/URLUtils"; import history from "utils/history"; import { curlImportPageURL } from "RouteBuilder"; import { isMacOrIOS, modText, shiftText } from "utils/helpers"; diff --git a/app/client/src/components/editorComponents/form/fields/EmbeddedDatasourcePathField.tsx b/app/client/src/components/editorComponents/form/fields/EmbeddedDatasourcePathField.tsx index ccc32d5087..bea7f4fa8e 100644 --- a/app/client/src/components/editorComponents/form/fields/EmbeddedDatasourcePathField.tsx +++ b/app/client/src/components/editorComponents/form/fields/EmbeddedDatasourcePathField.tsx @@ -41,7 +41,7 @@ import { Text, FontWeight, TextType } from "design-system"; import history from "utils/history"; import { getDatasourceInfo } from "pages/Editor/APIEditor/ApiRightPane"; import * as FontFamilies from "constants/Fonts"; -import { getQueryParams } from "utils/AppsmithUtils"; +import { getQueryParams } from "utils/URLUtils"; import { AuthType } from "entities/Datasource/RestAPIForm"; import { setDatsourceEditorMode } from "actions/datasourceActions"; diff --git a/app/client/src/components/formControls/DynamicTextFieldControl.tsx b/app/client/src/components/formControls/DynamicTextFieldControl.tsx index e011c94e35..68194f5af2 100644 --- a/app/client/src/components/formControls/DynamicTextFieldControl.tsx +++ b/app/client/src/components/formControls/DynamicTextFieldControl.tsx @@ -16,10 +16,7 @@ import TemplateMenu from "pages/Editor/QueryEditor/TemplateMenu"; import { QUERY_BODY_FIELD } from "constants/QueryEditorConstants"; import { getPluginResponseTypes } from "selectors/entitiesSelector"; import history from "utils/history"; -import { - convertObjectToQueryParams, - getQueryParams, -} from "utils/AppsmithUtils"; +import { convertObjectToQueryParams, getQueryParams } from "utils/URLUtils"; import { actionPathFromName } from "components/formControls/utils"; import { EvaluationSubstitutionType } from "entities/DataTree/dataTreeFactory"; diff --git a/app/client/src/ee/reducers/settingsReducer.ts b/app/client/src/ee/reducers/settingsReducer.ts index 527fb71f13..2e8732db59 100644 --- a/app/client/src/ee/reducers/settingsReducer.ts +++ b/app/client/src/ee/reducers/settingsReducer.ts @@ -1,5 +1,5 @@ export * from "ce/reducers/settingsReducer"; import { handlers, initialState } from "ce/reducers/settingsReducer"; -import { createReducer } from "utils/AppsmithUtils"; +import { createReducer } from "utils/ReducerUtils"; export default createReducer(initialState, handlers); diff --git a/app/client/src/index.tsx b/app/client/src/index.tsx index 5ea35972dc..b5cd532b69 100755 --- a/app/client/src/index.tsx +++ b/app/client/src/index.tsx @@ -4,7 +4,7 @@ import ReactDOM from "react-dom"; import { Provider } from "react-redux"; import "./index.css"; import { ThemeProvider } from "constants/DefaultTheme"; -import { appInitializer } from "utils/AppsmithUtils"; +import { appInitializer } from "utils/AppUtils"; import { Slide } from "react-toastify"; import store from "./store"; import { LayersContext, Layers } from "constants/Layers"; diff --git a/app/client/src/pages/Editor/APIEditor/ApiAuthentication.tsx b/app/client/src/pages/Editor/APIEditor/ApiAuthentication.tsx index 6222295f0a..0b257c20a2 100644 --- a/app/client/src/pages/Editor/APIEditor/ApiAuthentication.tsx +++ b/app/client/src/pages/Editor/APIEditor/ApiAuthentication.tsx @@ -9,7 +9,7 @@ import { storeAsDatasource, } from "actions/datasourceActions"; import history from "utils/history"; -import { getQueryParams } from "utils/AppsmithUtils"; +import { getQueryParams } from "utils/URLUtils"; import { Text, TextType } from "design-system"; import { AuthType } from "entities/Datasource/RestAPIForm"; import { API_EDITOR_FORM_NAME } from "constants/forms"; diff --git a/app/client/src/pages/Editor/APIEditor/ApiRightPane.tsx b/app/client/src/pages/Editor/APIEditor/ApiRightPane.tsx index 49e022fc5e..4294d38f2a 100644 --- a/app/client/src/pages/Editor/APIEditor/ApiRightPane.tsx +++ b/app/client/src/pages/Editor/APIEditor/ApiRightPane.tsx @@ -7,7 +7,7 @@ import { TabComponent } from "components/ads/Tabs"; import { Text, FontWeight, TextType } from "design-system"; import { TabbedViewContainer } from "./Form"; import get from "lodash/get"; -import { getQueryParams } from "utils/AppsmithUtils"; +import { getQueryParams } from "utils/URLUtils"; import ActionRightPane, { useEntityDependencies, } from "components/editorComponents/ActionRightPane"; diff --git a/app/client/src/pages/Editor/Explorer/Datasources/DatasourceEntity.tsx b/app/client/src/pages/Editor/Explorer/Datasources/DatasourceEntity.tsx index 43ac893305..74720a5fbf 100644 --- a/app/client/src/pages/Editor/Explorer/Datasources/DatasourceEntity.tsx +++ b/app/client/src/pages/Editor/Explorer/Datasources/DatasourceEntity.tsx @@ -16,7 +16,7 @@ import { useDispatch, useSelector } from "react-redux"; import { AppState } from "reducers"; import { DatasourceStructureContainer } from "./DatasourceStructureContainer"; import { isStoredDatasource, PluginType } from "entities/Action"; -import { getQueryParams } from "utils/AppsmithUtils"; +import { getQueryParams } from "utils/URLUtils"; import { getAction } from "selectors/entitiesSelector"; import { datasourcesEditorIdURL, diff --git a/app/client/src/pages/Editor/GeneratePage/components/GeneratePageForm/GeneratePageForm.tsx b/app/client/src/pages/Editor/GeneratePage/components/GeneratePageForm/GeneratePageForm.tsx index 9a7b33dc46..4bb659fce1 100644 --- a/app/client/src/pages/Editor/GeneratePage/components/GeneratePageForm/GeneratePageForm.tsx +++ b/app/client/src/pages/Editor/GeneratePage/components/GeneratePageForm/GeneratePageForm.tsx @@ -20,7 +20,7 @@ import { useParams, useLocation } from "react-router"; import { ExplorerURLParams } from "../../../Explorer/helpers"; import { INTEGRATION_TABS } from "constants/routes"; import history from "utils/history"; -import { getQueryParams } from "utils/AppsmithUtils"; +import { getQueryParams } from "utils/URLUtils"; import { getIsGeneratingTemplatePage } from "selectors/pageListSelectors"; import DataSourceOption from "../DataSourceOption"; import { getQueryStringfromObject } from "RouteBuilder"; diff --git a/app/client/src/pages/Editor/GuidedTour/TourCompletionMessage.tsx b/app/client/src/pages/Editor/GuidedTour/TourCompletionMessage.tsx index 34c6eaba87..6f732708df 100644 --- a/app/client/src/pages/Editor/GuidedTour/TourCompletionMessage.tsx +++ b/app/client/src/pages/Editor/GuidedTour/TourCompletionMessage.tsx @@ -7,7 +7,7 @@ import { getPostWelcomeTourState, setPostWelcomeTourState, } from "utils/storage"; -import { getQueryParams } from "utils/AppsmithUtils"; +import { getQueryParams } from "utils/URLUtils"; import { useDispatch } from "react-redux"; import { showPostCompletionMessage } from "actions/onboardingActions"; import AnalyticsUtil from "utils/AnalyticsUtil"; diff --git a/app/client/src/pages/Editor/IntegrationEditor/DatasourceCard.tsx b/app/client/src/pages/Editor/IntegrationEditor/DatasourceCard.tsx index b1c4505eb5..c1c9bd31bb 100644 --- a/app/client/src/pages/Editor/IntegrationEditor/DatasourceCard.tsx +++ b/app/client/src/pages/Editor/IntegrationEditor/DatasourceCard.tsx @@ -17,7 +17,7 @@ import { Position } from "@blueprintjs/core/lib/esm/common/position"; import { renderDatasourceSection } from "pages/Editor/DataSourceEditor/DatasourceSection"; import { setDatsourceEditorMode } from "actions/datasourceActions"; -import { getQueryParams } from "utils/AppsmithUtils"; +import { getQueryParams } from "utils/URLUtils"; import Menu from "components/ads/Menu"; import Icon, { IconSize } from "components/ads/Icon"; import MenuItem from "components/ads/MenuItem"; diff --git a/app/client/src/pages/Editor/IntegrationEditor/DatasourceHome.tsx b/app/client/src/pages/Editor/IntegrationEditor/DatasourceHome.tsx index 656427e359..627e6e133a 100644 --- a/app/client/src/pages/Editor/IntegrationEditor/DatasourceHome.tsx +++ b/app/client/src/pages/Editor/IntegrationEditor/DatasourceHome.tsx @@ -11,7 +11,7 @@ import AnalyticsUtil from "utils/AnalyticsUtil"; import { getCurrentApplication } from "selectors/applicationSelectors"; import { ApplicationPayload } from "@appsmith/constants/ReduxActionConstants"; import { Colors } from "constants/Colors"; -import { getQueryParams } from "utils/AppsmithUtils"; +import { getQueryParams } from "utils/URLUtils"; import { getGenerateCRUDEnabledPluginMap } from "selectors/entitiesSelector"; import { GenerateCRUDEnabledPluginMap } from "api/PluginApi"; import { getIsGeneratePageInitiator } from "utils/GenerateCrudUtil"; diff --git a/app/client/src/pages/Editor/IntegrationEditor/IntegrationsHomeScreen.tsx b/app/client/src/pages/Editor/IntegrationEditor/IntegrationsHomeScreen.tsx index 5d3e9f8036..bc5788afa5 100644 --- a/app/client/src/pages/Editor/IntegrationEditor/IntegrationsHomeScreen.tsx +++ b/app/client/src/pages/Editor/IntegrationEditor/IntegrationsHomeScreen.tsx @@ -20,7 +20,7 @@ import { INTEGRATION_TABS, INTEGRATION_EDITOR_MODES } from "constants/routes"; import { thinScrollbar } from "constants/DefaultTheme"; import BackButton from "../DataSourceEditor/BackButton"; import UnsupportedPluginDialog from "./UnsupportedPluginDialog"; -import { getQueryParams } from "utils/AppsmithUtils"; +import { getQueryParams } from "utils/URLUtils"; import { getIsGeneratePageInitiator } from "utils/GenerateCrudUtil"; import { getCurrentApplicationId } from "selectors/editorSelectors"; import { integrationEditorURL } from "RouteBuilder"; diff --git a/app/client/src/pages/Editor/IntegrationEditor/MockDataSources.tsx b/app/client/src/pages/Editor/IntegrationEditor/MockDataSources.tsx index a20cc07c68..1a48f48e23 100644 --- a/app/client/src/pages/Editor/IntegrationEditor/MockDataSources.tsx +++ b/app/client/src/pages/Editor/IntegrationEditor/MockDataSources.tsx @@ -6,7 +6,7 @@ import { getPluginImages } from "selectors/entitiesSelector"; import { Colors } from "constants/Colors"; import { addMockDatasourceToWorkspace } from "actions/datasourceActions"; import { getCurrentWorkspaceId } from "@appsmith/selectors/workspaceSelectors"; -import { getQueryParams } from "utils/AppsmithUtils"; +import { getQueryParams } from "utils/URLUtils"; import { AppState } from "reducers"; import AnalyticsUtil from "utils/AnalyticsUtil"; diff --git a/app/client/src/pages/Editor/IntegrationEditor/NewApi.tsx b/app/client/src/pages/Editor/IntegrationEditor/NewApi.tsx index 6881751d81..d60d3d5e7b 100644 --- a/app/client/src/pages/Editor/IntegrationEditor/NewApi.tsx +++ b/app/client/src/pages/Editor/IntegrationEditor/NewApi.tsx @@ -12,7 +12,7 @@ import AnalyticsUtil, { EventLocation } from "utils/AnalyticsUtil"; import { CURL } from "constants/AppsmithActionConstants/ActionConstants"; import { PluginType } from "entities/Action"; import { Spinner } from "@blueprintjs/core"; -import { getQueryParams } from "utils/AppsmithUtils"; +import { getQueryParams } from "utils/URLUtils"; import { GenerateCRUDEnabledPluginMap } from "api/PluginApi"; import { getGenerateCRUDEnabledPluginMap } from "selectors/entitiesSelector"; import { useSelector } from "react-redux"; diff --git a/app/client/src/pages/common/datasourceAuth/index.tsx b/app/client/src/pages/common/datasourceAuth/index.tsx index 818282fb99..2bac6c0f75 100644 --- a/app/client/src/pages/common/datasourceAuth/index.tsx +++ b/app/client/src/pages/common/datasourceAuth/index.tsx @@ -20,7 +20,7 @@ import { } from "actions/datasourceActions"; import AnalyticsUtil from "utils/AnalyticsUtil"; import { redirectToNewIntegrations } from "actions/apiPaneActions"; -import { getQueryParams } from "utils/AppsmithUtils"; +import { getQueryParams } from "utils/URLUtils"; import { getCurrentApplicationId } from "selectors/editorSelectors"; import { useParams, useLocation } from "react-router"; import { ExplorerURLParams } from "pages/Editor/Explorer/helpers"; diff --git a/app/client/src/reducers/entityReducers/actionsReducer.tsx b/app/client/src/reducers/entityReducers/actionsReducer.tsx index fc7370be7b..196ae2da5b 100644 --- a/app/client/src/reducers/entityReducers/actionsReducer.tsx +++ b/app/client/src/reducers/entityReducers/actionsReducer.tsx @@ -1,4 +1,4 @@ -import { createReducer } from "utils/AppsmithUtils"; +import { createReducer } from "utils/ReducerUtils"; import { ReduxActionTypes, ReduxAction, diff --git a/app/client/src/reducers/entityReducers/appReducer.ts b/app/client/src/reducers/entityReducers/appReducer.ts index 2b376de2f8..33ce91a014 100644 --- a/app/client/src/reducers/entityReducers/appReducer.ts +++ b/app/client/src/reducers/entityReducers/appReducer.ts @@ -1,4 +1,4 @@ -import { createReducer } from "utils/AppsmithUtils"; +import { createReducer } from "utils/ReducerUtils"; import { ReduxAction, ReduxActionTypes, diff --git a/app/client/src/reducers/entityReducers/canvasWidgetsReducer.tsx b/app/client/src/reducers/entityReducers/canvasWidgetsReducer.tsx index 09d8daac46..27759f5e9f 100644 --- a/app/client/src/reducers/entityReducers/canvasWidgetsReducer.tsx +++ b/app/client/src/reducers/entityReducers/canvasWidgetsReducer.tsx @@ -1,4 +1,4 @@ -import { createImmerReducer } from "utils/AppsmithUtils"; +import { createImmerReducer } from "utils/ReducerUtils"; import { ReduxActionTypes, UpdateCanvasPayload, diff --git a/app/client/src/reducers/entityReducers/datasourceReducer.ts b/app/client/src/reducers/entityReducers/datasourceReducer.ts index 8cc23886fb..0a5b1bd6d8 100644 --- a/app/client/src/reducers/entityReducers/datasourceReducer.ts +++ b/app/client/src/reducers/entityReducers/datasourceReducer.ts @@ -1,4 +1,4 @@ -import { createReducer } from "utils/AppsmithUtils"; +import { createReducer } from "utils/ReducerUtils"; import { ReduxActionTypes, ReduxAction, diff --git a/app/client/src/reducers/entityReducers/jsActionsReducer.tsx b/app/client/src/reducers/entityReducers/jsActionsReducer.tsx index b9352a7a19..d6c8a27caa 100644 --- a/app/client/src/reducers/entityReducers/jsActionsReducer.tsx +++ b/app/client/src/reducers/entityReducers/jsActionsReducer.tsx @@ -1,4 +1,4 @@ -import { createReducer } from "utils/AppsmithUtils"; +import { createReducer } from "utils/ReducerUtils"; import { JSAction, JSCollection } from "entities/JSCollection"; import { ReduxActionTypes, diff --git a/app/client/src/reducers/entityReducers/jsExecutionsReducer.ts b/app/client/src/reducers/entityReducers/jsExecutionsReducer.ts index 327538fa75..a46dff709a 100644 --- a/app/client/src/reducers/entityReducers/jsExecutionsReducer.ts +++ b/app/client/src/reducers/entityReducers/jsExecutionsReducer.ts @@ -1,4 +1,4 @@ -import { createReducer } from "utils/AppsmithUtils"; +import { createReducer } from "utils/ReducerUtils"; import { ReduxActionErrorTypes, ReduxAction, diff --git a/app/client/src/reducers/entityReducers/metaReducer/index.ts b/app/client/src/reducers/entityReducers/metaReducer/index.ts index 37cf295a48..a7e85db1d1 100644 --- a/app/client/src/reducers/entityReducers/metaReducer/index.ts +++ b/app/client/src/reducers/entityReducers/metaReducer/index.ts @@ -1,5 +1,5 @@ import { set } from "lodash"; -import { createReducer } from "utils/AppsmithUtils"; +import { createReducer } from "utils/ReducerUtils"; import { UpdateWidgetMetaPropertyPayload, ResetWidgetMetaPayload, diff --git a/app/client/src/reducers/entityReducers/pageListReducer.tsx b/app/client/src/reducers/entityReducers/pageListReducer.tsx index bebea20a09..ec7de30548 100644 --- a/app/client/src/reducers/entityReducers/pageListReducer.tsx +++ b/app/client/src/reducers/entityReducers/pageListReducer.tsx @@ -6,7 +6,7 @@ import { ClonePageSuccessPayload, ReduxActionErrorTypes, } from "@appsmith/constants/ReduxActionConstants"; -import { createReducer } from "utils/AppsmithUtils"; +import { createReducer } from "utils/ReducerUtils"; import { GenerateCRUDSuccess } from "actions/pageActions"; const initialState: PageListReduxState = { diff --git a/app/client/src/reducers/entityReducers/pluginsReducer.ts b/app/client/src/reducers/entityReducers/pluginsReducer.ts index 186f98ecbd..16e857d1d5 100644 --- a/app/client/src/reducers/entityReducers/pluginsReducer.ts +++ b/app/client/src/reducers/entityReducers/pluginsReducer.ts @@ -1,4 +1,4 @@ -import { createReducer } from "utils/AppsmithUtils"; +import { createReducer } from "utils/ReducerUtils"; import { ReduxActionTypes, ReduxAction, diff --git a/app/client/src/reducers/entityReducers/widgetConfigReducer.tsx b/app/client/src/reducers/entityReducers/widgetConfigReducer.tsx index d8e595213c..4835967aa9 100644 --- a/app/client/src/reducers/entityReducers/widgetConfigReducer.tsx +++ b/app/client/src/reducers/entityReducers/widgetConfigReducer.tsx @@ -1,4 +1,4 @@ -import { createImmerReducer } from "utils/AppsmithUtils"; +import { createImmerReducer } from "utils/ReducerUtils"; import { ReduxActionTypes, ReduxAction, diff --git a/app/client/src/reducers/evaluationReducers/dependencyReducer.ts b/app/client/src/reducers/evaluationReducers/dependencyReducer.ts index 042dbe66f5..0787b46116 100644 --- a/app/client/src/reducers/evaluationReducers/dependencyReducer.ts +++ b/app/client/src/reducers/evaluationReducers/dependencyReducer.ts @@ -1,4 +1,4 @@ -import { createReducer } from "utils/AppsmithUtils"; +import { createReducer } from "utils/ReducerUtils"; import { ReduxAction, ReduxActionTypes, diff --git a/app/client/src/reducers/evaluationReducers/formEvaluationReducer.ts b/app/client/src/reducers/evaluationReducers/formEvaluationReducer.ts index f465021bb0..3389616e82 100644 --- a/app/client/src/reducers/evaluationReducers/formEvaluationReducer.ts +++ b/app/client/src/reducers/evaluationReducers/formEvaluationReducer.ts @@ -1,4 +1,4 @@ -import { createReducer } from "utils/AppsmithUtils"; +import { createReducer } from "utils/ReducerUtils"; import { ReduxAction, ReduxActionTypes, diff --git a/app/client/src/reducers/evaluationReducers/loadingEntitiesReducer.ts b/app/client/src/reducers/evaluationReducers/loadingEntitiesReducer.ts index bb4776d183..2b3271d548 100644 --- a/app/client/src/reducers/evaluationReducers/loadingEntitiesReducer.ts +++ b/app/client/src/reducers/evaluationReducers/loadingEntitiesReducer.ts @@ -1,4 +1,4 @@ -import { createReducer } from "utils/AppsmithUtils"; +import { createReducer } from "utils/ReducerUtils"; import { ReduxAction, ReduxActionTypes, diff --git a/app/client/src/reducers/evaluationReducers/treeReducer.ts b/app/client/src/reducers/evaluationReducers/treeReducer.ts index 6f8c63d8b3..71fc62f0a4 100644 --- a/app/client/src/reducers/evaluationReducers/treeReducer.ts +++ b/app/client/src/reducers/evaluationReducers/treeReducer.ts @@ -4,7 +4,7 @@ import { } from "@appsmith/constants/ReduxActionConstants"; import { applyChange, Diff } from "deep-diff"; import { DataTree } from "entities/DataTree/dataTreeFactory"; -import { createImmerReducer } from "utils/AppsmithUtils"; +import { createImmerReducer } from "utils/ReducerUtils"; import * as Sentry from "@sentry/react"; export type EvaluatedTreeState = DataTree; diff --git a/app/client/src/reducers/evaluationReducers/triggerReducer.ts b/app/client/src/reducers/evaluationReducers/triggerReducer.ts index 27c22a9fde..85e1311ffe 100644 --- a/app/client/src/reducers/evaluationReducers/triggerReducer.ts +++ b/app/client/src/reducers/evaluationReducers/triggerReducer.ts @@ -1,4 +1,4 @@ -import { createReducer } from "utils/AppsmithUtils"; +import { createReducer } from "utils/ReducerUtils"; import { ReduxAction, ReduxActionTypes, diff --git a/app/client/src/reducers/uiReducers/apiNameReducer.ts b/app/client/src/reducers/uiReducers/apiNameReducer.ts index 36336498ec..2d05c39dca 100644 --- a/app/client/src/reducers/uiReducers/apiNameReducer.ts +++ b/app/client/src/reducers/uiReducers/apiNameReducer.ts @@ -1,4 +1,4 @@ -import { createReducer } from "utils/AppsmithUtils"; +import { createReducer } from "utils/ReducerUtils"; import { ReduxAction, ReduxActionTypes, diff --git a/app/client/src/reducers/uiReducers/apiPaneReducer.ts b/app/client/src/reducers/uiReducers/apiPaneReducer.ts index 8aeeac80cd..ef5ab27820 100644 --- a/app/client/src/reducers/uiReducers/apiPaneReducer.ts +++ b/app/client/src/reducers/uiReducers/apiPaneReducer.ts @@ -1,4 +1,4 @@ -import { createReducer } from "utils/AppsmithUtils"; +import { createReducer } from "utils/ReducerUtils"; import { ReduxActionTypes, ReduxActionErrorTypes, diff --git a/app/client/src/reducers/uiReducers/appCollabReducer.ts b/app/client/src/reducers/uiReducers/appCollabReducer.ts index 5318d804b6..201fe09254 100644 --- a/app/client/src/reducers/uiReducers/appCollabReducer.ts +++ b/app/client/src/reducers/uiReducers/appCollabReducer.ts @@ -2,7 +2,7 @@ import { ReduxAction, ReduxActionTypes, } from "@appsmith/constants/ReduxActionConstants"; -import { createReducer } from "utils/AppsmithUtils"; +import { createReducer } from "utils/ReducerUtils"; import { User } from "entities/AppCollab/CollabInterfaces"; import { cloneDeep } from "lodash"; diff --git a/app/client/src/reducers/uiReducers/appThemingReducer.ts b/app/client/src/reducers/uiReducers/appThemingReducer.ts index d182a7444f..783c980c14 100644 --- a/app/client/src/reducers/uiReducers/appThemingReducer.ts +++ b/app/client/src/reducers/uiReducers/appThemingReducer.ts @@ -1,6 +1,6 @@ import { AppTheme } from "entities/AppTheming"; import { AppThemingMode } from "selectors/appThemingSelectors"; -import { createImmerReducer } from "utils/AppsmithUtils"; +import { createImmerReducer } from "utils/ReducerUtils"; import { ReduxAction, ReduxActionTypes, diff --git a/app/client/src/reducers/uiReducers/appViewReducer.tsx b/app/client/src/reducers/uiReducers/appViewReducer.tsx index 6fd4e87c22..89facf6501 100644 --- a/app/client/src/reducers/uiReducers/appViewReducer.tsx +++ b/app/client/src/reducers/uiReducers/appViewReducer.tsx @@ -1,4 +1,4 @@ -import { createReducer } from "utils/AppsmithUtils"; +import { createReducer } from "utils/ReducerUtils"; import { ReduxAction, ReduxActionTypes, diff --git a/app/client/src/reducers/uiReducers/applicationsReducer.tsx b/app/client/src/reducers/uiReducers/applicationsReducer.tsx index 3e49087eb8..4ff0df79f7 100644 --- a/app/client/src/reducers/uiReducers/applicationsReducer.tsx +++ b/app/client/src/reducers/uiReducers/applicationsReducer.tsx @@ -1,4 +1,4 @@ -import { createReducer } from "utils/AppsmithUtils"; +import { createReducer } from "utils/ReducerUtils"; import { ReduxAction, ReduxActionTypes, diff --git a/app/client/src/reducers/uiReducers/authReducer.ts b/app/client/src/reducers/uiReducers/authReducer.ts index aa4be02c6f..6d4cbacb7a 100644 --- a/app/client/src/reducers/uiReducers/authReducer.ts +++ b/app/client/src/reducers/uiReducers/authReducer.ts @@ -1,4 +1,4 @@ -import { createReducer } from "utils/AppsmithUtils"; +import { createReducer } from "utils/ReducerUtils"; import { ReduxActionTypes, ReduxActionErrorTypes, diff --git a/app/client/src/reducers/uiReducers/canvasSelectionReducer.ts b/app/client/src/reducers/uiReducers/canvasSelectionReducer.ts index 5c4fe3e387..e501ad050b 100644 --- a/app/client/src/reducers/uiReducers/canvasSelectionReducer.ts +++ b/app/client/src/reducers/uiReducers/canvasSelectionReducer.ts @@ -1,4 +1,4 @@ -import { createImmerReducer } from "utils/AppsmithUtils"; +import { createImmerReducer } from "utils/ReducerUtils"; import { ReduxAction, ReduxActionTypes, diff --git a/app/client/src/reducers/uiReducers/crudInfoModalReducer.ts b/app/client/src/reducers/uiReducers/crudInfoModalReducer.ts index 038907983d..ee688af27f 100644 --- a/app/client/src/reducers/uiReducers/crudInfoModalReducer.ts +++ b/app/client/src/reducers/uiReducers/crudInfoModalReducer.ts @@ -1,4 +1,4 @@ -import { createReducer } from "utils/AppsmithUtils"; +import { createReducer } from "utils/ReducerUtils"; import { ReduxAction, ReduxActionTypes, diff --git a/app/client/src/reducers/uiReducers/datasourceNameReducer.ts b/app/client/src/reducers/uiReducers/datasourceNameReducer.ts index 16708c9e9c..911ae3e154 100644 --- a/app/client/src/reducers/uiReducers/datasourceNameReducer.ts +++ b/app/client/src/reducers/uiReducers/datasourceNameReducer.ts @@ -1,4 +1,4 @@ -import { createReducer } from "utils/AppsmithUtils"; +import { createReducer } from "utils/ReducerUtils"; import { ReduxAction, ReduxActionTypes, diff --git a/app/client/src/reducers/uiReducers/datasourcePaneReducer.ts b/app/client/src/reducers/uiReducers/datasourcePaneReducer.ts index 790bc66547..0e1976b2c4 100644 --- a/app/client/src/reducers/uiReducers/datasourcePaneReducer.ts +++ b/app/client/src/reducers/uiReducers/datasourcePaneReducer.ts @@ -1,4 +1,4 @@ -import { createReducer } from "utils/AppsmithUtils"; +import { createReducer } from "utils/ReducerUtils"; import { ReduxActionTypes, ReduxAction, diff --git a/app/client/src/reducers/uiReducers/debuggerReducer.ts b/app/client/src/reducers/uiReducers/debuggerReducer.ts index 8dee1c7005..deb3f8c672 100644 --- a/app/client/src/reducers/uiReducers/debuggerReducer.ts +++ b/app/client/src/reducers/uiReducers/debuggerReducer.ts @@ -1,4 +1,4 @@ -import { createReducer } from "utils/AppsmithUtils"; +import { createReducer } from "utils/ReducerUtils"; import { Log } from "entities/AppsmithConsole"; import { ReduxAction, diff --git a/app/client/src/reducers/uiReducers/dragResizeReducer.ts b/app/client/src/reducers/uiReducers/dragResizeReducer.ts index 444266d1df..0f8701a9ce 100644 --- a/app/client/src/reducers/uiReducers/dragResizeReducer.ts +++ b/app/client/src/reducers/uiReducers/dragResizeReducer.ts @@ -1,4 +1,4 @@ -import { createImmerReducer } from "utils/AppsmithUtils"; +import { createImmerReducer } from "utils/ReducerUtils"; import { ReduxAction, ReduxActionTypes, diff --git a/app/client/src/reducers/uiReducers/editorReducer.tsx b/app/client/src/reducers/uiReducers/editorReducer.tsx index 3aecfae5c8..f9a156b879 100644 --- a/app/client/src/reducers/uiReducers/editorReducer.tsx +++ b/app/client/src/reducers/uiReducers/editorReducer.tsx @@ -1,4 +1,4 @@ -import { createReducer } from "utils/AppsmithUtils"; +import { createReducer } from "utils/ReducerUtils"; import { ReduxAction, UpdateCanvasPayload, diff --git a/app/client/src/reducers/uiReducers/errorReducer.tsx b/app/client/src/reducers/uiReducers/errorReducer.tsx index 1527d4d3ec..54d54946a1 100644 --- a/app/client/src/reducers/uiReducers/errorReducer.tsx +++ b/app/client/src/reducers/uiReducers/errorReducer.tsx @@ -1,4 +1,4 @@ -import { createReducer } from "utils/AppsmithUtils"; +import { createReducer } from "utils/ReducerUtils"; import { ReduxAction, ReduxActionTypes, diff --git a/app/client/src/reducers/uiReducers/explorerReducer.ts b/app/client/src/reducers/uiReducers/explorerReducer.ts index 616f32e897..bd234d442e 100644 --- a/app/client/src/reducers/uiReducers/explorerReducer.ts +++ b/app/client/src/reducers/uiReducers/explorerReducer.ts @@ -1,4 +1,4 @@ -import { createReducer } from "utils/AppsmithUtils"; +import { createReducer } from "utils/ReducerUtils"; import { ReduxAction, ReduxActionTypes, diff --git a/app/client/src/reducers/uiReducers/gitSyncReducer.ts b/app/client/src/reducers/uiReducers/gitSyncReducer.ts index 99cac798d2..e86ed90c21 100644 --- a/app/client/src/reducers/uiReducers/gitSyncReducer.ts +++ b/app/client/src/reducers/uiReducers/gitSyncReducer.ts @@ -1,4 +1,4 @@ -import { createReducer } from "utils/AppsmithUtils"; +import { createReducer } from "utils/ReducerUtils"; import { ReduxAction, ReduxActionErrorTypes, diff --git a/app/client/src/reducers/uiReducers/globalSearchReducer.ts b/app/client/src/reducers/uiReducers/globalSearchReducer.ts index 278e022fd9..bab7ae75f5 100644 --- a/app/client/src/reducers/uiReducers/globalSearchReducer.ts +++ b/app/client/src/reducers/uiReducers/globalSearchReducer.ts @@ -1,4 +1,4 @@ -import { createReducer } from "utils/AppsmithUtils"; +import { createReducer } from "utils/ReducerUtils"; import { ReduxAction, ReduxActionTypes, diff --git a/app/client/src/reducers/uiReducers/helpReducer.ts b/app/client/src/reducers/uiReducers/helpReducer.ts index 8a9e1b4722..20643386ff 100644 --- a/app/client/src/reducers/uiReducers/helpReducer.ts +++ b/app/client/src/reducers/uiReducers/helpReducer.ts @@ -1,4 +1,4 @@ -import { createReducer } from "utils/AppsmithUtils"; +import { createReducer } from "utils/ReducerUtils"; import { ReduxAction, ReduxActionTypes, diff --git a/app/client/src/reducers/uiReducers/importReducer.ts b/app/client/src/reducers/uiReducers/importReducer.ts index df9702bb33..68d24ae789 100644 --- a/app/client/src/reducers/uiReducers/importReducer.ts +++ b/app/client/src/reducers/uiReducers/importReducer.ts @@ -1,4 +1,4 @@ -import { createReducer } from "utils/AppsmithUtils"; +import { createReducer } from "utils/ReducerUtils"; import { ReduxAction, ReduxActionTypes, diff --git a/app/client/src/reducers/uiReducers/importedCollectionsReducer.ts b/app/client/src/reducers/uiReducers/importedCollectionsReducer.ts index e44fbb2093..9211b01056 100644 --- a/app/client/src/reducers/uiReducers/importedCollectionsReducer.ts +++ b/app/client/src/reducers/uiReducers/importedCollectionsReducer.ts @@ -1,4 +1,4 @@ -import { createReducer } from "utils/AppsmithUtils"; +import { createReducer } from "utils/ReducerUtils"; import { ReduxAction, ReduxActionTypes, diff --git a/app/client/src/reducers/uiReducers/jsObjectNameReducer.tsx b/app/client/src/reducers/uiReducers/jsObjectNameReducer.tsx index 27d34e3e7c..f2a4dd9b05 100644 --- a/app/client/src/reducers/uiReducers/jsObjectNameReducer.tsx +++ b/app/client/src/reducers/uiReducers/jsObjectNameReducer.tsx @@ -1,4 +1,4 @@ -import { createReducer } from "utils/AppsmithUtils"; +import { createReducer } from "utils/ReducerUtils"; import { ReduxAction, ReduxActionTypes, diff --git a/app/client/src/reducers/uiReducers/jsPaneReducer.ts b/app/client/src/reducers/uiReducers/jsPaneReducer.ts index 985b387798..978a822902 100644 --- a/app/client/src/reducers/uiReducers/jsPaneReducer.ts +++ b/app/client/src/reducers/uiReducers/jsPaneReducer.ts @@ -1,4 +1,4 @@ -import { createReducer } from "utils/AppsmithUtils"; +import { createReducer } from "utils/ReducerUtils"; import { ReduxActionTypes, ReduxAction, diff --git a/app/client/src/reducers/uiReducers/mainCanvasReducer.ts b/app/client/src/reducers/uiReducers/mainCanvasReducer.ts index 82f50ea7fa..73e45944ca 100644 --- a/app/client/src/reducers/uiReducers/mainCanvasReducer.ts +++ b/app/client/src/reducers/uiReducers/mainCanvasReducer.ts @@ -1,4 +1,4 @@ -import { createImmerReducer } from "utils/AppsmithUtils"; +import { createImmerReducer } from "utils/ReducerUtils"; import { ReduxAction, ReduxActionTypes, diff --git a/app/client/src/reducers/uiReducers/modalActionReducer.ts b/app/client/src/reducers/uiReducers/modalActionReducer.ts index cb53876869..96902fb4e0 100644 --- a/app/client/src/reducers/uiReducers/modalActionReducer.ts +++ b/app/client/src/reducers/uiReducers/modalActionReducer.ts @@ -1,4 +1,4 @@ -import { createReducer } from "utils/AppsmithUtils"; +import { createReducer } from "utils/ReducerUtils"; import { ReduxAction, ReduxActionTypes, diff --git a/app/client/src/reducers/uiReducers/onBoardingReducer.ts b/app/client/src/reducers/uiReducers/onBoardingReducer.ts index b75ff49ba7..c5d6c829d5 100644 --- a/app/client/src/reducers/uiReducers/onBoardingReducer.ts +++ b/app/client/src/reducers/uiReducers/onBoardingReducer.ts @@ -2,7 +2,7 @@ import { ReduxAction, ReduxActionTypes, } from "@appsmith/constants/ReduxActionConstants"; -import { createReducer } from "utils/AppsmithUtils"; +import { createReducer } from "utils/ReducerUtils"; const initialState: OnboardingState = { // Signposting diff --git a/app/client/src/reducers/uiReducers/pageCanvasStructureReducer.ts b/app/client/src/reducers/uiReducers/pageCanvasStructureReducer.ts index ad5b7dddd1..3bb93a23c7 100644 --- a/app/client/src/reducers/uiReducers/pageCanvasStructureReducer.ts +++ b/app/client/src/reducers/uiReducers/pageCanvasStructureReducer.ts @@ -1,4 +1,4 @@ -import { createImmerReducer } from "utils/AppsmithUtils"; +import { createImmerReducer } from "utils/ReducerUtils"; import { ReduxActionTypes, ReduxActionErrorTypes, diff --git a/app/client/src/reducers/uiReducers/pageWidgetsReducer.ts b/app/client/src/reducers/uiReducers/pageWidgetsReducer.ts index 9417530a03..4ba220718f 100644 --- a/app/client/src/reducers/uiReducers/pageWidgetsReducer.ts +++ b/app/client/src/reducers/uiReducers/pageWidgetsReducer.ts @@ -1,4 +1,4 @@ -import { createImmerReducer } from "utils/AppsmithUtils"; +import { createImmerReducer } from "utils/ReducerUtils"; import { ReduxActionTypes, ReduxAction, diff --git a/app/client/src/reducers/uiReducers/propertyPaneReducer.tsx b/app/client/src/reducers/uiReducers/propertyPaneReducer.tsx index ed16d37a06..b8b6f7b852 100644 --- a/app/client/src/reducers/uiReducers/propertyPaneReducer.tsx +++ b/app/client/src/reducers/uiReducers/propertyPaneReducer.tsx @@ -1,4 +1,4 @@ -import { createReducer } from "utils/AppsmithUtils"; +import { createReducer } from "utils/ReducerUtils"; import { ReduxActionTypes, ReduxAction, diff --git a/app/client/src/reducers/uiReducers/providerReducer.ts b/app/client/src/reducers/uiReducers/providerReducer.ts index 4a71c75911..2d643b2fb0 100644 --- a/app/client/src/reducers/uiReducers/providerReducer.ts +++ b/app/client/src/reducers/uiReducers/providerReducer.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/ban-types */ -import { createReducer } from "utils/AppsmithUtils"; +import { createReducer } from "utils/ReducerUtils"; import { ReduxAction, ReduxActionTypes, diff --git a/app/client/src/reducers/uiReducers/queryPaneReducer.ts b/app/client/src/reducers/uiReducers/queryPaneReducer.ts index 5fed6429f1..5d790e6a8d 100644 --- a/app/client/src/reducers/uiReducers/queryPaneReducer.ts +++ b/app/client/src/reducers/uiReducers/queryPaneReducer.ts @@ -1,4 +1,4 @@ -import { createReducer } from "utils/AppsmithUtils"; +import { createReducer } from "utils/ReducerUtils"; import { ReduxActionTypes, ReduxActionErrorTypes, diff --git a/app/client/src/reducers/uiReducers/reflowReducer.ts b/app/client/src/reducers/uiReducers/reflowReducer.ts index 7511adb6bf..ba408bb539 100644 --- a/app/client/src/reducers/uiReducers/reflowReducer.ts +++ b/app/client/src/reducers/uiReducers/reflowReducer.ts @@ -1,4 +1,4 @@ -import { createReducer } from "utils/AppsmithUtils"; +import { createReducer } from "utils/ReducerUtils"; import { ReduxAction, ReflowReduxActionTypes, diff --git a/app/client/src/reducers/uiReducers/releasesReducer.ts b/app/client/src/reducers/uiReducers/releasesReducer.ts index ddc5513e5c..113f8668c6 100644 --- a/app/client/src/reducers/uiReducers/releasesReducer.ts +++ b/app/client/src/reducers/uiReducers/releasesReducer.ts @@ -1,4 +1,4 @@ -import { createReducer } from "utils/AppsmithUtils"; +import { createReducer } from "utils/ReducerUtils"; import { ReduxAction, ReduxActionTypes, diff --git a/app/client/src/reducers/uiReducers/tableFilterPaneReducer.tsx b/app/client/src/reducers/uiReducers/tableFilterPaneReducer.tsx index f89d489ea0..20028d273b 100644 --- a/app/client/src/reducers/uiReducers/tableFilterPaneReducer.tsx +++ b/app/client/src/reducers/uiReducers/tableFilterPaneReducer.tsx @@ -1,4 +1,4 @@ -import { createReducer } from "utils/AppsmithUtils"; +import { createReducer } from "utils/ReducerUtils"; import { ReduxActionTypes, ReduxAction, diff --git a/app/client/src/reducers/uiReducers/templateReducer.ts b/app/client/src/reducers/uiReducers/templateReducer.ts index 609bf265a4..804ef357c5 100644 --- a/app/client/src/reducers/uiReducers/templateReducer.ts +++ b/app/client/src/reducers/uiReducers/templateReducer.ts @@ -1,4 +1,4 @@ -import { createReducer } from "utils/AppsmithUtils"; +import { createReducer } from "utils/ReducerUtils"; import { ReduxAction, ReduxActionErrorTypes, diff --git a/app/client/src/reducers/uiReducers/themeReducer.ts b/app/client/src/reducers/uiReducers/themeReducer.ts index 1bee628623..6a978090e6 100644 --- a/app/client/src/reducers/uiReducers/themeReducer.ts +++ b/app/client/src/reducers/uiReducers/themeReducer.ts @@ -1,4 +1,4 @@ -import { createImmerReducer } from "utils/AppsmithUtils"; +import { createImmerReducer } from "utils/ReducerUtils"; import { ReduxAction, ReduxActionTypes, diff --git a/app/client/src/reducers/uiReducers/tourReducer.ts b/app/client/src/reducers/uiReducers/tourReducer.ts index d2beb34bc0..0809337eda 100644 --- a/app/client/src/reducers/uiReducers/tourReducer.ts +++ b/app/client/src/reducers/uiReducers/tourReducer.ts @@ -1,4 +1,4 @@ -import { createReducer } from "utils/AppsmithUtils"; +import { createReducer } from "utils/ReducerUtils"; import { ReduxAction, ReduxActionTypes, diff --git a/app/client/src/reducers/uiReducers/usersReducer.ts b/app/client/src/reducers/uiReducers/usersReducer.ts index c6a29c9f0d..ae999b29ed 100644 --- a/app/client/src/reducers/uiReducers/usersReducer.ts +++ b/app/client/src/reducers/uiReducers/usersReducer.ts @@ -1,5 +1,5 @@ import _ from "lodash"; -import { createReducer } from "utils/AppsmithUtils"; +import { createReducer } from "utils/ReducerUtils"; import { ReduxAction, ReduxActionTypes, diff --git a/app/client/src/reducers/uiReducers/websocketReducer.ts b/app/client/src/reducers/uiReducers/websocketReducer.ts index e39f3bb32a..67fe2ce561 100644 --- a/app/client/src/reducers/uiReducers/websocketReducer.ts +++ b/app/client/src/reducers/uiReducers/websocketReducer.ts @@ -1,4 +1,4 @@ -import { createReducer } from "utils/AppsmithUtils"; +import { createReducer } from "utils/ReducerUtils"; import { ReduxAction, ReduxActionTypes, diff --git a/app/client/src/reducers/uiReducers/workspaceReducer.ts b/app/client/src/reducers/uiReducers/workspaceReducer.ts index 0c973cc481..82201b1728 100644 --- a/app/client/src/reducers/uiReducers/workspaceReducer.ts +++ b/app/client/src/reducers/uiReducers/workspaceReducer.ts @@ -1,4 +1,4 @@ -import { createImmerReducer } from "utils/AppsmithUtils"; +import { createImmerReducer } from "utils/ReducerUtils"; import { ReduxAction, ReduxActionTypes, diff --git a/app/client/src/sagas/ActionSagas.ts b/app/client/src/sagas/ActionSagas.ts index 5b4a3d4ad0..b1517cbec5 100644 --- a/app/client/src/sagas/ActionSagas.ts +++ b/app/client/src/sagas/ActionSagas.ts @@ -86,11 +86,8 @@ import AppsmithConsole from "utils/AppsmithConsole"; import { ENTITY_TYPE } from "entities/AppsmithConsole"; import LOG_TYPE from "entities/AppsmithConsole/logtype"; import { createNewApiAction } from "actions/apiPaneActions"; -import { - createNewApiName, - createNewQueryName, - getQueryParams, -} from "utils/AppsmithUtils"; +import { createNewApiName, createNewQueryName } from "utils/AppsmithUtils"; +import { getQueryParams } from "utils/URLUtils"; import { DEFAULT_API_ACTION_CONFIG } from "constants/ApiEditorConstants"; import { setGlobalSearchCategory, diff --git a/app/client/src/sagas/ApiPaneSagas.ts b/app/client/src/sagas/ApiPaneSagas.ts index a0341d552c..cea3b5f5a1 100644 --- a/app/client/src/sagas/ApiPaneSagas.ts +++ b/app/client/src/sagas/ApiPaneSagas.ts @@ -29,7 +29,8 @@ import history from "utils/history"; import { INTEGRATION_EDITOR_MODES, INTEGRATION_TABS } from "constants/routes"; import { initialize, autofill, change } from "redux-form"; import { Property } from "api/ActionAPI"; -import { createNewApiName, getQueryParams } from "utils/AppsmithUtils"; +import { createNewApiName } from "utils/AppsmithUtils"; +import { getQueryParams } from "utils/URLUtils"; import { getPluginIdOfPackageName } from "sagas/selectors"; import { getAction, getActions, getPlugin } from "selectors/entitiesSelector"; import { diff --git a/app/client/src/sagas/DatasourcesSagas.ts b/app/client/src/sagas/DatasourcesSagas.ts index 2d32857b61..62aee1ca7c 100644 --- a/app/client/src/sagas/DatasourcesSagas.ts +++ b/app/client/src/sagas/DatasourcesSagas.ts @@ -77,7 +77,7 @@ import { checkAndGetPluginFormConfigsSaga } from "sagas/PluginSagas"; import { PluginType } from "entities/Action"; import LOG_TYPE from "entities/AppsmithConsole/logtype"; import { isDynamicValue } from "utils/DynamicBindingUtils"; -import { getQueryParams } from "utils/AppsmithUtils"; +import { getQueryParams } from "utils/URLUtils"; import { GenerateCRUDEnabledPluginMap } from "api/PluginApi"; import { getIsGeneratePageInitiator } from "utils/GenerateCrudUtil"; import { shouldBeDefined, trimQueryString } from "utils/helpers"; diff --git a/app/client/src/sagas/JSPaneSagas.ts b/app/client/src/sagas/JSPaneSagas.ts index 61ee9bc154..b3f63e3ced 100644 --- a/app/client/src/sagas/JSPaneSagas.ts +++ b/app/client/src/sagas/JSPaneSagas.ts @@ -23,7 +23,8 @@ import { JSCollectionData, JSCollectionDataState, } from "reducers/entityReducers/jsActionsReducer"; -import { createNewJSFunctionName, getQueryParams } from "utils/AppsmithUtils"; +import { createNewJSFunctionName } from "utils/AppsmithUtils"; +import { getQueryParams } from "utils/URLUtils"; import { JSCollection, JSAction } from "entities/JSCollection"; import { createJSCollectionRequest } from "actions/jsActionActions"; import history from "utils/history"; diff --git a/app/client/src/sagas/PageSagas.tsx b/app/client/src/sagas/PageSagas.tsx index 6143ac1ff1..f4e21f06f1 100644 --- a/app/client/src/sagas/PageSagas.tsx +++ b/app/client/src/sagas/PageSagas.tsx @@ -85,7 +85,7 @@ import { import { UrlDataState } from "reducers/entityReducers/appReducer"; import { APP_MODE } from "entities/App"; import { clearEvalCache } from "./EvaluationsSaga"; -import { getQueryParams } from "utils/AppsmithUtils"; +import { getQueryParams } from "utils/URLUtils"; import PerformanceTracker, { PerformanceTransactionName, } from "utils/PerformanceTracker"; diff --git a/app/client/src/sagas/QueryPaneSagas.ts b/app/client/src/sagas/QueryPaneSagas.ts index fab183b949..cfc3b178be 100644 --- a/app/client/src/sagas/QueryPaneSagas.ts +++ b/app/client/src/sagas/QueryPaneSagas.ts @@ -31,7 +31,8 @@ import { createActionRequest, setActionProperty, } from "actions/pluginActionActions"; -import { getNextEntityName, getQueryParams } from "utils/AppsmithUtils"; +import { getNextEntityName } from "utils/AppsmithUtils"; +import { getQueryParams } from "utils/URLUtils"; import { isEmpty, merge } from "lodash"; import { getConfigInitialValues } from "components/formControls/utils"; import { Variant } from "components/ads/common"; diff --git a/app/client/src/utils/AppUtils.ts b/app/client/src/utils/AppUtils.ts new file mode 100644 index 0000000000..b35ffeb16d --- /dev/null +++ b/app/client/src/utils/AppUtils.ts @@ -0,0 +1,22 @@ +import { getAppsmithConfigs } from "ce/configs"; +import FormControlRegistry from "./formControl/FormControlRegistry"; +import { LogLevelDesc } from "loglevel"; +import localStorage from "utils/localStorage"; +import * as log from "loglevel"; + +export const appInitializer = () => { + FormControlRegistry.registerFormControlBuilders(); + const appsmithConfigs = getAppsmithConfigs(); + log.setLevel(getEnvLogLevel(appsmithConfigs.logLevel)); +}; + +const getEnvLogLevel = (configLevel: LogLevelDesc): LogLevelDesc => { + let logLevel = configLevel; + if (localStorage && localStorage.getItem) { + const localStorageLevel = localStorage.getItem( + "logLevelOverride", + ) as LogLevelDesc; + if (localStorageLevel) logLevel = localStorageLevel; + } + return logLevel; +}; diff --git a/app/client/src/utils/AppsmithUtils.tsx b/app/client/src/utils/AppsmithUtils.tsx index 31cfbdb54d..f2a87024da 100644 --- a/app/client/src/utils/AppsmithUtils.tsx +++ b/app/client/src/utils/AppsmithUtils.tsx @@ -1,53 +1,16 @@ -import { ReduxAction } from "@appsmith/constants/ReduxActionConstants"; import { getAppsmithConfigs } from "@appsmith/configs"; import * as Sentry from "@sentry/react"; import AnalyticsUtil from "./AnalyticsUtil"; -import FormControlRegistry from "./formControl/FormControlRegistry"; import { Property } from "api/ActionAPI"; import _ from "lodash"; import { ActionDataState } from "reducers/entityReducers/actionsReducer"; import * as log from "loglevel"; -import { LogLevelDesc } from "loglevel"; -import produce from "immer"; import { AppIconCollection, AppIconName } from "components/ads/AppIcon"; import { ERROR_CODES } from "@appsmith/constants/ApiConstants"; import { createMessage, ERROR_500 } from "@appsmith/constants/messages"; -import localStorage from "utils/localStorage"; import { JSCollectionData } from "reducers/entityReducers/jsActionsReducer"; import { osName } from "react-device-detect"; -export const createReducer = ( - initialState: any, - handlers: { [type: string]: (state: any, action: any) => any }, -) => { - return function reducer(state = initialState, action: ReduxAction) { - if (handlers.hasOwnProperty(action.type)) { - return handlers[action.type](state, action); - } else { - return state; - } - }; -}; - -export const createImmerReducer = ( - initialState: any, - handlers: { [type: string]: any }, -) => { - return function reducer(state = initialState, action: ReduxAction) { - if (handlers.hasOwnProperty(action.type)) { - return produce(handlers[action.type])(state, action); - } else { - return state; - } - }; -}; - -export const appInitializer = () => { - FormControlRegistry.registerFormControlBuilders(); - const appsmithConfigs = getAppsmithConfigs(); - log.setLevel(getEnvLogLevel(appsmithConfigs.logLevel)); -}; - export const initializeAnalyticsAndTrackers = () => { const appsmithConfigs = getAppsmithConfigs(); @@ -255,17 +218,6 @@ export const convertToString = (value: any): string => { return value.toString(); }; -const getEnvLogLevel = (configLevel: LogLevelDesc): LogLevelDesc => { - let logLevel = configLevel; - if (localStorage && localStorage.getItem) { - const localStorageLevel = localStorage.getItem( - "logLevelOverride", - ) as LogLevelDesc; - if (localStorageLevel) logLevel = localStorageLevel; - } - return logLevel; -}; - export const getInitialsAndColorCode = ( fullName: any, colorPalette: string[], @@ -329,29 +281,6 @@ export function hexToRgb( }; } -export function getQueryParams() { - const urlParams = new URLSearchParams(window.location.search); - const keys = urlParams.keys(); - let key = keys.next().value; - const queryParams: Record = {}; - while (key) { - queryParams[key] = urlParams.get(key) as string; - key = keys.next().value; - } - return queryParams; -} - -export function convertObjectToQueryParams(object: any): string { - if (!_.isNil(object)) { - const paramArray: string[] = _.map(_.keys(object), (key) => { - return encodeURIComponent(key) + "=" + encodeURIComponent(object[key]); - }); - return "?" + _.join(paramArray, "&"); - } else { - return ""; - } -} - export const retryPromise = ( fn: () => Promise, retriesLeft = 5, diff --git a/app/client/src/utils/ReducerUtils.ts b/app/client/src/utils/ReducerUtils.ts new file mode 100644 index 0000000000..34b906ca0c --- /dev/null +++ b/app/client/src/utils/ReducerUtils.ts @@ -0,0 +1,28 @@ +import { ReduxAction } from "@appsmith/constants/ReduxActionConstants"; +import produce from "immer"; + +export const createReducer = ( + initialState: any, + handlers: { [type: string]: (state: any, action: any) => any }, +) => { + return function reducer(state = initialState, action: ReduxAction) { + if (handlers.hasOwnProperty(action.type)) { + return handlers[action.type](state, action); + } else { + return state; + } + }; +}; + +export const createImmerReducer = ( + initialState: any, + handlers: { [type: string]: any }, +) => { + return function reducer(state = initialState, action: ReduxAction) { + if (handlers.hasOwnProperty(action.type)) { + return produce(handlers[action.type])(state, action); + } else { + return state; + } + }; +}; diff --git a/app/client/src/utils/URLUtils.ts b/app/client/src/utils/URLUtils.ts new file mode 100644 index 0000000000..a340205639 --- /dev/null +++ b/app/client/src/utils/URLUtils.ts @@ -0,0 +1,24 @@ +import _ from "lodash"; + +export function getQueryParams() { + const urlParams = new URLSearchParams(window.location.search); + const keys = urlParams.keys(); + let key = keys.next().value; + const queryParams: Record = {}; + while (key) { + queryParams[key] = urlParams.get(key) as string; + key = keys.next().value; + } + return queryParams; +} + +export function convertObjectToQueryParams(object: any): string { + if (!_.isNil(object)) { + const paramArray: string[] = _.map(_.keys(object), (key) => { + return encodeURIComponent(key) + "=" + encodeURIComponent(object[key]); + }); + return "?" + _.join(paramArray, "&"); + } else { + return ""; + } +}