Skip to content

Commit df558c1

Browse files
Settings: added api docs sections using stoplight
1 parent 5292278 commit df558c1

File tree

8 files changed

+2115
-1352
lines changed

8 files changed

+2115
-1352
lines changed

client/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@
8585
"resize-observer-polyfill": "^1.5.1",
8686
"rollup": "^4.13.0",
8787
"simplebar": "^6.2.5",
88-
"swagger-ui-react": "^5.17.12",
8988
"tui-image-editor": "^3.15.3"
9089
}
9190
}

client/packages/lowcoder/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"@rjsf/core": "^5.15.1",
3030
"@rjsf/utils": "^5.15.1",
3131
"@rjsf/validator-ajv8": "^5.15.1",
32+
"@stoplight/elements": "^8.1.3",
3233
"@types/lodash": "^4.14.194",
3334
"@types/node": "^16.7.13",
3435
"@types/react": "^18.2.45",
@@ -128,6 +129,7 @@
128129
"vite-plugin-checker": "^0.5.1",
129130
"vite-plugin-dynamic-import": "^1.5.0",
130131
"vite-plugin-html": "^3.2.0",
132+
"vite-plugin-node-polyfills": "^0.22.0",
131133
"vite-plugin-svgr": "^2.2.2",
132134
"vite-tsconfig-paths": "^3.6.0"
133135
}

client/packages/lowcoder/src/app.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import {
2828
ORG_AUTH_FORGOT_PASSWORD_URL,
2929
ORG_AUTH_RESET_PASSWORD_URL,
3030
} from "constants/routesURL";
31-
3231
import React from "react";
3332
import { createRoot } from "react-dom/client";
3433
import { Helmet } from "react-helmet";
@@ -189,7 +188,6 @@ class AppIndex extends React.Component<AppIndexProps, any> {
189188
<LazyRoute path={`${COMPONENT_DOC_URL}/:name`} component={LazyComponentDoc} />
190189
<LazyRoute path={`/playground/:name/:dsl`} component={LazyComponentPlayground} />
191190
<Redirect to={`${COMPONENT_DOC_URL}/input`} path="/components" />
192-
193191
{developEnv() && (
194192
<>
195193
<LazyRoute path="/debug_comp/:name" component={LazyDebugComp} />

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2199,6 +2199,7 @@ export const en = {
21992199
"theme": "Themes",
22002200
"plugin": "Plugins",
22012201
"advanced": "Advanced",
2202+
"apiDocs": "API Docs",
22022203
"lab": "Lab",
22032204
"branding": "Branding",
22042205
"oauthProviders": "User Authentication",
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import '@stoplight/elements/styles.min.css';
2+
3+
import { API } from '@stoplight/elements';
4+
import React from 'react';
5+
6+
const ApiDocs: React.FC = () => {
7+
return (
8+
<API
9+
basePath="lowcoder-api"
10+
apiDescriptionUrl="https://api-service.lowcoder.cloud/api/docs/api-docs"
11+
/>
12+
);
13+
};
14+
15+
export default ApiDocs;

client/packages/lowcoder/src/pages/setting/settingHome.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import { selectSystemConfig } from "redux/selectors/configSelectors";
2626
import { enableCustomBrand } from "util/featureFlagUtils";
2727
import FreeLimitTag from "pages/common/freeLimitTag";
2828
import { Helmet } from "react-helmet";
29+
import ApiDocs from "./apiDocs";
2930

3031
enum SettingPageEnum {
3132
UserGroups = "permission",
@@ -34,6 +35,7 @@ enum SettingPageEnum {
3435
Theme = "theme",
3536
Branding = "branding",
3637
Advanced = "advanced",
38+
ApiDocs = "apiDocs",
3739
OAuthProvider = "oauth-provider",
3840
AppUsage = "app-usage",
3941
Environments = "environments",
@@ -71,6 +73,11 @@ export function SettingHome() {
7173
label: trans("settings.advanced"),
7274
icon: <LeftSettingIcon width={"20px"}/>,
7375
},
76+
{
77+
key: SettingPageEnum.ApiDocs,
78+
label: trans("settings.apiDocs"),
79+
icon: <LeftSettingIcon width={"20px"}/>,
80+
},
7481

7582
// Premium features
7683

@@ -148,6 +155,7 @@ export function SettingHome() {
148155
{selectKey === SettingPageEnum.Audit && <AuditSetting />}
149156
{selectKey === SettingPageEnum.Branding && <BrandingSetting />}
150157
{selectKey === SettingPageEnum.Advanced && <AdvancedSetting />}
158+
{selectKey === SettingPageEnum.ApiDocs && <ApiDocs />}
151159
</TwoColumnSettingPageContent>
152160
</>
153161
);

client/packages/lowcoder/vite.config.mts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import dynamicImport from 'vite-plugin-dynamic-import';
1212
import { ensureLastSlash } from "./src/dev-utils/util";
1313
import { buildVars } from "./src/dev-utils/buildVars";
1414
import { globalDepPlugin } from "./src/dev-utils/globalDepPlguin";
15+
import { nodePolyfills } from 'vite-plugin-node-polyfills'
1516

1617
dotenv.config();
1718

@@ -157,6 +158,7 @@ export const viteConfig: UserConfig = {
157158
}),
158159
isVisualizerEnabled && visualizer(),
159160
dynamicImport(),
161+
nodePolyfills({ include: ['process'] }),
160162
].filter(Boolean),
161163
};
162164

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