Skip to content
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

Swagger to yaml #253

Draft
wants to merge 14 commits into
base: master
Choose a base branch
from
Draft
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
7 changes: 7 additions & 0 deletions guide/results-viewer-react/.mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"require": "ts-node/register",
"watch-files": ["src/**/*.ts"],
"recursive": true,
"timeout": 5000
}

2,415 changes: 1,856 additions & 559 deletions guide/results-viewer-react/package-lock.json

Large diffs are not rendered by default.

22 changes: 13 additions & 9 deletions guide/results-viewer-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,22 @@
"react-dom": "^18.2.0",
"react-dropzone": "^14.2.3",
"react-transition-group": "^4.4.5",
"styled-components": "^6.0.0"
"styled-components": "^6.0.0",
"swagger2openapi": "^7.0.8"
},
"devDependencies": {
"@babel/core": "^7.20.12",
"@babel/preset-env": "^7.22.9",
"@babel/preset-typescript": "^7.22.5",
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.8.0",
"@storybook/addon-actions": "8.4.2",
"@storybook/addon-essentials": "8.4.2",
"@storybook/addon-interactions": "8.4.2",
"@storybook/addon-links": "8.4.2",
"@storybook/nextjs": "8.4.2",
"@storybook/react": "8.4.2",
"@storybook/test": "8.4.2",
"@storybook/addon-actions": "^8.4.5",
"@storybook/addon-essentials": "^8.4.5",
"@storybook/addon-interactions": "^8.4.5",
"@storybook/addon-links": "^8.4.5",
"@storybook/nextjs": "^8.4.5",
"@storybook/react": "^8.4.5",
"@storybook/test": "^8.4.5",
"@types/chart.js": "^2.9.37",
"@types/file-saver": "^2.0.5",
"@types/har-format": "^1.2.10",
Expand All @@ -64,12 +65,15 @@
"@types/react-dom": "^18.0.10",
"@types/react-transition-group": "^4.4.5",
"@types/styled-components": "^5.1.26",
"@types/swagger2openapi": "^7.0.4",
"@typescript-eslint/eslint-plugin": "^8.15.0",
"@typescript-eslint/parser": "^8.15.0",
"babel-loader": "^9.1.2",
"eslint": "^9.15.0",
"html-webpack-plugin": "^5.5.0",
"storybook": "8.4.2",
"openapi-types": "^12.1.3",
"process": "^0.11.10",
"storybook": "^8.4.5",
"ts-loader": "^9.4.2",
"typescript": "^5.0.2",
tkmcmaster marked this conversation as resolved.
Show resolved Hide resolved
"webpack": "^5.76.0",
Expand Down
78 changes: 78 additions & 0 deletions guide/results-viewer-react/src/components/Modal/story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,76 @@ const ModalCreateYamlDemo = () => {
);
};

// const ModalSwaggerUrlDemo = () => {
// const modalRef = useRef<ModalObject | null>(null);
// useEffectModal(modalRef, LogLevel.INFO);

// const [swaggerUrl, setSwaggerUrl] = useState('');

// const submitEvent = () => {
// log ("Swagger URL submitted: " + swaggerUrl, LogLevel.INFO);
// return Promise.resolve();
// };

// return (
// <div>
// <GlobalStyle />
// <button onClick={() => modalRef.current?.openModal()}>Upload Swagger URL</button>
// <Modal
// ref={modalRef}
// title={"Upload Swagger URL"}
// submitText={"Submit"}
// onSubmit={submitEvent}
// closeText={"Cancel"}
// isReady={swaggerUrl.length > 0}
// >
// <input
// type="text"
// value={swaggerUrl}
// onChange={(e) => setSwaggerUrl(e.target.value)}
// placeholder="Enter Swagger URL"
// style={{ width: "100%", padding: "8px", marginTop: "10px" }}
// />
// </Modal>
// </div>
// );
// };

// const ModalServerUrlDemo = () => {
// const modalRef = useRef<ModalObject | null>(null);
// useEffectModal(modalRef, LogLevel.INFO);

// const [serverUrl, setServerUrl] = useState('');

// const submitEvent = () => {
// log ("Server URL submitted: " + serverUrl, LogLevel.INFO);
// return Promise.resolve();
// };

// return (
// <div>
// <GlobalStyle />
// <button onClick={() => modalRef.current?.openModal()}>Insert Server URL</button>
// <Modal
// ref={modalRef}
// title={"Insert Server URL"}
// submitText={"Submit"}
// onSubmit={submitEvent}
// closeText={"Cancel"}
// isReady={serverUrl.length > 0}
// >
// <input
// type="text"
// value={serverUrl}
// onChange={(e) => setServerUrl(e.target.value)}
// placeholder="Enter Server URL"
// style={{ width: "100%", padding: "8px", marginTop: "10px" }}
// />
// </Modal>
// </div>
// );
// }

export default {
title: "Modal"
} as Meta<typeof Modal>;
Expand All @@ -206,3 +276,11 @@ export const _LoggerModal: StoryFn = () => (
export const CreateYamlModal: StoryFn = () => (
<ModalCreateYamlDemo/>
);

// export const SwaggerUrlModal: StoryFn = () => (
// <ModalSwaggerUrlDemo/>
// );

// export const ServerUrlModal: StoryFn = () => (
// <ModalServerUrlDemo/>
// );
Loading
Loading