atlas-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From suma...@apache.org
Subject incubator-atlas git commit: ATLAS-919 UI : Deleted references should be shown in red or filtered out (kevalbhatt18 via sumasai)
Date Tue, 28 Jun 2016 17:27:37 GMT
Repository: incubator-atlas
Updated Branches:
  refs/heads/master 0bf878de6 -> 2b28ce4d0


ATLAS-919 UI : Deleted references should be shown in red or filtered out (kevalbhatt18 via
sumasai)


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

Branch: refs/heads/master
Commit: 2b28ce4d02714dcea7234bb2d1355781989ebbb4
Parents: 0bf878d
Author: Suma Shivaprasad <sumasai.shivaprasad@gmail.com>
Authored: Tue Jun 28 10:27:31 2016 -0700
Committer: Suma Shivaprasad <sumasai.shivaprasad@gmail.com>
Committed: Tue Jun 28 10:27:31 2016 -0700

----------------------------------------------------------------------
 dashboardv2/public/css/scss/form.scss           |  6 +-
 dashboardv2/public/css/scss/main.scss           | 31 +++++---
 .../public/js/utils/CommonViewFunction.js       | 76 ++++++++++++++++----
 .../views/detail_page/DetailPageLayoutView.js   | 13 +++-
 release-log.txt                                 |  1 +
 5 files changed, 100 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/2b28ce4d/dashboardv2/public/css/scss/form.scss
