Skip to content
Draft
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
64 changes: 64 additions & 0 deletions assets/linting.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,68 @@

.cl-icon-info {
--icon-bg-color: var(--cl-color-info);
}

.cl-overlay {
z-index: 500;
}

.cl-overlay:hover {
z-index: 1000;
}

.cl-dropdown {
position: relative;
}

.cl-dropdown-menu {
position: absolute;
top: 18px;
left: 5px;
padding: 5px;
}

.cl-dropdown-menu {
display: none;
}

.cl-dropdown:hover .cl-dropdown-menu,
.cl-dropdown.open .cl-dropdown-menu {
display: block;
}

.cl-reports {
padding: 8px;
margin: 0;
list-style: none;

color: var(--cl-font-color);
font-family: var(--cl-font-family);
font-size: var(--cl-font-size);
background: var(--color-grey-225-10-97);
border: solid 1px var(--color-grey-225-10-75);
border-radius: 2px;

width: max-content;
max-width: 300px;
}

.cl-report {
display: flex;
align-items: flex-start;
justify-items: stretch;
}

.cl-report .cl-icon {
flex: none;

margin-top: .095em;
margin-right: .5em;

height: 1em;
width: 1em;

color: var(--icon-bg-color);
background: transparent;
border: none;
}
4 changes: 2 additions & 2 deletions lib/modeler/LintingAnnotations.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ export default class LintingAnnotations {

renderOverlay(html, {
reports,
onClick: () => {
this._eventBus.fire('lintingAnnotations.click', { report: reports[ 0 ] });
onClick: (report) => {
this._eventBus.fire('lintingAnnotations.click', { report });
}
});

Expand Down
43 changes: 37 additions & 6 deletions lib/modeler/OverlayComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,47 @@ export function OverlayComponent(props) {
: 'info';

return html`
<div
class=${ classNames('cl-icon',`cl-icon-${category}`) }
onClick=${ onClick }
title="Click to show issue"
>
${ icons[category] }
<div class="cl-overlay cl-dropdown">
<div class=${ classNames('cl-icon',`cl-icon-${category}`) }>
${ icons[category] }
</div>

<div class="cl-dropdown-menu">
<ul class="cl-reports">
${ reports.map(report => html`<${ReportComponent} report=${ report } onClick=${ onClick } />`) }
</ul>
</div>
</div>
`;
}

export function ReportComponent(props) {

const {
report,
onClick
} = props;

const {
category,
rule,
message
} = report;

const handleClick = (event) => onClick(report);

return html`
<li class=${ classNames('cl-report', `cl-report-${category}`) }>
<div class=${ classNames('cl-icon',`cl-icon-${category}`) }>${ icons[category] }</div>
<a title=${ `${ rule }: ${message}` }
data-rule=${ rule }
data-message=${ message }
onClick=${ handleClick }
>${ message }</a>
</li>
`;
}

export function renderOverlay(el, props) {
return renderComponent(html`<${OverlayComponent} ...${props} />`, el);
}
2 changes: 1 addition & 1 deletion test/spec/modeler/linting-cloud.bpmn
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</bpmn:serviceTask>
<bpmn:serviceTask id="ServiceTask_2" name="Bar">
<bpmn:extensionElements>
<zeebe:taskDefinition type="Foo" />
<zeebe:taskDefinition />
</bpmn:extensionElements>
<bpmn:incoming>Flow_1fo9xb9</bpmn:incoming>
<bpmn:incoming>Flow_192e6hp</bpmn:incoming>
Expand Down