Skip to content

Improvement/popularity types#90

Merged
emlimlf merged 6 commits intomainfrom
improvement/popularity-types
Mar 11, 2025
Merged

Improvement/popularity types#90
emlimlf merged 6 commits intomainfrom
improvement/popularity-types

Conversation

@emlimlf
Copy link
Copy Markdown
Collaborator

@emlimlf emlimlf commented Mar 11, 2025

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

    • Standardized internal type imports and naming conventions for data consistency (e.g., granularity labels and date keys).
    • Streamlined computed property handling for clearer data processing.
    • Enhanced dynamic SEO metadata generation for various components based on project and collection data.
  • Chores

    • Removed obsolete type declarations to simplify the project structure.
    • Temporarily hid the chart type selection until the final design is confirmed.

emlimlf added 5 commits March 11, 2025 09:31
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>
@emlimlf emlimlf requested review from borfast and gaspergrom March 11, 2025 02:23
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 11, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This pull request restructures type import paths across multiple Vue and TypeScript files by replacing relative paths with new absolute paths (using ~~/). Several components—spanning contributors, organizations, development metrics, and popularity features—now import types (such as Summary, ActiveContributors, and Granularity) from reorganized locations. In addition, enum values for granularity have been standardized to uppercase, legacy type definitions have been removed, new type files have been introduced, and retention-related data keys have been updated from dateFrom/dateTo to startDate/endDate.

Changes

File(s) Change Summary
Contributors & Organizations Components
(active-contributors.vue, active-organizations.vue, contributor-dependency.vue, contributors-leaderboard.vue, organization-dependency.vue, organizations-leaderboard.vue)
Updated import paths for contributor/organization types (e.g. ActiveContributors, ContributorDependency, ContributorLeaderboard, etc.) from relative paths to ~~/types/contributors/responses.types. Also, refactored computed properties to centralize type casting.
Development Components & Types
(active-days.vue, average-time-to-merge.vue, code-review-engagement.vue, contributions-outside-work-hours.vue, pull-request-legend-item.vue, merge-lead-time.vue, pull-requests.vue, wait-time-first-review.vue, and corresponding types files)
Updated import paths for the Summary type from ~/components/shared/types/summary.types to ~~/types/shared/summary.types.
Granularity & Chart Helpers
(granularity-tabs.ts, chart/helpers/formatters.ts, shared types in granularity.ts)
Changed import for Granularity to ~~/types/shared/granularity and updated its value references from camel case (e.g. Weekly) to uppercase (e.g. WEEKLY). Also, removed the old enum definition in favor of the new one.
Popularity Components & Types
(forks.vue, github-mentions.vue, press-mentions.vue, social-mentions.vue, stars.vue, and removal of popularity.types.ts)
Revised import paths for types like ForksData, StarsData, GithubMentions, etc., to use ~~/types/popularity/responses.types. Removed the legacy file defining these interfaces.
Retention & Server-side Files
(retention.vue, retention.get.ts, retention.mock.ts)
Disabled the chart type selection in retention.vue and introduced a new computed property casting data to Retention. Updated date key names from dateFrom/dateTo to startDate/endDate in API comments and mock data.
New Type Definitions
(frontend/types/contributors/responses.types.ts, frontend/types/popularity/responses.types.ts, frontend/types/shared/granularity.ts, frontend/types/shared/summary.types.ts)
Introduced new consolidated type definitions for contributors, organizations, popularity metrics, and shared types. Added new interfaces (e.g. Retention) and a Meta interface to the shared summary types, and defined a new Granularity enum with standardized values.

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
Loading

Possibly related PRs

Suggested reviewers

  • gaspergrom

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c7bd102 and 23f1eb5.

