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

fix: revert to passing hook as a prop for EE compatibility #34367

Merged
merged 1 commit into from
Jun 20, 2024

Conversation

alex-golovanov
Copy link
Contributor

@alex-golovanov alex-golovanov commented Jun 20, 2024

Description

Revert to passing hook as a prop for EE compatibility.

Fixes #32982

Automation

/ok-to-test tags="@tag.IDE"

🔍 Cypress test results

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/9600106265
Commit: 042f945
Cypress dashboard.
Tags: @tag.IDE

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

Summary by CodeRabbit

  • New Features

    • Enhanced navigation menu generation in the editor with improved data management.
  • Refactor

    • Updated the navigation menu logic to use a new function, improving code maintainability and data handling.
  • Bug Fixes

    • Fixed inconsistencies in the navigation menu across different components in the editor.

Copy link
Contributor

coderabbitai bot commented Jun 20, 2024

Walkthrough

The changes involve refactoring the navigation menu logic in the application's editor components. The useNavigationMenuData function was imported and used in various components to streamline and enhance performance using useCallback and useMemo. Additionally, the "Back to all apps" option was moved from the dropdown menu directly into the header.

Changes

File(s) Change Summary
.../EditorHeader.tsx Added import for useNavigationMenuData and updated component prop getNavigationMenu accordingly.
.../EditorName/index.tsx Replaced useNavigationMenuData with new getNavigationMenu function for generating navigation.
.../Editor/IDE/Header/index.tsx Added import for useNavigationMenuData and updated getNavigationMenu prop to use this function.

Assessment against linked issues

Objective Addressed Explanation
Move "Back to all apps" from dropdown menu to header (#34313, Fixes #32982)
Rename NavigationMenuData.ts to useNavigationMenuData.ts and fix memoization issues (#34313)

Poem

In the world of code, we rearrange,
Navigation menus evolve and change.
Back to apps with just one click,
Clean and swift, a perfect trick.
Functions renamed, efficiency found,
Our editor's navigation, now renowned. 🚀

Warning

Review ran into problems

Problems (1)
  • Git: Failed to clone repository. Please contact CodeRabbit support.

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

@github-actions github-actions bot added IDE Navigation Issues/feature requests related to IDE navigation, and context switching New Developers Pod Issues that new developers face while exploring the IDE Task A simple Todo labels Jun 20, 2024
@alex-golovanov alex-golovanov added the ok-to-test Required label for CI label Jun 20, 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 88e39f4 and 042f945.

Files selected for processing (3)
  • app/client/src/pages/Editor/EditorHeader.tsx (2 hunks)
  • app/client/src/pages/Editor/EditorName/index.tsx (3 hunks)
  • app/client/src/pages/Editor/IDE/Header/index.tsx (2 hunks)
Additional comments not posted (6)
app/client/src/pages/Editor/EditorName/index.tsx (3)

16-17: Ensure that NavigationMenuDataProps and MenuItemData are used correctly in the context of the reverted changes.

#!/bin/bash
# Description: Verify the usage of NavigationMenuDataProps and MenuItemData in other parts of the codebase.

# Test: Search for these types in other TypeScript files.
rg --type ts "NavigationMenuDataProps|MenuItemData"

35-38: The getNavigationMenu prop is now expected to be a function that takes NavigationMenuDataProps and returns an array of MenuItemData. Ensure that all usages of this prop are updated accordingly across the project.

#!/bin/bash
# Description: Check if `getNavigationMenu` is correctly implemented everywhere it's used.

# Test: Search for the usage of the `getNavigationMenu` prop.
rg --type ts "getNavigationMenu"

101-101: The implementation of getNavigationMenu here should be validated to ensure it adheres to the expected behavior, especially after the revert changes.

#!/bin/bash
# Description: Verify the correct implementation of `getNavigationMenu`.

# Test: Search for the function definition and usage to ensure it matches the expected behavior.
rg --type ts "getNavigationMenu"
app/client/src/pages/Editor/EditorHeader.tsx (2)

49-49: The import of useNavigationMenuData is crucial for the reverted functionality. Ensure that this hook is correctly implemented and used in the context of this component.

#!/bin/bash
# Description: Verify the correct implementation and usage of `useNavigationMenuData`.

# Test: Search for the definition and usage of `useNavigationCOURSE_DATA` in the TypeScript files.
rg --type ts "useNavigationMenuData"

211-211: Confirm that getNavigationMenu is used correctly here, especially after changes to ensure it aligns with the expected functionality and interface.

#!/bin/bash
# Description: Verify the correct usage of `getNavigationMenu` in `EditorHeader`.

# Test: Search for the usage of `getNavigationMenu` to ensure it matches the expected behavior.
rg --type ts "getNavigationMenu"
app/client/src/pages/Editor/IDE/Header/index.tsx (1)

79-79: The import of useNavigationMenuData here is essential for the reverted functionality. Verify that this hook is correctly implemented and utilized in this component's context.

#!/bin/bash
# Description: Verify the correct implementation and usage of `useNavigationMenuData`.

# Test: Search for the definition and usage of `useNavigationMenuData` in the TypeScript files.
rg --type ts "useNavigationMenuData"

@github-actions github-actions bot added the Bug Something isn't working label Jun 20, 2024
@alex-golovanov alex-golovanov merged commit 01dba77 into release Jun 20, 2024
45 of 48 checks passed
@alex-golovanov alex-golovanov deleted the fix/34313-partial-revert branch June 20, 2024 21:26
ashit-rath added a commit that referenced this pull request Jun 21, 2024
## Description
Reverted missed out code in
#34367

## Automation

/ok-to-test tags="@tag.IDE"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/9608916182>
> Commit: a252566
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=9608916182&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.IDE`

<!-- end of auto-generated comment: Cypress test results  -->



## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [x] No
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working IDE Navigation Issues/feature requests related to IDE navigation, and context switching New Developers Pod Issues that new developers face while exploring the IDE ok-to-test Required label for CI Task A simple Todo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Task]: Hyperlink to the workspace name in the top-bar in the IDE.
2 participants