You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by kb...@apache.org on 2020/04/03 07:36:16 UTC
[atlas] branch branch-2.0 updated: ATLAS-3711 : UI:
Classification/Term modal should close after create/update/delete response
#2 loader improvement for cancel button
This is an automated email from the ASF dual-hosted git repository.
kbhatt pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/atlas.git
The following commit(s) were added to refs/heads/branch-2.0 by this push:
new 8eb3468 ATLAS-3711 : UI: Classification/Term modal should close after create/update/delete response #2 loader improvement for cancel button
8eb3468 is described below
commit 8eb346880e1cdeaf67d1f62a7edefef458fbe52c
Author: kevalbhatt <kb...@apache.org>
AuthorDate: Fri Apr 3 13:03:58 2020 +0530
ATLAS-3711 : UI: Classification/Term modal should close after create/update/delete response #2 loader improvement for cancel button
(cherry picked from commit 73bf850fd77ef550aaffaa6c034c4fe4dc29b7af)
---
dashboardv2/public/js/utils/Utils.js | 25 ++++++++++++----------
.../js/views/entity/CreateEntityLayoutView.js | 2 --
dashboardv3/public/js/utils/Utils.js | 25 ++++++++++++----------
.../js/views/entity/CreateEntityLayoutView.js | 2 --
4 files changed, 28 insertions(+), 26 deletions(-)
diff --git a/dashboardv2/public/js/utils/Utils.js b/dashboardv2/public/js/utils/Utils.js
index 0c03ba6..4f1a002 100644
--- a/dashboardv2/public/js/utils/Utils.js
+++ b/dashboardv2/public/js/utils/Utils.js
@@ -630,17 +630,18 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
superTypes = [];
var getData = function(data, collection) {
- superTypes = superTypes.concat(data.superTypes);
-
- if (data.superTypes && data.superTypes.length) {
- _.each(data.superTypes, function(superTypeName) {
- if (collection.fullCollection) {
- var collectionData = collection.fullCollection.findWhere({ name: superTypeName }).toJSON();
- } else {
- var collectionData = collection.findWhere({ name: superTypeName }).toJSON();
- }
- return getData(collectionData, collection);
- });
+ if (data) {
+ superTypes = superTypes.concat(data.superTypes);
+ if (data.superTypes && data.superTypes.length) {
+ _.each(data.superTypes, function(superTypeName) {
+ if (collection.fullCollection) {
+ var collectionData = collection.fullCollection.findWhere({ name: superTypeName }).toJSON();
+ } else {
+ var collectionData = collection.findWhere({ name: superTypeName }).toJSON();
+ }
+ getData(collectionData, collection);
+ });
+ }
}
}
getData(data, collection);
@@ -887,9 +888,11 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
}
$.fn.showButtonLoader = function() {
$(this).attr("disabled", "true").addClass('button-loader');
+ $(this).siblings("button.cancel").prop("disabled", true);
}
$.fn.hideButtonLoader = function() {
$(this).removeClass('button-loader').removeAttr("disabled");
+ $(this).siblings("button.cancel").prop("disabled", false);
}
return Utils;
});
\ No newline at end of file
diff --git a/dashboardv2/public/js/views/entity/CreateEntityLayoutView.js b/dashboardv2/public/js/views/entity/CreateEntityLayoutView.js
index 3b8b2b6..d967728 100644
--- a/dashboardv2/public/js/views/entity/CreateEntityLayoutView.js
+++ b/dashboardv2/public/js/views/entity/CreateEntityLayoutView.js
@@ -103,7 +103,6 @@ define(['require',
}).open();
this.modal.$el.find('button.ok').attr("disabled", true);
this.modal.on('ok', function(e) {
- that.modal.$el.find('button.cancel').attr("disabled", true);
that.modal.$el.find('button.ok').showButtonLoader();
that.okButton();
});
@@ -788,7 +787,6 @@ define(['require',
editVisiblityOfEntitySelectionBox: true
});
that.modal.$el.find('button.ok').hideButtonLoader();
- that.modal.$el.find('button.cancel').attr("disabled", false);
}
});
diff --git a/dashboardv3/public/js/utils/Utils.js b/dashboardv3/public/js/utils/Utils.js
index 97fa40b..ecc9ab3 100644
--- a/dashboardv3/public/js/utils/Utils.js
+++ b/dashboardv3/public/js/utils/Utils.js
@@ -677,17 +677,18 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
superTypes = [];
var getData = function(data, collection) {
- superTypes = superTypes.concat(data.superTypes);
-
- if (data.superTypes && data.superTypes.length) {
- _.each(data.superTypes, function(superTypeName) {
- if (collection.fullCollection) {
- var collectionData = collection.fullCollection.findWhere({ name: superTypeName }).toJSON();
- } else {
- var collectionData = collection.findWhere({ name: superTypeName }).toJSON();
- }
- return getData(collectionData, collection);
- });
+ if (data) {
+ superTypes = superTypes.concat(data.superTypes);
+ if (data.superTypes && data.superTypes.length) {
+ _.each(data.superTypes, function(superTypeName) {
+ if (collection.fullCollection) {
+ var collectionData = collection.fullCollection.findWhere({ name: superTypeName }).toJSON();
+ } else {
+ var collectionData = collection.findWhere({ name: superTypeName }).toJSON();
+ }
+ getData(collectionData, collection);
+ });
+ }
}
}
getData(data, collection);
@@ -935,9 +936,11 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
}
$.fn.showButtonLoader = function() {
$(this).attr("disabled", "true").addClass('button-loader');
+ $(this).siblings("button.cancel").prop("disabled", true);
}
$.fn.hideButtonLoader = function() {
$(this).removeClass('button-loader').removeAttr("disabled");
+ $(this).siblings("button.cancel").prop("disabled", false);
}
return Utils;
});
\ No newline at end of file
diff --git a/dashboardv3/public/js/views/entity/CreateEntityLayoutView.js b/dashboardv3/public/js/views/entity/CreateEntityLayoutView.js
index e74454b..9e763d1 100644
--- a/dashboardv3/public/js/views/entity/CreateEntityLayoutView.js
+++ b/dashboardv3/public/js/views/entity/CreateEntityLayoutView.js
@@ -103,7 +103,6 @@ define(['require',
}).open();
this.modal.$el.find('button.ok').attr("disabled", true);
this.modal.on('ok', function(e) {
- that.modal.$el.find('button.cancel').attr("disabled", true);
that.modal.$el.find('button.ok').showButtonLoader();
that.okButton();
});
@@ -794,7 +793,6 @@ define(['require',
editVisiblityOfEntitySelectionBox: true
});
that.modal.$el.find('button.ok').hideButtonLoader();
- that.modal.$el.find('button.cancel').attr("disabled", false);
}
});