Skip to content

Commit d632bbd

Browse files
send applicationId for npm plugins
1 parent 9cad22d commit d632bbd

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

client/packages/lowcoder/src/pages/editor/right/PluginPanel/PluginCompItem.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { LowcoderCompMeta } from "types/remoteComp";
1111
import { TransparentImg } from "util/commonUtils";
1212
import { ModuleIcon } from "lowcoder-design";
1313
import { NPM_PLUGIN_ASSETS_BASE_URL } from "constants/npmPlugins";
14+
import { useApplicationId } from "@lowcoder-ee/index.sdk";
1415

1516
const ItemWrapper = styled.div`
1617
display: flex;
@@ -75,10 +76,11 @@ interface PluginCompItemProps {
7576
}
7677

7778
export function PluginCompItem(props: PluginCompItemProps) {
79+
const appId = useApplicationId();
7880
const { packageName, packageVersion, compName, compMeta, onDrag } = props;
7981
const compType = getRemoteCompType("npm", packageName, packageVersion, compName);
8082

81-
const icon = `${NPM_PLUGIN_ASSETS_BASE_URL}/${packageName}@${packageVersion}/${compMeta.icon}`;
83+
const icon = `${NPM_PLUGIN_ASSETS_BASE_URL}/${appId}/${packageName}@${packageVersion}/${compMeta.icon}`;
8284

8385
return (
8486
<ItemWrapper

client/packages/lowcoder/src/pages/editor/right/PluginPanel/PluginItem.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import axios from "axios";
22
import { EmptyContent } from "components/EmptyContent";
33
import { LinkButton } from "lowcoder-design";
4-
import { useShallowEqualSelector } from "util/hooks";
4+
import { useApplicationId, useShallowEqualSelector } from "util/hooks";
55
import { useContext, useEffect, useMemo, useState } from "react";
66
import { useDispatch, useSelector } from "react-redux";
77
import { AppState } from "redux/reducers";
@@ -55,6 +55,7 @@ interface PluginViewProps {
5555
export function PluginItem(props: PluginViewProps) {
5656
const { name, onRemove } = props;
5757
const dispatch = useDispatch();
58+
const appId = useApplicationId();
5859
const { onDrag, searchValue } = useContext(RightContext);
5960
const [loading, setLoading] = useState(false);
6061
const packageMeta = useShallowEqualSelector(
@@ -67,7 +68,7 @@ export function PluginItem(props: PluginViewProps) {
6768

6869
useEffect(() => {
6970
setLoading(true);
70-
axios.get<NpmPackageMeta>(`${NPM_REGISTRY_URL}/${name}`).then((res) => {
71+
axios.get<NpmPackageMeta>(`${NPM_REGISTRY_URL}/${appId}/${name}`).then((res) => {
7172
if (res.status >= 400) {
7273
return;
7374
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy