Skip to content

[Fix]: remove applications/list endpoint from home #1791

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions client/packages/lowcoder/src/pages/ApplicationV2/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import {
UserIcon,
} from "lowcoder-design";
import React, { useCallback, useEffect, useState, useMemo } from "react";
import { fetchAllApplications, fetchHomeData } from "redux/reduxActions/applicationActions";
import { fetchHomeData } from "redux/reduxActions/applicationActions";
import { fetchSubscriptionsAction } from "redux/reduxActions/subscriptionActions";
import { getHomeOrg, normalAppListSelector } from "redux/selectors/applicationSelector";
import { DatasourceHome } from "../datasource";
Expand Down Expand Up @@ -125,18 +125,13 @@ export default function ApplicationHome() {
}, [org, orgHomeId]);

useEffect(() => {
if (allAppCount !== 0) {
return;
}
user.currentOrgId && dispatch(fetchAllApplications({}));
}, [dispatch, allAppCount, user.currentOrgId]);

useEffect(() => {
if (allFoldersCount !== 0) {
// Check if we need to fetch data (either no folders or no applications)
if (allFoldersCount !== 0 && allAppCount !== 0) {
return;
}

user.currentOrgId && dispatch(fetchFolderElements({}));
}, [dispatch, allFoldersCount, user.currentOrgId]);
}, [dispatch, allFoldersCount, allAppCount, user.currentOrgId]);

if (fetchingUser || !isPreloadCompleted) {
return <ProductLoading />;
Expand Down
12 changes: 12 additions & 0 deletions client/packages/lowcoder/src/redux/sagas/folderSagas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,19 @@ export function* fetchFolderElementsSaga(action: ReduxAction<FetchFolderElements
type: ReduxActionTypes.FETCH_ALL_FOLDERS_SUCCESS,
payload: response.data.data.filter((m) => m.folder),
});

// filter out applications with NORMAL status

const applications = response.data.data.filter((item): item is ApplicationMeta =>
!item.folder && item.applicationStatus === "NORMAL"
);

yield put({
type: ReduxActionTypes.FETCH_ALL_APPLICATIONS_SUCCESS,
payload: applications,
});
}

yield put({
type: ReduxActionTypes.FETCH_FOLDER_ELEMENTS_SUCCESS,
payload: { parentFolderId: action.payload.folderId, elements: response.data.data },
Expand Down
Loading