Skip to content

Commit 5a64c74

Browse files
author
FalkWolsky
committed
Version Display for remote Comps
1 parent c6e347c commit 5a64c74

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

client/packages/lowcoder/src/components/CompName.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,18 @@ export const CompName = (props: Iprops) => {
113113

114114

115115
if (compInfo.isRemote) {
116+
// Falk: Displaying the current version of the component
117+
items.push({
118+
text: trans("history.currentVersion") + ": " + compInfo.packageVersion,
119+
onClick: () => {
120+
},
121+
});
116122
items.push({
117123
text: trans("comp.menuUpgradeToLatest"),
118124
onClick: () => {
119125
handleUpgrade();
120126
},
127+
121128
});
122129
}
123130

client/packages/lowcoder/src/comps/comps/remoteComp/loaders.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@ async function npmLoader(
1515

1616
// Falk: removed "packageVersion = "latest" as default value fir packageVersion - to ensure no automatic version jumping.
1717

18+
const localPackageVersion = remoteInfo.packageVersion || "latest";
1819
const { packageName, packageVersion, compName } = remoteInfo;
19-
const entry = `${NPM_PLUGIN_ASSETS_BASE_URL}/${packageName}@${packageVersion}/index.js`;
20-
// const entry = `../../../../../public/package/index.js`;
21-
// console.log("Entry", entry);
20+
const entry = `${NPM_PLUGIN_ASSETS_BASE_URL}/${packageName}@${localPackageVersion}/index.js`;
2221
try {
2322
const module = await import(/* webpackIgnore: true */ entry);
2423
const comp = module.default?.[compName];

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export function PluginCompItem(props: PluginCompItemProps) {
9696
</div>
9797
<div className="module-content">
9898
<div className="module-name">{compMeta.name}</div>
99-
<div className="module-desc">{compMeta.description || "No description."}</div>
99+
<div className="module-desc">{compMeta.description || "No description."} <span>v{packageVersion || ""}</span></div>
100100
</div>
101101
</ItemWrapper>
102102
);

0 commit comments

Comments
 (0)