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-1964]chore: cycles actions restructuring #6298

Merged
merged 7 commits into from
Jan 2, 2025

Conversation

vamsikrishnamathala
Copy link
Collaborator

@vamsikrishnamathala vamsikrishnamathala commented Jan 2, 2025

Description

Restructured cycles actions.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Improvement (change that would cause existing functionality to not work as expected)
  • Code refactoring
  • Performance improvements
  • Documentation update

References

WEB-1964

Summary by CodeRabbit

Release Notes

  • New Features

    • Added support for cycle additional actions
    • Introduced end cycle functionality for project cycles
  • Improvements

    • Enhanced cycle quick actions with new modal and context menu
    • Updated import paths for cycle-related components
  • Technical Updates

    • Expanded export statements across cycle-related modules
    • Added new hooks and components for cycle management

Copy link
Contributor

coderabbitai bot commented Jan 2, 2025

Walkthrough

This pull request introduces several enhancements to the cycles management module across multiple files. The changes primarily focus on expanding the public API of the cycles components, adding new exports, and introducing new components like CycleAdditionalActions and EndCycleModal. The modifications span both community edition (CE) and enterprise edition (EE) components, with updates to import paths, export statements, and the addition of new hooks and placeholder components for future functionality.

Changes

File Change Summary
web/ce/components/cycles/index.ts Added exports for additional-actions and end-cycle modules
web/core/components/cycles/list/cycle-list-item-action.tsx Updated imports, added CycleAdditionalActions component
web/core/components/cycles/list/cycles-list-item.tsx Updated import path for CycleQuickActions
web/ee/components/cycles/index.ts Added exports for end-cycle and additional-actions modules
web/ce/components/cycles/additional-actions.tsx New CycleAdditionalActions component (currently empty)
web/ce/components/cycles/end-cycle/index.ts Added exports for modal and use-end-cycle modules
web/ce/components/cycles/end-cycle/modal.tsx New EndCycleModal component (currently empty)
web/ce/components/cycles/end-cycle/use-end-cycle.tsx New useEndCycle hook
web/core/components/cycles/quick-actions.tsx Added useEndCycle hook and EndCycleModal integration
web/ee/components/cycles/end-cycle/index.ts Re-exported entities from CE end-cycle module

Possibly related PRs

Suggested Labels

⚙️backend

Suggested Reviewers

  • SatishGandham
  • rahulramesha

Poem

🐰 Cycles spinning, modules growing bright,
Exports dancing with newfound might,
Components waiting, hooks taking flight,
A rabbit's code leaps with pure delight!
Plane's features bloom in software's light 🚀


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>, 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. (Beta)
  • @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.

@vamsikrishnamathala vamsikrishnamathala marked this pull request as draft January 2, 2025 06:38
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

🧹 Nitpick comments (1)
web/core/components/cycles/list/cycle-list-item-action.tsx (1)

154-154: Error silencing in the catch block
Removing the error parameter obfuscates debugging. Consider at least logging or capturing the error to help diagnose issues if the check fails.

-} catch {
+} catch (error) {
+  console.error(error);
   return false;
 }
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between df671d1 and b06d718.

📒 Files selected for processing (5)
  • web/ce/components/cycles/index.ts (1 hunks)
  • web/core/components/cycles/index.ts (0 hunks)
  • web/core/components/cycles/list/cycle-list-item-action.tsx (2 hunks)
  • web/core/components/cycles/list/cycles-list-item.tsx (1 hunks)
  • web/ee/components/cycles/index.ts (1 hunks)
💤 Files with no reviewable changes (1)
  • web/core/components/cycles/index.ts
🔇 Additional comments (4)
web/ce/components/cycles/index.ts (1)

3-3: Exporting quick-actions from CE cycles is consistent with the restructuring goal.
By exposing its functionalities at this level, it centralizes the reorganization and makes the feature more discoverable across the codebase.

web/ee/components/cycles/index.ts (1)

3-3: Ensure importing paths are correct in dependent modules.
Adding export * from "ce/components/cycles/quick-actions"; provides a unified interface for the EE layer. Verify that all references and imports use the correct path.

web/core/components/cycles/list/cycles-list-item.tsx (1)

21-22: Updated import path
Switching to "@/plane-web/components/cycles/" aligns with the new structure, improving clarity. Confirm that references to CycleQuickActions in related files have similarly consistent paths.

web/core/components/cycles/list/cycle-list-item-action.tsx (1)

34-35: Use of plane-web import
Adopting the "@/plane-web/components/cycles" path is consistent with the refactoring. This cleanly segregates the feature scope into plane-web.

@vamsikrishnamathala vamsikrishnamathala marked this pull request as ready for review January 2, 2025 06:55
@vamsikrishnamathala vamsikrishnamathala changed the title [WEB-1964]chore: cycles quick actions restructuring [WEB-1964]chore: cycles actions restructuring Jan 2, 2025
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

🧹 Nitpick comments (1)
web/ce/components/cycles/additional-actions.tsx (1)

1-2: Consider renaming or consolidating imports if the component grows in complexity.
The current imports are concise and clear, but if the component's complexity increases, you might consider grouping related imports into a barrel or shared index file for clarity.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between b06d718 and 330fff9.

