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

feat: Action redesign - changes in save and edit datasource #36222

Merged
merged 7 commits into from
Sep 11, 2024

Conversation

albinAppsmith
Copy link
Collaborator

@albinAppsmith albinAppsmith commented Sep 10, 2024

Description

This PR updates the save datasource text to "Save" and edit datasource text to "Edit". Also, updated the save datasource icon to better represent datasource.

Fixes #35503

Automation

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

🔍 Cypress test results

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/10807660093
Commit: fda9c74
Cypress dashboard.
Tags: @tag.All
Spec:


Wed, 11 Sep 2024 09:43:42 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • New Features

    • Simplified user interface messages for editing and saving data sources to "Edit" and "Save."
    • Updated the icon for the save button to better represent the action when saving a datasource.
    • Introduced a new locator for the save datasource button to enhance testing capabilities.
  • Bug Fixes

    • Improved adherence to coding standards by modifying ESLint rules related to function props.

Copy link
Contributor

coderabbitai bot commented Sep 10, 2024

Walkthrough

The changes in this pull request involve updates to user interface messages for editing and saving data sources, simplifying the strings to "Edit" and "Save." Additionally, the icon for the save button in the StoreAsDatasource component has been changed from "cloud" to "database-2-line" based on the shouldSave condition. Furthermore, the test interactions have been refined to utilize a locator-based approach, enhancing maintainability.

Changes

File Path Change Summary
app/client/src/ce/constants/messages.ts Updated EDIT_DATASOURCE and SAVE_DATASOURCE constants to shorter strings.
app/client/cypress/e2e/Sanity/Datasources/GraphQL_spec.ts Changed button interactions to use locator-based approach and updated assertions for button visibility.
app/client/cypress/support/Objects/CommonLocators.ts Added _saveDatasource locator for the save datasource button.
app/client/src/components/editorComponents/StoreAsDatasource.tsx Changed button startIcon from "cloud" to "database-2-line" based on props.shouldSave.

Assessment against linked issues

