Skip to content

Commit d3ef400

Browse files
author
FalkWolsky
committed
Updated Documentation Functions
1 parent aa9a3e1 commit d3ef400

File tree

5 files changed

+35
-8
lines changed

5 files changed

+35
-8
lines changed

client/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.1.5
1+
2.1.7

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { GreyTextColor } from "constants/style";
1111
import { UICompType } from "comps/uiCompRegistry";
1212
import { trans } from "i18n";
1313
import { getComponentDocUrl } from "comps/utils/compDocUtil";
14+
import { getComponentPlaygroundUrl } from "comps/utils/compDocUtil";
1415
import { parseCompType } from "comps/utils/remote";
1516

1617
const CompDiv = styled.div<{ width?: number; hasSearch?: boolean; showSearch?: boolean }>`
@@ -78,6 +79,7 @@ export const CompName = (props: Iprops) => {
7879
const compType = selectedComp.children.compType.getView() as UICompType;
7980
const compInfo = parseCompType(compType);
8081
const docUrl = getComponentDocUrl(compType);
82+
const playgroundUrl = getComponentPlaygroundUrl(compType);
8183

8284
const items: EditPopoverItemType[] = [];
8385

@@ -99,6 +101,16 @@ export const CompName = (props: Iprops) => {
99101
});
100102
}
101103

104+
if (playgroundUrl) {
105+
items.push({
106+
text: trans("comp.menuViewPlayground"),
107+
onClick: () => {
108+
window.open(playgroundUrl, "_blank");
109+
},
110+
});
111+
}
112+
113+
102114
if (compInfo.isRemote) {
103115
items.push({
104116
text: trans("comp.menuUpgradeToLatest"),

client/packages/lowcoder/src/comps/utils/compDocUtil.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,14 @@ export function getComponentDocUrl(compType: UICompType) {
1212
return trans("docUrls.components", { compType });
1313
}
1414
}
15+
export function getComponentPlaygroundUrl(compType: UICompType) {
16+
if (!compType) {
17+
return "";
18+
}
19+
switch (compType) {
20+
case "module":
21+
return trans("docUrls.module");
22+
default:
23+
return trans("playground.url", { compType });
24+
}
25+
}

client/packages/lowcoder/src/i18n/locales/en.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -906,6 +906,7 @@ export const en = {
906906
},
907907
comp: {
908908
menuViewDocs: "View documentation",
909+
menuViewPlayground: "View playground",
909910
menuUpgradeToLatest: "Upgrade to latest version",
910911
nameNotEmpty: "Can not be empty",
911912
nameRegex:
@@ -2273,13 +2274,13 @@ export const en = {
22732274
},
22742275
docUrls: {
22752276
docHome: "https://docs.lowcoder.cloud/",
2276-
components: "https://app.lowcoder.cloud/components?n={compType}",
2277-
module: "",
2277+
components: "https://app.lowcoder.cloud/components/{compType}",
2278+
module: "https://docs.lowcoder.cloud/lowcoder-documentation/build-applications/create-a-new-app/modules",
22782279
optionList: "",
2279-
terms: "",
2280-
privacy: "",
2281-
aboutUs: "",
2282-
changeLog: "",
2280+
terms: "https://lowcoder.cloud/terms",
2281+
privacy: "https://lowcoder.cloud/privacy",
2282+
aboutUs: "https://lowcoder.cloud/about",
2283+
changeLog: "https://github.com/lowcoder-org/lowcoder/releases",
22832284
introVideo: "",
22842285
devNpmPlugin:
22852286
"https://docs.lowcoder.cloud/lowcoder-extension/develop-data-source-plugins",
@@ -2536,6 +2537,7 @@ export const en = {
25362537
justify: "Justify both ends",
25372538
},
25382539
playground: {
2540+
url: "https://app.lowcoder.cloud/playground/{compType}/1",
25392541
data: "Data",
25402542
preview: "Preview",
25412543
property: "Properties",

client/packages/lowcoder/src/i18n/locales/zh.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -852,6 +852,7 @@ uiComp: {
852852
},
853853
comp: {
854854
menuViewDocs: "查看文档",
855+
menuViewPlayground: "查看组件游乐场",
855856
menuUpgradeToLatest: "升级到最新版本",
856857
nameNotEmpty: "不能为空",
857858
nameRegex: "必须以字母开头,只能包含字母、数字和下划线(_)",
@@ -2106,7 +2107,7 @@ toggleButton: {
21062107
},
21072108
docUrls: {
21082109
docHome: "https://docs.lowcoder.cloud/",
2109-
components: "https://app.lowcoder.cloud/components?n={compType}",
2110+
components: "https://app.lowcoder.cloud/components/{compType}",
21102111
module: "",
21112112
optionList: "",
21122113
terms: "",
@@ -2391,6 +2392,7 @@ componentDoc: {
23912392
justify: "两端对齐",
23922393
},
23932394
playground: {
2395+
url: "https://app.lowcoder.cloud/playground/{compType}/1",
23942396
data: "数据",
23952397
preview: "预览",
23962398
property: "属性",

0 commit comments

Comments
 (0)