atlas-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mad...@apache.org
Subject incubator-atlas git commit: ATLAS-1952: UI optimization to use searchResult.referredEntity to render object type attributes
Date Fri, 14 Jul 2017 23:26:24 GMT
Repository: incubator-atlas
Updated Branches:
  refs/heads/0.8-incubating c1f0f4964 -> da9a0e2e7


ATLAS-1952: UI optimization to use searchResult.referredEntity to render object type attributes

Signed-off-by: Madhan Neethiraj <madhan@apache.org>
(cherry picked from commit 84c6d52d266c6aa2039e7e8cb9a7edb8f4bb8a93)


Project: http://git-wip-us.apache.org/repos/asf/incubator-atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-atlas/commit/da9a0e2e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-atlas/tree/da9a0e2e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-atlas/diff/da9a0e2e

Branch: refs/heads/0.8-incubating
Commit: da9a0e2e796e985744bae84bc50387fc3b432816
Parents: c1f0f49
Author: kevalbhatt <kbhatt@apache.org>
Authored: Fri Jul 14 17:47:03 2017 +0530
Committer: Madhan Neethiraj <madhan@apache.org>
Committed: Fri Jul 14 16:26:10 2017 -0700

----------------------------------------------------------------------
 dashboardv2/public/js/collection/VSearchList.js    |  3 ++-
 dashboardv2/public/js/utils/CommonViewFunction.js  | 17 ++---------------
 dashboardv2/public/js/utils/Utils.js               | 17 ++++++++++++++++-
 .../js/views/entity/EntityDetailTableLayoutView.js |  7 ++++---
 .../js/views/search/SearchResultLayoutView.js      |  5 ++++-
 5 files changed, 28 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/da9a0e2e/dashboardv2/public/js/collection/VSearchList.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/collection/VSearchList.js b/dashboardv2/public/js/collection/VSearchList.js
index 6291838..0a7b713 100644
--- a/dashboardv2/public/js/collection/VSearchList.js
+++ b/dashboardv2/public/js/collection/VSearchList.js
@@ -37,6 +37,7 @@ define(['require',
             parseRecords: function(resp, options) {
                 this.queryType = resp.queryType;
                 this.queryText = resp.queryText;
+                this.referredEntities = resp.referredEntities;
                 return resp.entities ? resp.entities : [];
             },
             getBasicRearchResult: function(options) {
@@ -62,4 +63,4 @@ define(['require',
         }
     );
     return VSearchList;
-});
+});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/da9a0e2e/dashboardv2/public/js/utils/CommonViewFunction.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/utils/CommonViewFunction.js b/dashboardv2/public/js/utils/CommonViewFunction.js
index a04fb3f..6b8f50d 100644
--- a/dashboardv2/public/js/utils/CommonViewFunction.js
+++ b/dashboardv2/public/js/utils/CommonViewFunction.js
@@ -75,19 +75,6 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
             }
         });
     };
-    CommonViewFunction.findAndmergeRefEntity = function(attributeObject, referredEntities)
{
-        _.each(attributeObject, function(obj, key) {
-            if (_.isObject(obj)) {
-                if (_.isArray(obj)) {
-                    _.each(obj, function(value) {
-                        _.extend(value, referredEntities[value.guid]);
-                    });
-                } else {
-                    _.extend(obj, referredEntities[obj.guid]);
-                }
-            }
-        });
-    }
     CommonViewFunction.propertyTable = function(options) {
         var scope = options.scope,
             valueObject = options.valueObject,
@@ -179,7 +166,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
                     }
                     if (id && inputOutputField) {
                         var name = Utils.getName(inputOutputField);
-                        if (name === "-" || name === id) {
+                        if ((name === "-" || name === id) && !inputOutputField.attributes)
{
                             var fetch = true;
                             var fetchId = (_.isObject(id) ? id.id : id);
                             fetchInputOutputValue(fetchId);
@@ -474,4 +461,4 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
         }
     }
     return CommonViewFunction;
-});
+});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/da9a0e2e/dashboardv2/public/js/utils/Utils.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/utils/Utils.js b/dashboardv2/public/js/utils/Utils.js
index 9071df3..6e0453b 100644
--- a/dashboardv2/public/js/utils/Utils.js
+++ b/dashboardv2/public/js/utils/Utils.js
@@ -454,6 +454,21 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'pnotify.button
         loaderEl.hide();
         titleBoxEl.fadeIn();
     }
