Skip to content

Commit

Permalink
fix(openshiftMetrics,openshiftDedicated): ent-4251 legend tooltip (#775)
Browse files Browse the repository at this point in the history
  • Loading branch information
cdcabrera committed Dec 6, 2021
1 parent d264834 commit 9d4f6b6
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 18 deletions.
5 changes: 3 additions & 2 deletions public/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@
"label_threshold_infinite": "unlimited",
"legendTooltip_cores": "{{product}} CPU usage, per CPU core.",
"legendTooltip_coreHours": "{{product}} core hours usage.",
"legendTooltip_coreHours_OpenShift-dedicated-metrics": "OpenShift Dedicated core hours usage.",
"legendTooltip_instanceHours_OpenShift-dedicated-metrics": "OpenShift Dedicated instance hours usage.",
"legendTooltip_coreHours_OpenShift-dedicated-metrics": "OpenShift Dedicated <0>On-Demand</0> core hour usage.",
"legendTooltip_instanceHours_OpenShift-dedicated-metrics": "OpenShift Dedicated <0>On-Demand</0> instance hour usage.",
"legendTooltip_coreHours_OpenShift-metrics": "OpenShift Container Platform <0>On-Demand</0> core hour usage.",
"legendTooltip_cloudSockets": "Public cloud {{product}} CPU usage, 1 CPU socket per instance.",
"legendTooltip_hypervisorCores": "{{product}} CPU usage, per CPU core.",
"legendTooltip_hypervisorSockets": "{{product}} CPU socket usage, per socket pair.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ exports[`GraphCardChartLegend Component should render a basic component: basic 1
<Tooltip
content={
<p>
t(curiosity-graph.legendTooltip_loremIpsum, {"product":"","context":""})
t(curiosity-graph.legendTooltip_loremIpsum, {"product":"","context":""}, [object Object])
</p>
}
distance={5}
Expand Down Expand Up @@ -213,7 +213,7 @@ exports[`GraphCardChartLegend Component should render basic data: data 1`] = `
<Tooltip
content={
<p>
t(curiosity-graph.legendTooltip_loremIpsum, {"product":"test","context":"test"})
t(curiosity-graph.legendTooltip_loremIpsum, {"product":"test","context":"test"}, [object Object])
</p>
}
distance={5}
Expand Down Expand Up @@ -250,7 +250,7 @@ exports[`GraphCardChartLegend Component should render basic data: data 1`] = `
<Tooltip
content={
<p>
t(curiosity-graph.legendTooltip_ametConsectetur, {"product":"test","context":"test"})
t(curiosity-graph.legendTooltip_ametConsectetur, {"product":"test","context":"test"}, [object Object])
</p>
}
distance={5}
Expand Down Expand Up @@ -282,7 +282,7 @@ exports[`GraphCardChartLegend Component should render basic data: data 1`] = `
<Tooltip
content={
<p>
t(curiosity-graph.legendTooltip_threshold_dolorSit, {"product":"test","context":"test"})
t(curiosity-graph.legendTooltip_threshold_dolorSit, {"product":"test","context":"test"}, [object Object])
</p>
}
distance={5}
Expand Down Expand Up @@ -319,7 +319,7 @@ exports[`GraphCardChartLegend Component should render basic data: data 1`] = `
<Tooltip
content={
<p>
t(curiosity-graph.legendTooltip_threshold_nonCursus, {"product":"test","context":"test"})
t(curiosity-graph.legendTooltip_threshold_nonCursus, {"product":"test","context":"test"}, [object Object])
</p>
}
distance={5}
Expand Down
12 changes: 8 additions & 4 deletions src/components/graphCard/graphCardChartLegend.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,14 @@ class GraphCardChartLegend extends React.Component {
}
);

const tooltipContent = t(`curiosity-graph.legendTooltip${(isThreshold && '_threshold') || ''}_${id}`, {
product: productLabel,
context: productLabel
});
const tooltipContent = t(
`curiosity-graph.legendTooltip${(isThreshold && '_threshold') || ''}_${id}`,
{
product: productLabel,
context: productLabel
},
[<span style={{ whiteSpace: 'nowrap' }} />]
);

return this.renderLegendItem({
chartId: id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Array [
},
Object {
"key": "",
"match": "t(\`curiosity-graph.legendTooltip\${(isThreshold && '_threshold')",
"match": "t( \`curiosity-graph.legendTooltip\${(isThreshold && '_threshold')",
},
],
},
Expand Down
6 changes: 0 additions & 6 deletions src/styles/index.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
// Framework
@import '~@redhat-cloud-services/frontend-components-utilities/index';
/**
* FixMe: Variables break Sass compiler
* Sass compiler throws an error when coming across the following syntax in
* --BackgroundUrl:url("d...
* Workaround is to move the CSS files to ./src/index.js
*/
@import '~@patternfly/patternfly/sass-utilities/all';

// App
Expand Down

0 comments on commit 9d4f6b6

Please sign in to comment.