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

fix(3247): virtual job icon is not used when the graph redraw #1275

Merged
merged 2 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion app/components/workflow-graph-d3/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ export default Component.extend({
if (n) {
const txt = n.select('text');

txt.text(icon(node.status));
txt.text(icon(node.status, node.virtual));
n.attr(
'class',
`graph-node${
Expand Down
2 changes: 1 addition & 1 deletion app/utils/pipeline/graph/d3-graph-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const STATUS_MAP = {
* @return {String} Unicode character that maps to an icon in screwdriver icon font
*/
export function icon(status, isVirtual) {
if (isVirtual && (!status || ['SUCCESS', 'WARNING', 'CREATED'])) {
Copy link
Contributor Author

@y-oksaku y-oksaku Dec 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right hand side of this statement is always true.

I think that this might means ['SUCCESS', 'WARNING', 'CREATED'].includes(status).
But if use this statement then the icon will be able to change QUEUED to VIRTUAL.

In this case, we need to recalculate the icon size and its position when redrawing. This would be difficult.

This change explicitly allowed the virtual icon to have queued status (i.e. allow blue virtual icon).

if (isVirtual) {
return STATUS_MAP.VIRTUAL.icon;
}

Expand Down