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

feat: display data fields on graph #3674

Closed
wants to merge 1 commit into from
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,13 @@ const Checklist: React.FC<Props> = React.memo((props) => {
onContextMenu={handleContext}
ref={drag}
>
{Icon && <Icon />}
<span>{props.text}</span>
<div className="question-icon-wrapper">
{Icon && <Icon />}
<span className="question-text">{props.text}</span>
</div>
{props.data?.fn && (
<div className="question-schema">{props.data.fn}</div>
)}
</Link>
{groupedOptions ? (
<ol className="categories">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const Option: React.FC<any> = (props) => {
<Link href={href} prefetch={false} onClick={(e) => e.preventDefault()}>
<div className="band" style={{ background, color }}></div>
<div className="text">{props.data.text}</div>
{props.data?.val && <div className="schema">{props.data?.val}</div>}
</Link>
<ol className="decisions">
{childNodes.map((child: any) => (
Expand Down
47 changes: 46 additions & 1 deletion editor.planx.uk/src/pages/FlowEditor/floweditor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ $fontMonospace: "Source Code Pro", monospace;
flex-direction: column;
padding: 0;
min-width: 60px;
max-width: 200px;
max-width: fit-content;
}
.band {
width: 100%;
Expand All @@ -261,6 +261,51 @@ $fontMonospace: "Source Code Pro", monospace;
align-self: center;
margin: 0;
padding: 6px 12px;
width: 100%;
border-bottom: $nodeBorderWidth solid $optionBorder;
}
.schema {
background-color: $hangerBackground;
font-family: $fontMonospace;
align-self: center;
margin: 0;
margin-bottom: -$nodeBorderWidth;
padding: 6px 12px;
width: 100%;
border-bottom: $nodeBorderWidth solid $optionBorder;
}
}

.question {
> a {
border-color: $nodeBorder;
flex-direction: column;
padding: 0;
min-width: 60px;
max-width: 300px;
}
.question-icon-wrapper {
display: flex;
flex-direction: row;
padding: 6px;
width: 100%;
border-bottom: $nodeBorderWidth solid $nodeBorder;
}
.question-text {
align-self: center;
margin: 0;
padding: 6px 12px;
width: 100%;
}
.question-schema {
background-color: $hangerBackground;
font-family: $fontMonospace;
align-self: center;
margin: 0;
margin-bottom: -$nodeBorderWidth;
padding: 6px 12px;
width: 100%;
border-bottom: $nodeBorderWidth solid $nodeBorder;
}
}

Expand Down
Loading