PromucFlow_constructor/app/client/src/reducers/uiReducers/importReducer.ts
Abhinav Jha 543b7ec72d
Entity Explorer Render (#1354)
* WIP: Performance improvements in entity explorer

* WIP: Achieve feature parity for entity explorer with release

* Update unit tests

* Add sentry profiling to current page entity properties component

* Fix page add/delete not showing up on entity explorer issue. Update memoization logic for pagegroup entity

* Deal with the ban-ts-ignore eslint issues

* Update unit tests

* Fix widget entity children visibility

* Fix tests and code

* Fix tests for scenarios where the collapsed entities are unmount, as this is a part of the performance optimization

* Filter undefined children when generating structureDSL

* Remove rule from eslintrc

Consolidate createPage test command

* Update CreatePage tests to remove redundant dsl updates

* Revert CreatePage test changes, as adding more checks within this command globally causes other tests to have issues.

* re-enable eslint rule, as without it CI tests fail

* Revert to ban-ts-comment

* Fix typescript ban-ts-ignore issue by upgrading react-scripts and fixing typescript issue across the application

* Typescript errors handled

Co-authored-by: vicky-primathon.in <vicky.bansal@primathon.in>
2020-11-03 18:35:40 +05:30

38 lines
947 B
TypeScript

import { createReducer } from "utils/AppsmithUtils";
import {
ReduxAction,
ReduxActionTypes,
ReduxActionErrorTypes,
} from "constants/ReduxActionConstants";
const initialState: ImportReduxState = {
isImportingCurl: false,
errorPayload: {},
};
const importReducer = createReducer(initialState, {
[ReduxActionTypes.SUBMIT_CURL_FORM_INIT]: (state: ImportReduxState) => {
return {
...state,
isImportingCurl: true,
};
},
[ReduxActionTypes.SUBMIT_CURL_FORM_SUCCESS]: (state: ImportReduxState) => ({
...state,
isImportingCurl: false,
}),
[ReduxActionErrorTypes.SUBMIT_CURL_FORM_ERROR]: (
state: ImportReduxState,
action: ReduxAction<{ errorPayload: string }>,
) => {
return { ...state, errorPayload: action.payload, isImportingCurl: false };
},
});
export interface ImportReduxState {
isImportingCurl: boolean;
errorPayload: Record<string, unknown>;
}
export default importReducer;