Github user robertgmoss commented on a diff in the pull request:
https://github.com/apache/incubator-brooklyn/pull/704#discussion_r33034260
--- Diff: usage/jsgui/src/main/webapp/assets/js/view/catalog.js ---
@@ -113,9 +113,16 @@ define([
// Could use wait flag to block removal of model from
collection
// until server confirms deletion and success handler to
perform
// removal. Useful if delete fails for e.g. lack of
entitlement.
- this.activeModel.destroy();
- var displayName = $(event.currentTarget).data("name");
- this.renderEmpty(displayName ? "Deleted " + displayName : "");
+ var that = this;
+ var displayName = $(event.currentTarget).data("name") ||
"item";
+ this.activeModel.destroy({
+ success: function() {
+ that.renderEmpty("Deleted " + displayName);
+ },
+ error: function(info) {
+ that.renderEmpty("Unable to permanently delete " +
displayName+". Deletion is temporary, client-side only.");
--- End diff --
In fact, didn't realise the item would reappear as soon as refresh is
clicked. Perhaps it would be better not to remove it from the GUI and just say
it failed (and why)?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---