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
This commit is contained in:
Sangeeth Sivan 2023-02-02 11:55:20 +05:30 committed by GitHub
parent b314bd71e4
commit 34669c6a68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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<Props, State> {
constructor(props: Props) {
super(props);
this.state = {
selectedWorkspaceId: "",
showOnboardingForm: false,
};
} as State;
}
componentDidMount() {