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 2016/08/04 09:18:42 UTC

incubator-atlas git commit: ATLAS-1080 : Regression - UI - hive_storagedesc is shown as undefined in UI (kbhatt)

Repository: incubator-atlas
Updated Branches:
  refs/heads/master a2801f0ea -> 81ceabbdf


ATLAS-1080 : Regression - UI - hive_storagedesc is shown as undefined in UI (kbhatt)


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

Branch: refs/heads/master
Commit: 81ceabbdf6f817c1a25f439073941d5e19b88c9c
Parents: a2801f0
Author: Keval Bhatt <kb...@apache.org>
Authored: Thu Aug 4 14:45:56 2016 +0530
Committer: Keval Bhatt <ke...@gmail.com>
Committed: Thu Aug 4 14:47:35 2016 +0530

----------------------------------------------------------------------
 .../js/views/search/SearchResultLayoutView.js   | 134 ++++++++++++-------
 release-log.txt                                 |   1 +
 2 files changed, 84 insertions(+), 51 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/81ceabbd/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 62852e5..b28328c 100644
--- a/dashboardv2/public/js/views/search/SearchResultLayoutView.js
+++ b/dashboardv2/public/js/views/search/SearchResultLayoutView.js
@@ -263,33 +263,10 @@ define(['require',
                 var that = this,
                     count = 5;
                 require(['utils/TableLayout'], function(TableLayout) {
-                    var columnCollection = Backgrid.Columns.extend({
-                        sortKey: "position",
-                        comparator: function(item) {
-                            return item.get(this.sortKey) || 999;
-                        },
-                        setPositions: function() {
-                            _.each(this.models, function(model, index) {
-                                if (model.get('name') == "name") {
-                                    model.set("position", 2, { silent: true });
-                                    model.set("label", "Name");
-                                } else if (model.get('name') == "description") {
-                                    model.set("position", 3, { silent: true });
-                                    model.set("label", "Description");
-                                } else if (model.get('name') == "owner") {
-                                    model.set("position", 4, { silent: true });
-                                    model.set("label", "Owner");
-                                }
-                            });
-                            return this;
-                        }
-                    });
-                    var columns = new columnCollection(that.getEntityTableColumns());
-                    columns.setPositions().sort();
+                    var columns = new Backgrid.Columns(that.getEntityTableColumns());
                     that.REntityTableLayoutView.show(new TableLayout(_.extend({}, that.commonTableOptions, {
                         globalVent: that.globalVent,
-                        columns: columns,
-                        includeOrderAbleColumns: true
+                        columns: columns
                     })));
                     that.$('.searchResult').find(".inputAssignTag.multiSelect").hide();
                     that.renderBreadcrumb();
@@ -392,29 +369,91 @@ define(['require',
             },
             getFixedDslColumn: function() {
                 var that = this,
+                    nameCheck = 0,
                     col = {};
-                col['name'] = {
-                    label: "Name",
-                    cell: "html",
-                    editable: false,
-                    sortable: false,
-                    formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
-                        fromRaw: function(rawValue, model) {
-                            var nameHtml = "";
-                            if (model.get('$id$')) {
-                                nameHtml = '<a href="#!/detailPage/' + model.get('$id$').id + '">' + rawValue + '</a>';
-                            } else {
-                                nameHtml = '<a>' + rawValue + '</a>';
+                this.searchCollection.each(function(model) {
+                    if (model.get('name') || model.get('qualifiedName')) {
+                        ++nameCheck
+                    }
+                });
+                if (Globals.taxonomy) {
+                    col['Check'] = {
+                        name: "selected",
+                        label: "",
+                        cell: "select-row",
+                        headerCell: "select-all"
+                    };
+                }
+                if (nameCheck > 0) {
+                    col['name'] = {
+                        label: "Name",
+                        cell: "html",
+                        editable: false,
+                        sortable: false,
+                        className: "searchTableName",
+                        formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
+                            fromRaw: function(rawValue, model) {
+                                var nameHtml = "";
+                                if (rawValue === undefined) {
+                                    if (model.get('qualifiedName')) {
+                                        rawValue = model.get('qualifiedName');
+                                    } else if (model.get('$id$') && model.get('$id$').qualifiedName) {
+                                        rawValue = model.get('$id$').qualifiedName
+                                    } else {
+                                        return "";
+                                    }
+                                }
+                                if (model.get('$id$') && model.get('$id$').id) {
+                                    nameHtml = '<a href="#!/detailPage/' + model.get('$id$').id + '">' + rawValue + '</a>';
+                                } else {
+                                    nameHtml = '<a>' + rawValue + '</a>';
+                                }
+                                if (model.get('$id$') && model.get('$id$').state && Globals.entityStateReadOnly[model.get('$id$').state]) {
+                                    nameHtml += '<button title="Deleted" class="btn btn-atlasAction btn-atlas deleteBtn"><i class="fa fa-trash"></i></button>';
+                                    return '<div class="readOnly readOnlyLink">' + nameHtml + '</div>';
+                                } else {
+                                    return nameHtml;
+                                }
                             }
-                            if (model.get('$id$') && model.get('$id$').state && Globals.entityStateReadOnly[model.get('$id$').state]) {
-                                nameHtml += '<button title="Deleted" class="btn btn-atlasAction btn-atlas deleteBtn"><i class="fa fa-trash"></i></button>';
-                                return '<div class="readOnly readOnlyLink">' + nameHtml + '</div>';
-                            } else {
-                                return nameHtml;
+                        })
+                    }
+                }
+                if (nameCheck === 0) {
+                    col['typeName'] = {
+                        label: "Type Name",
+                        cell: "html",
+                        editable: false,
+                        sortable: false,
+                        formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
+                            fromRaw: function(rawValue, model) {
+                                var nameHtml = "";
+                                if (rawValue === undefined) {
+                                    if (model.get('$id$') && model.get('$id$')['$typeName$']) {
+                                        rawValue = model.get('$id$')['$typeName$']
+                                    } else if (model.get('$typeName$')) {
+                                        rawValue = model.get('$typeName$');
+                                    } else if (model.get('typeName')) {
+                                        rawValue = model.get('typeName')
+                                    } else {
+                                        return "";
+                                    }
+                                }
+                                if (model.get('$id$') && model.get('$id$').id) {
+                                    nameHtml = '<a href="#!/detailPage/' + model.get('$id$').id + '">' + rawValue + '</a>';
+                                } else {
+                                    nameHtml = '<a>' + rawValue + '</a>';
+                                }
+                                if (model.get('$id$') && model.get('$id$').state && Globals.entityStateReadOnly[model.get('$id$').state]) {
+                                    nameHtml += '<button title="Deleted" class="btn btn-atlasAction btn-atlas deleteBtn"><i class="fa fa-trash"></i></button>';
+                                    return '<div class="readOnly readOnlyLink">' + nameHtml + '</div>';
+                                } else {
+                                    return nameHtml;
+                                }
                             }
-                        }
-                    })
+                        })
+                    }
                 }
+
                 col['description'] = {
                     label: "Description",
                     cell: "String",
@@ -446,13 +485,6 @@ define(['require',
                     })
                 };
                 if (Globals.taxonomy) {
-                    col['Check'] = {
-                        name: "selected",
-                        label: "",
-                        cell: "select-row",
-                        headerCell: "select-all",
-                        position: 1
-                    };
                     col['terms'] = {
                         label: "Terms",
                         cell: "Html",

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/81ceabbd/release-log.txt
----------------------------------------------------------------------
diff --git a/release-log.txt b/release-log.txt
index d620cc6..dec8f0f 100644
--- a/release-log.txt
+++ b/release-log.txt
@@ -6,6 +6,7 @@ INCOMPATIBLE CHANGES:
 
 
 ALL CHANGES:
+ATLAS-1080 Regression - UI - hive_storagedesc is shown as "undefined" in UI.(kevalbhatt)
 ATLAS-1089 Storm hook should handle cyclic references in topology object (mneethiraj via sumasai)
 ATLAS-1086 Build failure in hive-bridge after security fixes in ATLAS-762 (sumasai)
 ATLAS-1088 Fix /search api to default to fulltext on dsl failure (sumasai)