atlas-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yhema...@apache.org
Subject incubator-atlas git commit: ATLAS-846 Atlas UI : Add Pagination to Tags and Terms tabs of asset detailes page (kevalbhatt18 via yhemanth)
Date Thu, 02 Jun 2016 13:05:30 GMT
Repository: incubator-atlas
Updated Branches:
  refs/heads/master 83d053978 -> b8a5d4d61


ATLAS-846 Atlas UI : Add Pagination to Tags and Terms tabs of asset detailes page (kevalbhatt18
via yhemanth)


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

Branch: refs/heads/master
Commit: b8a5d4d616e5d12b635fbea071eb36bba2598209
Parents: 83d0539
Author: Hemanth Yamijala <hyamijala@hortonworks.com>
Authored: Thu Jun 2 18:35:17 2016 +0530
Committer: Hemanth Yamijala <hyamijala@hortonworks.com>
Committed: Thu Jun 2 18:35:17 2016 +0530

----------------------------------------------------------------------
 dashboardv2/public/css/scss/override.scss       |   6 +
 .../tag/TagDetailTableLayoutView_tmpl.html      |  15 +-
 .../js/views/audit/AuditTableLayoutView.js      |   2 +-
 .../views/detail_page/DetailPageLayoutView.js   |  23 ---
 .../public/js/views/schema/SchemaLayoutView.js  |   9 +-
 .../js/views/tag/TagDetailTableLayoutView.js    | 153 ++++++++++++-------
 release-log.txt                                 |   1 +
 7 files changed, 111 insertions(+), 98 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/b8a5d4d6/dashboardv2/public/css/scss/override.scss
----------------------------------------------------------------------
diff --git a/dashboardv2/public/css/scss/override.scss b/dashboardv2/public/css/scss/override.scss
index 67dafaf..1d9540a 100644
--- a/dashboardv2/public/css/scss/override.scss
+++ b/dashboardv2/public/css/scss/override.scss
@@ -95,3 +95,9 @@
 .select2-container--default.select2-container--focus .select2-selection--multiple {
     border-color: #8fa5b1 !important;
 }
