Skip to content

Commit 0fda0c7

Browse files
fix(scorecard): fix the default layout for homePageScorecards (#2771)
Signed-off-by: rohitratannagar <rohitratannagar2003@gmail.com>
1 parent 5413f1d commit 0fda0c7

File tree

3 files changed

+68
-19
lines changed

3 files changed

+68
-19
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@red-hat-developer-hub/backstage-plugin-scorecard': patch
3+
---
4+
5+
fixed the scorecard-homepage-cards default layout for nfs

workspaces/scorecard/app-config.yaml

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,46 @@ app:
2525
config:
2626
customizable: true
2727
widgetLayout:
28-
ScorecardJiraHomepage:
29-
priority: 240
28+
AggregatedCardWithDeprecatedMetricId:
29+
priority: 410
3030
breakpoints:
3131
xl: { w: 4, h: 6 }
3232
lg: { w: 4, h: 6 }
3333
md: { w: 4, h: 6 }
3434
sm: { w: 4, h: 6 }
3535
xs: { w: 4, h: 6 }
3636
xxs: { w: 4, h: 6 }
37-
ScorecardGithubHomepage:
38-
priority: 250
37+
38+
AggregatedCardWithDefaultAggregation:
39+
priority: 420
40+
breakpoints:
41+
xl: { w: 4, h: 6, x: 4 }
42+
lg: { w: 4, h: 6, x: 4 }
43+
md: { w: 4, h: 6, x: 4 }
44+
sm: { w: 4, h: 6, x: 4 }
45+
xs: { w: 4, h: 6, x: 4 }
46+
xxs: { w: 4, h: 6, x: 4 }
47+
48+
AggregatedCardWithJiraOpenIssues:
49+
priority: 430
50+
breakpoints:
51+
xl: { w: 4, h: 6 }
52+
lg: { w: 4, h: 6 }
53+
md: { w: 4, h: 6 }
54+
sm: { w: 4, h: 6 }
55+
xs: { w: 4, h: 6 }
56+
xxs: { w: 4, h: 6 }
57+
58+
AggregatedCardWithGithubOpenPrs:
59+
priority: 440
3960
breakpoints:
4061
xl: { w: 4, h: 6, x: 4 }
4162
lg: { w: 4, h: 6, x: 4 }
4263
md: { w: 4, h: 6, x: 4 }
4364
sm: { w: 4, h: 6, x: 4 }
4465
xs: { w: 4, h: 6, x: 4 }
4566
xxs: { w: 4, h: 6, x: 4 }
67+
4668
organization:
4769
name: My Company
4870

workspaces/scorecard/plugins/scorecard/README.md

Lines changed: 37 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -136,17 +136,35 @@ To align with the legacy EntityPage (Scorecard on component pages and default en
136136
config:
137137
customizable: true
138138
widgetLayout:
139-
ScorecardJiraHomepage:
140-
priority: 240
139+
AggregatedCardWithDeprecatedMetricId:
140+
priority: 410
141141
breakpoints:
142142
xl: { w: 4, h: 6 }
143143
lg: { w: 4, h: 6 }
144144
md: { w: 4, h: 6 }
145145
sm: { w: 4, h: 6 }
146146
xs: { w: 4, h: 6 }
147147
xxs: { w: 4, h: 6 }
148-
ScorecardGithubHomepage:
149-
priority: 250
148+
AggregatedCardWithDefaultAggregation:
149+
priority: 420
150+
breakpoints:
151+
xl: { w: 4, h: 6, x: 4 }
152+
lg: { w: 4, h: 6, x: 4 }
153+
md: { w: 4, h: 6, x: 4 }
154+
sm: { w: 4, h: 6, x: 4 }
155+
xs: { w: 4, h: 6, x: 4 }
156+
xxs: { w: 4, h: 6, x: 4 }
157+
AggregatedCardWithJiraOpenIssues:
158+
priority: 430
159+
breakpoints:
160+
xl: { w: 4, h: 6 }
161+
lg: { w: 4, h: 6 }
162+
md: { w: 4, h: 6 }
163+
sm: { w: 4, h: 6 }
164+
xs: { w: 4, h: 6 }
165+
xxs: { w: 4, h: 6 }
166+
AggregatedCardWithGithubOpenPrs:
167+
priority: 440
150168
breakpoints:
151169
xl: { w: 4, h: 6, x: 4 }
152170
lg: { w: 4, h: 6, x: 4 }
@@ -156,31 +174,35 @@ To align with the legacy EntityPage (Scorecard on component pages and default en
156174
xxs: { w: 4, h: 6, x: 4 }
157175
```
158176

159-
The home module contributes two widgets:
177+
The home module contributes four widgets:
160178

161-
- `ScorecardGithubHomepage` (title: **Scorecard: GitHub open PRs**)
162-
- `ScorecardJiraHomepage` (title: **Scorecard: Jira open blocking tickets**)
179+
- `AggregatedCardWithDeprecatedMetricId` (title: **Scorecard: With deprecated metricId property (Jira)**)
180+
- `AggregatedCardWithDefaultAggregation` (title: **Scorecard: With default aggregation config (GitHub)**)
181+
- `AggregatedCardWithJiraOpenIssues` (title: **Scorecard: Jira open blocking tickets**)
182+
- `AggregatedCardWithGithubOpenPrs` (title: **Scorecard: GitHub open PRs**)
163183

164-
These widgets render the same `ScorecardHomepageCard` component used in legacy apps, preconfigured for `github.open_prs` and `jira.open_issues`.
184+
These widgets render the `ScorecardHomepageCard` component used in legacy apps, preconfigured with different aggregation/metric configurations.
165185

166186
##### Modules and extensions (NFS)
167187

168188
The following modules and extensions are available from `@red-hat-developer-hub/backstage-plugin-scorecard/alpha` for NFS apps:
169189

170190
**Modules**
171191

172-
| Module | Description |
173-
| ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
174-
| `scorecardHomeModule` | Registers Scorecard homepage widgets for the home plugin (`ScorecardGithubHomepage` and `ScorecardJiraHomepage`). |
175-
| `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). |
176-
| `scorecardTranslationsModule` | Registers Scorecard translations with the app. Add to your app's `features`. |
192+
| Module | Description |
193+
| ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
194+
| `scorecardHomeModule` | Registers Scorecard homepage widgets for the home plugin (`AggregatedCardWithDeprecatedMetricId`, `AggregatedCardWithDefaultAggregation`, `AggregatedCardWithJiraOpenIssues`, and `AggregatedCardWithGithubOpenPrs`). |
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`. |
177197

178198
**Extensions**
179199

180200
- `api:scorecard` — Scorecard API (provided by the plugin; auto-discovered when the plugin is installed).
181201
- `entity-content:catalog/entity-content-scorecard` — Scorecard tab on catalog entity pages. Configure with `allowedFilters` in `app.extensions` to limit by kind and optionally type.
182-
- `home-page-widget:home/scorecard-github-homepage` — Homepage widget showing GitHub open PR metric.
183-
- `home-page-widget:home/scorecard-jira-homepage` — Homepage widget showing Jira open issues metric.
202+
- `home-page-widget:home/scorecard-deprecated-metric-id` — Homepage widget using deprecated metricId property (Jira open issues).
203+
- `home-page-widget:home/scorecard-default-aggregation` — Homepage widget using default aggregation config (GitHub open PRs).
204+
- `home-page-widget:home/scorecard-jira-open-issues` — Homepage widget showing Jira open blocking tickets.
205+
- `home-page-widget:home/scorecard-github-open-prs` — Homepage widget showing GitHub open PRs.
184206

185207
#### Legacy app
186208

0 commit comments

Comments
 (0)