chore: start with data store workspace id and fetch plugins info (#28763)

## Description

This PR stores the workspaceId in appropriate redux state for start with
data, and it also fetches list of plugins which are required to show
list of datasources during onboarding.

Workspace id is further required to fetch plugins, test and save the
datasource

#### PR fixes following issue(s)
Fixes #28730 
#### Media
> A video or a GIF is preferred. when using Loom, don’t embed because it
looks like it’s a GIF. instead, just link to the video
>
>
#### Type of change
- Chore (housekeeping or task changes that don't impact user perception)
>
>
>
## Testing
>
#### How Has This Been Tested?
> Please describe the tests that you ran to verify your changes. Also
list any relevant details for your test configuration.
> Delete anything that is not relevant
- [x] Manual
- [ ] JUnit
- [ ] 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
- [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
- [ ] 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

---------

Co-authored-by: nilansh <nilansh@appsmith.com>
Co-authored-by: Aman Agarwal <aman@appsmith.com>
Co-authored-by: “sneha122” <“sneha@appsmith.com”>
This commit is contained in:
sneha122 2023-11-13 09:43:17 +05:30 committed by GitHub
parent 581772d22d
commit 74b3ec6db2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 1 deletions

View File

@ -42,6 +42,7 @@ import { useFeatureFlag } from "utils/hooks/useFeatureFlag";
import { FEATURE_FLAG } from "@appsmith/entities/FeatureFlag";
import { ASSETS_CDN_URL } from "constants/ThirdPartyConstants";
import { getAssetUrl } from "@appsmith/utils/airgapHelpers";
import { fetchPlugins } from "actions/pluginActions";
const SectionWrapper = styled.div`
display: flex;
@ -192,7 +193,12 @@ const CreateNewAppsOption = ({
}
};
const onClickStartWithData = () => {};
const onClickStartWithData = () => {
// fetch plugins information to show list of all plugins
if (isEnabledForStartWithData) {
dispatch(fetchPlugins());
}
};
const goBackFromTemplate = () => {
setUseTemplate(false);

View File

@ -209,6 +209,14 @@ export function* getAllApplicationSaga() {
const response: FetchUsersApplicationsWorkspacesResponse = yield call(
ApplicationApi.getAllApplication,
);
const isEnabledForStartWithData: boolean = yield select(
selectFeatureFlagCheck,
FEATURE_FLAG.ab_onboarding_flow_start_with_data_dev_only_enabled,
);
const isEnabledForCreateNew: boolean = yield select(
selectFeatureFlagCheck,
FEATURE_FLAG.ab_create_new_apps_enabled,
);
const isValidResponse: boolean = yield validateResponse(response);
if (isValidResponse) {
const workspaceApplication: WorkspaceApplicationObject[] =
@ -233,6 +241,17 @@ export function* getAllApplicationSaga() {
type: ReduxActionTypes.FETCH_USER_APPLICATIONS_WORKSPACES_SUCCESS,
payload: workspaceApplication,
});
if (
isEnabledForStartWithData &&
isEnabledForCreateNew &&
workspaceApplication.length > 0
) {
yield put({
type: ReduxActionTypes.SET_CURRENT_WORKSPACE,
payload: workspaceApplication[0]?.workspace,
});
}
}
if (!isAirgappedInstance) {
yield call(fetchReleases);