Skip to content

Commit 4f80cae

Browse files
authored
Merge pull request #741 from lowcoder-org/dev
Differentiate App URL Locations
2 parents 92f3786 + 617365e commit 4f80cae

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

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

+4
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export const PERMISSION_SETTING_DETAIL = `${PERMISSION_SETTING}/:groupId`;
2020
export const ORGANIZATION_SETTING_DETAIL = `${ORGANIZATION_SETTING}/:orgId`;
2121

2222
export const ALL_APPLICATIONS_URL = "/apps";
23+
export const APPLICATION_MARKETPLACE_URL = `https://app.lowcoder.cloud/apps`;
2324
export const MODULE_APPLICATIONS_URL = "/apps/module";
2425
export const MARKETPLACE_URL = `/marketplace`;
2526
export const DATASOURCE_URL = `/datasource`;
@@ -48,6 +49,9 @@ export const MARKETPLACE_TYPE_URL = `${MARKETPLACE_URL}/:marketplaceType`;
4849
export const APPLICATION_VIEW_URL = (appId: string, viewMode: AppViewMode) =>
4950
`${ALL_APPLICATIONS_URL}/${appId}/${viewMode}`;
5051

52+
export const APPLICATION_MARKETPLACE_VIEW_URL = (appId: string, viewMode: AppViewMode) =>
53+
`${APPLICATION_MARKETPLACE_URL}/${appId}/${viewMode}`;
54+
5155
export const MARKETPLACE_URL_BY_TYPE = (type: MarketplaceType) =>
5256
`${MARKETPLACE_URL}/${type}`;
5357

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

+2-6
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,8 @@ export function MarketplaceResCard(props: { res: HomeRes; }) {
164164
)}
165165
<CardInfo
166166
onClick={(e) => {
167-
if (checkIsMobile(window.innerWidth)) {
168-
history.push(APPLICATION_VIEW_URL(res.id, "view"));
169-
return;
170-
}
171167
if(res.isMarketplace) {
172-
handleMarketplaceAppViewClick(res.id);
168+
handleMarketplaceAppViewClick(res.id , res.isLocalMarketplace);
173169
return;
174170
}
175171
}}
@@ -185,7 +181,7 @@ export function MarketplaceResCard(props: { res: HomeRes; }) {
185181
}
186182
</CardInfo>
187183
<OperationWrapper>
188-
<ExecButton onClick={() => handleMarketplaceAppViewClick(res.id)}>
184+
<ExecButton onClick={() => handleMarketplaceAppViewClick(res.id, res.isLocalMarketplace)}>
189185
{trans("view")}
190186
</ExecButton>
191187
</OperationWrapper>

client/packages/lowcoder/src/util/homeResUtils.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
NavDocIcon,
88
} from "lowcoder-design";
99
import { HomeResTypeEnum } from "../types/homeRes";
10-
import { APPLICATION_VIEW_URL, buildFolderUrl } from "../constants/routesURL";
10+
import { APPLICATION_VIEW_URL, APPLICATION_MARKETPLACE_VIEW_URL, buildFolderUrl } from "../constants/routesURL";
1111
import history from "./history";
1212
import { trans } from "../i18n";
1313
import { FunctionComponent } from "react";
@@ -58,6 +58,6 @@ export const handleAppEditClick = (e: any, id: string): void => {
5858

5959
export const handleAppViewClick = (id: string) => window.open(APPLICATION_VIEW_URL(id, "view"));
6060

61-
export const handleMarketplaceAppViewClick = (id: string) => window.open(APPLICATION_VIEW_URL(id, "view_marketplace"));
61+
export const handleMarketplaceAppViewClick = (id: string, isLocalMarketplace?: boolean) => isLocalMarketplace == true ? window.open(APPLICATION_VIEW_URL(id, "view_marketplace")) : window.open(APPLICATION_MARKETPLACE_VIEW_URL(id, "view_marketplace"));
6262

6363
export const handleFolderViewClick = (id: string) => history.push(buildFolderUrl(id));

0 commit comments

Comments
 (0)