Skip to content

Commit 2177419

Browse files
authored
feat: add management of new widgets (IN-872) (#3661)
Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
1 parent bc8920d commit 2177419

2 files changed

Lines changed: 56 additions & 0 deletions

File tree

  • frontend/src/modules/admin/modules/insights-projects
  • services/libs/types/src/enums

frontend/src/modules/admin/modules/insights-projects/widgets.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ export enum Widgets {
2626
AVERAGE_TIME_TO_MERGE = 'averageTimeToMerge',
2727
WAIT_TIME_FOR_1ST_REVIEW = 'waitTimeFor1stReview',
2828
CODE_REVIEW_ENGAGEMENT = 'codeReviewEngagement',
29+
REVIEW_EFFICIENCY = 'reviewEfficiency',
30+
PATCHSET_PER_REVIEW = 'patchsetPerReview',
31+
MEDIAN_TIME_TO_MERGE = 'medianTimeToMerge',
32+
MEDIAN_TIME_TO_REVIEW = 'medianTimeToReview',
2933
}
3034

3135
export const WIDGETS_GROUPS = [
@@ -151,6 +155,22 @@ export const WIDGETS_GROUPS = [
151155
name: 'Code review engagement',
152156
key: Widgets.CODE_REVIEW_ENGAGEMENT,
153157
},
158+
{
159+
name: 'Review efficiency',
160+
key: Widgets.REVIEW_EFFICIENCY,
161+
},
162+
{
163+
name: 'Patchsets per review',
164+
key: Widgets.PATCHSET_PER_REVIEW,
165+
},
166+
{
167+
name: 'Median time to merge',
168+
key: Widgets.MEDIAN_TIME_TO_MERGE,
169+
},
170+
{
171+
name: 'Median time to review',
172+
key: Widgets.MEDIAN_TIME_TO_REVIEW,
173+
},
154174
],
155175
},
156176
];

services/libs/types/src/enums/widgets.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ export enum Widgets {
2828
AVERAGE_TIME_TO_MERGE = 'averageTimeToMerge',
2929
WAIT_TIME_FOR_1ST_REVIEW = 'waitTimeFor1stReview',
3030
CODE_REVIEW_ENGAGEMENT = 'codeReviewEngagement',
31+
// New widgets
32+
REVIEW_EFFICIENCY = 'reviewEfficiency',
33+
PATCHSET_PER_REVIEW = 'patchsetPerReview',
34+
MEDIAN_TIME_TO_MERGE = 'medianTimeToMerge',
35+
MEDIAN_TIME_TO_REVIEW = 'medianTimeToReview',
3136
}
3237

3338
export const DEFAULT_WIDGET_VALUES: Record<
@@ -189,4 +194,35 @@ export const DEFAULT_WIDGET_VALUES: Record<
189194
PlatformType.GERRIT,
190195
],
191196
},
197+
[Widgets.REVIEW_EFFICIENCY]: {
198+
enabled: false,
199+
platform: [
200+
PlatformType.GERRIT,
201+
PlatformType.GITHUB,
202+
PlatformType.GITLAB,
203+
PlatformType.GITHUB_NANGO,
204+
],
205+
},
206+
[Widgets.PATCHSET_PER_REVIEW]: {
207+
enabled: false,
208+
platform: [PlatformType.GERRIT],
209+
},
210+
[Widgets.MEDIAN_TIME_TO_MERGE]: {
211+
enabled: false,
212+
platform: [
213+
PlatformType.GERRIT,
214+
PlatformType.GITHUB,
215+
PlatformType.GITLAB,
216+
PlatformType.GITHUB_NANGO,
217+
],
218+
},
219+
[Widgets.MEDIAN_TIME_TO_REVIEW]: {
220+
enabled: false,
221+
platform: [
222+
PlatformType.GERRIT,
223+
PlatformType.GITHUB,
224+
PlatformType.GITLAB,
225+
PlatformType.GITHUB_NANGO,
226+
],
227+
},
192228
}

0 commit comments

Comments
 (0)