@@ -35,13 +35,12 @@ const Collection = () => {
const planTitleNode = SchemaUtils.getChildOfNode(resources[i+1], "title");
const firstExpression: string | undefined = SchemaUtils.getChildOfNodePath(resources[i+1], ["action", "condition", "expression", "expression"])?.value;
const conditionExpressions: string[] = firstExpression ? [firstExpression] : [];
- const profile = SchemaUtils.getChildOfNode(resource, "profile");
return
diff --git a/src/simplified/folder.tsx b/src/simplified/folder.tsx
index 26d5a30..6cf4982 100644
--- a/src/simplified/folder.tsx
+++ b/src/simplified/folder.tsx
@@ -1,26 +1,29 @@
import {useState, useEffect} from "react";
-import { propTypes } from "react-bootstrap/esm/Image";
import {BaseCard} from"./baseCard";
import { CSSTransition } from 'react-transition-group';
import State from "../state";
-import { PLAN_DEFINITION } from "./nameHelpers";
+import { CloseButton } from "react-bootstrap";
+import { ACTIVITY_DEFINITION, getBorderPropsForType, PLAN_DEFINITION, profileToFriendlyResourceListEntry, profileToFriendlyResourceSelf } from "./nameHelpers";
interface FolderProps {
actTitle: string,
planTitle: string,
conditionExpressions: string[],
index: number,
- type: string,
+ profile: string,
link?: string
wait: number
}
export const Folder = (props: FolderProps) => {
const [show, setShow] = useState(false);
+ const friendlyName = profileToFriendlyResourceListEntry(props.profile)?.FRIENDLY ?? "Unknown";
+ const resourceType = profileToFriendlyResourceSelf(props.profile)?.FHIR ?? "";
useEffect(() => {
- setTimeout(() => {
+ const timeoutId = setTimeout(() => {
setShow(true);
}, props.wait);
+ return () => clearTimeout(timeoutId);
}, [props.wait]);
@@ -31,33 +34,40 @@ export const Folder = (props: FolderProps) => {
classNames="res-folder"
unmountOnExit
>
-
{
setShow(false);
- setTimeout(() => {
- State.emit("set_bundle_pos", props.index);
- }, 300);
+ State.emit("set_bundle_pos", props.index);
}}>
-
+
+
{props.actTitle} {props.conditionExpressions.length > 0 ? `WHEN ${props.conditionExpressions[0]} IS TRUE` : ""}
-
+
}/>
{State.get().bundle.resources.length > 2 &&
-
}
+
+ {
+ e.stopPropagation();
+ State.emit("remove_from_bundle", props.index + 1);
+ State.emit("remove_from_bundle", props.index);
+ State.get().set("ui", {status:"collection"})
+ }}
+ />
+
+ }
)
diff --git a/src/simplified/nameHelpers.tsx b/src/simplified/nameHelpers.tsx
index 56e3b96..3b209b1 100644
--- a/src/simplified/nameHelpers.tsx
+++ b/src/simplified/nameHelpers.tsx
@@ -1,5 +1,9 @@
import friendlyNames from "../../friendly-names.json";
+export type FriendlyResource = (typeof friendlyNames.RESOURCES) extends Array