+    Utils.findAndMergeRefEntity = function(attributeObject, referredEntities) {
+        if (attributeObject && referredEntities) {
+            _.each(attributeObject, function(obj, key) {
+                if (_.isObject(obj)) {
+                    if (_.isArray(obj)) {
+                        _.each(obj, function(value) {
+                            _.extend(value, referredEntities[value.guid]);
+                        });
+                    } else {
+                        _.extend(obj, referredEntities[obj.guid]);
+                    }
+                }
+            });
+        }
+    }
     Utils.getNestedSuperTypeObj = function(options) {
         var flag = 0,
             data = options.data,
@@ -539,4 +554,4 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'pnotify.button
 
     });
     return Utils;
-});
+});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/da9a0e2e/dashboardv2/public/js/views/entity/EntityDetailTableLayoutView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/entity/EntityDetailTableLayoutView.js b/dashboardv2/public/js/views/entity/EntityDetailTableLayoutView.js
index 87c5dcd..e27edf4 100644
--- a/dashboardv2/public/js/views/entity/EntityDetailTableLayoutView.js
+++ b/dashboardv2/public/js/views/entity/EntityDetailTableLayoutView.js
@@ -21,7 +21,8 @@ define(['require',
     'hbs!tmpl/entity/EntityDetailTableLayoutView_tmpl',
     'utils/CommonViewFunction',
     'models/VEntity',
-], function(require, Backbone, EntityDetailTableLayoutView_tmpl, CommonViewFunction, VEntity)
{
+    'utils/Utils'
+], function(require, Backbone, EntityDetailTableLayoutView_tmpl, CommonViewFunction, VEntity,
Utils) {
     'use strict';
 
     var EntityDetailTableLayoutView = Backbone.Marionette.LayoutView.extend(
@@ -58,7 +59,7 @@ define(['require',
             entityTableGenerate: function() {
                 var that = this,
                     attributeObject = this.entity.attributes;
-                CommonViewFunction.findAndmergeRefEntity(attributeObject, that.referredEntities);
+                Utils.findAndMergeRefEntity(attributeObject, that.referredEntities);
                 if (attributeObject && attributeObject.columns) {
                     var valueSorted = _.sortBy(attributeObject.columns, function(val) {
                         return val.attributes.position
@@ -70,4 +71,4 @@ define(['require',
             }
         });
     return EntityDetailTableLayoutView;
-});
+});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/da9a0e2e/dashboardv2/public/js/views/search/SearchResultLayoutView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/search/SearchResultLayoutView.js b/dashboardv2/public/js/views/search/SearchResultLayoutView.js
index dba27fa..319beab 100644
--- a/dashboardv2/public/js/views/search/SearchResultLayoutView.js
+++ b/dashboardv2/public/js/views/search/SearchResultLayoutView.js
@@ -352,6 +352,7 @@ define(['require',
                             return;
                         }
                         if (isPostMethod) {
+                            that.searchCollection.referredEntities = model.referredEntities;
                             that.searchCollection.reset(model.entities);
                         }
                         if (that.searchCollection.models.length === 0 && that.offset
> that.limit) {
@@ -658,7 +659,9 @@ define(['require',
                                                 'valueObject': {},
                                                 'isTable': false
                                             }
+
                                             tempObj.valueObject[key] = modelObj.attributes[key]
+                                            Utils.findAndMergeRefEntity(tempObj.valueObject,
that.searchCollection.referredEntities);
                                             return CommonViewFunction.propertyTable(tempObj);
                                         }
                                     }
@@ -862,4 +865,4 @@ define(['require',
             }
         });
     return SearchResultLayoutView;
-});
+});
\ No newline at end of file


Mime
View raw message