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

MAT-7023: Partial editor routes. broken height #299

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
40 changes: 40 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@
"react": "^17.0.2",
"react-ace": "^10.0.0",
"react-dom": "^17.0.2",
"react-router": "^6.25.1",
"react-router-dom": "^6.25.1",
"sass": "^1.51.0",
"sass-loader": "^12.6.0",
"single-spa": "^5.9.3",
Expand Down
33 changes: 28 additions & 5 deletions src/cqlEditorWithTerminology/CqlEditorWithTerminology.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import React from "react";
import MadieAceEditor, { EditorPropsType } from "../AceEditor/madie-ace-editor";
import React, { FC } from "react";
import { RouterProvider, createBrowserRouter } from "react-router-dom";
import { Allotment } from "allotment";
import "allotment/dist/style.css";
import "./CqlEditorWithTerminology.scss";
import CqlBuilderPanel from "../CqlBuilderPanel/CqlBuilderPanel";
import { useLocation } from "react-router-dom"

Check failure on line 7 in src/cqlEditorWithTerminology/CqlEditorWithTerminology.tsx

View workflow job for this annotation

GitHub Actions / Checkout, install, lint, build and test with coverage

'react-router-dom' import is duplicated

Check failure on line 7 in src/cqlEditorWithTerminology/CqlEditorWithTerminology.tsx

View workflow job for this annotation

GitHub Actions / Checkout, install, lint, build and test with coverage

Insert `;`
import MadieAceEditor, { EditorPropsType } from "../AceEditor/madie-ace-editor";

const CqlEditorWithTerminology = ({
const CqlEditorWithTerminology: FC<EditorPropsType> = ({
value,
onChange,
handleCodeDelete,
Expand All @@ -24,7 +26,10 @@
setEditorVal,
setIsCQLUnchanged,
isCQLUnchanged,
}: EditorPropsType) => {
}) => {
const { pathname } = useLocation();
console.log('pathname is', pathname);

Check failure on line 31 in src/cqlEditorWithTerminology/CqlEditorWithTerminology.tsx

View workflow job for this annotation

GitHub Actions / Checkout, install, lint, build and test with coverage

Unexpected console statement

Check failure on line 31 in src/cqlEditorWithTerminology/CqlEditorWithTerminology.tsx

View workflow job for this annotation

GitHub Actions / Checkout, install, lint, build and test with coverage

Replace `'pathname·is'` with `"pathname·is"`

return (
<div className="allotment-wrapper" id="cql-editor-with-terminology">
<Allotment defaultSizes={[175, 125]} vertical={false}>
Expand Down Expand Up @@ -65,4 +70,22 @@
);
};

export default CqlEditorWithTerminology;
const CqlEditorWithTerminologyWrapper: FC = (props) => {
//@ts-ignore
return <CqlEditorWithTerminology {...props} />;
};

export const routesConfig = [
{
path: "/*",
element: <CqlEditorWithTerminologyWrapper />,
},
];

const router = createBrowserRouter(routesConfig);

const EditorBrowserRouter: FC<EditorPropsType> = (props) => {
return <RouterProvider router={router} />;
}

Check failure on line 89 in src/cqlEditorWithTerminology/CqlEditorWithTerminology.tsx

View workflow job for this annotation

GitHub Actions / Checkout, install, lint, build and test with coverage

Insert `;`

export default EditorBrowserRouter;
26 changes: 26 additions & 0 deletions src/cqlEditorWithTerminology/EditorRoutes.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React from "react";
import { RouterProvider, createBrowserRouter } from "react-router-dom";
import CqlEditorWithTerminology from "./CqlEditorWithTerminology";
// import EditMeasure from "../editMeasure/EditMeasure";
// import MeasureLanding from "../measureLanding/MeasureLanding";
// import NotFound from "../notfound/NotFound";


Check failure on line 8 in src/cqlEditorWithTerminology/EditorRoutes.tsx

View workflow job for this annotation

GitHub Actions / Checkout, install, lint, build and test with coverage

Delete `⏎⏎`

export const routesConfig = [
{

Check failure on line 11 in src/cqlEditorWithTerminology/EditorRoutes.tsx

View workflow job for this annotation

GitHub Actions / Checkout, install, lint, build and test with coverage

Delete `··`
children: [

Check failure on line 12 in src/cqlEditorWithTerminology/EditorRoutes.tsx

View workflow job for this annotation

GitHub Actions / Checkout, install, lint, build and test with coverage

Delete `··`
{ path: "/", element:(props) => <CqlEditorWithTerminology {...props}/> },

Check failure on line 13 in src/cqlEditorWithTerminology/EditorRoutes.tsx

View workflow job for this annotation

GitHub Actions / Checkout, install, lint, build and test with coverage

Replace `·······{·path:·"/",·element:(props)·=>·<CqlEditorWithTerminology·{...props}/>` with `·····{⏎········path:·"/",⏎········element:·(props)·=>·<CqlEditorWithTerminology·{...props}·/>,⏎·····`
{ path: "/valueSets", element:(props) => <CqlEditorWithTerminology {...props}/> },

Check failure on line 14 in src/cqlEditorWithTerminology/EditorRoutes.tsx

View workflow job for this annotation

GitHub Actions / Checkout, install, lint, build and test with coverage

Replace `··{·path:·"/valueSets",·element:(props)·=>·<CqlEditorWithTerminology·{...props}/>` with `{⏎········path:·"/valueSets",⏎········element:·(props)·=>·<CqlEditorWithTerminology·{...props}·/>,⏎·····`
{ path: "/codes*", element:(props) => <CqlEditorWithTerminology {...props}/> }
],
},
];

const router = createBrowserRouter(routesConfig);

const EditorBrowserRouter = () => {
<RouterProvider router={router} />
}

export default EditorBrowserRouter;
Loading