Skip to content

fix: Added height to new query button menu#29729

Merged
albinAppsmith merged 4 commits intoreleasefrom
new-query-menu-height-issue
Dec 20, 2023
Merged

fix: Added height to new query button menu#29729
albinAppsmith merged 4 commits intoreleasefrom
new-query-menu-height-issue

Conversation

@albinAppsmith
Copy link
Copy Markdown
Contributor

@albinAppsmith albinAppsmith commented Dec 19, 2023

Description

This PR adds a fixed height to the new query button in datasource config page.

PR fixes following issue(s)

Fixes #29609

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Testing

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Also list any relevant details for your test configuration.
Delete anything that is not relevant

  • Manual
  • JUnit
  • Jest
  • Cypress

Test Plan

Add Testsmith test cases links that relate to this PR

Issues raised during DP testing

Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR)

Checklist:

Dev activity

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • PR is being merged under a feature flag

QA activity:

  • Speedbreak features have been covered
  • Test plan covers all impacted features and areas of interest
  • Test plan has been peer reviewed by project stakeholders and other QA members
  • Manually tested functionality on DP
  • We had an implementation alignment call with stakeholders post QA Round 2
  • Cypress test cases have been added and approved by SDET/manual QA
  • Added Test Plan Approved label after Cypress tests were reviewed
  • Added Test Plan Approved label after JUnit tests were reviewed

Summary by CodeRabbit

  • Refactor
    • Updated the action button to have a conditional height based on the number of pages for improved layout consistency.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Dec 19, 2023

Walkthrough

The modification made to the NewActionButton function involves adding a conditional height prop to the MenuContent component based on the length of pages. This change aims to address the issue where the new query button dropdown extends the height of the screen, making it more compact and preventing it from obstructing the view of the underlying page.

Changes

File Path Change Summary
app/client/src/pages/Editor/DataSourceEditor/NewActionButton.tsx Added a conditional height prop to the MenuContent component based on the length of pages.

Assessment against linked issues

Objective Addressed Explanation
#29609: Dropdown size should be smaller and not occupy the entire height of the page The addition of a conditional height prop directly addresses the issue of the dropdown being too tall and occupying the entire height of the page.

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 X ?


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • You can reply to a review comment made by CodeRabbit.
  • You can tag CodeRabbit on specific lines of code or files in the PR by tagging @coderabbitai in a comment.
  • You can tag @coderabbitai in a PR comment and ask one-off questions about the PR and the codebase. Use quoted replies to pass the context for follow-up questions.

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 a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @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.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

@github-actions github-actions bot added Bug Something isn't working IDE Navigation Issues/feature requests related to IDE navigation, and context switching Medium Issues that frustrate users due to poor UX Needs Triaging Needs attention from maintainers to triage IDE Pod Issues that new developers face while exploring the IDE UI Improvement labels Dec 19, 2023
Comment on lines 123 to 128
<MenuContent
align={"end"}
data-testId={"t--page-selection"}
height={"350px"}
side={"bottom"}
>
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.

The addition of a fixed height to the MenuContent component is implemented as intended to address the dropdown issue. However, consider using a constant for the height value to improve maintainability and make it easier to adjust in the future if needed.

-        height={"350px"}
+        const MENU_CONTENT_HEIGHT = "350px";
+        height={MENU_CONTENT_HEIGHT}

Committable suggestion

IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
<MenuContent
align={"end"}
data-testId={"t--page-selection"}
height={"350px"}
side={"bottom"}
>
<MenuContent
align={"end"}
data-testId={"t--page-selection"}
const MENU_CONTENT_HEIGHT = "350px";
height={MENU_CONTENT_HEIGHT}
side={"bottom"}
>

@albinAppsmith
Copy link
Copy Markdown
Contributor Author

/ok-to-test

@albinAppsmith
Copy link
Copy Markdown
Contributor Author

/build-deploy-preview skip-tests=true

@github-actions
Copy link
Copy Markdown

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/7259268429.
Workflow: Appsmith External Integration Test Workflow.
Tags: ``.

@github-actions
Copy link
Copy Markdown

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/7259271046.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 29729.
recreate: .

Comment thread app/client/src/pages/Editor/DataSourceEditor/NewActionButton.tsx Outdated
@github-actions
Copy link
Copy Markdown

Deploy-Preview-URL: https://ce-29729.dp.appsmith.com

@github-actions
Copy link
Copy Markdown

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/7259268429.
Commit: ``.
Cypress dashboard url: Click here!
All cypress tests have passed 🎉🎉🎉

