-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into use-fhir-questionnaire
- Loading branch information
Showing
19 changed files
with
745 additions
and
447 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
@import 'src/styles/colors'; | ||
|
||
.title { | ||
display: flex; | ||
line-height: 32px; | ||
margin-bottom: 3px; | ||
} | ||
|
||
.container { | ||
width: 100%; | ||
height: 100%; | ||
overflow: auto; | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
|
||
.evenContainer { | ||
background-color: $base-light-color; | ||
} | ||
|
||
.oddContainer { | ||
background-color: $base-surface-color; | ||
} | ||
|
||
.content { | ||
flex: 1; | ||
padding: 20px; | ||
overflow-y: auto; | ||
} | ||
|
||
.boxHeader { | ||
position: relative; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import classNames from 'classnames'; | ||
|
||
import s from './Cell.module.scss'; | ||
|
||
interface CellProps extends React.HTMLAttributes<HTMLDivElement> { | ||
title?: string; | ||
even?: boolean; | ||
} | ||
|
||
export function Cell({ title, children, even }: CellProps) { | ||
const isEven = even ?? false; | ||
|
||
return ( | ||
<div className={classNames(s.container, isEven ? s.evenContainer : s.oddContainer)}> | ||
<div className={s.content}> | ||
<div className={s.boxHeader}> | ||
<h2 className={s.title}>{title}</h2> | ||
</div> | ||
{children} | ||
</div> | ||
</div> | ||
); | ||
} |
74 changes: 0 additions & 74 deletions
74
web/src/components/ExpandableElement/ExpandableElement.module.scss
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
16 changes: 0 additions & 16 deletions
16
web/src/components/ExpandableRow/ExpandableRow.module.scss
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
65 changes: 65 additions & 0 deletions
65
web/src/containers/Main/MappingEditor/MappingEditorEditor/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import classNames from 'classnames'; | ||
import { WithId } from 'fhir-react'; | ||
import { Button } from 'web/src/components/Button'; | ||
import { ResourceCodeEditor } from 'web/src/components/ResourceCodeEditor'; | ||
|
||
import { Mapping } from 'shared/src/contrib/aidbox'; | ||
|
||
import { MappingEditorEditorProps } from '../interfaces'; | ||
import s from '../MappingEditor.module.scss'; | ||
|
||
export function MappingEditorEditor(props: MappingEditorEditorProps) { | ||
const { | ||
reload, | ||
onChange, | ||
updatedResource, | ||
onSave, | ||
setUpdatedResource, | ||
mapping, | ||
launchContext, | ||
questionnaireResponseRD, | ||
setEditorSelect, | ||
} = props; | ||
|
||
return ( | ||
<> | ||
<ResourceCodeEditor<WithId<Mapping>> | ||
reload={() => { | ||
reload(); | ||
setUpdatedResource(undefined); | ||
}} | ||
resource={mapping} | ||
onChange={(updatedMapping) => { | ||
setUpdatedResource(updatedMapping); | ||
onChange(updatedMapping); | ||
}} | ||
launchContext={launchContext} | ||
questionnaireResponseRD={questionnaireResponseRD} | ||
/> | ||
<div className={s.actions}> | ||
<Button | ||
className={s.action} | ||
variant="secondary" | ||
onClick={() => { | ||
setEditorSelect(); | ||
}} | ||
> | ||
clear | ||
</Button> | ||
<Button | ||
className={classNames(s.action, { | ||
_active: !!updatedResource, | ||
})} | ||
onClick={() => { | ||
if (updatedResource) { | ||
onSave(updatedResource); | ||
setUpdatedResource(undefined); | ||
} | ||
}} | ||
> | ||
save mapping | ||
</Button> | ||
</div> | ||
</> | ||
); | ||
} |
31 changes: 31 additions & 0 deletions
31
web/src/containers/Main/MappingEditor/MappingEditorError/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { Button } from 'web/src/components/Button'; | ||
|
||
import { formatError } from 'fhir-react/lib/utils/error'; | ||
|
||
import { MappingEditorErrorProps } from '../interfaces'; | ||
import s from '../MappingEditor.module.scss'; | ||
|
||
export function MappingEditorError(props: MappingEditorErrorProps) { | ||
const { error, setEditorSelect, editorState } = props; | ||
|
||
return editorState !== 'ready' ? ( | ||
<div> | ||
{formatError(error)} | ||
{error?.id === 'not-found' ? ( | ||
<div className={s.actions}> | ||
<Button | ||
className={s.action} | ||
variant="secondary" | ||
onClick={() => { | ||
setEditorSelect(); | ||
}} | ||
> | ||
create new | ||
</Button> | ||
</div> | ||
) : null} | ||
</div> | ||
) : ( | ||
<div /> | ||
); | ||
} |
Oops, something went wrong.