📒 Files selected for processing (4)
  • web/ce/components/cycles/additional-actions.tsx (1 hunks)
  • web/ce/components/cycles/index.ts (1 hunks)
  • web/core/components/cycles/list/cycle-list-item-action.tsx (3 hunks)
  • web/ee/components/cycles/index.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • web/core/components/cycles/list/cycle-list-item-action.tsx
🔇 Additional comments (4)
web/ce/components/cycles/additional-actions.tsx (2)

3-6: Ensure type definitions accommodate future expansion.
The selected Props type is straightforward. Keep an eye on whether you’ll need optional or more specialized properties (e.g., booleans or callback handlers) as the component evolves.


7-7: Placeholder component - plan for next steps.
Currently, the component returns an empty fragment. Verify that this placeholder is intentional and consider adding a short explanatory comment or a minimal placeholder UI to guide future contributors.

web/ce/components/cycles/index.ts (1)

3-4: Exports align with intended structure.
By exporting everything from both quick-actions and additional-actions, you ensure these modules remain easily discoverable. Confirm that no private or helper utilities are unintentionally exposed.

web/ee/components/cycles/index.ts (1)

3-4: Parallel structure maintained between CE and EE.
Mirroring the CE exports helps align both editions of the application. Continue ensuring your build/deploy processes handle these consistent exports without duplication or conflicts.

@vamsikrishnamathala vamsikrishnamathala marked this pull request as draft January 2, 2025 07:29
@vamsikrishnamathala vamsikrishnamathala removed the request for review from rahulramesha January 2, 2025 07:29
@vamsikrishnamathala vamsikrishnamathala marked this pull request as ready for review January 2, 2025 10:57
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

🧹 Nitpick comments (4)
web/ce/components/cycles/end-cycle/modal.tsx (1)

3-10: Validate usage of prop types.
The interface is well-defined with strongly-typed props. However, none of them are currently used in the component. Ensure that future logic references the props properly to avoid potential dead code.

web/ce/components/cycles/end-cycle/use-end-cycle.tsx (1)

1-7: Unused parameter and placeholders.
The hook returns static values, and isCurrentCycle parameter is unused at runtime. This can lead to confusion or technical debt if future maintainers expect the parameter to alter the hook’s state. Consider implementing a functional approach or clarifying that this is strictly a placeholder.

web/core/components/cycles/quick-actions.tsx (2)

54-54: Validate the new hook usage.
You’re calling useEndCycle(isCurrentCycle) but the hook currently ignores the parameter. Ensure the hook is updated soon so that isCurrentCycle influences the modal’s behavior, or rename it if it’s intentionally unused.


146-146: Context menu insertion logic.
MENU_ITEMS.splice(3, 0, endCycleContextMenu) is straightforward but can be fragile in the long run, especially if the menu item order changes. Consider a structure where you define menu items based on conditions, or insert them more semantically.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 330fff9 and bcb1352.

