diff --git a/frontend/app/components/modules/project/components/development/review-time-by-pull-request-size.vue b/frontend/app/components/modules/project/components/development/review-time-by-pull-request-size.vue index 2442cea5d..4d44347b6 100644 --- a/frontend/app/components/modules/project/components/development/review-time-by-pull-request-size.vue +++ b/frontend/app/components/modules/project/components/development/review-time-by-pull-request-size.vue @@ -3,15 +3,88 @@

Review time by pull request size

-

+

Active contributor is an individual performing tasks such as commits, issues, or pull requests during the selected time period.

+
+
+
+
+
+
+ {{ item.lines }} lines + {{ item.prCount }} pull requests +
+
+ +
+
+
+ +
+
diff --git a/frontend/server/api/project/[slug]/development/review-time-by-pr-size.get.ts b/frontend/server/api/project/[slug]/development/review-time-by-pr-size.get.ts new file mode 100644 index 000000000..a4c8d6aaa --- /dev/null +++ b/frontend/server/api/project/[slug]/development/review-time-by-pr-size.get.ts @@ -0,0 +1,21 @@ +import { reviewTimeByPr } from '~~/server/mocks/review-time-by-pr.mock'; + +/** + * Frontend expects the data to be in the following format: + * [ + * { + * sortId: number; + * lines: string; + * prCount: number; + * averageReviewTime: number; + * averageReviewTimeUnit: string; + * } + * ] + */ +/** + * Query params: + * - project: string + * - repository: string + * - time-period: string // This is isn't defined yet, but we'll add '90d', '1y', '5y' for now + */ +export default defineEventHandler(async () => reviewTimeByPr); diff --git a/frontend/server/mocks/review-time-by-pr.mock.ts b/frontend/server/mocks/review-time-by-pr.mock.ts new file mode 100644 index 000000000..8eb82394e --- /dev/null +++ b/frontend/server/mocks/review-time-by-pr.mock.ts @@ -0,0 +1,37 @@ +export const reviewTimeByPr = [ + { + sortId: 1, + lines: '1-9', + prCount: 1000, + averageReviewTime: 9.86, + averageReviewTimeUnit: 'days' + }, + { + sortId: 2, + lines: '10-59', + prCount: 1200, + averageReviewTime: 20.96, + averageReviewTimeUnit: 'days' + }, + { + sortId: 3, + lines: '60-99', + prCount: 1100, + averageReviewTime: 31.32, + averageReviewTimeUnit: 'days' + }, + { + sortId: 4, + lines: '100-499', + prCount: 1300, + averageReviewTime: 42.07, + averageReviewTimeUnit: 'days' + }, + { + sortId: 5, + lines: '500+', + prCount: 900, + averageReviewTime: 55.9, + averageReviewTimeUnit: 'days' + } +];