<MenuContent
align={"end"}
data-testId={"t--page-selection"}
height={pages.length <= 4 ? "fit-content" : "186px"}
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.

The fixed height for the MenuContent component is set conditionally based on the number of pages. However, the height "186px" seems arbitrary. It would be beneficial to ensure this value aligns with the design system and consider using a constant for maintainability.

- height={pages.length <= 4 ? "fit-content" : "186px"}
+ const MENU_MAX_HEIGHT = "186px"; // This should be defined in a constants file or theme settings
+ height={pages.length <= 4 ? "fit-content" : MENU_MAX_HEIGHT}

Committable suggestion

IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
height={pages.length <= 4 ? "fit-content" : "186px"}
const MENU_MAX_HEIGHT = "186px"; // This should be defined in a constants file or theme settings
height={pages.length <= 4 ? "fit-content" : MENU_MAX_HEIGHT}

Consider adding a comment explaining why the height is set to "fit-content" when there are 4 or fewer pages and "186px" otherwise. This will help future maintainers understand the reasoning behind these specific values.


If manual testing has not been mentioned, recommend adding a test case to ensure that the dropdown behaves as expected with different numbers of pages, especially at the boundary condition of 4 pages.

@albinAppsmith
Copy link
Copy Markdown
Contributor Author

/ok-to-test

@albinAppsmith
Copy link
Copy Markdown
Contributor Author

/build-deploy-preview skip-tests=true

@github-actions
Copy link
Copy Markdown

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/7261112455.
Workflow: Appsmith External Integration Test Workflow.
Tags: ``.

@github-actions
Copy link
Copy Markdown

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/7261113319.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 29729.
recreate: .

@github-actions
Copy link
Copy Markdown

Deploy-Preview-URL: https://ce-29729.dp.appsmith.com

@github-actions
Copy link
Copy Markdown

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/7261112455.
Commit: ``.
Cypress dashboard url: Click here!
It seems like there are some failures 😔. We are not able to recognize it, please check this manually here.

@albinAppsmith
Copy link
Copy Markdown
Contributor Author

/ok-to-test

@github-actions
Copy link
Copy Markdown

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/7270926741.
Workflow: Appsmith External Integration Test Workflow.
Tags: ``.

@github-actions
Copy link
Copy Markdown

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/7270926741.
Commit: ``.
Cypress dashboard url: Click here!
All cypress tests have passed 🎉🎉🎉

@albinAppsmith albinAppsmith merged commit a185256 into release Dec 20, 2023
@albinAppsmith albinAppsmith deleted the new-query-menu-height-issue branch December 20, 2023 06:49
sharat87 pushed a commit that referenced this pull request Dec 23, 2023
## Description

This PR adds a fixed height to the new query button in datasource config
page.

#### PR fixes following issue(s)
Fixes #29609


#### Type of change

- Bug fix (non-breaking change which fixes an issue)


## Testing
>
#### How Has This Been Tested?
> Please describe the tests that you ran to verify your changes. Also
list any relevant details for your test configuration.
> Delete anything that is not relevant
- [ ] Manual
- [ ] JUnit
- [ ] Jest
- [ ] Cypress
>
>
#### Test Plan
> Add Testsmith test cases links that relate to this PR
>
>
#### Issues raised during DP testing
> Link issues raised during DP testing for better visiblity and tracking
(copy link from comments dropped on this PR)
>
>
>
## Checklist:
#### Dev activity
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] New and existing unit tests pass locally with my changes
- [x] PR is being merged under a feature flag


#### QA activity:
- [ ] [Speedbreak
features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-)
have been covered
- [ ] Test plan covers all impacted features and [areas of
interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-)
- [ ] Test plan has been peer reviewed by project stakeholders and other
QA members
- [ ] Manually tested functionality on DP
- [ ] We had an implementation alignment call with stakeholders post QA
Round 2
- [ ] Cypress test cases have been added and approved by SDET/manual QA
- [ ] Added `Test Plan Approved` label after Cypress tests were reviewed
- [ ] Added `Test Plan Approved` label after JUnit tests were reviewed


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Refactor**
- Updated the action button to have a conditional height based on the
number of pages for improved layout consistency.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
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 IDE Pod Issues that new developers face while exploring the IDE Medium Issues that frustrate users due to poor UX Needs Triaging Needs attention from maintainers to triage UI Improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: The new query button dropdown extends the height of the screen. The height should be more compact.

2 participants