📒 Files selected for processing (9)
  • web/ce/components/cycles/end-cycle/index.ts (1 hunks)
  • web/ce/components/cycles/end-cycle/modal.tsx (1 hunks)
  • web/ce/components/cycles/end-cycle/use-end-cycle.tsx (1 hunks)
  • web/ce/components/cycles/index.ts (1 hunks)
  • web/core/components/cycles/list/cycle-list-item-action.tsx (3 hunks)
  • web/core/components/cycles/list/cycles-list-item.tsx (1 hunks)
  • web/core/components/cycles/quick-actions.tsx (5 hunks)
  • web/ee/components/cycles/end-cycle/index.ts (1 hunks)
  • web/ee/components/cycles/index.ts (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • web/ee/components/cycles/end-cycle/index.ts
  • web/ce/components/cycles/end-cycle/index.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • web/ee/components/cycles/index.ts
  • web/core/components/cycles/list/cycles-list-item.tsx
  • web/ce/components/cycles/index.ts
  • web/core/components/cycles/list/cycle-list-item-action.tsx
🔇 Additional comments (5)
web/ce/components/cycles/end-cycle/modal.tsx (2)

1-2: Ensure consistent naming imports next time.
The import statement is concise and clear, but it's always good to keep import statements organized (grouping React, external packages, and internal modules separately) if the file grows.


12-12: Placeholder component logic.
The EndCycleModal returns an empty fragment, indicating a placeholder. If this modal is intended to handle end-of-cycle actions, a skeleton or preliminary UI may be useful for layout or testing, ensuring the rest of the code can integrate with this component’s future functionality.

Would you like help adding a skeleton for the modal?

web/core/components/cycles/quick-actions.tsx (3)

18-18: Imports are organized properly.
Adding useEndCycle and EndCycleModal here aligns with the new end-cycle feature. Good job keeping them in a single import statement for clarity.


44-45: Ensure correct logic for cycle states.
By setting isCurrentCycle and transferableIssuesCount, you correctly derive states from the cycle details. Verify that the transferableIssuesCount is the correct formula for your use case.


173-180: Properly connect modal props.
The EndCycleModal is receiving all relevant props for future end-of-cycle functionality. Once the modal is implemented, the parent component will already be well-prepared for a smooth integration.

@pushya22 pushya22 merged commit 6a13a64 into preview Jan 2, 2025
21 of 22 checks passed
@pushya22 pushya22 deleted the chore-cycles-quick-actions branch January 2, 2025 12:57
sangeethailango pushed a commit that referenced this pull request Jan 3, 2025
* chore: cycles quick actions restructuring

* chore: added additional actions to cycle list actions

* chore: cycle quick action structure

* chore: added additional actions to cycle list actions

* chore: added end cycle hook

* fix: updated end cycle export

---------

Co-authored-by: gurusinath <gurusainath007@gmail.com>
sriramveeraghanta added a commit that referenced this pull request Jan 6, 2025
* WIP

* WIP

* WIP

* WIP

* Create home preference if not exist

* chore: handled the unique state name validation (#6299)

* fix: changed the response structure (#6301)

* [WEB-1964]chore: cycles actions restructuring (#6298)

* chore: cycles quick actions restructuring

* chore: added additional actions to cycle list actions

* chore: cycle quick action structure

* chore: added additional actions to cycle list actions

* chore: added end cycle hook

* fix: updated end cycle export

---------

Co-authored-by: gurusinath <gurusainath007@gmail.com>

* fix: active cycle graph tooltip and endpoint validation (#6306)

* [WEB-2870]feat: language support (#6215)

* fix: adding language support package

* fix: language support implementation using mobx

* fix: adding more languages for support

* fix: profile settings translations

* feat: added language support for sidebar and user settings

* feat: added language support for deactivation modal

* fix: added project sync after transfer issues (#6200)

* code refactor and improvement (#6203)

* chore: package code refactoring

* chore: component restructuring and refactor

* chore: comment create improvement

* refactor: enhance workspace and project wrapper modularity (#6207)

* [WEB-2678]feat: added functionality to add labels directly from dropdown (#6211)

* enhancement:added functionality to add features directly from dropdown

* fix: fixed import order

* fix: fixed lint errors

* chore: added common component for project activity (#6212)

* chore: added common component for project activity

* fix: added enum

* fix: added enum for initiatives

* - Do not clear temp files that are locked. (#6214)

- Handle edge cases in sync workspace

* fix: labels empty state for drop down (#6216)

* refactor: remove cn helper function from the editor package (#6217)

* * feat: added language support to issue create modal in sidebar
* fix: project activity type

* * fix: added missing translations
* fix: modified translation for plurals

* fix: fixed spanish translation

* dev: language type error in space user profile types

* fix: type fixes

* chore: added alpha tag

---------

Co-authored-by: sriram veeraghanta <veeraghanta.sriram@gmail.com>
Co-authored-by: Anmol Singh Bhatia <121005188+anmolsinghbhatia@users.noreply.github.com>
Co-authored-by: Prateek Shourya <prateekshourya29@gmail.com>
Co-authored-by: Akshita Goyal <36129505+gakshita@users.noreply.github.com>
Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
Co-authored-by: Aaryan Khandelwal <65252264+aaryan610@users.noreply.github.com>
Co-authored-by: gurusinath <gurusainath007@gmail.com>

* feat: introduced stacked bar chart and tree map chart. (#6305)

* feat: add issue attachment external endpoint (#6307)

* [PE-97] chore: re-order pages options (#6303)

* chore: re-order pages dropdown options

* chore: re-order pages dropdown options

* fix: remove localdb tracing

* [WEB-2937] feat: home recent activies list endpoint (#6295)

* Crud for wuick links

* Validate quick link existence

* Add custom method for destroy and retrieve

* Add List method

* Remove print statements

* List all the workspace quick links

* feat: endpoint to get recently active items

* Resolve conflicts

* Resolve conflicts

* Add filter to only list required entities

* Return required fields

* Add filter

* Add filter

* fix: remove emoji edit for uneditable pages (#6304)

* Removed duplicate imports

* feat: patch api

* Enable sort order to be updatable

* Return key name
only insert missing keys
use serializer to return data

* Remove random generation of sort_order

* Remove name field
Remove random generation of sort_order

---------

Co-authored-by: Bavisetti Narayan <72156168+NarayanBavisetti@users.noreply.github.com>
Co-authored-by: Vamsi Krishna <46787868+mathalav55@users.noreply.github.com>
Co-authored-by: gurusinath <gurusainath007@gmail.com>
Co-authored-by: Anmol Singh Bhatia <121005188+anmolsinghbhatia@users.noreply.github.com>
Co-authored-by: sriram veeraghanta <veeraghanta.sriram@gmail.com>
Co-authored-by: Prateek Shourya <prateekshourya29@gmail.com>
Co-authored-by: Akshita Goyal <36129505+gakshita@users.noreply.github.com>
Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
Co-authored-by: Aaryan Khandelwal <65252264+aaryan610@users.noreply.github.com>
Co-authored-by: Nikhil <118773738+pablohashescobar@users.noreply.github.com>
@coderabbitai coderabbitai bot mentioned this pull request Jan 10, 2025
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants