Skip to content

Commit

Permalink
Merge pull request #741 from lowcoder-org/dev
Browse files Browse the repository at this point in the history
Differentiate App URL Locations
  • Loading branch information
FalkWolsky authored Mar 5, 2024
2 parents 92f3786 + 617365e commit 4f80cae
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 4 additions & 0 deletions client/packages/lowcoder/src/constants/routesURL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const PERMISSION_SETTING_DETAIL = `${PERMISSION_SETTING}/:groupId`;
export const ORGANIZATION_SETTING_DETAIL = `${ORGANIZATION_SETTING}/:orgId`;

export const ALL_APPLICATIONS_URL = "/apps";
export const APPLICATION_MARKETPLACE_URL = `https://app.lowcoder.cloud/apps`;
export const MODULE_APPLICATIONS_URL = "/apps/module";
export const MARKETPLACE_URL = `/marketplace`;
export const DATASOURCE_URL = `/datasource`;
Expand Down Expand Up @@ -48,6 +49,9 @@ export const MARKETPLACE_TYPE_URL = `${MARKETPLACE_URL}/:marketplaceType`;
export const APPLICATION_VIEW_URL = (appId: string, viewMode: AppViewMode) =>
`${ALL_APPLICATIONS_URL}/${appId}/${viewMode}`;

export const APPLICATION_MARKETPLACE_VIEW_URL = (appId: string, viewMode: AppViewMode) =>
`${APPLICATION_MARKETPLACE_URL}/${appId}/${viewMode}`;

export const MARKETPLACE_URL_BY_TYPE = (type: MarketplaceType) =>
`${MARKETPLACE_URL}/${type}`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,8 @@ export function MarketplaceResCard(props: { res: HomeRes; }) {
)}
<CardInfo
onClick={(e) => {
if (checkIsMobile(window.innerWidth)) {
history.push(APPLICATION_VIEW_URL(res.id, "view"));
return;
}
if(res.isMarketplace) {
handleMarketplaceAppViewClick(res.id);
handleMarketplaceAppViewClick(res.id , res.isLocalMarketplace);
return;
}
}}
Expand All @@ -185,7 +181,7 @@ export function MarketplaceResCard(props: { res: HomeRes; }) {
}
</CardInfo>
<OperationWrapper>
<ExecButton onClick={() => handleMarketplaceAppViewClick(res.id)}>
<ExecButton onClick={() => handleMarketplaceAppViewClick(res.id, res.isLocalMarketplace)}>
{trans("view")}
</ExecButton>
</OperationWrapper>
Expand Down
4 changes: 2 additions & 2 deletions client/packages/lowcoder/src/util/homeResUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
NavDocIcon,
} from "lowcoder-design";
import { HomeResTypeEnum } from "../types/homeRes";
import { APPLICATION_VIEW_URL, buildFolderUrl } from "../constants/routesURL";
import { APPLICATION_VIEW_URL, APPLICATION_MARKETPLACE_VIEW_URL, buildFolderUrl } from "../constants/routesURL";
import history from "./history";
import { trans } from "../i18n";
import { FunctionComponent } from "react";
Expand Down Expand Up @@ -58,6 +58,6 @@ export const handleAppEditClick = (e: any, id: string): void => {

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

export const handleMarketplaceAppViewClick = (id: string) => window.open(APPLICATION_VIEW_URL(id, "view_marketplace"));
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"));

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

0 comments on commit 4f80cae

Please sign in to comment.