Skip to content

Differentiate App URL Locations #741

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 5, 2024
Merged
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
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));