Skip to content

Commit

Permalink
MAT-7578: Add search icon functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmcphillips committed Sep 20, 2024
1 parent ce0ce37 commit 113b0eb
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 8 deletions.
3 changes: 3 additions & 0 deletions src/components/cqlLibraryEditor/CqlLibraryEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import { EditorAnnotation, MadieEditor } from "@madie/madie-editor";
import * as _ from "lodash";
import { ElmTranslationError } from "./editorUtil";
import tw from "twin.macro";
import { IconButton } from "@mui/material";
import Search from "@mui/icons-material/Search";

const MessageText = tw.p`text-sm font-medium`;
const SuccessText = tw(MessageText)`text-green-800`;
const ErrorText = tw(MessageText)`text-red-800`;
Expand Down
9 changes: 9 additions & 0 deletions src/components/editCqlLibrary/EditCQLLibrary.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@
border-color: #ededed;
background-color: white;

#header-editor-row {
display: flex;
flex-direction: row;
flex-grow: 1;
height: 48px;
justify-content: flex-end;
background: #ededed;
}

.flow-container {
display: flex;
flex-grow: 1;
Expand Down
37 changes: 29 additions & 8 deletions src/components/editCqlLibrary/EditCqlLibrary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,15 @@ import {
} from "@madie/madie-design-system/dist/react";
import NavTabs from "./NavTabs";
import "./EditCQLLibrary.scss";
import { Checkbox, FormControlLabel, Typography } from "@mui/material";
import {
Checkbox,
IconButton,
FormControlLabel,
Typography,
} from "@mui/material";
import TextArea from "../common/TextArea";
import StatusHandler from "./statusHandler/StatusHandler";
import Search from "@mui/icons-material/Search";

const EditCqlLibrary = () => {
useDocumentTitle("MADiE Edit Library");
Expand Down Expand Up @@ -334,24 +340,39 @@ const EditCqlLibrary = () => {
const handleTabChange = (event, nextTab) => {
history.push(`?tab=${nextTab}`);
};

const toggleSearch = () => {
const event = new CustomEvent("toggleEditorSearchBox");
window.dispatchEvent(event);
};
return (
<form
id="edit-library-page"
data-testId="edit-library-form"
onSubmit={formik.handleSubmit}
>
<StatusHandler
error={error}
errorMessage={errorMessage}
success={success}
outboundAnnotations={outboundAnnotations}
/>
<div className="flow-container">
<div id="left-panel">
<div tw="flex-grow " data-testid="cql-library-editor-component">
{!activeSpinner && (
<>
<StatusHandler
error={error}
errorMessage={errorMessage}
success={success}
outboundAnnotations={outboundAnnotations}
/>
<div id="header-editor-row">
<IconButton
data-testid="editor-search-button"
aria-label="search button"
style={{
color: "#0073c8",
}}
onClick={toggleSearch}
>
<Search />
</IconButton>
</div>
<CqlLibraryEditor
value={formik.values.cql}
onChange={onChange}
Expand Down

0 comments on commit 113b0eb

Please sign in to comment.