+
+.backgrid {
+    td {
+        white-space: normal;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/b8a5d4d6/dashboardv2/public/js/templates/tag/TagDetailTableLayoutView_tmpl.html
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/templates/tag/TagDetailTableLayoutView_tmpl.html b/dashboardv2/public/js/templates/tag/TagDetailTableLayoutView_tmpl.html
index 5d856cd..4be7cc2 100644
--- a/dashboardv2/public/js/templates/tag/TagDetailTableLayoutView_tmpl.html
+++ b/dashboardv2/public/js/templates/tag/TagDetailTableLayoutView_tmpl.html
@@ -20,17 +20,4 @@
 <div class="fontLoader">
     <i class="fa fa-refresh fa-spin-custom"></i>
 </div>
-<table class="table table-quickMenu">
-    <thead>
-        <tr>
-            <th class="tagTermheading">Tag</th>
-            <th>Attributes</th>
-            <th>Tools</th>
-        </tr>
-    </thead>
-    <tbody data-id="detailValue">
-    </tbody>
-</table>
-<div class="noTags" style="display:none">
-    No tags to display
-</div>
+<div id="r_tagTermTableLayoutView"></div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/b8a5d4d6/dashboardv2/public/js/views/audit/AuditTableLayoutView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/audit/AuditTableLayoutView.js b/dashboardv2/public/js/views/audit/AuditTableLayoutView.js
index 9ac622c..19f3b70 100644
--- a/dashboardv2/public/js/views/audit/AuditTableLayoutView.js
+++ b/dashboardv2/public/js/views/audit/AuditTableLayoutView.js
@@ -62,7 +62,7 @@ define(['require',
                     collection: this.entityCollection,
                     includeFilter: false,
                     includePagination: true,
-                    includePageSize: true,
+                    includePageSize: false,
                     includeFooterRecords: true,
                     gridOpts: {
                         className: "table table-hover backgrid table-quickMenu",

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/b8a5d4d6/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js b/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js
index c138044..8be3066 100644
--- a/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js
+++ b/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js
@@ -112,22 +112,7 @@ define(['require',
              */
             initialize: function(options) {
                 _.extend(this, _.pick(options, 'globalVent', 'collection', 'vent', 'id'));
-                this.key = 'branchDetail';
-                //this.updateValue();
                 this.bindEvents();
-                this.commonTableOptions = {
-                    collection: this.collection,
-                    includeFilter: false,
-                    includePagination: false,
-                    includePageSize: false,
-                    includeFooterRecords: true,
-                    gridOpts: {
-                        className: "table table-striped table-condensed backgrid table-quickMenu",
-                        emptyText: 'No records found!'
-                    },
-                    filterOpts: {},
-                    paginatorOpts: {}
-                };
             },
             bindEvents: function() {
                 var that = this;
@@ -170,14 +155,6 @@ define(['require',
             onRender: function() {
                 var that = this;
                 this.ui.editBox.hide();
-                /*    this.ui.appendList.on('click', 'div', function(e) {
-                        if (e.target.nodeName == "INPUT") {
-                            return false;
-                        }
-                        that.ui.addTagtext.hide();
-                        that.ui.addTagPlus.show();
-                        that.saveTagFromList($(this));
-                    });*/
             },
             fetchCollection: function() {
                 this.collection.fetch({ reset: true });

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/b8a5d4d6/dashboardv2/public/js/views/schema/SchemaLayoutView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/schema/SchemaLayoutView.js b/dashboardv2/public/js/views/schema/SchemaLayoutView.js
index 4733b92..4cd8ccb 100644
--- a/dashboardv2/public/js/views/schema/SchemaLayoutView.js
+++ b/dashboardv2/public/js/views/schema/SchemaLayoutView.js
@@ -75,10 +75,10 @@ define(['require',
                     collection: this.schemaCollection,
                     includeFilter: false,
                     includePagination: true,
-                    includePageSize: true,
+                    includePageSize: false,
                     includeFooterRecords: true,
                     gridOpts: {
-                        className: "table table-striped table-condensed backgrid table-quickMenu",
+                        className: "table table-hover backgrid table-quickMenu",
                         emptyText: 'No records found!'
                     },
                     filterOpts: {},
@@ -111,10 +111,7 @@ define(['require',
                     var cols = new Backgrid.Columns(that.getSchemaTableColumns());
                     that.RTagLayoutView.show(new TableLayout(_.extend({}, that.commonTableOptions,
{
                         globalVent: that.globalVent,
-                        columns: cols,
-                        gridOpts: {
-                            className: "table table-quickMenu",
-                        },
+                        columns: cols
                     })));
                 });
             },

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/b8a5d4d6/dashboardv2/public/js/views/tag/TagDetailTableLayoutView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/tag/TagDetailTableLayoutView.js b/dashboardv2/public/js/views/tag/TagDetailTableLayoutView.js
index 3534d02..be72dcb 100644
--- a/dashboardv2/public/js/views/tag/TagDetailTableLayoutView.js
+++ b/dashboardv2/public/js/views/tag/TagDetailTableLayoutView.js
@@ -20,8 +20,9 @@ define(['require',
     'backbone',
     'hbs!tmpl/tag/TagDetailTableLayoutView_tmpl',
     'utils/CommonViewFunction',
-    'utils/Utils'
-], function(require, Backbone, TagDetailTableLayoutView_tmpl, CommonViewFunction, Utils)
{
+    'utils/Utils',
+    'collection/VTagList'
+], function(require, Backbone, TagDetailTableLayoutView_tmpl, CommonViewFunction, Utils,
VTagList) {
     'use strict';
 
     var TagDetailTableLayoutView = Backbone.Marionette.LayoutView.extend(
@@ -32,7 +33,9 @@ define(['require',
             template: TagDetailTableLayoutView_tmpl,
 
             /** Layout sub regions */
-            regions: {},
+            regions: {
+                RTagTermTableLayoutView: "#r_tagTermTableLayoutView"
+            },
 
             /** ui selector cache */
             ui: {
@@ -52,68 +55,110 @@ define(['require',
                 return events;
             },
             /**
-             * intialize a new EntityDetailTableLayoutView Layout
+             * intialize a new TagDetailTableLayoutView Layout
              * @constructs
              */
             initialize: function(options) {
                 _.extend(this, _.pick(options, 'globalVent', 'collection', 'guid', 'term'));
                 this.collectionObject = this.collection.toJSON();
-
+                this.tagTermCollection = new VTagList();
+                var tagorterm = _.toArray(this.collectionObject[0].traits),
+                    tagTermList = [],
+                    that = this;
+                _.each(tagorterm, function(object) {
+                    if (that.term) {
+                        var checkTagOrTerm = Utils.checkTagOrTerm(object.typeName);
+                        if (checkTagOrTerm.term) {
+                            tagTermList.push(object);
+                        }
+                    } else {
+                        var checkTagOrTerm = Utils.checkTagOrTerm(object.typeName);
+                        if (!checkTagOrTerm.term) {
+                            tagTermList.push(object);
+                        }
+                    }
+                });
+                this.tagTermCollection.set(tagTermList);
+                this.commonTableOptions = {
+                    collection: this.tagTermCollection,
+                    includeFilter: false,
+                    includePagination: true,
+                    includePageSize: false,
+                    includeFooterRecords: true,
+                    gridOpts: {
+                        className: "table table-hover backgrid table-quickMenu",
+                        emptyText: 'No records found!'
+                    },
+                    filterOpts: {},
+                    paginatorOpts: {}
+                };
             },
             bindEvents: function() {},
             onRender: function() {
-                this.tagTableGenerate();
-                if (this.term) {
-                    this.$('.tagTermheading').text('Terms');
-                } else {
-                    this.$('.tagTermheading').text('Tags');
-                }
+                this.renderTableLayoutView();
             },
-            tagTableGenerate: function() {
-                var that = this,
-                    table = "",
-                    valueObject = this.collectionObject[0].traits;
-                if (_.isEmpty(valueObject)) {
-                    this.showNoTagorTermMessage()
-                } else {
-                    this.$(".noTags").hide();
-                    _.keys(valueObject).map(function(key) {
-                        var keyValue = valueObject[key];
-                        var tagValue = 'NA';
-                        if (_.isObject(keyValue)) {
-                            //tagValue = "";
-                            if (!_.isEmpty(keyValue.values)) {
-                                var stringArr = [];
-                                tagValue = "";
-                                _.each(keyValue.values, function(val, key) {
+            renderTableLayoutView: function() {
+                var that = this;
+                require(['utils/TableLayout'], function(TableLayout) {
+                    var cols = new Backgrid.Columns(that.getSchemaTableColumns());
+                    that.RTagTermTableLayoutView.show(new TableLayout(_.extend({}, that.commonTableOptions,
{
+                        globalVent: that.globalVent,
+                        columns: cols
+                    })));
+                });
+            },
+            getSchemaTableColumns: function() {
+                var that = this;
+                var col = {};
 
-                                    var attrName = "<span>" + key + ":" + val + "</span>";
-                                    stringArr.push(attrName);
-                                });
-                                tagValue += stringArr.join(", ");
-                            }
-                            var name = Utils.checkTagOrTerm(keyValue.typeName);
-                            if (that.term && name.term) {
-                                table += '<tr><td>' + keyValue.typeName + '</td><td>'
+ tagValue + '</td><td>' + '<a href="javascript:void(0)"><i class="fa
fa-trash" data-id="delete" data-name="' + keyValue.typeName + '"></i></a></tr>';
-                            }
-                            if (!that.term && !name.term) {
-                                table += '<tr><td>' + keyValue.typeName + '</td><td>'
+ tagValue + '</td><td>' + '<a href="javascript:void(0)"><i class="fa
fa-trash" data-id="delete" data-name="' + keyValue.typeName + '"></i></a></tr>';
-                            }
+                return this.tagTermCollection.constructor.getTableCols({
+                        TagorTerm: {
+                            label: (this.term) ? "Terms" : "Tags",
+                            cell: "String",
+                            editable: false,
+                            sortable: false,
+                            formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
+                                fromRaw: function(rawValue, model) {
+                                    return model.get('typeName');
+                                }
+                            })
+                        },
+                        Attributes: {
+                            label: "Attributes",
+                            cell: "html",
+                            editable: false,
+                            sortable: false,
+                            formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
+                                fromRaw: function(rawValue, model) {
+                                    var values = model.get('values'),
+                                        tagValue = 'NA';
+                                    if (!_.isEmpty(values)) {
+                                        var stringArr = [];
+                                        tagValue = "";
+                                        _.each(values, function(val, key) {
+                                            var attrName = "<span>" + key + ":" + val
+ "</span>";
+                                            stringArr.push(attrName);
+                                        });
+                                        tagValue += stringArr.join(", ");
+                                    }
+                                    return tagValue;
+                                }
+                            })
+                        },
+                        tool: {
+                            label: "Tool",
+                            cell: "html",
+                            editable: false,
+                            sortable: false,
+                            formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
+                                fromRaw: function(rawValue, model) {
+                                    return '<a href="javascript:void(0)"><i class="fa
fa-trash" data-id="delete" data-name="' + model.get('typeName') + '"></i></a>'
+                                }
+                            })
+                        },
 
-                        } else {}
-                    });
-                    if (table.length == 0) {
-                        this.showNoTagorTermMessage();
-                    }
-                    that.ui.detailValue.append(table);
-                }
-            },
-            showNoTagorTermMessage: function() {
-                if (this.term) {
-                    this.$(".noTags").text(' No terms to display').show();
-                } else {
-                    this.$(".noTags").text(' No tags to display').show();
-                }
+                    },
+                    this.tagTermCollection);
             },
             addModalView: function(e) {
                 var that = this;

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/b8a5d4d6/release-log.txt
----------------------------------------------------------------------
diff --git a/release-log.txt b/release-log.txt
index 86cff05..1ef3245 100644
--- a/release-log.txt
+++ b/release-log.txt
@@ -22,6 +22,7 @@ ATLAS-409 Atlas will not import avro tables with schema read from a file
(dosset
 ATLAS-379 Create sqoop and falcon metadata addons (venkatnrangan,bvellanki,sowmyaramesh via
shwethags)
 
 ALL CHANGES:
+ATLAS-846 Atlas UI : Add Pagination to Tags and Terms tabs of asset detailes page (kevalbhatt18
via yhemanth)
 ATLAS-503 Lock exceptions occurring due to concurrent updates to backend stores (yhemanth)
 ATLAS-766 Atlas policy file does not honour standard hash as comment format ( saqeeb.s via
sumasai )
 ATLAS-843 Atlas UI: Feature to search terms in left navigation. (Kalyanikashikar via sumasai)


Mime
View raw message