Skip to content

Commit 3ff918e

Browse files
added marketplace route
1 parent 5bce8d2 commit 3ff918e

File tree

11 files changed

+90
-2
lines changed

11 files changed

+90
-2
lines changed
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 12 additions & 0 deletions
Loading
Lines changed: 16 additions & 0 deletions
Loading

client/packages/lowcoder-design/src/icons/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,13 @@ export { ReactComponent as HomeModuleIcon } from "./icon-application-module.svg"
176176
export { ReactComponent as HomeQueryLibraryIcon } from "./icon-application-query-library.svg";
177177
export { ReactComponent as HomeDataSourceIcon } from "./icon-application-datasource.svg";
178178
export { ReactComponent as RecyclerIcon } from "./icon-application-recycler.svg";
179+
export { ReactComponent as MarketplaceIcon } from "./icon-application-marketplace.svg";
179180
export { ReactComponent as HomeActiveIcon } from "./icon-application-home-active.svg";
180181
export { ReactComponent as HomeModuleActiveIcon } from "./icon-application-module-active.svg";
181182
export { ReactComponent as HomeQueryLibraryActiveIcon } from "./icon-application-query-library-active.svg";
182183
export { ReactComponent as HomeDataSourceActiveIcon } from "./icon-application-datasource-active.svg";
183184
export { ReactComponent as RecyclerActiveIcon } from "./icon-application-recycler-active.svg";
185+
export { ReactComponent as MarketplaceActiveIcon } from "./icon-application-marketplace-active.svg";
184186
export { ReactComponent as FavoritesIcon } from "./icon-application-favorites.svg";
185187
export { ReactComponent as HomeSettingIcon } from "./icon-application-setting.svg";
186188
export { ReactComponent as FolderIcon } from "./icon-application-folder.svg";

client/packages/lowcoder/src/app.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
IMPORT_APP_FROM_TEMPLATE_URL,
1515
INVITE_LANDING_URL,
1616
isAuthUnRequired,
17+
MARKETPLACE_URL,
1718
ORG_AUTH_LOGIN_URL,
1819
ORG_AUTH_REGISTER_URL,
1920
QUERY_LIBRARY_URL,
@@ -138,6 +139,7 @@ class AppIndex extends React.Component<AppIndexProps, any> {
138139
FOLDER_URL,
139140
TRASH_URL,
140141
SETTING,
142+
MARKETPLACE_URL,
141143
]}
142144
// component={ApplicationListPage}
143145
component={ApplicationHome}

client/packages/lowcoder/src/constants/routesURL.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export const ORGANIZATION_SETTING_DETAIL = `${ORGANIZATION_SETTING}/:orgId`;
2121

2222
export const ALL_APPLICATIONS_URL = "/apps";
2323
export const MODULE_APPLICATIONS_URL = "/apps/module";
24+
export const MARKETPLACE_URL = `/marketplace`;
2425
export const DATASOURCE_URL = `/datasource`;
2526
export const DATASOURCE_CREATE_URL = `${DATASOURCE_URL}/new/:datasourceType`;
2627
export const DATASOURCE_EDIT_URL = `${DATASOURCE_URL}/:datasourceId`;