Objective Addressed Explanation
Update save datasource button to the new UI (#35503)

🎉 In the code, a change so bright,
"Edit" and "Save" now feel just right.
Icons shift to match the new design,
A user interface that's truly refined!
With every update, our app takes flight! 🚀


Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between ddbf96a and fda9c74.

Files selected for processing (2)
  • app/client/cypress/support/Objects/CommonLocators.ts (1 hunks)
  • app/client/src/components/editorComponents/StoreAsDatasource.tsx (1 hunks)
Files skipped from review as they are similar to previous changes (2)
  • app/client/cypress/support/Objects/CommonLocators.ts
  • app/client/src/components/editorComponents/StoreAsDatasource.tsx

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

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 IDE Pod Issues that new developers face while exploring the IDE IDE Product Issues related to the IDE Product Task A simple Todo labels Sep 10, 2024
@albinAppsmith albinAppsmith added the ok-to-test Required label for CI label Sep 10, 2024
@github-actions github-actions bot added the Enhancement New feature or request label Sep 10, 2024
@albinAppsmith
Copy link
Collaborator Author

/build-deploy-preview skip-test=true

Copy link

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

@albinAppsmith
Copy link
Collaborator Author

Corresponding EE PR: https://github.com/appsmithorg/appsmith-ee/pull/5095

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

Outside diff range, codebase verification and nitpick comments (1)
app/client/src/components/editorComponents/StoreAsDatasource.tsx (1)

39-39: Consider extracting the function to avoid re-creation on each render.

I understand that you've disabled the ESLint rule to allow using a new function as a prop, potentially for performance considerations. However, creating a new function on each render can lead to unnecessary re-renders and performance issues.

Consider extracting the saveOrEditDatasource function outside the component to avoid re-creation on each render. This way, you can still use it as a prop without the performance overhead.

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 316f914 and 1081c9b.

Files selected for processing (2)
  • app/client/src/ce/constants/messages.ts (1 hunks)
  • app/client/src/components/editorComponents/StoreAsDatasource.tsx (2 hunks)
Files skipped from review due to trivial changes (1)
  • app/client/src/ce/constants/messages.ts
Additional comments not posted (1)
app/client/src/components/editorComponents/StoreAsDatasource.tsx (1)

68-68: Great choice of icon for the save action!

The "database-2-line" icon is a fitting representation for the save datasource action. It aligns well with the operation being performed and enhances the visual clarity of the button.

The conditional logic to determine the icon based on the shouldSave prop is also implemented correctly.

Copy link

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

hetunandu
hetunandu previously approved these changes Sep 10, 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

Outside diff range and nitpick comments (1)
app/client/cypress/e2e/Sanity/Datasources/GraphQL_spec.ts (1)

Line range hint 1-1: TODO comment: Add tests.

It's a good practice to use TODO comments to keep track of pending tasks. Consider creating a GitHub issue to ensure this task is prioritized and completed.

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 1081c9b and ddbf96a.

Files selected for processing (3)
  • app/client/cypress/e2e/Sanity/Datasources/GraphQL_spec.ts (2 hunks)
  • app/client/cypress/support/Objects/CommonLocators.ts (1 hunks)
  • app/client/src/components/editorComponents/StoreAsDatasource.tsx (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • app/client/src/components/editorComponents/StoreAsDatasource.tsx
Additional context used
Path-based instructions (2)
app/client/cypress/e2e/Sanity/Datasources/GraphQL_spec.ts (1)

Pattern app/client/cypress/**/**.*: Review the following e2e test code written using the Cypress test library. Ensure that:

  • Follow best practices for Cypress code and e2e automation.
  • Avoid using cy.wait in code.
  • Avoid using cy.pause in code.
  • Avoid using agHelper.sleep().
  • Use locator variables for locators and do not use plain strings.
  • Use data-* attributes for selectors.
  • Avoid Xpaths, Attributes and CSS path.
  • Avoid selectors like .btn.submit or button[type=submit].
  • Perform logins via API with LoginFromAPI.
  • Perform logout via API with LogOutviaAPI.
  • Perform signup via API with SignupFromAPI.
  • Avoid using it.only.
  • Avoid using after and aftereach in test cases.
  • Use multiple assertions for expect statements.
  • Avoid using strings for assertions.
  • Do not use duplicate filenames even with different paths.
  • Avoid using agHelper.Sleep, this.Sleep in any file in code.
app/client/cypress/support/Objects/CommonLocators.ts (1)

Pattern app/client/cypress/**/**.*: Review the following e2e test code written using the Cypress test library. Ensure that:

  • Follow best practices for Cypress code and e2e automation.
  • Avoid using cy.wait in code.
  • Avoid using cy.pause in code.
  • Avoid using agHelper.sleep().
  • Use locator variables for locators and do not use plain strings.
  • Use data-* attributes for selectors.
  • Avoid Xpaths, Attributes and CSS path.
  • Avoid selectors like .btn.submit or button[type=submit].
  • Perform logins via API with LoginFromAPI.
  • Perform logout via API with LogOutviaAPI.
  • Perform signup via API with SignupFromAPI.
  • Avoid using it.only.
  • Avoid using after and aftereach in test cases.
  • Use multiple assertions for expect statements.
  • Avoid using strings for assertions.
  • Do not use duplicate filenames even with different paths.
  • Avoid using agHelper.Sleep, this.Sleep in any file in code.
Additional comments not posted (4)
app/client/cypress/e2e/Sanity/Datasources/GraphQL_spec.ts (3)

282-282: Good practice: Using agHelper.GetNClick with a locator variable.

The change from agHelper.ClickButton("Save as datasource") to agHelper.GetNClick(locators._saveDatasource) is a good practice. It enhances the maintainability and readability of the test code by using a locator variable instead of a hard-coded string.


299-299: Verify the assertion change for the visibility of the "Save as datasource" button.

The assertion for the visibility of the "Edit datasource" button has been replaced with an assertion for the visibility of the "Save as datasource" button. This change suggests an update in the expected UI behavior after saving a datasource.

Please ensure that this change aligns with the current functionality and verify that the "Save as datasource" button is indeed visible after saving a datasource.


306-306: Consistent usage of agHelper.GetNClick with a locator variable.

The change from agHelper.ClickButton("Save as datasource") to agHelper.GetNClick(locators._saveDatasource) is consistent with the previous change and follows the same good practice of using a locator variable for better maintainability and readability.

app/client/cypress/support/Objects/CommonLocators.ts (1)

341-341: Good addition: _saveDatasource property in the CommonLocators class.

The addition of the _saveDatasource property to the CommonLocators class is a valuable enhancement. It provides a specific locator for the save datasource button, making it easier to interact with this element in tests.

Moreover, using a data-testid selector for the locator is a good practice. It ensures reliable element identification and improves the stability of the tests.

@albinAppsmith
Copy link
Collaborator Author

EE DP: https://ee-5095.dp.appsmith.com/

@albinAppsmith albinAppsmith merged commit 91fd967 into release Sep 11, 2024
82 checks passed
@albinAppsmith albinAppsmith deleted the action-redesign/rest-api branch September 11, 2024 11:02
Shivam-z pushed a commit to Shivam-z/appsmith that referenced this pull request Sep 26, 2024
…org#36222)

## Description

This PR updates the save datasource text to "Save" and edit datasource
text to "Edit". Also, updated the save datasource icon to better
represent datasource.


Fixes appsmithorg#35503

## Automation

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

### 🔍 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/10807660093>
> Commit: fda9c74
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10807660093&attempt=2"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.All`
> Spec:
> <hr>Wed, 11 Sep 2024 09:43:42 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [x] No


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


- **New Features**
- Simplified user interface messages for editing and saving data sources
to "Edit" and "Save."
- Updated the icon for the save button to better represent the action
when saving a datasource.
- Introduced a new locator for the save datasource button to enhance
testing capabilities.

- **Bug Fixes**
- Improved adherence to coding standards by modifying ESLint rules
related to function props.

<!-- 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
Enhancement New feature or request IDE Navigation Issues/feature requests related to IDE navigation, and context switching IDE Pod Issues that new developers face while exploring the IDE IDE Product Issues related to the IDE Product 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]: Update REST API & GraphQL save datasource design
2 participants