----------------------------------------------------------------------
diff --git a/dashboardv2/public/css/scss/form.scss b/dashboardv2/public/css/scss/form.scss
index 470dbf7..82bd960 100644
--- a/dashboardv2/public/css/scss/form.scss
+++ b/dashboardv2/public/css/scss/form.scss
@@ -193,7 +193,7 @@ button:focus {
     border-color: $color_mountain_mist_approx;
     color: $color_mountain_mist_approx;
     cursor: default;
-    margin: 10px;
+    margin: 5px 10px;
     &:hover {
         border-color: $color_mountain_mist_approx;
         color: $color_mountain_mist_approx;
@@ -205,3 +205,7 @@ button:focus {
         background-color: $transparent;
     }
 }
+
+.block {
+    display: block !important;
+}

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/2b28ce4d/dashboardv2/public/css/scss/main.scss
----------------------------------------------------------------------
diff --git a/dashboardv2/public/css/scss/main.scss b/dashboardv2/public/css/scss/main.scss
index 85a68b1..e9fb452 100644
--- a/dashboardv2/public/css/scss/main.scss
+++ b/dashboardv2/public/css/scss/main.scss
@@ -99,7 +99,8 @@ body {
 }
 
 .gray-bg {
-    background-color: $color_white_lilac_approx;
+    background-color: #f6f7fb;
+    padding-bottom: 4%;
 }
 
 header {
@@ -240,6 +241,16 @@ ul {
     }
 }
 
+.readOnlyLink {
+    display: inline-block;
+    .deleteBtn {
+        padding: 0px 5px;
+    }
+    a {
+        color: $delete_link;
+    }
+}
+
 .readOnly {
     .addTag-dropdown {
         display: none;
@@ -251,15 +262,6 @@ ul {
             }
         }
     }
-    &.readOnlyLink {
-        display: inline-block;
-        .deleteBtn {
-            padding: 0px 5px;
-        }
-        a {
-            color: $delete_link;
-        }
-    }
     a {
         &.inputTag[data-id="addTag"] {
             display: none;
@@ -282,3 +284,12 @@ ul {
         }
     }
 }
+
+@media (min-width: 768px) {
+    .col-sm-offset-1 {
+        margin: 4% 4% 0;
+    }
+    .col-sm-10 {
+        width: 92%;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/2b28ce4d/dashboardv2/public/js/utils/CommonViewFunction.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/utils/CommonViewFunction.js b/dashboardv2/public/js/utils/CommonViewFunction.js
index ffffa1c..d699fe8 100644
--- a/dashboardv2/public/js/utils/CommonViewFunction.js
+++ b/dashboardv2/public/js/utils/CommonViewFunction.js
@@ -16,7 +16,7 @@
  * limitations under the License.
  */
 
-define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages'], function(require, Utils,
Modal, Messages) {
+define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Globals'], function(require,
Utils, Modal, Messages, Globals) {
     'use strict';
 
     var CommonViewFunction = {};
@@ -108,16 +108,23 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages'],
function(r
             fetchInputOutputValue = function(id) {
                 var that = this;
                 scope.model.getEntity(id, {
-                    beforeSend: function() {},
                     success: function(data) {
-                        var value = "";
+                        var value = "",
+                            deleteButton = "";
                         if (data.definition.values.name) {
                             value = data.definition.values.name;
+                        } else if (data.definition.values.qualifiedName) {
+                            value = data.definition.values.qualifiedName;
+                        } else if (data.definition.typeName) {
+                            value = data.definition.typeName;
                         }
                         var id = "";
                         if (data.definition.id) {
                             if (_.isObject(data.definition.id) && data.definition.id.id)
{
                                 id = data.definition.id.id;
+                                if (Globals.entityStateReadOnly[data.definition.id.state])
{
+                                    deleteButton += '<button title="Deleted" class="btn
btn-atlasAction btn-atlas deleteBtn"><i class="fa fa-trash"></i></button>';
+                                }
                             } else {
                                 id = data.definition.id;
                             }
@@ -127,7 +134,10 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages'],
function(r
                         } else {
                             scope.$('td div[data-id="' + id + '"]').html('<a href="#!/detailPage/'
+ id + '">' + id + '</a>');
                         }
-
+                        if (deleteButton.length) {
+                            scope.$('td div[data-id="' + id + '"]').addClass('block readOnlyLink');
+                            scope.$('td div[data-id="' + id + '"]').append(deleteButton);
+                        }
                     },
                     error: function(error, data, status) {},
                     complete: function() {}
@@ -139,46 +149,78 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages'],
function(r
                 var subLink = "";
                 for (var i = 0; i < keyValue.length; i++) {
                     var inputOutputField = keyValue[i],
-                        id = undefined;
+                        id = undefined,
+                        tempLink = "",
+                        readOnly = false;
                     if (_.isObject(inputOutputField.id)) {
                         id = inputOutputField.id.id;
+                        if (Globals.entityStateReadOnly[inputOutputField.id.state]) {
+                            readOnly = inputOutputField.id.state
+                        }
                     } else {
                         id = inputOutputField.id;
                     }
                     if (id) {
                         if (inputOutputField.values) {
                             if (inputOutputField.values.name) {
-                                subLink += '<div><a href="#!/detailPage/' + id +
'">' + inputOutputField.values.name + '</a><div>'
+                                tempLink += '<a href="#!/detailPage/' + id + '">' +
inputOutputField.values.name + '</a>'
+                            } else if (inputOutputField.values.qualifiedName) {
+                                tempLink += '<a href="#!/detailPage/' + id + '">' +
inputOutputField.values.qualifiedName + '</a>'
+                            } else if (inputOutputField.typeName) {
+                                tempLink += '<a href="#!/detailPage/' + id + '">' +
inputOutputField.typeName + '</a>'
                             } else {
-                                subLink += '<a href="#!/detailPage/' + id + '">' +
id + '</a>'
+                                tempLink += '<a href="#!/detailPage/' + id + '">' +
id + '</a>'
                             }
                         } else {
                             fetchInputOutputValue(id);
-                            subLink += '<div data-id="' + id + '"></div>';
+                            tempLink += '<div data-id="' + id + '"></div>';
                         }
 
+                    }
+                    if (readOnly) {
+                        tempLink += '<button title="Deleted" class="btn btn-atlasAction
btn-atlas deleteBtn"><i class="fa fa-trash"></i></button>';
+                        subLink += '<div class="block readOnlyLink">' + tempLink +
'</div>';
                     } else {
-                        subLink += '<div></div>';
+                        if (tempLink.search('href') != -1) {
+                            subLink += '<div>' + tempLink + '</div>'
+                        } else {
+                            subLink += tempLink
+                        }
                     }
                 }
                 table += '<tr><td>' + key + '</td><td>' + subLink
+ '</td></tr>';
             } else if (_.isObject(keyValue)) {
-                var id = undefined;
+                var id = undefined,
+                    tempLink = "",
+                    readOnly = false;
                 if (_.isObject(keyValue.id)) {
                     id = keyValue.id.id;
+                    if (Globals.entityStateReadOnly[keyValue.id.state]) {
+                        readOnly = keyValue.id.state
+                    }
                 } else {
                     id = keyValue.id;
                 }
                 if (id) {
                     if (keyValue.values) {
                         if (keyValue.values.name) {
-                            table += '<tr><td>' + key + '</td><td><div><a
href="#!/detailPage/' + id + '">' + keyValue.values.name + '</a><div></td></tr>';
+                            tempLink += '<a href="#!/detailPage/' + id + '">' + keyValue.values.name
+ '</a>';
+                        } else if (keyValue.values.qualifiedName) {
+                            tempLink += '<a href="#!/detailPage/' + id + '">' + keyValue.values.qualifiedName
+ '</a>'
+                        } else if (keyValue.typeName) {
+                            tempLink += '<a href="#!/detailPage/' + id + '">' + keyValue.typeName
+ '</a>'
                         } else {
-                            table += '<tr><td>' + key + '</td><td><div><a
href="#!/detailPage/' + id + '">' + id + '</a><div></td></tr>';
+                            tempLink += '<a href="#!/detailPage/' + id + '">' + id
+ '</a>';
                         }
                     } else {
                         fetchInputOutputValue(id);
-                        table += '<tr><td>' + key + '</td><td><div
data-id="' + id + '"></div></td></tr>';
+                        tempLink += '<div data-id="' + id + '"></div>';
+                    }
+                    if (readOnly) {
+                        tempLink += '<button title="Deleted" class="btn btn-atlasAction
btn-atlas deleteBtn"><i class="fa fa-trash"></i></button>';
+                        table += '<tr><td>' + key + '</td><td><div
class="block readOnlyLink">' + tempLink + '</div></td></tr>';
+                    } else {
+                        table += '<tr><td>' + key + '</td><td>' +
tempLink + '</td></tr>';
                     }
                 } else {
                     var stringArr = [];
@@ -194,9 +236,13 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages'],
function(r
                     });
                     var jointValues = stringArr.join(", ");
                     if (jointValues.length) {
-                        table += '<tr><td>' + key + '</td><td><div>'
+ jointValues + '</div></td></tr>';
+                        tempLink += '<div>' + jointValues + '</div>';
+                    }
+                    if (readOnly) {
+                        tempLink += '<button title="Deleted" class="btn btn-atlasAction
btn-atlas deleteBtn"><i class="fa fa-trash"></i></button>';
+                        table += '<tr><td>' + key + '</td><td><div
class="block readOnlyLink">' + tempLink + '</div></td></tr>';
                     } else {
-                        table += '<tr><td>' + key + '</td><td></td></tr>';
+                        table += '<tr><td>' + key + '</td><td>' +
tempLink + '</td></tr>';
                     }
                 }
             } else {

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/2b28ce4d/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 cb96c79..7f31141 100644
--- a/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js
+++ b/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js
@@ -130,7 +130,18 @@ define(['require',
                     }
                     if (collectionJSON && collectionJSON.length) {
                         if (collectionJSON[0].values) {
-                            this.name = collectionJSON[0].values.name;
+                            if (collectionJSON[0].values.name) {
+                                this.name = collectionJSON[0].values.name;
+                            }
+                            if (!this.name && collectionJSON[0].values.qualifiedName)
{
+                                this.name = collectionJSON[0].values.qualifiedName;
+                            }
+                            if (!this.name && collectionJSON[0].typeName) {
+                                this.name = collectionJSON[0].typeName;
+                            }
+                            if (!this.name && this.id) {
+                                this.name = this.id;
+                            }
                             this.description = collectionJSON[0].values.description;
                             if (this.name) {
                                 this.ui.title.show();

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/2b28ce4d/release-log.txt
----------------------------------------------------------------------
diff --git a/release-log.txt b/release-log.txt
index 9c64693..7ef05d6 100644
--- a/release-log.txt
+++ b/release-log.txt
@@ -6,6 +6,7 @@ INCOMPATIBLE CHANGES:
 
 
 ALL CHANGES:
+ATLAS-919 UI : Deleted references should be shown in red or filtered out (kevalbhatt18 via
sumasai)
 ATLAS-927 aboutAtlas_tmpl.html has hard-coded project version (Kalyanikashikar via yhemanth)
 ATLAS-624 UI: Clicking a tag hyperlink should always result in DSL search. In some cases,
results in full-text search. (Kalyanikashikar via yhemanth)
 ATLAS-950 Atlas should support Solr that requires Kerberos authentication (madhan.neethiraj
via yhemanth)


Mime
View raw message