@red-hat-developer-hub/backstage-plugin-scorecard 2.6.0 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +3 -1
  3. package/dist/alpha/extensions/homePageCards.esm.js +18 -1
  4. package/dist/alpha/extensions/homePageCards.esm.js.map +1 -1
  5. package/dist/alpha.d.ts +1 -1
  6. package/dist/alpha.esm.js +3 -2
  7. package/dist/alpha.esm.js.map +1 -1
  8. package/dist/components/AggregatedMetricCards/AggregatedMetricCard.esm.js +32 -0
  9. package/dist/components/AggregatedMetricCards/AggregatedMetricCard.esm.js.map +1 -0
  10. package/dist/components/AggregatedMetricCards/AverageCard/AverageCardComponent.esm.js +168 -0
  11. package/dist/components/AggregatedMetricCards/AverageCard/AverageCardComponent.esm.js.map +1 -0
  12. package/dist/components/AggregatedMetricCards/AverageCard/AverageCardPieCenterLabel.esm.js +58 -0
  13. package/dist/components/AggregatedMetricCards/AverageCard/AverageCardPieCenterLabel.esm.js.map +1 -0
  14. package/dist/components/AggregatedMetricCards/AverageCard/DonutChartTooltipContent.esm.js +30 -0
  15. package/dist/components/AggregatedMetricCards/AverageCard/DonutChartTooltipContent.esm.js.map +1 -0
  16. package/dist/components/AggregatedMetricCards/AverageCard/LegendTooltipContent.esm.js +39 -0
  17. package/dist/components/AggregatedMetricCards/AverageCard/LegendTooltipContent.esm.js.map +1 -0
  18. package/dist/components/AggregatedMetricCards/AverageCard/TooltipContent.esm.js +36 -0
  19. package/dist/components/AggregatedMetricCards/AverageCard/TooltipContent.esm.js.map +1 -0
  20. package/dist/components/AggregatedMetricCards/StatusGroupedCard/StatusGroupedCardComponent.esm.js +100 -0
  21. package/dist/components/AggregatedMetricCards/StatusGroupedCard/StatusGroupedCardComponent.esm.js.map +1 -0
  22. package/dist/components/AggregatedMetricCards/UnsupportedAggregationType.esm.js +29 -0
  23. package/dist/components/AggregatedMetricCards/UnsupportedAggregationType.esm.js.map +1 -0
  24. package/dist/components/AggregatedMetricCards/components/CardChartContainer.esm.js +31 -0
  25. package/dist/components/AggregatedMetricCards/components/CardChartContainer.esm.js.map +1 -0
  26. package/dist/components/AggregatedMetricCards/components/CardInfoButton.esm.js +46 -0
  27. package/dist/components/AggregatedMetricCards/components/CardInfoButton.esm.js.map +1 -0
  28. package/dist/components/AggregatedMetricCards/components/CardLegendContent.esm.js +24 -0
  29. package/dist/components/AggregatedMetricCards/components/CardLegendContent.esm.js.map +1 -0
  30. package/dist/components/AggregatedMetricCards/components/CardPieTooltipContent.esm.js +16 -0
  31. package/dist/components/AggregatedMetricCards/components/CardPieTooltipContent.esm.js.map +1 -0
  32. package/dist/components/AggregatedMetricCards/components/CardSubheader.esm.js +33 -0
  33. package/dist/components/AggregatedMetricCards/components/CardSubheader.esm.js.map +1 -0
  34. package/dist/components/AggregatedMetricCards/components/CardTooltip.esm.js +36 -0
  35. package/dist/components/AggregatedMetricCards/components/CardTooltip.esm.js.map +1 -0
  36. package/dist/components/Common/CardLoading.esm.js +3 -1
  37. package/dist/components/Common/CardLoading.esm.js.map +1 -1
  38. package/dist/components/ScorecardHomepageSection/CustomLegend.esm.js +10 -15
  39. package/dist/components/ScorecardHomepageSection/CustomLegend.esm.js.map +1 -1
  40. package/dist/components/ScorecardHomepageSection/CustomTooltip.esm.js +7 -2
  41. package/dist/components/ScorecardHomepageSection/CustomTooltip.esm.js.map +1 -1
  42. package/dist/components/ScorecardHomepageSection/ResponsivePieChart.esm.js +3 -2
  43. package/dist/components/ScorecardHomepageSection/ResponsivePieChart.esm.js.map +1 -1
  44. package/dist/components/ScorecardHomepageSection/ScorecardHomepageCard.esm.js +2 -2
  45. package/dist/components/ScorecardHomepageSection/ScorecardHomepageCard.esm.js.map +1 -1
  46. package/dist/components/ScorecardPage/EntitiesTable/EntitiesTable.esm.js +1 -1
  47. package/dist/components/ScorecardPage/EntitiesTable/EntitiesTable.esm.js.map +1 -1
  48. package/dist/index.d.ts +1 -1
  49. package/dist/translations/de.esm.js +8 -2
  50. package/dist/translations/de.esm.js.map +1 -1
  51. package/dist/translations/es.esm.js +8 -2
  52. package/dist/translations/es.esm.js.map +1 -1
  53. package/dist/translations/fr.esm.js +8 -2
  54. package/dist/translations/fr.esm.js.map +1 -1
  55. package/dist/translations/it.esm.js +8 -2
  56. package/dist/translations/it.esm.js.map +1 -1
  57. package/dist/translations/ja.esm.js +8 -2
  58. package/dist/translations/ja.esm.js.map +1 -1
  59. package/dist/translations/ref.esm.js +12 -4
  60. package/dist/translations/ref.esm.js.map +1 -1
  61. package/dist/types/{index.d-WA6f0Uad.d.ts → index.d-Uz1xsqdo.d.ts} +7 -2
  62. package/dist/utils/formatPercentage.esm.js +6 -0
  63. package/dist/utils/formatPercentage.esm.js.map +1 -0
  64. package/package.json +2 -2
  65. package/dist/components/ScorecardHomepageSection/ScorecardHomepageCardComponent.esm.js +0 -172
  66. package/dist/components/ScorecardHomepageSection/ScorecardHomepageCardComponent.esm.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # @red-hat-developer-hub/backstage-plugin-scorecard
2
2
 
3
+ ## 2.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - bf72ffc: Adds `**average**` as an aggregation KPI type alongside `**statusGrouped**`, with configurable `**options.statusScores**` and optional `**options.thresholds**` (same shape as metric thresholds) for homepage donut coloring against `**averageScore × 100**`, with built-in defaults when omitted.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [bf72ffc]
12
+ - @red-hat-developer-hub/backstage-plugin-scorecard-common@2.7.0
13
+
3
14
  ## 2.6.0
4
15
 
5
16
  ### Minor Changes
package/README.md CHANGED
@@ -6,7 +6,7 @@ The plugin supports both the **legacy** Backstage frontend and the **New Fronten
6
6
  **Features:**
7
7
 
8
8
  - **Entity scorecard tab** — View scorecard metrics on catalog entity pages (components, websites, etc.).
9
- - **Scorecard homepage card** — Show aggregated KPIs on the home page (e.g. GitHub open PRs, Jira open issues).
9
+ - **Scorecard homepage card** — Show aggregated KPIs on the home page (e.g. GitHub open PRs, Jira open issues). Supports **`statusGrouped`** (multi-slice pie) and **`average`** (weighted health donut) KPI types configured under **`scorecard.aggregationKPIs`**.
10
10
  - **Scorecard Entities page** — Drill down from an aggregated metric to see the list of entities contributing to that metric, with entity-level values and status, so you can identify services impacting the KPI and investigate issues.
11
11
 
12
12
  ## Getting started
@@ -310,6 +310,8 @@ The plugin exports **`ScorecardHomepageCard`** (see [`plugin.ts`](./src/plugin.t
310
310
 
311
311
  Define KPI ids and optional labels under **`scorecard.aggregationKPIs`** so each card can call **`GET /aggregations/<aggregationId>`** with a stable id. See [Scorecard backend README — Aggregation KPIs](../scorecard-backend/README.md#aggregation-kpis-homepage-and-get-aggregations). If you omit a KPI entry, use the **metric id** as `aggregationId` (default status-grouped aggregation).
312
312
 
313
+ **`type: average`** KPIs require **`options.statusScores`** (weights per threshold rule key). Optionally set **`options.thresholds`** so the API returns **`aggregationChartDisplayColor`** for the headline percentage. Behavior, validation, and drill-down notes are described in [aggregation.md](../scorecard-backend/docs/aggregation.md).
314
+
313
315
  #### Card props
314
316
 
315
317
  The supported model is **a single `aggregationId` string** whose value is either:
@@ -32,6 +32,9 @@ function AggregatedCardWithGithubFilecheckLicenseContent() {
32
32
  function AggregatedCardWithGithubFilecheckCodeownersContent() {
33
33
  return /* @__PURE__ */ jsx(ScorecardHomepageCardWithProvider, { aggregationId: "filecheck.codeowners" });
34
34
  }
35
+ function AggregatedCardWithGithubOpenPrsWeightedContent() {
36
+ return /* @__PURE__ */ jsx(ScorecardHomepageCardWithProvider, { aggregationId: "openPrsWeightedKpi" });
37
+ }
35
38
  function BorderlessHomeWidgetRenderer({ Content }) {
36
39
  return /* @__PURE__ */ jsx(Content, {});
37
40
  }
@@ -119,6 +122,20 @@ const aggregatedCardWithGithubFilecheckCodeownersWidget = HomePageWidgetBlueprin
119
122
  })
120
123
  }
121
124
  });
125
+ const aggregatedCardWithGithubOpenPrsWeightedWidget = HomePageWidgetBlueprint.make({
126
+ name: "scorecard-github-open-prs-weighted",
127
+ params: {
128
+ name: "AggregatedCardWithGithubOpenPrsWeighted",
129
+ title: "Scorecard: GitHub open PRs (weighted health)",
130
+ layout: defaultCardLayout,
131
+ componentProps: {
132
+ Renderer: BorderlessHomeWidgetRenderer
133
+ },
134
+ components: () => Promise.resolve({
135
+ Content: AggregatedCardWithGithubOpenPrsWeightedContent
136
+ })
137
+ }
138
+ });
122
139
 
