Conversation
Signed-off-by: Efren Lim <elim@linuxfoundation.org>
Signed-off-by: Efren Lim <elim@linuxfoundation.org>
Signed-off-by: Efren Lim <elim@linuxfoundation.org>
Signed-off-by: Efren Lim <elim@linuxfoundation.org>
Signed-off-by: Efren Lim <elim@linuxfoundation.org>
|
Caution Review failedThe pull request is closed. WalkthroughThis pull request restructures type import paths across multiple Vue and TypeScript files by replacing relative paths with new absolute paths (using Changes
Sequence Diagram(s)sequenceDiagram
participant C as Retention.vue Component
participant Data as Fetched Data
participant Comp as Computed Property (retention)
participant Chart as convertToChartData Function
C->>Data: Fetch retention data
Data-->>Comp: Return raw data
Comp->>C: Provide typed Retention data (using startDate/endDate)
C->>Chart: Convert retention data for charting
Chart-->>C: Return formatted chartData
Possibly related PRs
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (80)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (9)
frontend/app/components/modules/project/components/development/types/wait-time-1st-review.types.ts (1)
6-7: Consider updating date property names for consistency.The properties
dateFromanddateToin this interface could be renamed tostartDateandendDateto align with modern naming conventions and potentially other parts of the codebase.export interface WaitTime1stReview { summary: Summary; data: { - dateFrom: string; - dateTo: string; + startDate: string; + endDate: string; waitTime: number; }[]; }frontend/app/components/modules/project/components/development/types/issues-resolution.types.ts (1)
7-15: Consider updating date properties for consistency.The data model still uses
dateFromanddateToproperties, while other parts of the codebase (like the retention endpoint) have standardized onstartDateandendDate.export interface IssuesResolution { summary: ResolutionSummary; data: { - dateFrom: string; - dateTo: string; + startDate: string; + endDate: string; closedIssues: number; totalIssues: number; }[]; }frontend/server/api/project/[slug]/contributors/retention.get.ts (1)
6-37: Consider adding TypeScript type for the return value.Since you're importing a type for
Retentionaccording to the AI summary, consider adding a return type to the event handler function for better type safety.- export default defineEventHandler(async (event) => { + export default defineEventHandler(async (event): Promise<Retention[]> => {frontend/app/components/modules/project/components/development/types/active-days.types.ts (1)
3-11: Consider updating date properties for consistency.Similar to the IssuesResolution interface, the ActiveDays interface still uses
dateFromanddateToproperties, while other parts of the codebase have standardized onstartDateandendDate.export interface ActiveDays { summary: Summary; avgContributions: number; data: { - dateFrom: string; - dateTo: string; + startDate: string; + endDate: string; contributions: number; }[]; }frontend/app/components/modules/project/components/development/active-days.vue (1)
89-89: Consider updating other import paths for consistency.While the Summary type import has been updated to use the new absolute path pattern, the lineGranularities import on line 89 is still using a relative path. Consider updating this import to use the same pattern for consistency.
-import { lineGranularities } from '~/components/shared/types/granularity'; +import { lineGranularities } from '~~/types/shared/granularity';frontend/app/components/modules/project/components/popularity/press-mentions.vue (1)
82-83: Consider updating the 'dateFrom' property nameThis convertToChartData call still uses 'dateFrom' while in other components these date properties have been standardized to 'startDate'/'endDate'.
- () => convertToChartData(mentions.value.data as RawChartData[], 'dateFrom', [ + () => convertToChartData(mentions.value.data as RawChartData[], 'startDate', [ 'mentions' ])frontend/app/components/modules/project/components/contributors/retention.vue (2)
19-21: Temporary UI change needs trackingThe chart type selection UI has been temporarily commented out with a TODO note. Consider adding a ticket reference to ensure this is revisited once the final design is decided.
- <!-- TODO: Hiding for now since the final design is not decided yet --> + <!-- TODO: Hiding for now since the final design is not decided yet - INS-XXX -->
110-121: Consider removing commented codeRather than commenting out the chartTypes array, consider removing it entirely since the component no longer uses it. If it's needed for reference, document it in the related issue ticket instead.
-// const chartTypes = [ -// { -// icon: 'fa-light fa-chart-line-down', -// label: 'Line', -// value: 'line' -// }, -// { -// icon: 'fa-light fa-bars-sort', -// label: 'Bar', -// value: 'bar' -// } -// ];frontend/app/components/modules/project/components/popularity/stars.vue (1)
108-110: Consider updating dateFrom/dateTo to startDate/endDate for consistency.While the import paths have been updated, the code still uses
dateFromanddateToproperties in the chart data conversion. According to the PR summary, retention-related data keys have been updated fromdateFrom/dateTotostartDate/endDatein other components. Consider updating these for consistency.- () => convertToChartData(stars.value?.data as RawChartData[], 'dateFrom', [ - 'stars' - ], undefined, 'dateTo') + () => convertToChartData(stars.value?.data as RawChartData[], 'startDate', [ + 'stars' + ], undefined, 'endDate')
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (40)
frontend/app/components/modules/project/components/contributors/active-contributors.vue(1 hunks)frontend/app/components/modules/project/components/contributors/active-organizations.vue(1 hunks)frontend/app/components/modules/project/components/contributors/config/granularity-tabs.ts(4 hunks)frontend/app/components/modules/project/components/contributors/contributor-dependency.vue(2 hunks)frontend/app/components/modules/project/components/contributors/contributors-leaderboard.vue(1 hunks)frontend/app/components/modules/project/components/contributors/organization-dependency.vue(2 hunks)frontend/app/components/modules/project/components/contributors/organizations-leaderboard.vue(1 hunks)frontend/app/components/modules/project/components/contributors/retention.vue(5 hunks)frontend/app/components/modules/project/components/contributors/types/contributors.types.ts(0 hunks)frontend/app/components/modules/project/components/development/active-days.vue(1 hunks)frontend/app/components/modules/project/components/development/average-time-to-merge.vue(1 hunks)frontend/app/components/modules/project/components/development/code-review-engagement.vue(1 hunks)frontend/app/components/modules/project/components/development/contributions-outside-work-hours.vue(1 hunks)frontend/app/components/modules/project/components/development/fragments/pull-request-legend-item.vue(1 hunks)frontend/app/components/modules/project/components/development/merge-lead-time.vue(1 hunks)frontend/app/components/modules/project/components/development/pull-requests.vue(1 hunks)frontend/app/components/modules/project/components/development/types/active-days.types.ts(1 hunks)frontend/app/components/modules/project/components/development/types/average-time-merge.types.ts(1 hunks)frontend/app/components/modules/project/components/development/types/code-review-engagement.types.ts(1 hunks)frontend/app/components/modules/project/components/development/types/contribution-outside-hours.types.ts(1 hunks)frontend/app/components/modules/project/components/development/types/issues-resolution.types.ts(1 hunks)frontend/app/components/modules/project/components/development/types/merge-lead-time.types.ts(1 hunks)frontend/app/components/modules/project/components/development/types/pull-requests.types.ts(1 hunks)frontend/app/components/modules/project/components/development/types/wait-time-1st-review.types.ts(1 hunks)frontend/app/components/modules/project/components/development/wait-time-first-review.vue(1 hunks)frontend/app/components/modules/project/components/popularity/forks.vue(1 hunks)frontend/app/components/modules/project/components/popularity/github-mentions.vue(1 hunks)frontend/app/components/modules/project/components/popularity/press-mentions.vue(1 hunks)frontend/app/components/modules/project/components/popularity/social-mentions.vue(1 hunks)frontend/app/components/modules/project/components/popularity/stars.vue(1 hunks)frontend/app/components/modules/project/components/popularity/types/popularity.types.ts(0 hunks)frontend/app/components/shared/types/granularity.ts(1 hunks)frontend/app/components/uikit/chart/helpers/formatters.ts(2 hunks)frontend/app/components/uikit/delta-display/types/delta-display.types.ts(1 hunks)frontend/server/api/project/[slug]/contributors/retention.get.ts(1 hunks)frontend/server/mocks/retention.mock.ts(1 hunks)frontend/types/contributors/responses.types.ts(1 hunks)frontend/types/popularity/responses.types.ts(1 hunks)frontend/types/shared/granularity.ts(1 hunks)frontend/types/shared/summary.types.ts(1 hunks)
💤 Files with no reviewable changes (2)
- frontend/app/components/modules/project/components/contributors/types/contributors.types.ts
- frontend/app/components/modules/project/components/popularity/types/popularity.types.ts
🔇 Additional comments (54)
frontend/types/shared/summary.types.ts (1)
10-14: Well-structured Meta interface addition.This new interface provides essential pagination metadata properties. The interface is clean and correctly defined with all properties having the appropriate number type.
frontend/app/components/modules/project/components/development/types/code-review-engagement.types.ts (1)
1-1: Import path updated successfully.The import path for the Summary type has been correctly updated to use the new absolute path with the double tilde prefix (
~~), which aligns with the PR objective of standardizing type imports.frontend/types/shared/granularity.ts (1)
1-8: Properly structured Granularity enum.This enum provides a standardized way to represent time intervals throughout the application. The uppercase naming convention for enum members follows TypeScript best practices, while maintaining lowercase string values for API compatibility.
frontend/app/components/modules/project/components/development/types/wait-time-1st-review.types.ts (1)
1-1: Import path updated correctly.The import path for the Summary type has been properly updated to use the new absolute path format, consistent with other changes in this PR.
frontend/app/components/modules/project/components/development/types/merge-lead-time.types.ts (1)
1-1: Standardized Import Update
The import ofSummarynow uses the new absolute path (~~/types/shared/summary.types), which is consistent with the reorganized type structure.frontend/app/components/modules/project/components/development/types/contribution-outside-hours.types.ts (1)
1-1: Consistent Import Path Revision
The updated import for theSummarytype using~~/types/shared/summary.typesis correctly applied, ensuring consistency across the project’s types.frontend/app/components/modules/project/components/development/types/average-time-merge.types.ts (2)
1-1: Updated Import with New Absolute Path
The change to importSummaryfrom~~/types/shared/summary.typesaligns with the new directory structure and maintains consistency.
6-8: Field Naming in Data Objects
TheAverageTimeMergeinterface still usesdateFromanddateTo. Confirm that these field names are intentionally preserved here rather than switching tostartDate/endDate(which are updated for retention data elsewhere).frontend/server/mocks/retention.mock.ts (3)
3-6: Renamed Retention Keys in ContributorRetention
The contributor retention entries now usestartDateandendDateinstead ofdateFrom/dateTo. This update correctly reflects the new naming convention.
8-51: Verify Consistency Across ContributorRetention Entries
All contributor retention objects have been updated with the new key names. Please ensure that any downstream consumers (e.g., components or API endpoints) are modified accordingly to referencestartDateandendDate.
56-105: Renamed Retention Keys in OrganizationRetention
The organization retention array also reflects the updated keys (startDateandendDate). Confirm that all related processing logic or components handling these entries accommodate this change.frontend/app/components/modules/project/components/development/types/pull-requests.types.ts (1)
1-1: Consistent Import Path Update
TheSummarytype is now imported from~~/types/shared/summary.types, ensuring a standardized path across the type definitions.frontend/app/components/modules/project/components/development/types/issues-resolution.types.ts (1)
1-1: LGTM: Import path updated to use shared types location.The import path has been updated to use the new shared types location, which aligns with the project's goal of better type organization.
frontend/server/api/project/[slug]/contributors/retention.get.ts (2)
1-4: LGTM: Import formatting improved.The import statement has been reformatted for better readability while maintaining the same functionality.
9-10: LGTM: Updated property names in comments.The property names in the comments have been updated from
dateFrom/dateTotostartDate/endDate, aligning with the actual data structure in the mocks.frontend/app/components/modules/project/components/development/types/active-days.types.ts (1)
1-1: LGTM: Import path updated to use shared types location.The import path has been updated to use the new shared types location, which aligns with the project's goal of better type organization.
frontend/app/components/modules/project/components/development/code-review-engagement.vue (1)
65-65: LGTM: Import path updated to use shared types location.The import path has been updated to use the new shared types location, which aligns with the project's goal of better type organization.
frontend/app/components/uikit/delta-display/types/delta-display.types.ts (1)
2-2: Import path updated to use absolute path pattern.The import path for the Summary type has been updated to use the new centralized types location with the '~~/' prefix, which is consistent with the PR objective of reorganizing types.
frontend/app/components/modules/project/components/development/merge-lead-time.vue (1)
82-82: Import path updated to use absolute path pattern.The import path for the Summary type has been updated to use the new centralized types location with the '~~/' prefix, which is consistent with the PR objective of reorganizing types.
frontend/app/components/modules/project/components/contributors/contributors-leaderboard.vue (1)
37-37: Import path updated to use absolute path pattern.The import path for ContributorLeaderboard has been updated from a relative path to the new centralized types location with the '~~/' prefix, which is consistent with the PR objective of reorganizing types into a common shared folder.
frontend/app/components/modules/project/components/development/active-days.vue (1)
73-73: Import path updated to use absolute path pattern.The import path for the Summary type has been updated to use the new centralized types location with the '~~/' prefix, which is consistent with the PR objective of reorganizing types.
frontend/app/components/modules/project/components/development/wait-time-first-review.vue (1)
53-53: Import path update looks goodThe import path for the
Summarytype has been updated to use the absolute path with the~~prefix, which aligns with the project's restructuring of type definitions.frontend/app/components/modules/project/components/popularity/social-mentions.vue (1)
44-45: Type imports correctly updatedThe import paths for both
SocialMentionsandSummarytypes have been properly updated to use absolute paths, withSocialMentionsnow coming from the centralized popularity types folder. This aligns with the project's goal of improving type organization.frontend/app/components/modules/project/components/development/contributions-outside-work-hours.vue (1)
89-89: Type import path standardizedThe import path for the
Summarytype has been correctly updated to use the absolute path with the~~prefix, which follows the consistent pattern applied across the codebase.frontend/app/components/modules/project/components/popularity/github-mentions.vue (1)
44-45: Type imports properly restructuredBoth
GithubMentionsandSummarytype imports have been successfully updated to use absolute paths, withGithubMentionsnow imported from the centralized popularity types location. This change correctly follows the type organization pattern established in this PR.frontend/app/components/modules/project/components/development/average-time-to-merge.vue (1)
53-53: Updated import path looks goodThe import path for the
Summarytype has been successfully updated to use the new shared types folder structure. This change aligns with the PR objective of relocating types to a common shared folder.frontend/app/components/modules/project/components/development/pull-requests.vue (1)
92-92: Import path correctly updatedThe import path for the
Summarytype has been properly updated to use the new centralized type location. This change is consistent with the project's effort to standardize type imports.frontend/app/components/modules/project/components/contributors/organizations-leaderboard.vue (1)
37-37: Import path correctly restructuredThe import path for the
OrganizationLeaderboardtype has been updated to use the new type organization structure. The change from a relative path to an absolute path with the new location in the dedicated contributors responses types file is appropriate.frontend/app/components/modules/project/components/contributors/active-organizations.vue (2)
52-53: Type imports successfully updatedBoth import paths for
ActiveOrganizationsandSummaryhave been correctly updated to use the new centralized type locations. This change is consistent with the overall restructuring of type definitions across the project.
94-96: Updated property names align with type changesNice work on updating the property names from
dateFrom/dateTotostartDate/endDatein the chart data conversion. This ensures consistency with the updated type definitions.frontend/app/components/uikit/chart/helpers/formatters.ts (2)
11-11: LGTM: Path standardization for type importsThe import path has been updated to use the absolute path with the
~~/prefix, aligning with the goal of organizing types in a common shared folder.
74-75: LGTM: Enum naming convention improvementUpdating the granularity enum values to UPPERCASE follows TypeScript best practices for constant enum values.
Also applies to: 80-80, 82-82
frontend/app/components/modules/project/components/development/fragments/pull-request-legend-item.vue (1)
26-26: LGTM: Consistent type import pathThe import path has been standardized to use the absolute path with the
~~/prefix, which aligns with the PR objective of relocating types to a common shared folder.frontend/app/components/modules/project/components/popularity/forks.vue (3)
59-59: LGTM: Updated import path for ForksDataThe import path has been changed to use the new centralized type location, improving organization.
61-61: LGTM: Standardized Summary type importThe import path has been standardized to use the absolute path with the
~~/prefix, consistent with other type imports.
108-110: Consider updating the date property namesAccording to the API summary, date property names are being updated from
dateFrom/dateTotostartDate/endDate. However, this component still uses the old property names.Check if these property names need to be updated:
- () => convertToChartData(forks.value?.data as RawChartData[], 'dateFrom', [ - 'forks' - ], undefined, 'dateTo') + () => convertToChartData(forks.value?.data as RawChartData[], 'startDate', [ + 'forks' + ], undefined, 'endDate')frontend/types/popularity/responses.types.ts (2)
1-2: LGTM: Proper relative import for Summary typeGood use of relative import paths within the types directory structure.
3-19: Consider updating date property naming conventionsThe interfaces use
dateFromanddateToproperties, but according to the AI summary, there's a standardization effort to usestartDateandendDateinstead.export interface StarsData { summary: Summary; data: { - dateFrom: string; - dateTo: string; + startDate: string; + endDate: string; stars: number; }[]; } export interface ForksData { summary: Summary; data: { - dateFrom: string; - dateTo: string; + startDate: string; + endDate: string; forks: number; }[]; }Verify whether these properties should be updated for consistency across the codebase. Other interfaces in this file (like SocialMentions) also use the same property names.
frontend/app/components/shared/types/granularity.ts (2)
2-2: Import path updated to use absolute pathThe import statement now uses an absolute path with the
~~/types/shared/prefix instead of a relative import, which aligns with the PR objective of relocating types to a common shared folder.
5-9: Standardized enum values to uppercase constantsAll Granularity enum references have been properly updated from camelCase to UPPERCASE format (e.g.,
Granularity.WeeklytoGranularity.WEEKLY), which promotes consistency in enum naming conventions across the codebase.Also applies to: 13-21, 25-33
frontend/app/components/modules/project/components/popularity/press-mentions.vue (1)
42-43: Import paths updated to use centralized type definitionsImport paths have been updated to use absolute paths with the
~~/types/prefix, moving from local type definitions to centralized ones. This change aligns with the PR objective of reorganizing types into a common shared folder structure.frontend/app/components/modules/project/components/contributors/config/granularity-tabs.ts (2)
3-3: Import path updated to use absolute pathThe import statement now uses an absolute path with the
~~/types/shared/prefix, which aligns with the PR objective of relocating types to a common shared folder.
8-8: Standardized enum values to uppercase constantsAll Granularity enum references have been properly updated from camelCase to UPPERCASE format, which maintains consistency with the changes made to the enum definition itself.
Also applies to: 20-20, 35-35, 48-48
frontend/app/components/modules/project/components/contributors/retention.vue (2)
60-60: New type import from centralized locationThe Retention type is now imported from a centralized types directory, which aligns with the PR objective of reorganizing types.
85-86: Improved type safety and standardized date property namesThese changes improve the code by:
- Adding a properly typed computed property for retention data
- Standardizing date property names from 'dateFrom'/'dateTo' to 'startDate'/'endDate'
This is a good change that enhances type safety and maintains consistency across the codebase.
Also applies to: 89-95
frontend/app/components/modules/project/components/popularity/stars.vue (2)
59-59: Import path updated to use absolute path notation.The type import has been updated from a relative path to an absolute path using the
~~prefix, aligning with the PR objective of relocating popularity types to a common shared folder.
61-61: Import path updated for Summary type.Similarly, the Summary type import has been updated to use the new centralized type location.
frontend/app/components/modules/project/components/contributors/organization-dependency.vue (2)
60-60: Import path updated to use absolute path notation.The type import has been updated from a relative path to an absolute path using the
~~prefix, consistent with the type reorganization in this PR.
84-87: Improved data access pattern with dedicated type casting.The refactoring introduces a dedicated computed property
organizationDependencyfor type casting, which improves code clarity. The other computed properties now reference this property rather than repeatedly castingdata.value. This is a good practice for TypeScript type safety and code maintainability.frontend/app/components/modules/project/components/contributors/contributor-dependency.vue (2)
60-60: Import path updated to use absolute path notation.The type import has been updated from a relative path to an absolute path using the
~~prefix, consistent with the type reorganization in this PR.
84-88: Improved data access pattern with dedicated type casting.Similar to the organization-dependency component, this refactoring introduces a dedicated computed property
contributorDependencyfor type casting. The other computed properties now reference this property rather than repeatedly castingdata.value, improving code clarity and type safety.frontend/app/components/modules/project/components/contributors/active-contributors.vue (2)
52-53: Import paths updated to use absolute path notation.Both type imports have been updated from relative paths to absolute paths using the
~~prefix, aligned with the type reorganization.
94-96: Already using standardized date property names.This component is already using the standardized
startDateandendDateproperties mentioned in the PR summary, which is good for consistency across the codebase.frontend/types/contributors/responses.types.ts (1)
1-68: Well-structured type definitions with clear organization.The file defines a comprehensive set of interfaces for contributors and organizations with consistent naming patterns and proper type relationships. The standardization of date properties to
startDateandendDate(as mentioned in PR summary) improves consistency across the codebase.
Signed-off-by: Efren Lim <elim@linuxfoundation.org>
In this PR
Moved all the popularity chart widget types to the common shared type folder
Ticket
INS-155
Summary by CodeRabbit
Summary by CodeRabbit
Refactor
Chores