@red-hat-developer-hub/backstage-plugin-scorecard 2.7.3 → 2.7.4
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.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @red-hat-developer-hub/backstage-plugin-scorecard
|
|
2
2
|
|
|
3
|
+
## 2.7.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 8c129da: Fix default layout for `AggregatedCardWithGithubFilecheckLicense`, `AggregatedCardWithGithubFilecheckCodeowners` and `AggregatedCardWithGithubOpenPrsWeighted` homepage scorecard cards at the new frontend system (NFS)
|
|
8
|
+
- 367195b: Fix drilldown page header showing raw provider title instead of the translated scorecard title
|
|
9
|
+
- @red-hat-developer-hub/backstage-plugin-scorecard-common@2.7.4
|
|
10
|
+
|
|
3
11
|
## 2.7.3
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -172,14 +172,44 @@ To align with the legacy EntityPage (Scorecard on component pages and default en
|
|
|
172
172
|
sm: { w: 4, h: 6, x: 4 }
|
|
173
173
|
xs: { w: 4, h: 6, x: 4 }
|
|
174
174
|
xxs: { w: 4, h: 6, x: 4 }
|
|
175
|
+
AggregatedCardWithGithubFilecheckLicense:
|
|
176
|
+
priority: 450
|
|
177
|
+
breakpoints:
|
|
178
|
+
xl: { w: 4, h: 6 }
|
|
179
|
+
lg: { w: 4, h: 6 }
|
|
180
|
+
md: { w: 4, h: 6 }
|
|
181
|
+
sm: { w: 4, h: 6 }
|
|
182
|
+
xs: { w: 4, h: 6 }
|
|
183
|
+
xxs: { w: 4, h: 6 }
|
|
184
|
+
AggregatedCardWithGithubFilecheckCodeowners:
|
|
185
|
+
priority: 460
|
|
186
|
+
breakpoints:
|
|
187
|
+
xl: { w: 4, h: 6, x: 8 }
|
|
188
|
+
lg: { w: 4, h: 6, x: 8 }
|
|
189
|
+
md: { w: 4, h: 6, x: 8 }
|
|
190
|
+
sm: { w: 4, h: 6, x: 8 }
|
|
191
|
+
xs: { w: 4, h: 6, x: 8 }
|
|
192
|
+
xxs: { w: 4, h: 6, x: 8 }
|
|
193
|
+
AggregatedCardWithGithubOpenPrsWeighted:
|
|
194
|
+
priority: 470
|
|
195
|
+
breakpoints:
|
|
196
|
+
xl: { w: 4, h: 6, x: 8 }
|
|
197
|
+
lg: { w: 4, h: 6, x: 8 }
|
|
198
|
+
md: { w: 4, h: 6, x: 8 }
|
|
199
|
+
sm: { w: 4, h: 6, x: 8 }
|
|
200
|
+
xs: { w: 4, h: 6, x: 8 }
|
|
201
|
+
xxs: { w: 4, h: 6, x: 8 }
|
|
175
202
|
```
|
|
176
203
|
|
|
177
|
-
The home module contributes
|
|
204
|
+
The home module contributes seven widgets:
|
|
178
205
|
|
|
179
206
|
- `AggregatedCardWithDeprecatedMetricId` (title: **Scorecard: With deprecated metricId property (Jira)**)
|
|
180
207
|
- `AggregatedCardWithDefaultAggregation` (title: **Scorecard: With default aggregation config (GitHub)**)
|
|
181
208
|
- `AggregatedCardWithJiraOpenIssues` (title: **Scorecard: Jira open blocking tickets**)
|
|
182
209
|
- `AggregatedCardWithGithubOpenPrs` (title: **Scorecard: GitHub open PRs**)
|
|
210
|
+
- `AggregatedCardWithGithubFilecheckLicense` (title: **Scorecard: LICENSE file exists**)
|
|
211
|
+
- `AggregatedCardWithGithubFilecheckCodeowners` (title: **Scorecard: CODEOWNERS file exists**)
|
|
212
|
+
- `AggregatedCardWithGithubOpenPrsWeighted` (title: **Scorecard: GitHub open PRs (weighted health)**)
|
|
183
213
|
|
|
184
214
|
These widgets render the `ScorecardHomepageCard` component used in legacy apps, preconfigured with different aggregation/metric configurations.
|
|
185
215
|
|
|
@@ -189,11 +219,11 @@ The following modules and extensions are available from `@red-hat-developer-hub/
|
|
|
189
219
|
|
|
190
220
|
**Modules**
|
|
191
221
|
|
|
192
|
-
| Module | Description
|
|
193
|
-
| ----------------------------- |
|
|
194
|
-
| `scorecardHomeModule` | Registers Scorecard homepage widgets for the home plugin (`AggregatedCardWithDeprecatedMetricId`, `AggregatedCardWithDefaultAggregation`, `AggregatedCardWithJiraOpenIssues`, and `
|
|
195
|
-
| `scorecardCatalogModule` | Registers the Scorecard entity tab with the catalog plugin. Add to your app's `features`. Which entities show the tab is configured via `app.extensions` (see step 3).
|
|
196
|
-
| `scorecardTranslationsModule` | Registers Scorecard translations with the app. Add to your app's `features`.
|
|
222
|
+
| Module | Description |
|
|
223
|
+
| ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
224
|
+
| `scorecardHomeModule` | Registers Scorecard homepage widgets for the home plugin (`AggregatedCardWithDeprecatedMetricId`, `AggregatedCardWithDefaultAggregation`, `AggregatedCardWithJiraOpenIssues`, `AggregatedCardWithGithubOpenPrs`, `AggregatedCardWithGithubFilecheckLicense`, `AggregatedCardWithGithubFilecheckCodeowners` and `AggregatedCardWithGithubOpenPrsWeighted`). |
|
|
225
|
+
| `scorecardCatalogModule` | Registers the Scorecard entity tab with the catalog plugin. Add to your app's `features`. Which entities show the tab is configured via `app.extensions` (see step 3). |
|
|
226
|
+
| `scorecardTranslationsModule` | Registers Scorecard translations with the app. Add to your app's `features`. |
|
|
197
227
|
|
|
198
228
|
**Extensions**
|
|
199
229
|
|
|
@@ -203,6 +233,9 @@ The following modules and extensions are available from `@red-hat-developer-hub/
|
|
|
203
233
|
- `home-page-widget:home/scorecard-default-aggregation` — Homepage widget using default aggregation config (GitHub open PRs).
|
|
204
234
|
- `home-page-widget:home/scorecard-jira-open-issues` — Homepage widget showing Jira open blocking tickets.
|
|
205
235
|
- `home-page-widget:home/scorecard-github-open-prs` — Homepage widget showing GitHub open PRs.
|
|
236
|
+
- `home-page-widget:home/scorecard-github-filecheck-license` - Homepage widget showing file check "License".
|
|
237
|
+
- `home-page-widget:home/scorecard-github-filecheck-codeowners` - Homepage widget showing file check "Codeowners".
|
|
238
|
+
- `home-page-widget:home/scorecard-github-open-prs-weighted` - Homepage widget showing average GitHub open PRs.
|
|
206
239
|
|
|
207
240
|
#### Legacy app
|
|
208
241
|
|
|
@@ -8,6 +8,7 @@ import '../../api/index.esm.js';
|
|
|
8
8
|
import { ScorecardHomepageCard } from '../ScorecardHomepageSection/ScorecardHomepageCard.esm.js';
|
|
9
9
|
import NotFoundState from '../Common/NotFoundState.esm.js';
|
|
10
10
|
import { useTranslation } from '../../hooks/useTranslation.esm.js';
|
|
11
|
+
import { resolveMetricTranslation } from '../../utils/translationUtils.esm.js';
|
|
11
12
|
import { ScorecardPageHeader } from './ScorecardPageHeader.esm.js';
|
|
12
13
|
import { EntitiesTable } from './EntitiesTable/EntitiesTable.esm.js';
|
|
13
14
|
import { ScorecardQueryProvider } from '../../api/ScorecardQueryProvider.esm.js';
|
|
@@ -18,9 +19,7 @@ const ScorecardPage = () => {
|
|
|
18
19
|
const [metricTitle, setMetricTitle] = useState("");
|
|
19
20
|
const [metricNotFound, setMetricNotFound] = useState(false);
|
|
20
21
|
const { t } = useTranslation();
|
|
21
|
-
const
|
|
22
|
-
const title = t(titleKey, {});
|
|
23
|
-
const finalTitle = title === titleKey ? metricTitle : title;
|
|
22
|
+
const finalTitle = resolveMetricTranslation(t, resolvedMetricId, "title", metricTitle) || metricTitle;
|
|
24
23
|
if (metricNotFound) {
|
|
25
24
|
return /* @__PURE__ */ jsx(Page, { themeId: "home", children: /* @__PURE__ */ jsx(Content, { children: /* @__PURE__ */ jsx(NotFoundState, {}) }) });
|
|
26
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScorecardPage.esm.js","sources":["../../../src/components/ScorecardPage/ScorecardPage.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 { useParams } from 'react-router-dom';\n\nimport { Content, Page } from '@backstage/core-components';\n\nimport Box from '@mui/material/Box';\nimport Divider from '@mui/material/Divider';\n\nimport { ScorecardQueryProvider } from '../../api';\nimport { ScorecardHomepageCard } from '../ScorecardHomepageSection/ScorecardHomepageCard';\nimport NotFoundState from '../Common/NotFoundState';\nimport { useTranslation } from '../../hooks/useTranslation';\n\nimport { ScorecardPageHeader } from './ScorecardPageHeader';\nimport { EntitiesTable } from './EntitiesTable/EntitiesTable';\n\nexport const ScorecardPage = () => {\n const { aggregationId = '', metricId = '' } = useParams<{\n aggregationId: string;\n metricId: string;\n }>();\n\n // TODO: Remove metricId once we deprecate it. We need to keep it for backward compatibility.\n const resolvedMetricId = aggregationId || metricId || '';\n\n const [metricTitle, setMetricTitle] = useState<string>('');\n const [metricNotFound, setMetricNotFound] = useState<boolean>(false);\n\n const { t } = useTranslation();\n\n const
|
|
1
|
+
{"version":3,"file":"ScorecardPage.esm.js","sources":["../../../src/components/ScorecardPage/ScorecardPage.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 { useParams } from 'react-router-dom';\n\nimport { Content, Page } from '@backstage/core-components';\n\nimport Box from '@mui/material/Box';\nimport Divider from '@mui/material/Divider';\n\nimport { ScorecardQueryProvider } from '../../api';\nimport { ScorecardHomepageCard } from '../ScorecardHomepageSection/ScorecardHomepageCard';\nimport NotFoundState from '../Common/NotFoundState';\nimport { useTranslation } from '../../hooks/useTranslation';\nimport { resolveMetricTranslation } from '../../utils/translationUtils';\n\nimport { ScorecardPageHeader } from './ScorecardPageHeader';\nimport { EntitiesTable } from './EntitiesTable/EntitiesTable';\n\nexport const ScorecardPage = () => {\n const { aggregationId = '', metricId = '' } = useParams<{\n aggregationId: string;\n metricId: string;\n }>();\n\n // TODO: Remove metricId once we deprecate it. We need to keep it for backward compatibility.\n const resolvedMetricId = aggregationId || metricId || '';\n\n const [metricTitle, setMetricTitle] = useState<string>('');\n const [metricNotFound, setMetricNotFound] = useState<boolean>(false);\n\n const { t } = useTranslation();\n\n const finalTitle =\n resolveMetricTranslation(t, resolvedMetricId, 'title', metricTitle) ||\n metricTitle;\n\n if (metricNotFound) {\n return (\n <Page themeId=\"home\">\n <Content>\n <NotFoundState />\n </Content>\n </Page>\n );\n }\n\n return (\n <Page themeId=\"home\">\n <ScorecardPageHeader\n title={\n finalTitle ||\n metricId ||\n aggregationId ||\n t('entitiesPage.unknownMetric')\n }\n />\n <Divider />\n <Content>\n <Box\n sx={{\n display: 'flex',\n alignItems: 'flex-start',\n flexWrap: 'wrap',\n gap: 3,\n py: 2,\n }}\n >\n <Box sx={{ flex: { xs: '1 1 100%', lg: '1 1 0%' }, minWidth: 0 }}>\n <EntitiesTable\n metricId={metricId}\n aggregationId={aggregationId}\n setMetricTitle={setMetricTitle}\n setMetricNotFound={setMetricNotFound}\n />\n </Box>\n <Box\n sx={{\n flex: { xs: '1 1 100%', lg: '0 0 33%' },\n minWidth: 0,\n alignSelf: 'flex-start',\n height: { xs: 320, sm: 380 },\n '& > *': { height: '100%' },\n '& > div[class*=\"MuiCard-root\"]': {\n height: '100%',\n overflow: 'hidden',\n display: 'flex',\n flexDirection: 'column',\n },\n '& div[class*=\"MuiCardContent-root\"]': {\n flex: 1,\n minHeight: 0,\n },\n }}\n >\n <ScorecardHomepageCard\n aggregationId={aggregationId}\n metricId={metricId}\n showSubheader={false}\n showInfo={false}\n />\n </Box>\n </Box>\n </Content>\n </Page>\n );\n};\n\n/**\n * ScorecardPage wrapped with QueryClientProvider so it works\n * when rendered outside a tree that already has a provider (e.g. on the homepage).\n */\nexport const ScorecardPageWithProvider = () => (\n <ScorecardQueryProvider>\n <ScorecardPage />\n </ScorecardQueryProvider>\n);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAiCO,MAAM,gBAAgB,MAAM;AACjC,EAAA,MAAM,EAAE,aAAgB,GAAA,EAAA,EAAI,QAAW,GAAA,EAAA,KAAO,SAG3C,EAAA;AAGH,EAAM,MAAA,gBAAA,GAAmB,iBAAiB,QAAY,IAAA,EAAA;AAEtD,EAAA,MAAM,CAAC,WAAA,EAAa,cAAc,CAAA,GAAI,SAAiB,EAAE,CAAA;AACzD,EAAA,MAAM,CAAC,cAAA,EAAgB,iBAAiB,CAAA,GAAI,SAAkB,KAAK,CAAA;AAEnE,EAAM,MAAA,EAAE,CAAE,EAAA,GAAI,cAAe,EAAA;AAE7B,EAAA,MAAM,aACJ,wBAAyB,CAAA,CAAA,EAAG,gBAAkB,EAAA,OAAA,EAAS,WAAW,CAClE,IAAA,WAAA;AAEF,EAAA,IAAI,cAAgB,EAAA;AAClB,IACE,uBAAA,GAAA,CAAC,QAAK,OAAQ,EAAA,MAAA,EACZ,8BAAC,OACC,EAAA,EAAA,QAAA,kBAAA,GAAA,CAAC,aAAc,EAAA,EAAA,CAAA,EACjB,CACF,EAAA,CAAA;AAAA;AAIJ,EACE,uBAAA,IAAA,CAAC,IAAK,EAAA,EAAA,OAAA,EAAQ,MACZ,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,mBAAA;AAAA,MAAA;AAAA,QACC,KACE,EAAA,UAAA,IACA,QACA,IAAA,aAAA,IACA,EAAE,4BAA4B;AAAA;AAAA,KAElC;AAAA,wBACC,OA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A,gBAAC,qBAAA;AAAA,gBAAA;AAAA,kBACC,aAAA;AAAA,kBACA,QAAA;AAAA,kBACA,aAAe,EAAA,KAAA;AAAA,kBACf,QAAU,EAAA;AAAA;AAAA;AACZ;AAAA;AACF;AAAA;AAAA,KAEJ,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;AAMO,MAAM,4BAA4B,sBACvC,GAAA,CAAC,sBACC,EAAA,EAAA,QAAA,kBAAA,GAAA,CAAC,iBAAc,CACjB,EAAA;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@red-hat-developer-hub/backstage-plugin-scorecard",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.4",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "./dist/index.esm.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"@backstage/theme": "^0.7.2",
|
|
76
76
|
"@mui/icons-material": "5.18.0",
|
|
77
77
|
"@mui/material": "5.18.0",
|
|
78
|
-
"@red-hat-developer-hub/backstage-plugin-scorecard-common": "^2.7.
|
|
78
|
+
"@red-hat-developer-hub/backstage-plugin-scorecard-common": "^2.7.4",
|
|
79
79
|
"@tanstack/react-query": "^5.95.2",
|
|
80
80
|
"date-fns": "^4.1.0",
|
|
81
81
|
"react-use": "^17.2.4",
|