123
- export { aggregatedCardWithDefaultAggregationWidget, aggregatedCardWithDeprecatedMetricIdWidget, aggregatedCardWithGithubFilecheckCodeownersWidget, aggregatedCardWithGithubFilecheckLicenseWidget, aggregatedCardWithGithubOpenPrsWidget, aggregatedCardWithJiraOpenIssuesWidget };
140
+ export { aggregatedCardWithDefaultAggregationWidget, aggregatedCardWithDeprecatedMetricIdWidget, aggregatedCardWithGithubFilecheckCodeownersWidget, aggregatedCardWithGithubFilecheckLicenseWidget, aggregatedCardWithGithubOpenPrsWeightedWidget, aggregatedCardWithGithubOpenPrsWidget, aggregatedCardWithJiraOpenIssuesWidget };
124
141
  //# sourceMappingURL=homePageCards.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"homePageCards.esm.js","sources":["../../../src/alpha/extensions/homePageCards.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { HomePageWidgetBlueprint } from '@backstage/plugin-home-react/alpha';\nimport type { RendererProps } from '@backstage/plugin-home-react';\nimport { ScorecardHomepageCardWithProvider } from '../../components/ScorecardHomepageSection';\n\nconst defaultCardLayout = {\n width: {\n minColumns: 3,\n maxColumns: 12,\n defaultColumns: 4,\n },\n height: {\n minRows: 5,\n maxRows: 12,\n defaultRows: 6,\n },\n} as const;\n\nfunction AggregatedCardWithDeprecatedMetricIdContent() {\n return <ScorecardHomepageCardWithProvider metricId=\"jira.open_issues\" />;\n}\n\nfunction AggregatedCardWithDefaultAggregationContent() {\n return <ScorecardHomepageCardWithProvider aggregationId=\"github.open_prs\" />;\n}\n\nfunction AggregatedCardWithJiraOpenIssuesContent() {\n return <ScorecardHomepageCardWithProvider aggregationId=\"openIssuesKpi\" />;\n}\n\nfunction AggregatedCardWithGithubOpenPrsContent() {\n return <ScorecardHomepageCardWithProvider aggregationId=\"openPrsKpi\" />;\n}\n\nfunction AggregatedCardWithGithubFilecheckLicenseContent() {\n return (\n <ScorecardHomepageCardWithProvider aggregationId=\"licenseFileExistsKpi\" />\n );\n}\n\nfunction AggregatedCardWithGithubFilecheckCodeownersContent() {\n return (\n <ScorecardHomepageCardWithProvider aggregationId=\"filecheck.codeowners\" />\n );\n}\n\nfunction BorderlessHomeWidgetRenderer({ Content }: RendererProps) {\n return <Content />;\n}\n\n/**\n * NFS widget: AggregatedCardWithDeprecatedMetricId.\n * @alpha\n */\nexport const aggregatedCardWithDeprecatedMetricIdWidget =\n HomePageWidgetBlueprint.make({\n name: 'scorecard-deprecated-metric-id',\n params: {\n name: 'AggregatedCardWithDeprecatedMetricId',\n title: 'Scorecard: With deprecated metricId property (Jira)',\n layout: defaultCardLayout,\n componentProps: {\n Renderer: BorderlessHomeWidgetRenderer,\n },\n components: () =>\n Promise.resolve({\n Content: AggregatedCardWithDeprecatedMetricIdContent,\n }),\n },\n });\n\n/**\n * NFS widget: AggregatedCardWithDefaultAggregation.\n * @alpha\n */\nexport const aggregatedCardWithDefaultAggregationWidget =\n HomePageWidgetBlueprint.make({\n name: 'scorecard-default-aggregation',\n params: {\n name: 'AggregatedCardWithDefaultAggregation',\n title: 'Scorecard: With default aggregation config (GitHub)',\n layout: defaultCardLayout,\n componentProps: {\n Renderer: BorderlessHomeWidgetRenderer,\n },\n components: () =>\n Promise.resolve({\n Content: AggregatedCardWithDefaultAggregationContent,\n }),\n },\n });\n\n/**\n * NFS widget: AggregatedCardWithJiraOpenIssues.\n * @alpha\n */\nexport const aggregatedCardWithJiraOpenIssuesWidget =\n HomePageWidgetBlueprint.make({\n name: 'scorecard-jira-open-issues',\n params: {\n name: 'AggregatedCardWithJiraOpenIssues',\n title: 'Scorecard: Jira open blocking tickets',\n layout: defaultCardLayout,\n componentProps: {\n Renderer: BorderlessHomeWidgetRenderer,\n },\n components: () =>\n Promise.resolve({\n Content: AggregatedCardWithJiraOpenIssuesContent,\n }),\n },\n });\n\n/**\n * NFS widget: AggregatedCardWithGithubOpenPrs.\n * @alpha\n */\nexport const aggregatedCardWithGithubOpenPrsWidget =\n HomePageWidgetBlueprint.make({\n name: 'scorecard-github-open-prs',\n params: {\n name: 'AggregatedCardWithGithubOpenPrs',\n title: 'Scorecard: GitHub open PRs',\n layout: defaultCardLayout,\n componentProps: {\n Renderer: BorderlessHomeWidgetRenderer,\n },\n components: () =>\n Promise.resolve({\n Content: AggregatedCardWithGithubOpenPrsContent,\n }),\n },\n });\n\n/**\n * NFS widget: AggregatedCardWithGithubFilecheckLicense.\n * @alpha\n */\nexport const aggregatedCardWithGithubFilecheckLicenseWidget =\n HomePageWidgetBlueprint.make({\n name: 'scorecard-github-filecheck-license',\n params: {\n name: 'AggregatedCardWithGithubFilecheckLicense',\n title: 'Scorecard: LICENSE file exists',\n layout: defaultCardLayout,\n componentProps: {\n Renderer: BorderlessHomeWidgetRenderer,\n },\n components: () =>\n Promise.resolve({\n Content: AggregatedCardWithGithubFilecheckLicenseContent,\n }),\n },\n });\n\n/**\n * NFS widget: AggregatedCardWithGithubFilecheckCodeowners.\n * @alpha\n */\nexport const aggregatedCardWithGithubFilecheckCodeownersWidget =\n HomePageWidgetBlueprint.make({\n name: 'scorecard-github-filecheck-codeowners',\n params: {\n name: 'AggregatedCardWithGithubFilecheckCodeowners',\n title: 'Scorecard: CODEOWNERS file exists',\n layout: defaultCardLayout,\n componentProps: {\n Renderer: BorderlessHomeWidgetRenderer,\n },\n components: () =>\n Promise.resolve({\n Content: AggregatedCardWithGithubFilecheckCodeownersContent,\n }),\n },\n });\n"],"names":[],"mappings":";;;;AAoBA,MAAM,iBAAoB,GAAA;AAAA,EACxB,KAAO,EAAA;AAAA,IACL,UAAY,EAAA,CAAA;AAAA,IACZ,UAAY,EAAA,EAAA;AAAA,IACZ,cAAgB,EAAA;AAAA,GAClB;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,OAAS,EAAA,CAAA;AAAA,IACT,OAAS,EAAA,EAAA;AAAA,IACT,WAAa,EAAA;AAAA;AAEjB,CAAA;AAEA,SAAS,2CAA8C,GAAA;AACrD,EAAO,uBAAA,GAAA,CAAC,iCAAkC,EAAA,EAAA,QAAA,EAAS,kBAAmB,EAAA,CAAA;AACxE;AAEA,SAAS,2CAA8C,GAAA;AACrD,EAAO,uBAAA,GAAA,CAAC,iCAAkC,EAAA,EAAA,aAAA,EAAc,iBAAkB,EAAA,CAAA;AAC5E;AAEA,SAAS,uCAA0C,GAAA;AACjD,EAAO,uBAAA,GAAA,CAAC,iCAAkC,EAAA,EAAA,aAAA,EAAc,eAAgB,EAAA,CAAA;AAC1E;AAEA,SAAS,sCAAyC,GAAA;AAChD,EAAO,uBAAA,GAAA,CAAC,iCAAkC,EAAA,EAAA,aAAA,EAAc,YAAa,EAAA,CAAA;AACvE;AAEA,SAAS,+CAAkD,GAAA;AACzD,EACE,uBAAA,GAAA,CAAC,iCAAkC,EAAA,EAAA,aAAA,EAAc,sBAAuB,EAAA,CAAA;AAE5E;AAEA,SAAS,kDAAqD,GAAA;AAC5D,EACE,uBAAA,GAAA,CAAC,iCAAkC,EAAA,EAAA,aAAA,EAAc,sBAAuB,EAAA,CAAA;AAE5E;AAEA,SAAS,4BAAA,CAA6B,EAAE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MAAQ,EAAA;AAAA,IACN,IAAM,EAAA,iCAAA;AAAA,IACN,KAAO,EAAA,4BAAA;AAAA,IACP,MAAQ,EAAA,iBAAA;AAAA,IACR,cAAgB,EAAA;AAAA,MACd,QAAU,EAAA;AAAA,KACZ;AAAA,IACA,UAAA,EAAY,MACV,OAAA,CAAQ,OAAQ,CAAA;AAAA,MACd,OAAS,EAAA;AAAA,KACV;AAAA;AAEP,CAAC;AAMU,MAAA,8CAAA,GACX,wBAAwB,IAAK,CAAA;AAAA,EAC3B,IAAM,EAAA,oCAAA;AAAA,EACN,MAAQ,EAAA;AAAA,IACN,IAAM,EAAA,0CAAA;AAAA,IACN,KAAO,EAAA,gCAAA;AAAA,IACP,MAAQ,EAAA,iBAAA;AAAA,IACR,cAAgB,EAAA;AAAA,MACd,QAAU,EAAA;AAAA,KACZ;AAAA,IACA,UAAA,EAAY,MACV,OAAA,CAAQ,OAAQ,CAAA;AAAA,MACd,OAAS,EAAA;AAAA,KACV;AAAA;AAEP,CAAC;AAMU,MAAA,iDAAA,GACX,wBAAwB,IAAK,CAAA;AAAA,EAC3B,IAAM,EAAA,uCAAA;AAAA,EACN,MAAQ,EAAA;AAAA,IACN,IAAM,EAAA,6CAAA;AAAA,IACN,KAAO,EAAA,mCAAA;AAAA,IACP,MAAQ,EAAA,iBAAA;AAAA,IACR,cAAgB,EAAA;AAAA,MACd,QAAU,EAAA;AAAA,KACZ;AAAA,IACA,UAAA,EAAY,MACV,OAAA,CAAQ,OAAQ,CAAA;AAAA,MACd,OAAS,EAAA;AAAA,KACV;AAAA;AAEP,CAAC;;;;"}
