Skip to content

Feature swagger display #906

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 3 commits into from
May 24, 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
2 changes: 2 additions & 0 deletions client/packages/lowcoder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"@rjsf/core": "^5.15.1",
"@rjsf/utils": "^5.15.1",
"@rjsf/validator-ajv8": "^5.15.1",
"@stoplight/elements": "^8.1.3",
"@types/lodash": "^4.14.194",
"@types/node": "^16.7.13",
"@types/react": "^18.2.45",
Expand Down Expand Up @@ -128,6 +129,7 @@
"vite-plugin-checker": "^0.5.1",
"vite-plugin-dynamic-import": "^1.5.0",
"vite-plugin-html": "^3.2.0",
"vite-plugin-node-polyfills": "^0.22.0",
"vite-plugin-svgr": "^2.2.2",
"vite-tsconfig-paths": "^3.6.0"
}
Expand Down
2 changes: 0 additions & 2 deletions client/packages/lowcoder/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import {
ORG_AUTH_FORGOT_PASSWORD_URL,
ORG_AUTH_RESET_PASSWORD_URL,
} from "constants/routesURL";

import React from "react";
import { createRoot } from "react-dom/client";
import { Helmet } from "react-helmet";
Expand Down Expand Up @@ -222,7 +221,6 @@ class AppIndex extends React.Component<AppIndexProps, any> {
<LazyRoute path={`${COMPONENT_DOC_URL}/:name`} component={LazyComponentDoc} />
<LazyRoute path={`/playground/:name/:dsl`} component={LazyComponentPlayground} />
<Redirect to={`${COMPONENT_DOC_URL}/input`} path="/components" />

{developEnv() && (
<>
<LazyRoute path="/debug_comp/:name" component={LazyDebugComp} />
Expand Down
1 change: 1 addition & 0 deletions client/packages/lowcoder/src/i18n/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2199,6 +2199,7 @@ export const en = {
"theme": "Themes",
"plugin": "Plugins",
"advanced": "Advanced",
"apiDocs": "API Docs",
"lab": "Lab",
"branding": "Branding",
"oauthProviders": "User Authentication",
Expand Down
15 changes: 15 additions & 0 deletions client/packages/lowcoder/src/pages/setting/apiDocs/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import '@stoplight/elements/styles.min.css';

import { API } from '@stoplight/elements';
import React from 'react';

const ApiDocs: React.FC = () => {
return (
<API
basePath="lowcoder-api"
apiDescriptionUrl="https://api-service.lowcoder.cloud/api/docs/api-docs"
/>
);
};

export default ApiDocs;
8 changes: 8 additions & 0 deletions client/packages/lowcoder/src/pages/setting/settingHome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { selectSystemConfig } from "redux/selectors/configSelectors";
import { enableCustomBrand } from "util/featureFlagUtils";
import FreeLimitTag from "pages/common/freeLimitTag";
import { Helmet } from "react-helmet";
import ApiDocs from "./apiDocs";

enum SettingPageEnum {
UserGroups = "permission",
Expand All @@ -34,6 +35,7 @@ enum SettingPageEnum {
Theme = "theme",
Branding = "branding",
Advanced = "advanced",
ApiDocs = "apiDocs",
OAuthProvider = "oauth-provider",
AppUsage = "app-usage",
Environments = "environments",
Expand Down Expand Up @@ -71,6 +73,11 @@ export function SettingHome() {
label: trans("settings.advanced"),
icon: <LeftSettingIcon width={"20px"}/>,
},
{
key: SettingPageEnum.ApiDocs,
label: trans("settings.apiDocs"),
icon: <LeftSettingIcon width={"20px"}/>,
},

// Premium features

Expand Down Expand Up @@ -148,6 +155,7 @@ export function SettingHome() {
{selectKey === SettingPageEnum.Audit && <AuditSetting />}
{selectKey === SettingPageEnum.Branding && <BrandingSetting />}
{selectKey === SettingPageEnum.Advanced && <AdvancedSetting />}
{selectKey === SettingPageEnum.ApiDocs && <ApiDocs />}
</TwoColumnSettingPageContent>
</>
);
Expand Down
2 changes: 2 additions & 0 deletions client/packages/lowcoder/vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import dynamicImport from 'vite-plugin-dynamic-import';
import { ensureLastSlash } from "./src/dev-utils/util";
import { buildVars } from "./src/dev-utils/buildVars";
import { globalDepPlugin } from "./src/dev-utils/globalDepPlguin";
import { nodePolyfills } from 'vite-plugin-node-polyfills'

dotenv.config();

Expand Down Expand Up @@ -157,6 +158,7 @@ export const viteConfig: UserConfig = {
}),
isVisualizerEnabled && visualizer(),
dynamicImport(),
nodePolyfills({ include: ['process'] }),
].filter(Boolean),
};

Expand Down
Loading
Loading