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