1
+ {"version":3,"file":"homePageCards.esm.js","sources":["../../../src/alpha/extensions/homePageCards.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { HomePageWidgetBlueprint } from '@backstage/plugin-home-react/alpha';\nimport type { RendererProps } from '@backstage/plugin-home-react';\nimport { ScorecardHomepageCardWithProvider } from '../../components/ScorecardHomepageSection';\n\nconst defaultCardLayout = {\n width: {\n minColumns: 3,\n maxColumns: 12,\n defaultColumns: 4,\n },\n height: {\n minRows: 5,\n maxRows: 12,\n defaultRows: 6,\n },\n} as const;\n\nfunction AggregatedCardWithDeprecatedMetricIdContent() {\n return <ScorecardHomepageCardWithProvider metricId=\"jira.open_issues\" />;\n}\n\nfunction AggregatedCardWithDefaultAggregationContent() {\n return <ScorecardHomepageCardWithProvider aggregationId=\"github.open_prs\" />;\n}\n\nfunction AggregatedCardWithJiraOpenIssuesContent() {\n return <ScorecardHomepageCardWithProvider aggregationId=\"openIssuesKpi\" />;\n}\n\nfunction AggregatedCardWithGithubOpenPrsContent() {\n return <ScorecardHomepageCardWithProvider aggregationId=\"openPrsKpi\" />;\n}\n\nfunction AggregatedCardWithGithubFilecheckLicenseContent() {\n return (\n <ScorecardHomepageCardWithProvider aggregationId=\"licenseFileExistsKpi\" />\n );\n}\n\nfunction AggregatedCardWithGithubFilecheckCodeownersContent() {\n return (\n <ScorecardHomepageCardWithProvider aggregationId=\"filecheck.codeowners\" />\n );\n}\n\nfunction AggregatedCardWithGithubOpenPrsWeightedContent() {\n return (\n <ScorecardHomepageCardWithProvider aggregationId=\"openPrsWeightedKpi\" />\n );\n}\n\nfunction BorderlessHomeWidgetRenderer({ Content }: RendererProps) {\n return <Content />;\n}\n\n/**\n * NFS widget: AggregatedCardWithDeprecatedMetricId.\n * @alpha\n */\nexport const aggregatedCardWithDeprecatedMetricIdWidget =\n HomePageWidgetBlueprint.make({\n name: 'scorecard-deprecated-metric-id',\n params: {\n name: 'AggregatedCardWithDeprecatedMetricId',\n title: 'Scorecard: With deprecated metricId property (Jira)',\n layout: defaultCardLayout,\n componentProps: {\n Renderer: BorderlessHomeWidgetRenderer,\n },\n components: () =>\n Promise.resolve({\n Content: AggregatedCardWithDeprecatedMetricIdContent,\n }),\n },\n });\n\n/**\n * NFS widget: AggregatedCardWithDefaultAggregation.\n * @alpha\n */\nexport const aggregatedCardWithDefaultAggregationWidget =\n HomePageWidgetBlueprint.make({\n name: 'scorecard-default-aggregation',\n params: {\n name: 'AggregatedCardWithDefaultAggregation',\n title: 'Scorecard: With default aggregation config (GitHub)',\n layout: defaultCardLayout,\n componentProps: {\n Renderer: BorderlessHomeWidgetRenderer,\n },\n components: () =>\n Promise.resolve({\n Content: AggregatedCardWithDefaultAggregationContent,\n }),\n },\n });\n\n/**\n * NFS widget: AggregatedCardWithJiraOpenIssues.\n * @alpha\n */\nexport const aggregatedCardWithJiraOpenIssuesWidget =\n HomePageWidgetBlueprint.make({\n name: 'scorecard-jira-open-issues',\n params: {\n name: 'AggregatedCardWithJiraOpenIssues',\n title: 'Scorecard: Jira open blocking tickets',\n layout: defaultCardLayout,\n componentProps: {\n Renderer: BorderlessHomeWidgetRenderer,\n },\n components: () =>\n Promise.resolve({\n Content: AggregatedCardWithJiraOpenIssuesContent,\n }),\n },\n });\n\n/**\n * NFS widget: AggregatedCardWithGithubOpenPrs.\n * @alpha\n */\nexport const aggregatedCardWithGithubOpenPrsWidget =\n HomePageWidgetBlueprint.make({\n name: 'scorecard-github-open-prs',\n params: {\n name: 'AggregatedCardWithGithubOpenPrs',\n title: 'Scorecard: GitHub open PRs',\n layout: defaultCardLayout,\n componentProps: {\n Renderer: BorderlessHomeWidgetRenderer,\n },\n components: () =>\n Promise.resolve({\n Content: AggregatedCardWithGithubOpenPrsContent,\n }),\n },\n });\n\n/**\n * NFS widget: AggregatedCardWithGithubFilecheckLicense.\n * @alpha\n */\nexport const aggregatedCardWithGithubFilecheckLicenseWidget =\n HomePageWidgetBlueprint.make({\n name: 'scorecard-github-filecheck-license',\n params: {\n name: 'AggregatedCardWithGithubFilecheckLicense',\n title: 'Scorecard: LICENSE file exists',\n layout: defaultCardLayout,\n componentProps: {\n Renderer: BorderlessHomeWidgetRenderer,\n },\n components: () =>\n Promise.resolve({\n Content: AggregatedCardWithGithubFilecheckLicenseContent,\n }),\n },\n });\n\n/**\n * NFS widget: AggregatedCardWithGithubFilecheckCodeowners.\n * @alpha\n */\nexport const aggregatedCardWithGithubFilecheckCodeownersWidget =\n HomePageWidgetBlueprint.make({\n name: 'scorecard-github-filecheck-codeowners',\n params: {\n name: 'AggregatedCardWithGithubFilecheckCodeowners',\n title: 'Scorecard: CODEOWNERS file exists',\n layout: defaultCardLayout,\n componentProps: {\n Renderer: BorderlessHomeWidgetRenderer,\n },\n components: () =>\n Promise.resolve({\n Content: AggregatedCardWithGithubFilecheckCodeownersContent,\n }),\n },\n });\n\n/**\n * NFS widget: AggregatedCardWithGithubOpenPrsWeighted.\n * @alpha\n */\nexport const aggregatedCardWithGithubOpenPrsWeightedWidget =\n HomePageWidgetBlueprint.make({\n name: 'scorecard-github-open-prs-weighted',\n params: {\n name: 'AggregatedCardWithGithubOpenPrsWeighted',\n title: 'Scorecard: GitHub open PRs (weighted health)',\n layout: defaultCardLayout,\n componentProps: {\n Renderer: BorderlessHomeWidgetRenderer,\n },\n components: () =>\n Promise.resolve({\n Content: AggregatedCardWithGithubOpenPrsWeightedContent,\n }),\n },\n });\n"],"names":[],"mappings":";;;;AAoBA,MAAM,iBAAoB,GAAA;AAAA,EACxB,KAAO,EAAA;AAAA,IACL,UAAY,EAAA,CAAA;AAAA,IACZ,UAAY,EAAA,EAAA;AAAA,IACZ,cAAgB,EAAA;AAAA,GAClB;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,OAAS,EAAA,CAAA;AAAA,IACT,OAAS,EAAA,EAAA;AAAA,IACT,WAAa,EAAA;AAAA;AAEjB,CAAA;AAEA,SAAS,2CAA8C,GAAA;AACrD,EAAO,uBAAA,GAA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AA,IACP,MAAQ,EAAA,iBAAA;AAAA,IACR,cAAgB,EAAA;AAAA,MACd,QAAU,EAAA;AAAA,KACZ;AAAA,IACA,UAAA,EAAY,MACV,OAAA,CAAQ,OAAQ,CAAA;AAAA,MACd,OAAS,EAAA;AAAA,KACV;AAAA;AAEP,CAAC;AAMU,MAAA,iDAAA,GACX,wBAAwB,IAAK,CAAA;AAAA,EAC3B,IAAM,EAAA,uCAAA;AAAA,EACN,MAAQ,EAAA;AAAA,IACN,IAAM,EAAA,6CAAA;AAAA,IACN,KAAO,EAAA,mCAAA;AAAA,IACP,MAAQ,EAAA,iBAAA;AAAA,IACR,cAAgB,EAAA;AAAA,MACd,QAAU,EAAA;AAAA,KACZ;AAAA,IACA,UAAA,EAAY,MACV,OAAA,CAAQ,OAAQ,CAAA;AAAA,MACd,OAAS,EAAA;AAAA,KACV;AAAA;AAEP,CAAC;AAMU,MAAA,6CAAA,GACX,wBAAwB,IAAK,CAAA;AAAA,EAC3B,IAAM,EAAA,oCAAA;AAAA,EACN,MAAQ,EAAA;AAAA,IACN,IAAM,EAAA,yCAAA;AAAA,IACN,KAAO,EAAA,8CAAA;AAAA,IACP,MAAQ,EAAA,iBAAA;AAAA,IACR,cAAgB,EAAA;AAAA,MACd,QAAU,EAAA;AAAA,KACZ;AAAA,IACA,UAAA,EAAY,MACV,OAAA,CAAQ,OAAQ,CAAA;AAAA,MACd,OAAS,EAAA;AAAA,KACV;AAAA;AAEP,CAAC;;;;"}
package/dist/alpha.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
3
3
  import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
4
- export { a as scorecardTranslationRef, s as scorecardTranslations } from './types/index.d-WA6f0Uad.js';
4
+ export { a as scorecardTranslationRef, s as scorecardTranslations } from './types/index.d-Uz1xsqdo.js';
5
5
 
