PromucFlow_constructor/app/client/src/actions/applicationActions.ts
albinAppsmith 110e6085b8
feat: Renamed design system package (#19854)
## Description

This PR includes changes for renaming design system package. Since we
are building new package for the refactored design system components,
the old package is renaming to design-system-old.

Fixes #19536 

## Type of change

- New feature (non-breaking change which adds functionality)
- Breaking change (fix or feature that would cause existing
functionality to not work as expected)


## How Has This Been Tested?

- Manual
- Jest
- Cypress

### Test Plan
> Add Testsmith test cases links that relate to this PR

### Issues raised during DP testing
> Link issues raised during DP testing for better visiblity and tracking
(copy link from comments dropped on this PR)


## 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


### QA activity:
- [ ] Test plan has been approved by relevant developers
- [ ] Test plan has been peer reviewed by QA
- [ ] Cypress test cases have been added and approved by either SDET or
manual QA
- [ ] Organized project review call with relevant stakeholders after
Round 1/2 of QA
- [ ] Added Test Plan Approved label after reveiwing all Cypress test
2023-01-23 09:20:47 +05:30

189 lines
4.2 KiB
TypeScript

import { ReduxActionTypes } from "@appsmith/constants/ReduxActionConstants";
import {
AppEmbedSetting,
ApplicationResponsePayload,
} from "api/ApplicationApi";
import {
UpdateApplicationPayload,
ImportApplicationRequest,
FetchApplicationPayload,
} from "api/ApplicationApi";
import { AppIconName } from "design-system-old";
import { Datasource } from "entities/Datasource";
export enum ApplicationVersion {
DEFAULT = 1,
SLUG_URL = 2,
}
export const changeAppViewAccessInit = (
applicationId: string,
publicAccess: boolean,
) => {
return {
type: ReduxActionTypes.CHANGE_APPVIEW_ACCESS_INIT,
payload: {
applicationId,
publicAccess,
},
};
};
export const setDefaultApplicationPageSuccess = (
pageId: string,
applicationId: string,
) => {
return {
type: ReduxActionTypes.SET_DEFAULT_APPLICATION_PAGE_SUCCESS,
payload: {
pageId,
applicationId,
},
};
};
export const fetchApplication = (payload: FetchApplicationPayload) => {
return {
type: ReduxActionTypes.FETCH_APPLICATION_INIT,
payload,
};
};
export const updateApplicationLayout = (
id: string,
data: UpdateApplicationPayload,
) => {
return {
type: ReduxActionTypes.UPDATE_APP_LAYOUT,
payload: {
id,
...data,
},
};
};
export const updateApplication = (
id: string,
data: UpdateApplicationPayload,
callback?: () => void,
) => {
return {
type: ReduxActionTypes.UPDATE_APPLICATION,
payload: {
id,
...data,
callback,
},
};
};
export const updateCurrentApplicationIcon = (icon: AppIconName) => {
return {
type: ReduxActionTypes.CURRENT_APPLICATION_ICON_UPDATE,
payload: icon,
};
};
export const updateCurrentApplicationEmbedSetting = (
embedSetting: AppEmbedSetting,
) => {
return {
type: ReduxActionTypes.CURRENT_APPLICATION_EMBED_SETTING_UPDATE,
payload: embedSetting,
};
};
export const publishApplication = (applicationId: string) => {
return {
type: ReduxActionTypes.PUBLISH_APPLICATION_INIT,
payload: {
applicationId,
},
};
};
export const duplicateApplication = (applicationId: string) => {
return {
type: ReduxActionTypes.DUPLICATE_APPLICATION_INIT,
payload: {
applicationId,
},
};
};
export const importApplication = (appDetails: ImportApplicationRequest) => {
return {
type: ReduxActionTypes.IMPORT_APPLICATION_INIT,
payload: appDetails,
};
};
export const importApplicationSuccess = (
importedApp: ApplicationResponsePayload,
) => {
return {
type: ReduxActionTypes.IMPORT_APPLICATION_SUCCESS,
payload: importedApp,
};
};
export const getAllApplications = () => {
return {
type: ReduxActionTypes.GET_ALL_APPLICATION_INIT,
};
};
export const resetCurrentApplication = () => {
return {
type: ReduxActionTypes.RESET_CURRENT_APPLICATION,
};
};
export const setShowAppInviteUsersDialog = (payload: boolean) => ({
type: ReduxActionTypes.SET_SHOW_APP_INVITE_USERS_MODAL,
payload,
});
export const initDatasourceConnectionDuringImportRequest = (
payload: string,
) => ({
type: ReduxActionTypes.INIT_DATASOURCE_CONNECTION_DURING_IMPORT_REQUEST,
payload,
});
export const initDatasourceConnectionDuringImportSuccess = () => ({
type: ReduxActionTypes.INIT_DATASOURCE_CONNECTION_DURING_IMPORT_SUCCESS,
});
export const resetDatasourceConfigForImportFetchedFlag = () => ({
type: ReduxActionTypes.RESET_DATASOURCE_CONFIG_FETCHED_FOR_IMPORT_FLAG,
});
export const setIsReconnectingDatasourcesModalOpen = (payload: {
isOpen: boolean;
}) => ({
type: ReduxActionTypes.SET_IS_RECONNECTING_DATASOURCES_MODAL_OPEN,
payload,
});
export const setWorkspaceIdForImport = (workspaceId?: string) => ({
type: ReduxActionTypes.SET_WORKSPACE_ID_FOR_IMPORT,
payload: workspaceId,
});
export const setPageIdForImport = (pageId?: string) => ({
type: ReduxActionTypes.SET_PAGE_ID_FOR_IMPORT,
payload: pageId,
});
// pageId can be used to navigate to a particular page instead of the default one
export const showReconnectDatasourceModal = (payload: {
application: ApplicationResponsePayload;
unConfiguredDatasourceList: Datasource[];
workspaceId: string;
pageId?: string;
}) => ({
type: ReduxActionTypes.SHOW_RECONNECT_DATASOURCE_MODAL,
payload,
});