Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WEB-2028] fix: added states to module progress bar #5273

Merged
merged 2 commits into from
Jul 31, 2024

Conversation

gakshita
Copy link
Collaborator

@gakshita gakshita commented Jul 30, 2024

Summary
In module's card layout, the progress bar only reflected the completed state. Add unstarted, backlog and started state as well.

[WEB-2028]

Summary by CodeRabbit

  • New Features

    • Enhanced visual representation of module progress with a new LinearProgressIndicator.
    • Introduced MODULE_STATE_GROUPS_DETAILS constant for better categorization of module states.
    • Updated progress indicators in the ActiveCycleProgress component to reflect new progress states.
  • Bug Fixes

    • Removed outdated tooltip and progress bar for a cleaner user interface.

Copy link
Contributor

coderabbitai bot commented Jul 30, 2024

Walkthrough

The changes enhance the ModuleCardItem component and introduce new constants for module and progress states. The ModuleCardItem now utilizes a LinearProgressIndicator to provide a cleaner visual representation of module metrics, replacing the previous tooltip and progress bar. Additionally, new constants like MODULE_STATE_GROUPS_DETAILS and PROGRESS_STATE_GROUPS_DETAILS help categorize and visualize various issue states, improving both functionality and user experience.

Changes

Files Change Summary
.../modules/module-card-item.tsx Updated to use LinearProgressIndicator for module progress, removing tooltip and progress bar elements.
.../constants/module.ts Introduced MODULE_STATE_GROUPS_DETAILS constant for categorizing module issue states with properties for key, title, and color.
.../constants/common.ts Added PROGRESS_STATE_GROUPS_DETAILS for structured representation of issue progress states, enhancing UI representation.
.../constants/cycle.ts Removed CYCLE_STATE_GROUPS_DETAILS, eliminating predefined cycle state details.
.../cycles/active-cycle/progress.tsx Updated to use PROGRESS_STATE_GROUPS_DETAILS for mapping progress indicators, changing the visual representation.

Poem

🐰 In fields of code where modules bloom,
Progress now shines, dispelling the gloom.
With colors bright and metrics clear,
A new design brings us cheer!
Hopping forward, we embrace the change,
In our UI garden, let’s rearrange! 🌼


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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.

@SatishGandham SatishGandham added this to the v0.23-dev milestone Jul 30, 2024
Copy link
Contributor

@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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 1f8f6d1 and 7dbc0d6.

Files selected for processing (2)
  • web/core/components/modules/module-card-item.tsx (4 hunks)
  • web/core/constants/module.ts (1 hunks)
Additional comments not posted (4)
web/core/constants/module.ts (1)

101-122: LGTM! Verify the usage of the new constant in the codebase.

The code changes are approved.

However, ensure that the new constant MODULE_STATE_GROUPS_DETAILS is correctly used throughout the codebase.

Verification successful

The new constant MODULE_STATE_GROUPS_DETAILS is correctly used in the codebase.

The constant is imported and utilized in the web/core/components/modules/module-card-item.tsx file.

  • web/core/components/modules/module-card-item.tsx: The constant is used to map over MODULE_STATE_GROUPS_DETAILS to create progressIndicatorData.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of the new constant `MODULE_STATE_GROUPS_DETAILS`.

# Test: Search for the constant usage. Expect: Correct usage throughout the codebase.
rg --type javascript --type typescript $'MODULE_STATE_GROUPS_DETAILS'

Length of output: 103


Script:

#!/bin/bash
# Description: Verify the usage of the new constant `MODULE_STATE_GROUPS_DETAILS`.

# Test: Search for the constant usage. Expect: Correct usage throughout the codebase.
rg --type js --type ts --type tsx 'MODULE_STATE_GROUPS_DETAILS'

Length of output: 91


Script:

#!/bin/bash
# Description: Verify the usage of the new constant `MODULE_STATE_GROUPS_DETAILS`.

# Test: Search for the constant usage. Expect: Correct usage throughout the codebase.
rg --type js --type ts 'MODULE_STATE_GROUPS_DETAILS'

Length of output: 390

web/core/components/modules/module-card-item.tsx (3)

9-10: LGTM!

The new imports are necessary for the updated functionality of the ModuleCardItem component.

Also applies to: 16-16


219-219: LGTM!

The usage of the LinearProgressIndicator component enhances the visual representation of module progress.


168-173: LGTM! Verify the correctness of the new logic.

The code changes are approved.

However, ensure that the new logic for progressIndicatorData correctly maps the module metrics.

Verification successful

The new logic for progressIndicatorData correctly maps the module metrics.

The structure of MODULE_STATE_GROUPS_DETAILS and CYCLE_STATE_GROUPS_DETAILS arrays is appropriate and aligns with the mapping logic in the code.

  • web/core/constants/module.ts
  • web/core/constants/cycle.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the correctness of the new logic for `progressIndicatorData`.

