Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 53c93d8

Browse files
committed
webui: Ensure deleting visualisations shows the success message too
Only when it's successful of course. :)
1 parent 5ad8c46 commit 53c93d8

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

cypress/e2e/1-webui/live_visualisation.cy.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ describe('live visualisation', () => {
237237
cy.get('[data-cy="formatsqlbtn"]').click()
238238

239239
// Verify the changed text
240+
cy.wait(waitTime)
240241
cy.get('[data-cy="usersqltext"]').should('contain',
241242
'SELECT\n' +
242243
' table1.Name,\n' +

webui/templates/visualise.html

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -436,8 +436,10 @@ <h4 style="color: {{ statusMessageColour }};" data-cy="statusmsg">&nbsp;{{ statu
436436
// Retrieve the SQL and chart settings for the newly chosen visualisation from the server
437437
$http.get("/x/visget/[[ .DB.Info.Owner ]]/[[ .DB.Info.Database ]]?visname="+newVis).then(
438438
function success(response) {
439-
// Clear any existing status message
440-
$scope.statusMessage = "";
439+
if (execNewVis) {
440+
// Clear any existing status message
441+
$scope.statusMessage = "";
442+
}
441443

442444
// Apply the retrieved information
443445
document.getElementById("savename").value = newVis;
@@ -554,10 +556,12 @@ <h4 style="color: {{ statusMessageColour }};" data-cy="statusmsg">&nbsp;{{ statu
554556
$scope.db.Records = {};
555557
}
556558
}, function failure(response) {
557-
// Retrieving visualisation text failed, so display the returned error message
558-
$scope.statusMessageColour = "red";
559-
$scope.statusMessage = nowString() + "Retrieving visualisation failed: " + response.data;
560-
$scope.showVis = false;
559+
if (execNewVis) {
560+
// Retrieving visualisation text failed, so display the returned error message
561+
$scope.statusMessageColour = "red";
562+
$scope.statusMessage = nowString() + "Retrieving visualisation failed: " + response.data;
563+
$scope.showVis = false;
564+
}
561565
}
562566
)
563567
}

0 commit comments

Comments
 (0)