Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ describe(
after("Verify Deletion of the datasource", () => {
dataSources.DeleteDatasourceFromWithinDS(dsName, 409);
agHelper.ValidateToastMessage(
"Cannot delete datasource since it has 1 action(s) using it.",
"Cannot delete datasource since it has 1 query using it.",
); //table is 1 action
});

Expand Down
2 changes: 1 addition & 1 deletion app/client/cypress/support/Pages/DataSources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -897,7 +897,7 @@ export class DataSources {
this.agHelper.AssertContains(
responseStatus === 200
? "datasource deleted successfully"
: "action(s) using it",
: "Cannot delete datasource",
);
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,9 @@ public Mono<Datasource> archiveById(String id) {
.flatMap(objects -> {
final Long actionsCount = objects.getT2();
if (actionsCount > 0) {
return Mono.error(new AppsmithException(AppsmithError.DATASOURCE_HAS_ACTIONS, actionsCount));
String queryWord = actionsCount == 1 ? "query" : "queries";
return Mono.error(
new AppsmithException(AppsmithError.DATASOURCE_HAS_ACTIONS, actionsCount, queryWord));
}
return Mono.just(objects.getT1());
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ public enum AppsmithError {
DATASOURCE_HAS_ACTIONS(
409,
AppsmithErrorCode.DATASOURCE_HAS_ACTIONS.getCode(),
"Cannot delete datasource since it has {0} action(s) using it.",
"Cannot delete datasource since it has {0} {1} using it.",
AppsmithErrorAction.DEFAULT,
"Datasource cannot be deleted",
ErrorType.BAD_REQUEST,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -947,7 +947,8 @@ public void deleteDatasourceWithActions() {
})
.flatMap(datasource -> datasourceService.archiveById(datasource.getId()));

StepVerifier.create(datasourceMono).verifyErrorMessage(AppsmithError.DATASOURCE_HAS_ACTIONS.getMessage("1"));
StepVerifier.create(datasourceMono)
.verifyErrorMessage(AppsmithError.DATASOURCE_HAS_ACTIONS.getMessage("1", "query"));
}

@Test
Expand Down