chore: Optimizing code-split for mapStateToProps and mapDispatchToProps (#27726)
## Description Optimizing code-split for mapStateToProps and mapDispatchToProps #### PR fixes following issue(s) Fixes [#27727](https://github.com/appsmithorg/appsmith/issues/27727) #### Type of change - Chore (housekeeping or task changes that don't impact user perception) ## Testing #### How Has This Been Tested? - [x] Manual - [ ] JUnit - [ ] Jest - [x] Cypress ## Checklist: #### Dev activity - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [x] 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 #### QA activity: - [ ] [Speedbreak features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-) have been covered - [ ] Test plan covers all impacted features and [areas of interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-) - [ ] Test plan has been peer reviewed by project stakeholders and other QA members - [ ] Manually tested functionality on DP - [ ] We had an implementation alignment call with stakeholders post QA Round 2 - [ ] Cypress test cases have been added and approved by SDET/manual QA - [ ] Added `Test Plan Approved` label after Cypress tests were reviewed - [ ] Added `Test Plan Approved` label after JUnit tests were reviewed
This commit is contained in:
parent
e1e2af4c73
commit
266c41fde3
|
|
@ -204,12 +204,12 @@ function AppRouter(props: {
|
|||
);
|
||||
}
|
||||
|
||||
const mapStateToProps = (state: AppState) => ({
|
||||
export const mapStateToProps = (state: AppState) => ({
|
||||
safeCrash: getSafeCrash(state),
|
||||
safeCrashCode: getSafeCrashCode(state),
|
||||
});
|
||||
|
||||
const mapDispatchToProps = (dispatch: any) => ({
|
||||
export const mapDispatchToProps = (dispatch: any) => ({
|
||||
getCurrentUser: () => dispatch(getCurrentUser()),
|
||||
getFeatureFlags: () => dispatch(fetchFeatureFlagsInit()),
|
||||
getCurrentTenant: () => dispatch(getCurrentTenant(false)),
|
||||
|
|
|
|||
|
|
@ -849,7 +849,7 @@ export class Applications<
|
|||
}
|
||||
}
|
||||
|
||||
const mapStateToProps = (state: AppState) => ({
|
||||
export const mapStateToProps = (state: AppState) => ({
|
||||
applicationList: getApplicationList(state),
|
||||
isFetchingApplications: getIsFetchingApplications(state),
|
||||
isCreatingApplication: getIsCreatingApplication(state),
|
||||
|
|
@ -860,7 +860,7 @@ const mapStateToProps = (state: AppState) => ({
|
|||
searchKeyword: getApplicationSearchKeyword(state),
|
||||
});
|
||||
|
||||
const mapDispatchToProps = (dispatch: any) => ({
|
||||
export const mapDispatchToProps = (dispatch: any) => ({
|
||||
getAllApplication: () => {
|
||||
dispatch({ type: ReduxActionTypes.GET_ALL_APPLICATION_INIT });
|
||||
},
|
||||
|
|
|
|||
|
|
@ -718,23 +718,28 @@ function WorkspaceInviteUsersForm(props: any) {
|
|||
);
|
||||
}
|
||||
|
||||
export const mapStateToProps = (
|
||||
state: AppState,
|
||||
{ formName }: { formName?: string },
|
||||
) => ({
|
||||
roles: getRolesForField(state),
|
||||
allUsers: getAllUsers(state),
|
||||
isLoading: state.ui.workspaces.loadingStates.isFetchAllUsers,
|
||||
form: formName || INVITE_USERS_TO_WORKSPACE_FORM,
|
||||
});
|
||||
|
||||
export const mapDispatchToProps = (dispatch: any) => ({
|
||||
fetchAllRoles: (workspaceId: string) =>
|
||||
dispatch(fetchRolesForWorkspace(workspaceId)),
|
||||
fetchCurrentWorkspace: (workspaceId: string) =>
|
||||
dispatch(fetchWorkspace(workspaceId)),
|
||||
fetchUser: (workspaceId: string) =>
|
||||
dispatch(fetchUsersForWorkspace(workspaceId)),
|
||||
});
|
||||
|
||||
export default connect(
|
||||
(state: AppState, { formName }: { formName?: string }) => {
|
||||
return {
|
||||
roles: getRolesForField(state),
|
||||
allUsers: getAllUsers(state),
|
||||
isLoading: state.ui.workspaces.loadingStates.isFetchAllUsers,
|
||||
form: formName || INVITE_USERS_TO_WORKSPACE_FORM,
|
||||
};
|
||||
},
|
||||
(dispatch: any) => ({
|
||||
fetchAllRoles: (workspaceId: string) =>
|
||||
dispatch(fetchRolesForWorkspace(workspaceId)),
|
||||
fetchCurrentWorkspace: (workspaceId: string) =>
|
||||
dispatch(fetchWorkspace(workspaceId)),
|
||||
fetchUser: (workspaceId: string) =>
|
||||
dispatch(fetchUsersForWorkspace(workspaceId)),
|
||||
}),
|
||||
mapStateToProps,
|
||||
mapDispatchToProps,
|
||||
)(
|
||||
reduxForm<
|
||||
InviteUsersToWorkspaceFormValues,
|
||||
|
|
|
|||
|
|
@ -102,7 +102,12 @@ const CircleAppIcon = styled(AppIcon)`
|
|||
|
||||
const NameWrapper = styled((props: HTMLDivProps & NameWrapperProps) => (
|
||||
<div
|
||||
{...omit(props, ["hasReadPermission", "showOverlay", "isContextMenuOpen"])}
|
||||
{...omit(props, [
|
||||
"hasReadPermission",
|
||||
"showOverlay",
|
||||
"isContextMenuOpen",
|
||||
"testId",
|
||||
])}
|
||||
/>
|
||||
))`
|
||||
.bp3-card {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user