You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by pi...@apache.org on 2022/01/05 04:57:33 UTC

[atlas] branch master updated: ATLAS-4512-1-If user tries to delete a glossary (where a term is assigned) a second time, the dialog box goes into endless loading animation

This is an automated email from the ASF dual-hosted git repository.

pinal pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git


The following commit(s) were added to refs/heads/master by this push:
     new 2eb180c  ATLAS-4512-1-If user tries to delete a glossary (where a term is assigned) a second time, the dialog box goes into endless loading animation
2eb180c is described below

commit 2eb180ca60d900f5fa3c00915a8d72666b5c55b4
Author: Farhan Khan <fa...@freestoneinfotech.com>
AuthorDate: Tue Dec 21 13:33:45 2021 +0530

    ATLAS-4512-1-If user tries to delete a glossary (where a term is assigned) a second time, the dialog box goes into endless loading animation
    
    Signed-off-by: Pinal Shah <pi...@freestoneinfotech.com>
---
 dashboardv2/public/js/models/VGlossary.js                         | 8 ++++++++
 dashboardv2/public/js/views/glossary/GlossaryLayoutView.js        | 5 ++++-
 dashboardv3/public/js/models/VGlossary.js                         | 8 ++++++++
 dashboardv3/public/js/views/search/tree/GlossaryTreeLayoutView.js | 5 ++++-
 4 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/dashboardv2/public/js/models/VGlossary.js b/dashboardv2/public/js/models/VGlossary.js
index 48c5a99..135035d 100644
--- a/dashboardv2/public/js/models/VGlossary.js
+++ b/dashboardv2/public/js/models/VGlossary.js
@@ -64,6 +64,14 @@ define(['require',
             }, options);
             return this.constructor.nonCrudOperation.call(this, url, type, options);
         },
+        deleteGlossary: function(guid, options) {
+            var url = UrlLinks.glossaryApiUrl({ "guid": guid });
+            options = _.extend({
+                contentType: 'application/json',
+                dataType: 'json'
+            }, options);
+            return this.constructor.nonCrudOperation.call(this, url, 'DELETE', options);
+        },
         deleteCategory: function(guid, options) {
             var url = UrlLinks.categoryApiUrl({ "guid": guid });
             options = _.extend({
diff --git a/dashboardv2/public/js/views/glossary/GlossaryLayoutView.js b/dashboardv2/public/js/views/glossary/GlossaryLayoutView.js
index a13ad4a..4aeb6c8 100644
--- a/dashboardv2/public/js/views/glossary/GlossaryLayoutView.js
+++ b/dashboardv2/public/js/views/glossary/GlossaryLayoutView.js
@@ -720,6 +720,9 @@ define(['require',
                             if (!gId) {
                                 gId = guid;
                             }
+                            if (gId === guid) {
+                                that.glossaryCollection.fullCollection.remove(gId);
+                            }
                             var glossary = that.glossaryCollection.fullCollection.get(gId);
                             if (that.value) {
                                 if (that.value.gType == "term") {
@@ -776,7 +779,7 @@ define(['require',
                             that.notificationModal = obj;
                             obj.showButtonLoader();
                             if (type == "Glossary") {
-                                that.glossaryCollection.fullCollection.get(guid).destroy(options, { silent: true, reset: false });
+                                new that.glossaryCollection.model().deleteGlossary(guid, options);
                             } else if (type == "GlossaryCategory") {
                                 new that.glossaryCollection.model().deleteCategory(guid, options);
                             } else if (type == "GlossaryTerm") {
diff --git a/dashboardv3/public/js/models/VGlossary.js b/dashboardv3/public/js/models/VGlossary.js
index 48c5a99..135035d 100644
--- a/dashboardv3/public/js/models/VGlossary.js
+++ b/dashboardv3/public/js/models/VGlossary.js
@@ -64,6 +64,14 @@ define(['require',
             }, options);
             return this.constructor.nonCrudOperation.call(this, url, type, options);
         },
+        deleteGlossary: function(guid, options) {
+            var url = UrlLinks.glossaryApiUrl({ "guid": guid });
+            options = _.extend({
+                contentType: 'application/json',
+                dataType: 'json'
+            }, options);
+            return this.constructor.nonCrudOperation.call(this, url, 'DELETE', options);
+        },
         deleteCategory: function(guid, options) {
             var url = UrlLinks.categoryApiUrl({ "guid": guid });
             options = _.extend({
diff --git a/dashboardv3/public/js/views/search/tree/GlossaryTreeLayoutView.js b/dashboardv3/public/js/views/search/tree/GlossaryTreeLayoutView.js
index b01ff1f..7254e5c 100644
--- a/dashboardv3/public/js/views/search/tree/GlossaryTreeLayoutView.js
+++ b/dashboardv3/public/js/views/search/tree/GlossaryTreeLayoutView.js
@@ -602,6 +602,9 @@ define([
                         if (!gId) {
                             gId = guid;
                         }
+                        if (gId === guid) {
+                            that.glossaryCollection.fullCollection.remove(gId);
+                        }
                         var glossary = that.glossaryCollection.fullCollection.get(gId);
                         if (type == "GlossaryTerm") {
                             glossary.set('terms', _.reject(glossary.get('terms'), function(obj) {
@@ -635,7 +638,7 @@ define([
                         that.notificationModal = obj;
                         obj.showButtonLoader();
                         if (type == "Glossary" || type == "GLOSSARY") {
-                            that.glossaryCollection.fullCollection.get(guid).destroy(options, { silent: true, reset: false });
+                            new that.glossaryCollection.model().deleteGlossary(guid, options);
                         } else if (type == "GlossaryCategory") {
                             new that.glossaryCollection.model().deleteCategory(guid, options);