# Test: Search for the `progressIndicatorData` usage. Expect: Correct mapping of module metrics.
rg --type javascript --type typescript $'progressIndicatorData'

Length of output: 97


Script:

#!/bin/bash
# Description: Verify the correctness of the new logic for `progressIndicatorData`.

# Test: Search for the `progressIndicatorData` usage. Expect: Correct mapping of module metrics.
rg --type js --type ts 'progressIndicatorData'

Length of output: 601


Script:

#!/bin/bash
# Description: Verify the definitions of `MODULE_STATE_GROUPS_DETAILS` and `CYCLE_STATE_GROUPS_DETAILS`.

# Test: Search for the definitions of `MODULE_STATE_GROUPS_DETAILS` and `CYCLE_STATE_GROUPS_DETAILS`.
rg --type js --type ts 'MODULE_STATE_GROUPS_DETAILS'
rg --type js --type ts 'CYCLE_STATE_GROUPS_DETAILS'

Length of output: 905


Script:

#!/bin/bash
# Description: Display the contents of `MODULE_STATE_GROUPS_DETAILS` and `CYCLE_STATE_GROUPS_DETAILS`.

# Display the contents of `MODULE_STATE_GROUPS_DETAILS`.
rg --type js --type ts --context 10 'export const MODULE_STATE_GROUPS_DETAILS' web/core/constants/module.ts

# Display the contents of `CYCLE_STATE_GROUPS_DETAILS`.
rg --type js --type ts --context 10 'export const CYCLE_STATE_GROUPS_DETAILS' web/core/constants/cycle.ts

Length of output: 924

@@ -97,3 +97,26 @@ export const MODULE_ORDER_BY_OPTIONS: { key: TModuleOrderByOptions; label: strin
label: "Manual",
},
];

export const MODULE_STATE_GROUPS_DETAILS = [
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is same for cycles as well. We should use that.

Copy link
Contributor

@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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 7dbc0d6 and c865d19.

Files selected for processing (4)
  • web/core/components/cycles/active-cycle/progress.tsx (3 hunks)
  • web/core/components/modules/module-card-item.tsx (4 hunks)
  • web/core/constants/common.ts (1 hunks)
  • web/core/constants/cycle.ts (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • web/core/components/modules/module-card-item.tsx
Additional comments not posted (5)
web/core/constants/common.ts (1)

9-30: LGTM!

The new constant PROGRESS_STATE_GROUPS_DETAILS is well-defined and follows a consistent structure.

web/core/constants/cycle.ts (1)

Line range hint 1-1:
Verify the removal of CYCLE_STATE_GROUPS_DETAILS.

Ensure that the constant CYCLE_STATE_GROUPS_DETAILS is not used elsewhere in the codebase.

Verification successful

Verification complete: CYCLE_STATE_GROUPS_DETAILS is not used elsewhere in the codebase.

  • The constant CYCLE_STATE_GROUPS_DETAILS was not found in any JavaScript or TypeScript files in the repository.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify if `CYCLE_STATE_GROUPS_DETAILS` is used elsewhere in the codebase.

# Test: Search for the constant usage. Expect: No occurrences of the constant.
rg --type js --type ts --type tsx -w 'CYCLE_STATE_GROUPS_DETAILS'

Length of output: 93


Script:

#!/bin/bash
# Description: Verify if `CYCLE_STATE_GROUPS_DETAILS` is used elsewhere in the codebase.

# Test: Search for the constant usage. Expect: No occurrences of the constant.
rg --type js --type jsx --type ts -w 'CYCLE_STATE_GROUPS_DETAILS'

Length of output: 93


Script:

#!/bin/bash
# Description: Verify if `CYCLE_STATE_GROUPS_DETAILS` is used elsewhere in the codebase.

# Test: Search for the constant usage. Expect: No occurrences of the constant.
rg --type js --type ts -w 'CYCLE_STATE_GROUPS_DETAILS'

Length of output: 54

web/core/components/cycles/active-cycle/progress.tsx (3)

12-12: LGTM!

The import statement correctly updates to use PROGRESS_STATE_GROUPS_DETAILS from common.ts.


24-24: LGTM!

The progressIndicatorData array correctly uses PROGRESS_STATE_GROUPS_DETAILS for mapping state groups.


70-70: LGTM!

The background color reference is correctly updated to use PROGRESS_STATE_GROUPS_DETAILS.

@SatishGandham SatishGandham merged commit f75df83 into preview Jul 31, 2024
13 of 14 checks passed
@SatishGandham SatishGandham deleted the fix/module-progress-bar branch July 31, 2024 08:42
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