Skip to content

Commit

Permalink
feat: Action redesign - changes in save and edit datasource (appsmith…
Browse files Browse the repository at this point in the history
…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 -->
  • Loading branch information
albinAppsmith authored Sep 11, 2024
1 parent 1c8712a commit 91fd967
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
8 changes: 3 additions & 5 deletions app/client/cypress/e2e/Sanity/Datasources/GraphQL_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ describe(
});

apiPage.SelectPaneTab("Authentication");
agHelper.ClickButton("Save as datasource");
agHelper.GetNClick(locators._saveDatasource);

agHelper.AssertText(
locators._inputFieldByName("URL") + "//" + locators._inputField,
Expand All @@ -296,16 +296,14 @@ describe(
// });
dataSources.SaveDatasource();
agHelper.ValidateToastMessage("datasource created");
agHelper.AssertElementVisibility(
locators._buttonByText("Edit datasource"),
);
agHelper.AssertElementVisibility(locators._saveDatasource);
apiPage.SelectPaneTab("Body");
dataSources.UpdateGraphqlQueryAndVariable({
query: GRAPHQL_QUERY,
variable: GRAPHQL_VARIABLES,
});
apiPage.RunAPI();
agHelper.ClickButton("Edit datasource");
agHelper.GetNClick(locators._saveDatasource);
dataSources.AssertDataSourceInfo([
dataManager.dsValues[
dataManager.defaultEnviorment
Expand Down
1 change: 1 addition & 0 deletions app/client/cypress/support/Objects/CommonLocators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,4 +338,5 @@ export class CommonLocators {
errorPageDescription = ".t--error-page-description";
_selectClearButton_testId = "selectbutton.btn.cancel";
_selectClearButton_dataTestId = `[data-testid="${this._selectClearButton_testId}"]`;
_saveDatasource = `[data-testid='t--store-as-datasource']`;
}
4 changes: 2 additions & 2 deletions app/client/src/ce/constants/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,8 @@ export const DATASOURCE_UPDATE = (dsName: string) =>
`${dsName} datasource updated successfully`;
export const DATASOURCE_VALID = (dsName: string) =>
`${dsName} datasource is valid`;
export const EDIT_DATASOURCE = () => "Edit datasource";
export const SAVE_DATASOURCE = () => "Save as datasource";
export const EDIT_DATASOURCE = () => "Edit";
export const SAVE_DATASOURCE = () => "Save";
export const SAVE_DATASOURCE_MESSAGE = () =>
"Save the URL as a datasource to access authentication settings";
export const EDIT_DATASOURCE_MESSAGE = () =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,12 @@ function StoreAsDatasource(props: storeDataSourceProps) {
return (
<Button
className="t--store-as-datasource"
data-testid="t--store-as-datasource"
isDisabled={!props.enable}
kind="secondary"
onClick={saveOrEditDatasource}
size="md"
startIcon={props.shouldSave ? "cloud" : "pencil-line"}
startIcon={props.shouldSave ? "database-2-line" : "pencil-line"}
>
{props.shouldSave
? createMessage(SAVE_DATASOURCE)
Expand Down

0 comments on commit 91fd967

Please sign in to comment.