6
6
  /**
7
7
  * The primary Scorecard frontend plugin.
package/dist/alpha.esm.js CHANGED
@@ -4,7 +4,7 @@ import { scorecardDrillDownRouteRef, rootRouteRef } from './routes.esm.js';
4
4
  import { scorecardTranslations } from './translations/index.esm.js';
5
5
  import { scorecardApi } from './alpha/extensions/api.esm.js';
6
6
  import { scorecardEntityContent } from './alpha/extensions/entityTab.esm.js';
7
- import { aggregatedCardWithDeprecatedMetricIdWidget, aggregatedCardWithDefaultAggregationWidget, aggregatedCardWithJiraOpenIssuesWidget, aggregatedCardWithGithubOpenPrsWidget, aggregatedCardWithGithubFilecheckLicenseWidget, aggregatedCardWithGithubFilecheckCodeownersWidget } from './alpha/extensions/homePageCards.esm.js';
7
+ import { aggregatedCardWithDeprecatedMetricIdWidget, aggregatedCardWithDefaultAggregationWidget, aggregatedCardWithJiraOpenIssuesWidget, aggregatedCardWithGithubOpenPrsWidget, aggregatedCardWithGithubFilecheckLicenseWidget, aggregatedCardWithGithubFilecheckCodeownersWidget, aggregatedCardWithGithubOpenPrsWeightedWidget } from './alpha/extensions/homePageCards.esm.js';
8
8
  import { scorecardPage } from './alpha/extensions/scorecardPage.esm.js';
9
9
  export { scorecardTranslationRef } from './translations/ref.esm.js';
10
10
 
@@ -37,7 +37,8 @@ const scorecardHomeModule = createFrontendModule({
37
37
  aggregatedCardWithJiraOpenIssuesWidget,
38
38
  aggregatedCardWithGithubOpenPrsWidget,
39
39
  aggregatedCardWithGithubFilecheckLicenseWidget,
40
- aggregatedCardWithGithubFilecheckCodeownersWidget
40
+ aggregatedCardWithGithubFilecheckCodeownersWidget,
41
+ aggregatedCardWithGithubOpenPrsWeightedWidget
41
42
  ]
42
43
  });
43
44
 
@@ -1 +1 @@
1
- {"version":3,"file":"alpha.esm.js","sources":["../src/alpha/index.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n createFrontendModule,\n createFrontendPlugin,\n} from '@backstage/frontend-plugin-api';\nimport { TranslationBlueprint } from '@backstage/plugin-app-react';\nimport { rootRouteRef, scorecardDrillDownRouteRef } from '../routes';\nimport { scorecardTranslations } from '../translations';\nimport { scorecardApi } from './extensions/api';\nimport { scorecardEntityContent } from './extensions/entityTab';\nimport {\n aggregatedCardWithDeprecatedMetricIdWidget,\n aggregatedCardWithDefaultAggregationWidget,\n aggregatedCardWithGithubOpenPrsWidget,\n aggregatedCardWithJiraOpenIssuesWidget,\n aggregatedCardWithGithubFilecheckLicenseWidget,\n aggregatedCardWithGithubFilecheckCodeownersWidget,\n} from './extensions/homePageCards';\nimport { scorecardPage } from './extensions/scorecardPage';\n\n/**\n * Extension for Scorecard translations.\n */\nconst scorecardTranslation = TranslationBlueprint.make({\n params: {\n resource: scorecardTranslations,\n },\n});\n\n/**\n * The primary Scorecard frontend plugin.\n * @alpha\n */\nexport default createFrontendPlugin({\n pluginId: 'scorecard',\n extensions: [scorecardApi, scorecardPage],\n routes: {\n root: rootRouteRef,\n drillDown: scorecardDrillDownRouteRef,\n },\n});\n\n/**\n * Catalog module that automatically injects the Scorecard tab into the Catalog.\n * @alpha\n */\nexport const scorecardCatalogModule = createFrontendModule({\n pluginId: 'catalog',\n extensions: [scorecardEntityContent],\n});\n\n/**\n * App module that automatically registers Scorecard translations.\n * @alpha\n */\nexport const scorecardTranslationsModule = createFrontendModule({\n pluginId: 'app',\n extensions: [scorecardTranslation],\n});\n\n/**\n * Home module that contributes scorecard homepage widget and layout.\n * @alpha\n */\nexport const scorecardHomeModule = createFrontendModule({\n pluginId: 'home',\n extensions: [\n aggregatedCardWithDeprecatedMetricIdWidget,\n aggregatedCardWithDefaultAggregationWidget,\n aggregatedCardWithJiraOpenIssuesWidget,\n aggregatedCardWithGithubOpenPrsWidget,\n aggregatedCardWithGithubFilecheckLicenseWidget,\n aggregatedCardWithGithubFilecheckCodeownersWidget,\n ],\n});\n\n/**\n * Re-exporting translations for external usage.\n * @alpha\n */\nexport * from '../translations';\n"],"names":[],"mappings":";;;;;;;;;;AAsCA,MAAM,oBAAA,GAAuB,qBAAqB,IAAK,CAAA;AAAA,EACrD,MAAQ,EAAA;AAAA,IACN,QAAU,EAAA;AAAA;AAEd,CAAC,CAAA;AAMD,YAAe,oBAAqB,CAAA;AAAA,EAClC,QAAU,EAAA,WAAA;AAAA,EACV,UAAA,EAAY,CAAC,YAAA,EAAc,aAAa,CAAA;AAAA,EACxC,MAAQ,EAAA;AAAA,IACN,IAAM,EAAA,YAAA;AAAA,IACN,SAAW,EAAA;AAAA;AAEf,CAAC,CAAA;AAMM,MAAM,yBAAyB,oBAAqB,CAAA;AAAA,EACzD,QAAU,EAAA,SAAA;AAAA,EACV,UAAA,EAAY,CAAC,sBAAsB;AACrC,CAAC;AAMM,MAAM,8BAA8B,oBAAqB,CAAA;AAAA,EAC9D,QAAU,EAAA,KAAA;AAAA,EACV,UAAA,EAAY,CAAC,oBAAoB;AACnC,CAAC;AAMM,MAAM,sBAAsB,oBAAqB,CAAA;AAAA,EACtD,QAAU,EAAA,MAAA;AAAA,EACV,UAAY,EAAA;AAAA,IACV,0CAAA;AAAA,IACA,0CAAA;AAAA,IACA,sCAAA;AAAA,IACA,qCAAA;AAAA,IACA,8CAAA;AAAA,IACA;AAAA;AAEJ,CAAC;;;;"}
1
+ {"version":3,"file":"alpha.esm.js","sources":["../src/alpha/index.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n createFrontendModule,\n createFrontendPlugin,\n} from '@backstage/frontend-plugin-api';\nimport { TranslationBlueprint } from '@backstage/plugin-app-react';\nimport { rootRouteRef, scorecardDrillDownRouteRef } from '../routes';\nimport { scorecardTranslations } from '../translations';\nimport { scorecardApi } from './extensions/api';\nimport { scorecardEntityContent } from './extensions/entityTab';\nimport {\n aggregatedCardWithDeprecatedMetricIdWidget,\n aggregatedCardWithDefaultAggregationWidget,\n aggregatedCardWithGithubOpenPrsWidget,\n aggregatedCardWithJiraOpenIssuesWidget,\n aggregatedCardWithGithubFilecheckLicenseWidget,\n aggregatedCardWithGithubFilecheckCodeownersWidget,\n aggregatedCardWithGithubOpenPrsWeightedWidget,\n} from './extensions/homePageCards';\nimport { scorecardPage } from './extensions/scorecardPage';\n\n/**\n * Extension for Scorecard translations.\n */\nconst scorecardTranslation = TranslationBlueprint.make({\n params: {\n resource: scorecardTranslations,\n },\n});\n\n/**\n * The primary Scorecard frontend plugin.\n * @alpha\n */\nexport default createFrontendPlugin({\n pluginId: 'scorecard',\n extensions: [scorecardApi, scorecardPage],\n routes: {\n root: rootRouteRef,\n drillDown: scorecardDrillDownRouteRef,\n },\n});\n\n/**\n * Catalog module that automatically injects the Scorecard tab into the Catalog.\n * @alpha\n */\nexport const scorecardCatalogModule = createFrontendModule({\n pluginId: 'catalog',\n extensions: [scorecardEntityContent],\n});\n\n/**\n * App module that automatically registers Scorecard translations.\n * @alpha\n */\nexport const scorecardTranslationsModule = createFrontendModule({\n pluginId: 'app',\n extensions: [scorecardTranslation],\n});\n\n/**\n * Home module that contributes scorecard homepage widget and layout.\n * @alpha\n */\nexport const scorecardHomeModule = createFrontendModule({\n pluginId: 'home',\n extensions: [\n aggregatedCardWithDeprecatedMetricIdWidget,\n aggregatedCardWithDefaultAggregationWidget,\n aggregatedCardWithJiraOpenIssuesWidget,\n aggregatedCardWithGithubOpenPrsWidget,\n aggregatedCardWithGithubFilecheckLicenseWidget,\n aggregatedCardWithGithubFilecheckCodeownersWidget,\n aggregatedCardWithGithubOpenPrsWeightedWidget,\n ],\n});\n\n/**\n * Re-exporting translations for external usage.\n * @alpha\n */\nexport * from '../translations';\n"],"names":[],"mappings":";;;;;;;;;;AAuCA,MAAM,oBAAA,GAAuB,qBAAqB,IAAK,CAAA;AAAA,EACrD,MAAQ,EAAA;AAAA,IACN,QAAU,EAAA;AAAA;AAEd,CAAC,CAAA;AAMD,YAAe,oBAAqB,CAAA;AAAA,EAClC,QAAU,EAAA,WAAA;AAAA,EACV,UAAA,EAAY,CAAC,YAAA,EAAc,aAAa,CAAA;AAAA,EACxC,MAAQ,EAAA;AAAA,IACN,IAAM,EAAA,YAAA;AAAA,IACN,SAAW,EAAA;AAAA;AAEf,CAAC,CAAA;AAMM,MAAM,yBAAyB,oBAAqB,CAAA;AAAA,EACzD,QAAU,EAAA,SAAA;AAAA,EACV,UAAA,EAAY,CAAC,sBAAsB;AACrC,CAAC;AAMM,MAAM,8BAA8B,oBAAqB,CAAA;AAAA,EAC9D,QAAU,EAAA,KAAA;AAAA,EACV,UAAA,EAAY,CAAC,oBAAoB;AACnC,CAAC;AAMM,MAAM,sBAAsB,oBAAqB,CAAA;AAAA,EACtD,QAAU,EAAA,MAAA;AAAA,EACV,UAAY,EAAA;AAAA,IACV,0CAAA;AAAA,IACA,0CAAA;AAAA,IACA,sCAAA;AAAA,IACA,qCAAA;AAAA,IACA,8CAAA;AAAA,IACA,iDAAA;AAAA,IACA;AAAA;AAEJ,CAAC;;;;"}
@@ -0,0 +1,32 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { aggregationTypes } from '@red-hat-developer-hub/backstage-plugin-scorecard-common';
3
+ import { StatusGroupedCardComponent } from './StatusGroupedCard/StatusGroupedCardComponent.esm.js';
4
+ import { AverageCardComponent } from './AverageCard/AverageCardComponent.esm.js';
5
+ import { UnsupportedAggregationType } from './UnsupportedAggregationType.esm.js';
6
+
7
+ const AggregatedMetricCard = (props) => {
8
+ switch (props.scorecard.metadata.aggregationType) {
9
+ case aggregationTypes.statusGrouped:
10
+ return /* @__PURE__ */ jsx(
11
+ StatusGroupedCardComponent,
12
+ {
13
+ ...props
14
+ }
15
+ );
16
+ case aggregationTypes.average:
17
+ return /* @__PURE__ */ jsx(AverageCardComponent, { ...props });
18
+ default:
19
+ return /* @__PURE__ */ jsx(
20
+ UnsupportedAggregationType,
21
+ {
22
+ cardTitle: props.cardTitle,
23
+ description: props.description,
24
+ dataTestId: props.dataTestId,
25
+ aggregationType: String(props.scorecard.metadata.aggregationType)
26
+ }
27
+ );
28
+ }
29
+ };
30
+
31
+ export { AggregatedMetricCard };
32
+ //# sourceMappingURL=AggregatedMetricCard.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AggregatedMetricCard.esm.js","sources":["../../../src/components/AggregatedMetricCards/AggregatedMetricCard.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { aggregationTypes } from '@red-hat-developer-hub/backstage-plugin-scorecard-common';\nimport { StatusGroupedCardComponent } from './StatusGroupedCard/StatusGroupedCardComponent';\nimport { AverageCardComponent } from './AverageCard/AverageCardComponent';\nimport type { AverageCardComponentProps } from './AverageCard/types';\nimport type { StatusGroupedCardComponentProps } from './StatusGroupedCard/types';\nimport { UnsupportedAggregationType } from './UnsupportedAggregationType';\n\nexport type AggregatedMetricCardProps =\n | StatusGroupedCardComponentProps\n | AverageCardComponentProps;\n\nexport const AggregatedMetricCard = (props: AggregatedMetricCardProps) => {\n switch (props.scorecard.metadata.aggregationType) {\n case aggregationTypes.statusGrouped:\n return (\n <StatusGroupedCardComponent\n {...(props as StatusGroupedCardComponentProps)}\n />\n );\n case aggregationTypes.average:\n return <AverageCardComponent {...(props as AverageCardComponentProps)} />;\n default:\n return (\n <UnsupportedAggregationType\n cardTitle={props.cardTitle}\n description={props.description}\n dataTestId={props.dataTestId}\n aggregationType={String(props.scorecard.metadata.aggregationType)}\n />\n );\n }\n};\n"],"names":[],"mappings":";;;;;;AA2Ba,MAAA,oBAAA,GAAuB,CAAC,KAAqC,KAAA;AACxE,EAAQ,QAAA,KAAA,CAAM,SAAU,CAAA,QAAA,CAAS,eAAiB;AAAA,IAChD,KAAK,gBAAiB,CAAA,aAAA;AACpB,MACE,uBAAA,GAAA;AAAA,QAAC,0BAAA;AAAA,QAAA;AAAA,UACE,GAAI;AAAA;AAAA,OACP;AAAA,IAEJ,KAAK,gBAAiB,CAAA,OAAA;AACpB,MAAO,uBAAA,GAAA,CAAC,oBAAsB,EAAA,EAAA,GAAI,KAAqC,EAAA,CAAA;AAAA,IACzE;AACE,MACE,uBAAA,GAAA;AAAA,QAAC,0BAAA;AAAA,QAAA;AAAA,UACC,WAAW,KAAM,CAAA,SAAA;AAAA,UACjB,aAAa,KAAM,CAAA,WAAA;AAAA,UACnB,YAAY,KAAM,CAAA,UAAA;AAAA,UAClB,eAAiB,EAAA,MAAA,CAAO,KAAM,CAAA,SAAA,CAAU,SAAS,eAAe;AAAA;AAAA,OAClE;AAAA;AAGR;;;;"}
@@ -0,0 +1,168 @@
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import { useState } from 'react';
3
+ import { useTheme } from '@mui/material/styles';
4
+ import { CardWrapper } from '../../Common/CardWrapper.esm.js';
5
+ import { SCORECARD_ERROR_STATE_COLOR } from '../../../utils/constants.esm.js';
6
+ import 'date-fns';
7
+ import { resolveStatusColor } from '../../../utils/statusUtils.esm.js';
8
+ import { getThresholdRuleColor } from '../../../utils/thresholdUtils.esm.js';
9
+ import { ResponsivePieChart } from '../../ScorecardHomepageSection/ResponsivePieChart.esm.js';
10
+ import { CardInfoButton } from '../components/CardInfoButton.esm.js';
11
+ import { CardSubheader } from '../components/CardSubheader.esm.js';
12
+ import { CardChartContainer } from '../components/CardChartContainer.esm.js';
13
+ import { CardTooltip } from '../components/CardTooltip.esm.js';
14
+ import { LegendTooltipContent } from './LegendTooltipContent.esm.js';
15
+ import { DonutChartTooltipContent } from './DonutChartTooltipContent.esm.js';
16
+ import { CardLegendContent } from '../components/CardLegendContent.esm.js';
17
+ import { AverageCardPieCenterLabel } from './AverageCardPieCenterLabel.esm.js';
18
+ import { formatPercentage } from '../../../utils/formatPercentage.esm.js';
19
+
20
+ const AVERAGE_SCORE_SLICE = "averageScoreFill";
21
+ const AVERAGE_REMAINDER_SLICE = "averageScoreRemainder";
22
+ function clampPercentForDonut(rawPercent) {
23
+ const fill = Math.min(100, Math.max(0, rawPercent));
24
+ return { fill, remainder: 100 - fill };
25
+ }
26
+ const AverageCardComponent = ({
27
+ scorecard,
28
+ cardTitle,
29
+ description,
30
+ aggregationId,
31
+ showSubheader = true,
32
+ showInfo = true,
33
+ dataTestId
34
+ }) => {
35
+ const theme = useTheme();
36
+ const [activeIndex, setActiveIndex] = useState(null);
37
+ const [tooltipPosition, setTooltipPosition] = useState(null);
38
+ const [centerTooltipPosition, setCenterTooltipPosition] = useState(null);
39
+ const updateCenterTooltipPosition = (e) => {
40
+ const rect = e.currentTarget.getBoundingClientRect();
41
+ setCenterTooltipPosition({
42
+ left: rect.left + rect.width / 2,
43
+ top: rect.top
44
+ });
45
+ };
46
+ const rawPercent = scorecard.result.averageScore * 100;
47
+ const { fill: chartFillPercent, remainder: chartRemainderPercent } = clampPercentForDonut(rawPercent);
48
+ const centerPercentLabel = `${formatPercentage(rawPercent)}%`;
49
+ const arcResolvedColor = resolveStatusColor(
50
+ theme,
51
+ scorecard.result.aggregationChartDisplayColor
52
+ );
53
+ const averagePieData = [
54
+ {
55
+ name: AVERAGE_SCORE_SLICE,
56
+ value: chartFillPercent,
57
+ color: arcResolvedColor
58
+ },
59
+ {
60
+ name: AVERAGE_REMAINDER_SLICE,
61
+ value: chartRemainderPercent,
62
+ color: theme.palette.grey[300]
63
+ }
64
+ ];
65
+ const statusPieData = scorecard.result.values?.map((value) => ({
66
+ name: value.name,
67
+ value: value.count,
68
+ score: value.score,
69
+ color: resolveStatusColor(
70
+ theme,
71
+ getThresholdRuleColor(scorecard.result.thresholds.rules, value.name) ?? SCORECARD_ERROR_STATE_COLOR
72
+ )
73
+ })) ?? [];
74
+ const subheader = showSubheader ? /* @__PURE__ */ jsx(
75
+ CardSubheader,
76
+ {
77
+ aggregationId,
78
+ scorecardId: scorecard.id,
79
+ entitiesCount: scorecard.result.total
80
+ }
81
+ ) : null;
82
+ const info = showInfo ? /* @__PURE__ */ jsx(CardInfoButton, { timestamp: scorecard.result.timestamp }) : null;
83
+ return /* @__PURE__ */ jsx(
84
+ CardWrapper,
85
+ {
86
+ title: cardTitle,
87
+ dataTestId,
88
+ subheader,
89
+ description,
90
+ info,
91
+ children: /* @__PURE__ */ jsxs(CardChartContainer, { children: [
92
+ /* @__PURE__ */ jsx(
93
+ ResponsivePieChart,
94
+ {
95
+ pieData: averagePieData,
96
+ LabelContent: (props) => /* @__PURE__ */ jsx(
97
+ AverageCardPieCenterLabel,
98
+ {
99
+ ...props,
100
+ centerPercentLabel,
101
+ arcResolvedColor,
102
+ setActiveIndex,
103
+ setTooltipPosition,
104
+ updateCenterTooltipPosition,
105
+ setCenterTooltipPosition
106
+ }
107
+ ),
108
+ legendContent: (props) => /* @__PURE__ */ jsx(
109
+ CardLegendContent,
110
+ {
111
+ ...props,
112
+ activeIndex,
113
+ setActiveIndex,
114
+ setTooltipPosition,
115
+ pieData: statusPieData
116
+ }
117
+ )
118
+ }
119
+ ),
120
+ centerTooltipPosition && /* @__PURE__ */ jsx(
121
+ CardTooltip,
122
+ {
123
+ tooltipPosition: centerTooltipPosition,
124
+ pieData: averagePieData,
125
+ payload: [
126
+ {
127
+ name: AVERAGE_SCORE_SLICE,
128
+ value: 1,
129
+ payload: averagePieData[0]
130
+ }
131
+ ],
132
+ customContent: /* @__PURE__ */ jsx(
133
+ DonutChartTooltipContent,
134
+ {
135
+ weightedSum: scorecard.result.averageWeightedSum,
136
+ maxPossible: scorecard.result.averageMaxPossible
137
+ }
138
+ )
139
+ }
140
+ ),
141
+ activeIndex !== null && tooltipPosition && statusPieData[activeIndex] && /* @__PURE__ */ jsx(
142
+ CardTooltip,
143
+ {
144
+ tooltipPosition,
145
+ pieData: statusPieData,
146
+ payload: [
147
+ {
148
+ name: statusPieData[activeIndex].name,
149
+ value: statusPieData[activeIndex].value || 1,
150
+ payload: statusPieData[activeIndex]
151
+ }
152
+ ],
153
+ customContent: /* @__PURE__ */ jsx(
154
+ LegendTooltipContent,
155
+ {
156
+ row: statusPieData[activeIndex],
157
+ maxPossible: scorecard.result.averageMaxPossible
158
+ }
159
+ )
160
+ }
161
+ )
162
+ ] })
163
+ }
164
+ );
165
+ };
166
+
167
+ export { AverageCardComponent };
168
+ //# sourceMappingURL=AverageCardComponent.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AverageCardComponent.esm.js","sources":["../../../../src/components/AggregatedMetricCards/AverageCard/AverageCardComponent.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useState } from 'react';\nimport type { MouseEvent } from 'react';\n\nimport { useTheme } from '@mui/material/styles';\n\nimport { CardWrapper } from '../../Common/CardWrapper';\nimport type { PieData } from '../../types';\nimport {\n getThresholdRuleColor,\n resolveStatusColor,\n SCORECARD_ERROR_STATE_COLOR,\n} from '../../../utils';\nimport { ResponsivePieChart } from '../../ScorecardHomepageSection/ResponsivePieChart';\nimport { CardInfoButton } from '../components/CardInfoButton';\nimport { CardSubheader } from '../components/CardSubheader';\nimport { CardChartContainer } from '../components/CardChartContainer';\nimport { CardTooltip } from '../components/CardTooltip';\nimport { LegendTooltipContent } from './LegendTooltipContent';\nimport { DonutChartTooltipContent } from './DonutChartTooltipContent';\nimport type { AverageCardComponentProps, TooltipPosition } from './types';\nimport { CardLegendContent } from '../components/CardLegendContent';\nimport { AverageCardPieCenterLabel } from './AverageCardPieCenterLabel';\nimport { formatPercentage } from '../../../utils/formatPercentage';\n\nconst AVERAGE_SCORE_SLICE = 'averageScoreFill';\nconst AVERAGE_REMAINDER_SLICE = 'averageScoreRemainder';\n\nfunction clampPercentForDonut(rawPercent: number): {\n fill: number;\n remainder: number;\n} {\n const fill = Math.min(100, Math.max(0, rawPercent));\n return { fill, remainder: 100 - fill };\n}\n\nexport const AverageCardComponent = ({\n scorecard,\n cardTitle,\n description,\n aggregationId,\n showSubheader = true,\n showInfo = true,\n dataTestId,\n}: AverageCardComponentProps) => {\n const theme = useTheme();\n\n const [activeIndex, setActiveIndex] = useState<number | null>(null);\n const [tooltipPosition, setTooltipPosition] =\n useState<TooltipPosition | null>(null);\n const [centerTooltipPosition, setCenterTooltipPosition] =\n useState<TooltipPosition | null>(null);\n\n const updateCenterTooltipPosition = (e: MouseEvent<SVGCircleElement>) => {\n const rect = e.currentTarget.getBoundingClientRect();\n setCenterTooltipPosition({\n left: rect.left + rect.width / 2,\n top: rect.top,\n });\n };\n\n const rawPercent = scorecard.result.averageScore * 100;\n const { fill: chartFillPercent, remainder: chartRemainderPercent } =\n clampPercentForDonut(rawPercent);\n\n const centerPercentLabel = `${formatPercentage(rawPercent)}%`;\n\n const arcResolvedColor = resolveStatusColor(\n theme,\n scorecard.result.aggregationChartDisplayColor,\n );\n\n const averagePieData: PieData[] = [\n {\n name: AVERAGE_SCORE_SLICE,\n value: chartFillPercent,\n color: arcResolvedColor,\n },\n {\n name: AVERAGE_REMAINDER_SLICE,\n value: chartRemainderPercent,\n color: theme.palette.grey[300],\n },\n ];\n\n const statusPieData: PieData[] =\n scorecard.result.values?.map(value => ({\n name: value.name,\n value: value.count,\n score: value.score,\n color: resolveStatusColor(\n theme,\n getThresholdRuleColor(scorecard.result.thresholds.rules, value.name) ??\n SCORECARD_ERROR_STATE_COLOR,\n ),\n })) ?? [];\n\n const subheader = showSubheader ? (\n <CardSubheader\n aggregationId={aggregationId}\n scorecardId={scorecard.id}\n entitiesCount={scorecard.result.total}\n />\n ) : null;\n\n const info = showInfo ? (\n <CardInfoButton timestamp={scorecard.result.timestamp} />\n ) : null;\n\n return (\n <CardWrapper\n title={cardTitle}\n dataTestId={dataTestId}\n subheader={subheader}\n description={description}\n info={info}\n >\n <CardChartContainer>\n <ResponsivePieChart\n pieData={averagePieData}\n LabelContent={props => (\n <AverageCardPieCenterLabel\n {...props}\n centerPercentLabel={centerPercentLabel}\n arcResolvedColor={arcResolvedColor}\n setActiveIndex={setActiveIndex}\n setTooltipPosition={setTooltipPosition}\n updateCenterTooltipPosition={updateCenterTooltipPosition}\n setCenterTooltipPosition={setCenterTooltipPosition}\n />\n )}\n legendContent={props => (\n <CardLegendContent\n {...props}\n activeIndex={activeIndex}\n setActiveIndex={setActiveIndex}\n setTooltipPosition={setTooltipPosition}\n pieData={statusPieData}\n />\n )}\n />\n\n {centerTooltipPosition && (\n <CardTooltip\n tooltipPosition={centerTooltipPosition}\n pieData={averagePieData}\n payload={[\n {\n name: AVERAGE_SCORE_SLICE,\n value: 1,\n payload: averagePieData[0],\n },\n ]}\n customContent={\n <DonutChartTooltipContent\n weightedSum={scorecard.result.averageWeightedSum}\n maxPossible={scorecard.result.averageMaxPossible}\n />\n }\n />\n )}\n\n {activeIndex !== null &&\n tooltipPosition &&\n statusPieData[activeIndex] && (\n <CardTooltip\n tooltipPosition={tooltipPosition}\n pieData={statusPieData}\n payload={[\n {\n name: statusPieData[activeIndex].name,\n value: statusPieData[activeIndex].value || 1,\n payload: statusPieData[activeIndex],\n },\n ]}\n customContent={\n <LegendTooltipContent\n row={statusPieData[activeIndex]}\n maxPossible={scorecard.result.averageMaxPossible}\n />\n }\n />\n )}\n </CardChartContainer>\n </CardWrapper>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAwCA,MAAM,mBAAsB,GAAA,kBAAA;AAC5B,MAAM,uBAA0B,GAAA,uBAAA;AAEhC,SAAS,qBAAqB,UAG5B,EAAA;AACA,EAAM,MAAA,IAAA,GAAO,KAAK,GAAI,CAAA,GAAA,EAAK,KAAK,GAAI,CAAA,CAAA,EAAG,UAAU,CAAC,CAAA;AAClD,EAAA,OAAO,EAAE,IAAA,EAAM,SAAW,EAAA,GAAA,GAAM,IAAK,EAAA;AACvC;AAEO,MAAM,uBAAuB,CAAC;AAAA,EACnC,SAAA;AAAA,EACA,SAAA;AAAA,EACA,WAAA;AAAA,EACA,aAAA;AAAA,EACA,aAAgB,GAAA,IAAA;AAAA,EAChB,QAAW,GAAA,IAAA;AAAA,EACX;AACF,CAAiC,KAAA;AAC/B,EAAA,MAAM,QAAQ,QAAS,EAAA;AAEvB,EAAA,MAAM,CAAC,WAAA,EAAa,cAAc,CAAA,GAAI,SAAwB,IAAI,CAAA;AAClE,EAAA,MAAM,CAAC,eAAA,EAAiB,kBAAkB,CAAA,GACxC,SAAiC,IAAI,CAAA;AACvC,EAAA,MAAM,CAAC,qBAAA,EAAuB,wBAAwB,CAAA,GACpD,SAAiC,IAAI,CAAA;AAEvC,EAAM,MAAA,2BAAA,GAA8B,CAAC,CAAoC,KAAA;AACvE,IAAM,MAAA,IAAA,GAAO,CAAE,CAAA,aAAA,CAAc,qBAAsB,EAAA;AACnD,IAAyB,wBAAA,CAAA;AAAA,MACvB,I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aACE,kBAAA,GAAA;AAAA,cAAC,wBAAA;AAAA,cAAA;AAAA,gBACC,WAAA,EAAa,UAAU,MAAO,CAAA,kBAAA;AAAA,gBAC9B,WAAA,EAAa,UAAU,MAAO,CAAA;AAAA;AAAA;AAChC;AAAA,SAEJ;AAAA,QAGD,WAAgB,KAAA,IAAA,IACf,eACA,IAAA,aAAA,CAAc,WAAW,CACvB,oBAAA,GAAA;AAAA,UAAC,WAAA;AAAA,UAAA;AAAA,YACC,eAAA;AAAA,YACA,OAAS,EAAA,aAAA;AAAA,YACT,OAAS,EAAA;AAAA,cACP;AAAA,gBACE,IAAA,EAAM,aAAc,CAAA,WAAW,CAAE,CAAA,IAAA;AAAA,gBACjC,KAAO,EAAA,aAAA,CAAc,WAAW,CAAA,CAAE,KAAS,IAAA,CAAA;AAAA,gBAC3C,OAAA,EAAS,cAAc,WAAW;AAAA;AACpC,aACF;AAAA,YACA,aACE,kBAAA,GAAA;AAAA,cAAC,oBAAA;AAAA,cAAA;AAAA,gBACC,GAAA,EAAK,cAAc,WAAW,CAAA;AAAA,gBAC9B,WAAA,EAAa,UAAU,MAAO,CAAA;AAAA;AAAA;AAChC;AAAA;AAEJ,OAEN,EAAA;AAAA;AAAA,GACF;AAEJ;;;;"}
@@ -0,0 +1,58 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+
3
+ function AverageCardPieCenterLabel({
4
+ cx,
5
+ cy,
6
+ index,
7
+ centerPercentLabel,
8
+ arcResolvedColor,
9
+ setActiveIndex,
10
+ setTooltipPosition,
11
+ updateCenterTooltipPosition,
12
+ setCenterTooltipPosition
13
+ }) {
14
+ if (cx === void 0 || cx === null || cy === void 0 || cy === null || index === void 0 || index !== 0) {
15
+ return null;
16
+ }
17
+ const cxNum = Number(cx);
18
+ const cyNum = Number(cy);
19
+ return /* @__PURE__ */ jsxs("g", { style: { cursor: "pointer" }, children: [
20
+ /* @__PURE__ */ jsx(
21
+ "circle",
22
+ {
23
+ cx: cxNum,
24
+ cy: cyNum,
25
+ r: 52,
26
+ fill: "transparent",
27
+ stroke: "none",
28
+ pointerEvents: "all",
29
+ "data-testid": "average-card-center-percent-hit-area",
30
+ onMouseEnter: (e) => {
31
+ setActiveIndex(null);
32
+ setTooltipPosition(null);
33
+ updateCenterTooltipPosition(e);
34
+ },
35
+ onMouseMove: updateCenterTooltipPosition,
36
+ onMouseLeave: () => setCenterTooltipPosition(null)
37
+ }
38
+ ),
39
+ /* @__PURE__ */ jsx(
40
+ "text",
41
+ {
42
+ x: cxNum,
43
+ y: cyNum,
44
+ textAnchor: "middle",
45
+ dominantBaseline: "middle",
46
+ fill: arcResolvedColor,
47
+ fontSize: 24,
48
+ fontWeight: 500,
49
+ pointerEvents: "none",
50
+ "data-testid": "average-card-center-percent",
51
+ children: centerPercentLabel
52
+ }
53
+ )
54
+ ] });
55
+ }
56
+
57
+ export { AverageCardPieCenterLabel };
58
+ //# sourceMappingURL=AverageCardPieCenterLabel.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AverageCardPieCenterLabel.esm.js","sources":["../../../../src/components/AggregatedMetricCards/AverageCard/AverageCardPieCenterLabel.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { PieLabelRenderProps } from 'recharts';\nimport { TooltipPosition } from './types';\n\ntype AverageCardPieCenterLabelProps = PieLabelRenderProps & {\n centerPercentLabel: string;\n arcResolvedColor: string;\n setActiveIndex: (index: number | null) => void;\n setTooltipPosition: (position: TooltipPosition | null) => void;\n updateCenterTooltipPosition: (e: React.MouseEvent<SVGCircleElement>) => void;\n setCenterTooltipPosition: (position: TooltipPosition | null) => void;\n};\n\nexport function AverageCardPieCenterLabel({\n cx,\n cy,\n index,\n centerPercentLabel,\n arcResolvedColor,\n setActiveIndex,\n setTooltipPosition,\n updateCenterTooltipPosition,\n setCenterTooltipPosition,\n}: AverageCardPieCenterLabelProps) {\n if (\n cx === undefined ||\n cx === null ||\n cy === undefined ||\n cy === null ||\n index === undefined ||\n index !== 0\n ) {\n return null;\n }\n const cxNum = Number(cx);\n const cyNum = Number(cy);\n return (\n <g style={{ cursor: 'pointer' }}>\n <circle\n cx={cxNum}\n cy={cyNum}\n r={52}\n fill=\"transparent\"\n stroke=\"none\"\n pointerEvents=\"all\"\n data-testid=\"average-card-center-percent-hit-area\"\n onMouseEnter={e => {\n setActiveIndex(null);\n setTooltipPosition(null);\n updateCenterTooltipPosition(e);\n }}\n onMouseMove={updateCenterTooltipPosition}\n onMouseLeave={() => setCenterTooltipPosition(null)}\n />\n <text\n x={cxNum}\n y={cyNum}\n textAnchor=\"middle\"\n dominantBaseline=\"middle\"\n fill={arcResolvedColor}\n fontSize={24}\n fontWeight={500}\n pointerEvents=\"none\"\n data-testid=\"average-card-center-percent\"\n >\n {centerPercentLabel}\n </text>\n </g>\n );\n}\n"],"names":[],"mappings":";;AA4BO,SAAS,yBAA0B,CAAA;AAAA,EACxC,EAAA;AAAA,EACA,EAAA;AAAA,EACA,KAAA;AAAA,EACA,kBAAA;AAAA,EACA,gBAAA;AAAA,EACA,cAAA;AAAA,EACA,kBAAA;AAAA,EACA,2BAAA;AAAA,EACA;AACF,CAAmC,EAAA;AACjC,EACE,IAAA,EAAA,KAAO,MACP,IAAA,EAAA,KAAO,IACP,IAAA,EAAA,KAAO,MACP,IAAA,EAAA,KAAO,IACP,IAAA,KAAA,KAAU,MACV,IAAA,KAAA,KAAU,CACV,EAAA;AACA,IAAO,OAAA,IAAA;AAAA;AAET,EAAM,MAAA,KAAA,GAAQ,OAAO,EAAE,CAAA;AACvB,EAAM,MAAA,KAAA,GAAQ,OAAO,EAAE,CAAA;AACvB,EAAA,4BACG,GAAE,EAAA,EAAA,KAAA,EAAO,EAAE,MAAA,EAAQ,WAClB,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,QAAA;AAAA,MAAA;AAAA,QACC,EAAI,EAAA,KAAA;AAAA,QACJ,EAAI,EAAA,KAAA;AAAA,QACJ,CAAG,EAAA,EAAA;AAAA,QACH,IAAK,EAAA,aAAA;AAAA,QACL,MAAO,EAAA,MAAA;AAAA,QACP,aAAc,EAAA,KAAA;AAAA,QACd,aAAY,EAAA,sCAAA;AAAA,QACZ,cAAc,CAAK,CAAA,KAAA;AACjB,UAAA,cAAA,CAAe,IAAI,CAAA;AACnB,UAAA,kBAAA,CAAmB,IAAI,CAAA;AACvB,UAAA,2BAAA,CAA4B,CAAC,CAAA;AAAA,SAC/B;AAAA,QACA,WAAa,EAAA,2BAAA;AAAA,QACb,YAAA,EAAc,MAAM,wBAAA,CAAyB,IAAI;AAAA;AAAA,KACnD;AAAA,oBACA,GAAA;AAAA,MAAC,MAAA;AAAA,MAAA;AAAA,QACC,CAAG,EAAA,KAAA;AAAA,QACH,CAAG,EAAA,KAAA;AAAA,QACH,UAAW,EAAA,QAAA;AAAA,QACX,gBAAiB,EAAA,QAAA;AAAA,QACjB,IAAM,EAAA,gBAAA;AAAA,QACN,QAAU,EAAA,EAAA;AAAA,QACV,UAAY,EAAA,GAAA;AAAA,QACZ,aAAc,EAAA,MAAA;AAAA,QACd,aAAY,EAAA,6BAAA;AAAA,QAEX,QAAA,EAAA;AAAA;AAAA;AACH,GACF,EAAA,CAAA;AAEJ;;;;"}
@@ -0,0 +1,30 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import Stack from '@mui/material/Stack';
3
+ import { TooltipContent } from './TooltipContent.esm.js';
4
+ import { useTranslation } from '../../../hooks/useTranslation.esm.js';
5
+
6
+ const DonutChartTooltipContent = ({
7
+ weightedSum,
8
+ maxPossible
9
+ }) => {
10
+ const { t } = useTranslation();
11
+ return /* @__PURE__ */ jsxs(Stack, { direction: "row", spacing: 3, children: [
12
+ /* @__PURE__ */ jsx(
13
+ TooltipContent,
14
+ {
15
+ label: t("metric.averageCenterTooltipTotalLabel"),
16
+ value: weightedSum
17
+ }
18
+ ),
19
+ /* @__PURE__ */ jsx(
20
+ TooltipContent,
21
+ {
22
+ label: t("metric.averageCenterTooltipMaxLabel"),
23
+ value: maxPossible
24
+ }
25
+ )
26
+ ] });
27
+ };
28
+
29
+ export { DonutChartTooltipContent };
30
+ //# sourceMappingURL=DonutChartTooltipContent.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DonutChartTooltipContent.esm.js","sources":["../../../../src/components/AggregatedMetricCards/AverageCard/DonutChartTooltipContent.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Stack from '@mui/material/Stack';\nimport { TooltipContent } from './TooltipContent';\nimport { useTranslation } from '../../../hooks/useTranslation';\n\nexport const DonutChartTooltipContent = ({\n weightedSum,\n maxPossible,\n}: {\n weightedSum: number | undefined;\n maxPossible: number | undefined;\n}) => {\n const { t } = useTranslation();\n\n return (\n <Stack direction=\"row\" spacing={3}>\n <TooltipContent\n label={t('metric.averageCenterTooltipTotalLabel')}\n value={weightedSum}\n />\n <TooltipContent\n label={t('metric.averageCenterTooltipMaxLabel')}\n value={maxPossible}\n />\n </Stack>\n );\n};\n"],"names":[],"mappings":";;;;;AAoBO,MAAM,2BAA2B,CAAC;AAAA,EACvC,WAAA;AAAA,EACA;AACF,CAGM,KAAA;AACJ,EAAM,MAAA,EAAE,CAAE,EAAA,GAAI,cAAe,EAAA;AAE7B,EAAA,uBACG,IAAA,CAAA,KAAA,EAAA,EAAM,SAAU,EAAA,KAAA,EAAM,SAAS,CAC9B,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,cAAA;AAAA,MAAA;AAAA,QACC,KAAA,EAAO,EAAE,uCAAuC,CAAA;AAAA,QAChD,KAAO,EAAA;AAAA;AAAA,KACT;AAAA,oBACA,GAAA;AAAA,MAAC,cAAA;AAAA,MAAA;AAAA,QACC,KAAA,EAAO,EAAE,qCAAqC,CAAA;AAAA,QAC9C,KAAO,EAAA;AAAA;AAAA;AACT,GACF,EAAA,CAAA;AAEJ;;;;"}
@@ -0,0 +1,39 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import Stack from '@mui/material/Stack';
3
+ import { useTranslation } from '../../../hooks/useTranslation.esm.js';
4
+ import { TooltipContent, formatAggregationScoreDetail } from './TooltipContent.esm.js';
5
+ import { formatPercentage } from '../../../utils/formatPercentage.esm.js';
6
+
7
+ const LegendTooltipContent = ({
8
+ row,
9
+ maxPossible
10
+ }) => {
11
+ const { t } = useTranslation();
12
+ const count = row.value;
13
+ const unitScore = row.score ?? 0;
14
+ const rowTotal = count * unitScore;
15
+ const percentLabel = maxPossible && maxPossible > 0 ? `${formatPercentage(rowTotal / maxPossible * 100)}%` : "\u2014";
16
+ return /* @__PURE__ */ jsxs(Stack, { direction: "column", children: [
17
+ /* @__PURE__ */ jsx(
18
+ TooltipContent,
19
+ {
20
+ label: t("metric.averageLegendTooltipEntitiesEach", {
21
+ count,
22
+ score: formatAggregationScoreDetail(unitScore)
23
+ })
24
+ }
25
+ ),
26
+ /* @__PURE__ */ jsx(
27
+ TooltipContent,
28
+ {
29
+ label: t("metric.averageLegendTooltipRowTotal", {
30
+ total: formatAggregationScoreDetail(rowTotal)
31
+ }),
32
+ value: percentLabel
33
+ }
34
+ )
35
+ ] });
36
+ };
37
+
38
+ export { LegendTooltipContent };
39
+ //# sourceMappingURL=LegendTooltipContent.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LegendTooltipContent.esm.js","sources":["../../../../src/components/AggregatedMetricCards/AverageCard/LegendTooltipContent.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { PieData } from '../../types';\nimport Stack from '@mui/material/Stack';\nimport { useTranslation } from '../../../hooks/useTranslation';\nimport { formatAggregationScoreDetail, TooltipContent } from './TooltipContent';\nimport { formatPercentage } from '../../../utils/formatPercentage';\n\nexport const LegendTooltipContent = ({\n row,\n maxPossible,\n}: {\n row: PieData;\n maxPossible: number | undefined;\n}) => {\n const { t } = useTranslation();\n const count = row.value;\n const unitScore = row.score ?? 0;\n const rowTotal = count * unitScore;\n const percentLabel =\n maxPossible && maxPossible > 0\n ? `${formatPercentage((rowTotal / maxPossible) * 100)}%`\n : '—';\n\n return (\n <Stack direction=\"column\">\n <TooltipContent\n label={t('metric.averageLegendTooltipEntitiesEach', {\n count,\n score: formatAggregationScoreDetail(unitScore),\n } as any)}\n />\n <TooltipContent\n label={t('metric.averageLegendTooltipRowTotal', {\n total: formatAggregationScoreDetail(rowTotal),\n } as any)}\n value={percentLabel}\n />\n </Stack>\n );\n};\n"],"names":[],"mappings":";;;;;;AAsBO,MAAM,uBAAuB,CAAC;AAAA,EACnC,GAAA;AAAA,EACA;AACF,CAGM,KAAA;AACJ,EAAM,MAAA,EAAE,CAAE,EAAA,GAAI,cAAe,EAAA;AAC7B,EAAA,MAAM,QAAQ,GAAI,CAAA,KAAA;AAClB,EAAM,MAAA,SAAA,GAAY,IAAI,KAAS,IAAA,CAAA;AAC/B,EAAA,MAAM,WAAW,KAAQ,GAAA,SAAA;AACzB,EAAM,MAAA,YAAA,GACJ,WAAe,IAAA,WAAA,GAAc,CACzB,GAAA,CAAA,EAAG,iBAAkB,QAAW,GAAA,WAAA,GAAe,GAAG,CAAC,CACnD,CAAA,CAAA,GAAA,QAAA;AAEN,EACE,uBAAA,IAAA,CAAC,KAAM,EAAA,EAAA,SAAA,EAAU,QACf,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,cAAA;AAAA,MAAA;AAAA,QACC,KAAA,EAAO,EAAE,yCAA2C,EAAA;AAAA,UAClD,KAAA;AAAA,UACA,KAAA,EAAO,6BAA6B,SAAS;AAAA,SACvC;AAAA;AAAA,KACV;AAAA,oBACA,GAAA;AAAA,MAAC,cAAA;AAAA,MAAA;AAAA,QACC,KAAA,EAAO,EAAE,qCAAuC,EAAA;AAAA,UAC9C,KAAA,EAAO,6BAA6B,QAAQ;AAAA,SACtC,CAAA;AAAA,QACR,KAAO,EAAA;AAAA;AAAA;AACT,GACF,EAAA,CAAA;AAEJ;;;;"}
@@ -0,0 +1,36 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import Stack from '@mui/material/Stack';
3
+ import Typography from '@mui/material/Typography';
4
+
5
+ const formatAggregationScoreDetail = (value) => {
6
+ if (typeof value === "string") {
7
+ return value;
8
+ }
9
+ if (value === void 0 || !Number.isFinite(value)) {
10
+ return "\u2014";
11
+ }
12
+ return Number.isInteger(value) ? String(value) : value.toLocaleString(void 0, { maximumFractionDigits: 2 });
13
+ };
14
+ const TooltipContent = ({
15
+ label,
16
+ value
17
+ }) => {
18
+ return /* @__PURE__ */ jsxs(Stack, { children: [
19
+ /* @__PURE__ */ jsx(Typography, { sx: { fontSize: "0.875rem", margin: 0, fontWeight: 500 }, children: label }),
20
+ value !== void 0 && value !== null && /* @__PURE__ */ jsx(
21
+ Typography,
22
+ {
23
+ sx: {
24
+ fontSize: "2.5rem",
25
+ margin: 0,
26
+ color: "#37a3a3",
27
+ fontWeight: 500
28
+ },
29
+ children: formatAggregationScoreDetail(value)
30
+ }
31
+ )
32
+ ] });
33
+ };
34
+
35
+ export { TooltipContent, formatAggregationScoreDetail };
36
+ //# sourceMappingURL=TooltipContent.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TooltipContent.esm.js","sources":["../../../../src/components/AggregatedMetricCards/AverageCard/TooltipContent.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Stack from '@mui/material/Stack';\nimport Typography from '@mui/material/Typography';\n\nexport const formatAggregationScoreDetail = (\n value?: number | string,\n): string => {\n if (typeof value === 'string') {\n return value;\n }\n\n if (value === undefined || !Number.isFinite(value)) {\n return '—';\n }\n\n return Number.isInteger(value)\n ? String(value)\n : value.toLocaleString(undefined, { maximumFractionDigits: 2 });\n};\n\nexport const TooltipContent = ({\n label,\n value,\n}: {\n label: string;\n value?: number | string;\n}) => {\n return (\n <Stack>\n <Typography sx={{ fontSize: '0.875rem', margin: 0, fontWeight: 500 }}>\n {label}\n </Typography>\n {value !== undefined && value !== null && (\n <Typography\n sx={{\n fontSize: '2.5rem',\n margin: 0,\n color: '#37a3a3',\n fontWeight: 500,\n }}\n >\n {formatAggregationScoreDetail(value)}\n </Typography>\n )}\n </Stack>\n );\n};\n"],"names":[],"mappings":";;;;AAmBa,MAAA,4BAAA,GAA+B,CAC1C,KACW,KAAA;AACX,EAAI,IAAA,OAAO,UAAU,QAAU,EAAA;AAC7B,IAAO,OAAA,KAAA;AAAA;AAGT,EAAA,IAAI,UAAU,MAAa,IAAA,CAAC,MAAO,CAAA,QAAA,CAAS,KAAK,CAAG,EAAA;AAClD,IAAO,OAAA,QAAA;AAAA;AAGT,EAAA,OAAO,MAAO,CAAA,SAAA,CAAU,KAAK,CAAA,GACzB,MAAO,CAAA,KAAK,CACZ,GAAA,KAAA,CAAM,cAAe,CAAA,MAAA,EAAW,EAAE,qBAAA,EAAuB,GAAG,CAAA;AAClE;AAEO,MAAM,iBAAiB,CAAC;AAAA,EAC7B,KAAA;AAAA,EACA;AACF,CAGM,KAAA;AACJ,EAAA,4BACG,KACC,EAAA,EAAA,QAAA,EAAA;AAAA,oBAAC,GAAA,CAAA,UAAA,EAAA,EAAW,EAAI,EAAA,EAAE,QAAU,EAAA,UAAA,EAAY,QAAQ,CAAG,EAAA,UAAA,EAAY,GAAI,EAAA,EAChE,QACH,EAAA,KAAA,EAAA,CAAA;AAAA,IACC,KAAA,KAAU,MAAa,IAAA,KAAA,KAAU,IAChC,oBAAA,GAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,EAAI,EAAA;AAAA,UACF,QAAU,EAAA,QAAA;AAAA,UACV,MAAQ,EAAA,CAAA;AAAA,UACR,KAAO,EAAA,SAAA;AAAA,UACP,UAAY,EAAA;AAAA,SACd;AAAA,QAEC,uCAA6B,KAAK;AAAA;AAAA;AACrC,GAEJ,EAAA,CAAA;AAEJ;;;;"}