-
Notifications
You must be signed in to change notification settings - Fork 95
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
Fixes #37122 - Update system status chart in job invocations detail page #871
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
// přidat mezeru pod chart když je menší obrazovka | ||
// ještě style z index.js | ||
// barva prázdného chart je nějaká čudná |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made me smile when I saw this, well done :)
{statuses.success} | ||
{5} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should go back to the way it was I assume
if (total > 0) return `${succeeded.toString()}/${total}`; | ||
if (totalHosts > 0) return `0/${totalHosts}`; | ||
return '0'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the difference between total
and totalHosts
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The total
represents the combined count of succeeded, failed, pending, and canceled, whereas totalHosts
also includes those currently scheduled in the future.
/> | ||
</FlexItem> | ||
<FlexItem className="chart-legend"> | ||
<Text className="legend-title">{__('System status')}</Text> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if System
is a fortunate wording in this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you please have any other ideas?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://www.sketch.com/s/9c533bae-e910-4a9c-89a1-fe67b04a84ca/a/mPmrkMJ
its the word from the design as well
@adamruzicka thanks for looking at it!
This is the default Patternfly way, but I get that it looks weird. Would it be better if it was on top (when there is only one "color")? Or maybe I could make it follow the mouse?
For sure! I thought it should filter out the hosts in the main table, so I wanted to make it when I have the table ready. Is there something else it should do? |
1a314dc
to
9da75ee
Compare
9da75ee
to
41a31a2
Compare
260e6a9
to
d44ac23
Compare
@MariaAga Fixed, the width of the chart legend is now adjusted dynamically. I hope it's not too over-complicated. |
@@ -0,0 +1,36 @@ | |||
.job-invocation-detail-page-section { | |||
.chart-donut { | |||
height: 105px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please put 105px in a variable in this file
webpack/JobInvocationDetail/index.js
Outdated
<JobInvocationOverview data={items} /> | ||
</FlexItem> | ||
<Flex | ||
style={{ height: '105px' }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move to the .scss file
const [legendWidth, setLegendWidth] = useState(270); | ||
|
||
useEffect(() => { | ||
const legendContainer = document.querySelector('.chart-legend'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand it today, but probably would be best to add a comment on why its needed for future us :)
label: `${d.title} ${d.count} hosts`, | ||
y: d.count, | ||
})) | ||
: [{ label: `Scheduled: ${totalHosts} hosts`, y: 1 }] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you use sprintf
here?
})) | ||
: [{ label: `Scheduled: ${totalHosts} hosts`, y: 1 }] | ||
} | ||
colorScale={total > 0 ? chartData.map(d => d.color) : ['#8A8D90']} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use a pf variable for `#8A8D90``
subTitle={__('Systems')} | ||
subTitleComponent={ | ||
<ChartLabel | ||
style={{ fontSize: '12px', fill: canceledColor.value }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be in a css file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be in a css file
@MariaAga is the comment // inline style overrides PatternFly default styling
enough? If so, could you please merge it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah! i approved it, and have to merge permissions in plugins, only @adamruzicka can merge here:)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't want to merge with outstanding comments in case this was still unresolved
<ChartTooltip pointerLength={0} constrainToVisibleArea /> | ||
} | ||
title={chartDonutTitle} | ||
titleComponent={<ChartLabel style={{ fontSize: '20px' }} />} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be in a css file
d44ac23
to
9183648
Compare
@MariaAga thank you, I incorporated everything except for some chart CSS styles (I left comments on those). |
@@ -0,0 +1,42 @@ | |||
$chart_size: 105px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also should be in .job-invocation-detail-page-section
or have unique name
9183648
to
d11668b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
1f7cd15
to
0aa6122
Compare
0aa6122
to
cb8e8ee
Compare
QA, LGTM. |
Also WRT UI automation, the identifiers look sufficient to locate all important items. |
Thank you @kmalyjur ! |
Thank you @MariaAga @adamruzicka @pnovotny |
Adds system status chart and its legend to the new job invocations detail page.
You can find the discussion here.
Links for filtering the host table through the legend will be added in a future PR.