From 34669c6a684de60b9d4ca0686337566d1e43d46c Mon Sep 17 00:00:00 2001 From: Sangeeth Sivan <74818788+berzerkeer@users.noreply.github.com> Date: Thu, 2 Feb 2023 11:55:20 +0530 Subject: [PATCH] chore: make CE applications class component as base component (#20072) ## Description When code splitting class components, extends from CE class to avoid code duplication and code inconsistency issues. Fixes [#19785](https://github.com/appsmithorg/appsmith/issues/19785) ## Type of change > Please delete options that are not relevant. - Chore (housekeeping or task changes that don't impact user perception) ## How Has This Been Tested? - Manual ## Checklist: ### Dev activity - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag --- .../src/ce/pages/Applications/index.tsx | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/app/client/src/ce/pages/Applications/index.tsx b/app/client/src/ce/pages/Applications/index.tsx index 59a17cbcd8..4245276d1c 100644 --- a/app/client/src/ce/pages/Applications/index.tsx +++ b/app/client/src/ce/pages/Applications/index.tsx @@ -985,7 +985,7 @@ export function ApplicationsSection(props: any) { ); } -export type ApplicationProps = { +export interface ApplicationProps { applicationList: ApplicationPayload[]; searchApplications: (keyword: string) => void; isCreatingApplication: creatingApplicationMap; @@ -1003,19 +1003,24 @@ export type ApplicationProps = { showHeaderSeparator: boolean, ) => void; resetEditor: () => void; -}; +} -class Applications extends Component< - ApplicationProps, - { selectedWorkspaceId: string; showOnboardingForm: boolean } -> { - constructor(props: ApplicationProps) { +export interface ApplicationState { + selectedWorkspaceId: string; + showOnboardingForm: boolean; +} + +export class Applications< + Props extends ApplicationProps, + State extends ApplicationState +> extends Component { + constructor(props: Props) { super(props); this.state = { selectedWorkspaceId: "", showOnboardingForm: false, - }; + } as State; } componentDidMount() {