Skip to content

added all the metrics for the activity dropdown#98

Merged
emlimlf merged 5 commits intomainfrom
improvement/metric-options
Mar 13, 2025
Merged

added all the metrics for the activity dropdown#98
emlimlf merged 5 commits intomainfrom
improvement/metric-options

Conversation

@emlimlf
Copy link
Copy Markdown
Collaborator

@emlimlf emlimlf commented Mar 12, 2025

In this PR

Added all the activity types on the Activity dropdown shared component.

Ticket

INS-169

Future Work

Filter the activities shown in this dropdown to just the activities that are enabled for the specific project

Summary by CodeRabbit

  • New Features

    • Enhanced the metrics selector with grouped categories for a clearer, more organized view of available options.
    • Updated the display behavior of dropdown options for improved visual clarity and user experience.
    • Changed the default active tab for displaying active contributors and organizations, potentially altering the initial view presented to users.
  • Bug Fixes

    • Improved observability for debugging purposes by adding console logging to monitor changes in the active tab.

Signed-off-by: Efren Lim <elim@linuxfoundation.org>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 12, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This update restructures the metrics configuration in the frontend and includes a minor adjustment in the dropdown settings. The metricsOptions constant now uses a grouped structure instead of a flat list, categorizing various metrics under distinct labels. Additionally, the <lfx-dropdown> component in the metric dropdown fragment has its :split-lines property updated. Changes to the initialization of the activeTab variable in two components affect their default states, while an import statement in the server API file was commented out for consistency. No public API changes have been introduced.

Changes

File(s) Change Summary
frontend/app/.../config/metrics.ts Restructured metricsOptions: updated from DropdownOption[] (flat list) to DropdownGroupOptions[] (grouped by categories; e.g., Github, Git, Gerrit, etc.)
frontend/app/.../metric-dropdown.vue Updated <lfx-dropdown> component: Changed the :split-lines property value from [0] to [1]
frontend/app/.../active-contributors.vue, frontend/app/.../active-organizations.vue Modified initialization of activeTab from granularityTabs[0]?.value to granularityTabs[1]?.value in both components
frontend/server/.../organization-dependency.get.ts Commented out import statements for allMetrics and commits from the organization-dependency.mock file

Possibly related PRs

  • added all the metrics for the activity dropdown #98: The changes in the main PR are directly related to the same metricsOptions constant in the metrics.ts file as those in the retrieved PR, both involving a restructuring of the metrics from a flat list to a grouped format.

Suggested reviewers

  • gaspergrom
  • borfast

Tip

⚡🧪 Multi-step agentic review comment chat (experimental)
  • We're introducing multi-step agentic chat in review comments. This experimental feature enhances review discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments.
    - To enable this feature, set early_access to true under in the settings.

📜 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 b070d55 and c26d483.

📒 Files selected for processing (1)
  • frontend/app/components/modules/project/components/contributors/active-contributors.vue (1 hunks)

🪧 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.

@emlimlf emlimlf requested a review from gaspergrom March 12, 2025 12:22
Signed-off-by: Efren Lim <elim@linuxfoundation.org>
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 (1)
frontend/app/components/modules/project/components/contributors/active-contributors.vue (1)

124-124: Remove console.log statement before production deployment

Console logging statements should typically be removed before merging to production code as they can clutter the browser console and potentially expose information.

watch(selectedTimeRangeKey, () => {
  activeTab.value = tabs.value[0]?.value || 'weekly';
-  console.log('activeTab', activeTab.value);
});
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4f72f9f and cc9713f.

📒 Files selected for processing (2)
  • frontend/app/components/modules/project/components/contributors/active-contributors.vue (2 hunks)
  • frontend/app/components/modules/project/components/contributors/active-organizations.vue (1 hunks)
🔇 Additional comments (2)
frontend/app/components/modules/project/components/contributors/active-organizations.vue (1)

75-75: Default granularity changed from first to second option

This change sets the default granularity to the second tab option instead of the first one. This matches the change in active-contributors.vue, ensuring consistent behavior across components.

Could you verify this change is intentional and aligns with the PR objective of enhancing the Activity dropdown? What specific granularity value does this now default to (assuming granularityTabs[1] is 'weekly')?

frontend/app/components/modules/project/components/contributors/active-contributors.vue (1)

75-75: Default granularity changed from first to second option

This change sets the default granularity to the second tab option instead of the first one. This matches the change in active-organizations.vue, ensuring consistent behavior across components.

Signed-off-by: emlimlf <52259294+emlimlf@users.noreply.github.com>
@emlimlf emlimlf requested a review from borfast March 13, 2025 06:46

watch(selectedTimeRangeKey, () => {
activeTab.value = tabs.value[0]?.value || 'weekly';
console.log('activeTab', activeTab.value);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks like this one got left behind.

{ label: 'Pull Requests Merged', value: 'pull-requests-merged' },
{ label: 'Pull Requests Reviews', value: 'pull-requests-reviews' },
{ label: 'Pull Requests Comments', value: 'pull-requests-comments' }
export const metricsOptions: DropdownGroupOptions[] = [
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we have a bit of a mismatch in terms of language here? We talk about "activities" but we're calling them "metrics" in the code, which can be a little confusing. A metric would be the number of a thing, not the thing itself. And we are filtering by the thing, not its number. Does that make sense, or am I mixing things?

@@ -1,13 +1,378 @@
import type { DropdownOption } from '~/components/uikit/dropdown/types/dropdown.types';
import type { DropdownGroupOptions } from '~/components/uikit/dropdown/types/dropdown.types';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This would be for a separate PR but, since the type DropdownGroupOptions (and the related DropdownOption) is specifically about activities and not just a generic dropdown widget, wouldn't it be better to name it something like ActivitiesDropdownGroupOptions, or something like that more explicit and less generic?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

No, DropdownGroupOptions is generic to the shared select component.

Copy link
Copy Markdown
Contributor

@borfast borfast left a comment

Choose a reason for hiding this comment

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

There's a forgotten console.log() and I left a couple of questions regarding variable names.

emlimlf and others added 2 commits March 13, 2025 16:38
Signed-off-by: Efren Lim <elim@linuxfoundation.org>
@emlimlf emlimlf merged commit ae0f375 into main Mar 13, 2025
1 check passed
@emlimlf emlimlf deleted the improvement/metric-options branch March 13, 2025 08:40
@coderabbitai coderabbitai bot mentioned this pull request Mar 26, 2025
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.

3 participants