client/packages/lowcoder/src/i18n/locales/de.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2053,6 +2053,7 @@ export const de = {
20532053
"modules": "Module",
20542054
"module": "Modul",
20552055
"trash": "Papierkorb",
2056+
"marketplace": "Marktplatz",
20562057
"queryLibrary": "Abfragebibliothek",
20572058
"datasource": "Datenquellen",
20582059
"selectDatasourceType": "Datenquellentyp auswählen",

client/packages/lowcoder/src/i18n/locales/en.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2236,6 +2236,7 @@ export const en = {
22362236
"modules": "Modules",
22372237
"module": "Module",
22382238
"trash": "Trash",
2239+
"marketplace": "Marketplace",
22392240
"queryLibrary": "Query Library",
22402241
"datasource": "Data Sources",
22412242
"selectDatasourceType": "Select Data Source Type",

client/packages/lowcoder/src/i18n/locales/zh.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2120,6 +2120,7 @@ home: {
21202120
modules: "模块",
21212121
module: "模块",
21222122
trash: "回收站",
2123+
marketplace: "市场",
21232124
queryLibrary: "查询管理",
21242125
datasource: "数据源",
21252126
selectDatasourceType: "选择数据源类型",
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { useEffect, useState } from "react";
2+
import { useDispatch, useSelector } from "react-redux";
3+
import { HomeLayout } from "./HomeLayout";
4+
import { MARKETPLACE_URL } from "constants/routesURL";
5+
import { marketplaceSelector } from "redux/selectors/applicationSelector";
6+
import { fetchAllMarketplaceApps } from "redux/reduxActions/applicationActions";
7+
import { trans } from "../../i18n";
8+
9+
export function MarketplaceView() {
10+
const [haveFetchedApps, setHaveFetchApps] = useState<boolean>(false);
11+
12+
const dispatch = useDispatch();
13+
const marketplaceApps = useSelector(marketplaceSelector);
14+
15+
useEffect(() => {
16+
if (!marketplaceApps.length && !haveFetchedApps) {
17+
dispatch(fetchAllMarketplaceApps());
18+
setHaveFetchApps(true);
19+
}
20+
}, []);
21+
22+
useEffect(() => {
23+
if (marketplaceApps.length) {
24+
setHaveFetchApps(true);
25+
}
26+
}, [marketplaceApps])
27+
28+
return (
29+
<HomeLayout
30+
elements={marketplaceApps}
31+
breadcrumb={[{ text: trans("home.marketplace"), path: MARKETPLACE_URL }]}
32+
mode={"marketplace"}
33+
/>
34+
);
35+
};

client/packages/lowcoder/src/pages/ApplicationV2/index.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
FOLDER_URL,
55
FOLDER_URL_PREFIX,
66
FOLDERS_URL,
7+
MARKETPLACE_URL,
78
MODULE_APPLICATIONS_URL,
89
QUERY_LIBRARY_URL,
910
SETTING,
@@ -30,6 +31,8 @@ import {
3031
PointIcon,
3132
RecyclerActiveIcon,
3233
RecyclerIcon,
34+
MarketplaceIcon,
35+
MarketplaceActiveIcon,
3336
} from "lowcoder-design";
3437
import React, { useEffect, useState } from "react";
3538
import { fetchAllApplications, fetchHomeData } from "redux/reduxActions/applicationActions";
@@ -44,6 +47,7 @@ import styled, { css } from "styled-components";
4447
import history from "../../util/history";
4548
import { FolderView } from "./FolderView";
4649
import { TrashView } from "./TrashView";
50+
import { MarketplaceView } from "./MarketplaceView";
4751
import { SideBarItemType } from "../../components/layout/SideBarSection";
4852
import { RootFolderListView } from "./RootFolderListView";
4953
import InviteDialog from "../common/inviteDialog";
@@ -411,6 +415,19 @@ export default function ApplicationHome() {
411415
visible: ({ user }) => user.orgDev,
412416
onSelected: (_, currentPath) => currentPath.split("/")[1] === "datasource",
413417
},
418+
{
419+
text: <TabLabel>{trans("home.marketplace")}</TabLabel>,
420+
routePath: MARKETPLACE_URL,
421+
routePathExact: false,
422+
routeComp: MarketplaceView,
423+
icon: ({ selected, ...otherProps }) =>
424+
selected ? (
425+
<MarketplaceActiveIcon {...otherProps} />
426+
) : (
427+
<MarketplaceIcon {...otherProps} />
428+
),
429+
visible: ({ user }) => user.orgDev,
430+
},
414431
{
415432
text: <TabLabel>{trans("settings.title")}</TabLabel>,
416433
routePath: SETTING,

0 commit comments

Comments
 (0)