⛔ Files ignored due to path filters (1)
  • frontend/public/favicon.ico is excluded by !**/*.ico
📒 Files selected for processing (80)
  • frontend/app/components/modules/project/components/contributors/config/granularity-tabs.ts (4 hunks)
  • frontend/app/components/shared/types/granularity.ts (1 hunks)
  • frontend/app/components/uikit/chart/helpers/formatters.ts (4 hunks)
  • frontend/types/shared/granularity.ts (1 hunks)
  • frontend/app/components/modules/project/components/contributors/active-contributors.vue (2 hunks)
  • frontend/app/components/modules/project/components/contributors/active-organizations.vue (2 hunks)
  • frontend/app/components/modules/project/components/contributors/types/contributors.types.ts (1 hunks)
  • frontend/app/components/modules/project/components/development/active-days.vue (3 hunks)
  • frontend/app/components/modules/project/components/development/average-time-to-merge.vue (2 hunks)
  • frontend/app/components/modules/project/components/development/code-review-engagement.vue (2 hunks)
  • frontend/app/components/modules/project/components/development/contributions-outside-work-hours.vue (3 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 (2 hunks)
  • frontend/app/components/modules/project/components/development/pull-requests.vue (2 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 (2 hunks)
  • frontend/app/components/modules/project/components/popularity/forks.vue (2 hunks)
  • frontend/app/components/modules/project/components/popularity/github-mentions.vue (2 hunks)
  • frontend/app/components/modules/project/components/popularity/press-mentions.vue (2 hunks)
  • frontend/app/components/modules/project/components/popularity/social-mentions.vue (2 hunks)
  • frontend/app/components/modules/project/components/popularity/stars.vue (2 hunks)
  • frontend/app/components/modules/project/components/popularity/types/mentions.types.ts (1 hunks)
  • frontend/app/components/modules/project/components/popularity/types/popularity.types.ts (1 hunks)
  • frontend/app/components/uikit/delta-display/types/delta-display.types.ts (1 hunks)
  • 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/types/contributors.types.ts (1 hunks)
  • frontend/app/components/modules/project/components/development/active-days.vue (2 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 (2 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/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/uikit/chart/helpers/formatters.ts (3 hunks)
  • frontend/types/shared/summary.types.ts (1 hunks)
  • 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/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/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/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/modules/collection/components/details/filters.vue (2 hunks)
  • frontend/app/components/modules/collection/components/details/header.vue (5 hunks)
  • frontend/app/components/uikit/button/button.scss (2 hunks)
  • frontend/app/pages/charts.vue (0 hunks)
  • frontend/app/pages/collection/[slug].vue (1 hunks)
  • frontend/app/pages/collection/index.vue (1 hunks)
  • frontend/app/pages/project/[slug]/contributors.vue (1 hunks)
  • frontend/app/pages/project/[slug]/development.vue (1 hunks)
  • frontend/app/pages/project/[slug]/popularity.vue (1 hunks)
  • frontend/app/pages/project/[slug]/repository/[name]/contributors.vue (1 hunks)
  • frontend/app/pages/project/[slug]/repository/[name]/development.vue (1 hunks)
  • frontend/app/pages/project/[slug]/repository/[name]/popularity.vue (1 hunks)
  • frontend/setup/head.ts (1 hunks)
  • frontend/tailwind.config.js (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 dateFrom and dateTo in this interface could be renamed to startDate and endDate to 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 dateFrom and dateTo properties, while other parts of the codebase (like the retention endpoint) have standardized on startDate and endDate.

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 Retention according 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 dateFrom and dateTo properties, while other parts of the codebase have standardized on startDate and endDate.

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 name

This 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 tracking

The 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 code

Rather 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 dateFrom and dateTo properties in the chart data conversion. According to the PR summary, retention-related data keys have been updated from dateFrom/dateTo to startDate/endDate in 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

📥 Commits

Reviewing files that changed from the base of the PR and between d95e9bb and c7bd102.

📒 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 of Summary now 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 the Summary type using ~~/types/shared/summary.types is 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 import Summary from ~~/types/shared/summary.types aligns with the new directory structure and maintains consistency.


6-8: Field Naming in Data Objects
The AverageTimeMerge interface still uses dateFrom and dateTo. Confirm that these field names are intentionally preserved here rather than switching to startDate/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 use startDate and endDate instead of dateFrom/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 reference startDate and endDate.


56-105: Renamed Retention Keys in OrganizationRetention
The organization retention array also reflects the updated keys (startDate and endDate). 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
The Summary type 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/dateTo to startDate/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 good

The import path for the Summary type 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 updated

The import paths for both SocialMentions and Summary types have been properly updated to use absolute paths, with SocialMentions now 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 standardized

The import path for the Summary type 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 restructured

Both GithubMentions and Summary type imports have been successfully updated to use absolute paths, with GithubMentions now 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 good

The import path for the Summary type 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 updated

The import path for the Summary type 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 restructured

The import path for the OrganizationLeaderboard type 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 updated

Both import paths for ActiveOrganizations and Summary have 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 changes

Nice work on updating the property names from dateFrom/dateTo to startDate/endDate in 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 imports

The 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 improvement

Updating 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 path

The 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 ForksData

The import path has been changed to use the new centralized type location, improving organization.


61-61: LGTM: Standardized Summary type import

The 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 names

According to the API summary, date property names are being updated from dateFrom/dateTo to startDate/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 type

Good use of relative import paths within the types directory structure.


3-19: Consider updating date property naming conventions

The interfaces use dateFrom and dateTo properties, but according to the AI summary, there's a standardization effort to use startDate and endDate instead.

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 path

The 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 constants

All Granularity enum references have been properly updated from camelCase to UPPERCASE format (e.g., Granularity.Weekly to Granularity.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 definitions

Import 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 path

The 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 constants

All 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 location

The 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 names

These changes improve the code by:

  1. Adding a properly typed computed property for retention data
  2. 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 organizationDependency for type casting, which improves code clarity. The other computed properties now reference this property rather than repeatedly casting data.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 contributorDependency for type casting. The other computed properties now reference this property rather than repeatedly casting data.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 startDate and endDate properties 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 startDate and endDate (as mentioned in PR summary) improves consistency across the codebase.

Signed-off-by: Efren Lim <elim@linuxfoundation.org>
@emlimlf emlimlf merged commit ffefc99 into main Mar 11, 2025
1 check passed
@emlimlf emlimlf deleted the improvement/popularity-types branch March 11, 2025 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants