Skip to content

Comments

[WEB-2015] chore: handled type error in issue detail and issue peek overview#5185

Merged
SatishGandham merged 1 commit intopreviewfrom
chore-issue_activity_store_update
Jul 22, 2024
Merged

[WEB-2015] chore: handled type error in issue detail and issue peek overview#5185
SatishGandham merged 1 commit intopreviewfrom
chore-issue_activity_store_update

Conversation

@gurusainath
Copy link
Member

@gurusainath gurusainath commented Jul 22, 2024

Summary

This PR resolved the TypeError of the issue activity in the issue peek overview and issue detail page

Changes

  1. Activity store

References

[WEB-2015]

Summary by CodeRabbit

  • New Features

    • Introduced a new boolean property to indicate if time tracking is enabled for projects.
    • Added default activity filters to streamline the filtering process for activities.
  • Improvements

    • Enhanced reactivity in the activity store for better performance in managing comments related to issues.
    • Simplified initialization of selected filters in the Issue Activity component for improved maintainability.

…iled in the project types and handled the default active filters in constants in activity constants
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 22, 2024

Walkthrough

The recent changes enhance project management functionalities by introducing a boolean property to track time tracking status within projects. Additionally, new constants streamline activity filtering, and updates to the IssueActivityStore enhance reactivity using MobX. The IssueActivity component now initializes selected filters more maintainably, improving code organization and usability. Overall, these modifications aim to create a more efficient and flexible application environment for managing projects and activities.

Changes

Files Grouped Change Summary
packages/types/... Added is_time_tracking_enabled: boolean; to IProject interface, allowing tracking of whether time tracking is enabled for projects.
web/ce/constants/... Introduced defaultActivityFilters, an array containing default activity filter types, enhancing filtering functionality and usability.
web/ce/store/... Modified getActivityCommentByIssueId to a computed function using mobx-utils, enhancing reactivity based on observable state changes while maintaining output.
web/core/components/... Changed initialization of selectedFilters in IssueActivity to use defaultActivityFilters, improving maintainability and reducing magic numbers in the code.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant IssueActivity
    participant ActivityStore
    participant ProjectType

    User->>IssueActivity: Initialize component
    IssueActivity->>ProjectType: Check time tracking status
    ProjectType-->>IssueActivity: Return is_time_tracking_enabled
    IssueActivity->>ActivityStore: Fetch activity comments
    ActivityStore-->>IssueActivity: Return filtered comments
    IssueActivity->>User: Display comments and filters
Loading

🐇 In a world of code, so bright and new,
A toggle for time tracking, just for you!
Filters now streamlined, easy to see,
Activity’s dance, as smooth as can be.
With changes aplenty, we hop with delight,
A better experience, oh what a sight! 🐰✨


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.

@gurusainath gurusainath linked an issue Jul 22, 2024 that may be closed by this pull request
1 task
@SatishGandham SatishGandham added this to the v0.23-dev milestone Jul 22, 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 8f9b568 and 3839ebc.

Files selected for processing (4)
  • packages/types/src/project/projects.d.ts (1 hunks)
  • web/ce/constants/issues.ts (1 hunks)
  • web/ce/store/issue/issue-details/activity.store.ts (3 hunks)
  • web/core/components/issues/issue-detail/issue-activity/root.tsx (2 hunks)
Additional comments not posted (6)
web/ce/constants/issues.ts (1)

19-20: Introduction of defaultActivityFilters

The new constant defaultActivityFilters is introduced to streamline activity filtering. This is a good addition for maintainability and usability. Ensure that this constant is used consistently across the codebase.

packages/types/src/project/projects.d.ts (1)

38-38: Introduction of is_time_tracking_enabled

The new property is_time_tracking_enabled is added to the IProject interface. This enhances the interface by allowing the representation of whether time tracking is enabled for a project. Ensure that this property is utilized correctly in the codebase.

web/ce/store/issue/issue-details/activity.store.ts (2)

9-9: Import computedFn from mobx-utils

The addition of the computedFn import from mobx-utils is necessary for transforming the getActivityCommentByIssueId method into a computed function. This is a good practice to enhance reactivity.


Line range hint 74-105:
Transformation of getActivityCommentByIssueId to a computed function

The transformation of the getActivityCommentByIssueId method into a computed function using computedFn from mobx-utils enhances reactivity within the MobX store architecture. The logic within the method remains consistent, but the execution context is improved for better performance and efficiency in state management.

Ensure that this change is thoroughly tested to confirm that the reactivity improvements do not introduce any unexpected behavior.

web/core/components/issues/issue-detail/issue-activity/root.tsx (2)

17-17: LGTM! Import statement updated correctly.

The import statement has been updated to import defaultActivityFilters instead of EActivityFilterType, which aligns with the changes in the initialization of selectedFilters.


38-38: LGTM! State initialization updated correctly.

The selectedFilters state is now initialized with defaultActivityFilters, enhancing maintainability and flexibility.

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.

[bug]: Latest Preview release breaks detail issue view

2 participants