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 2017/09/22 13:19:31 UTC
[3/3] atlas git commit: ATLAS-2162 : Add hyperlink for URI formatted
attribute value on property table
ATLAS-2162 : Add hyperlink for URI formatted attribute value on property table
Signed-off-by: kevalbhatt <kb...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/4149b55b
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/4149b55b
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/4149b55b
Branch: refs/heads/branch-0.8
Commit: 4149b55b18083ac1e41214aea3614df7a6fdf0d8
Parents: 6d9a0e6
Author: pratik pandey <pr...@freestoneinfotech.com>
Authored: Fri Sep 22 12:53:13 2017 +0530
Committer: kevalbhatt <kb...@apache.org>
Committed: Fri Sep 22 18:49:02 2017 +0530
----------------------------------------------------------------------
dashboardv2/public/css/scss/theme.scss | 7 ++++++-
dashboardv2/public/js/utils/CommonViewFunction.js | 12 ++++++++++--
dashboardv2/public/js/utils/Utils.js | 5 +++++
3 files changed, 21 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/atlas/blob/4149b55b/dashboardv2/public/css/scss/theme.scss
----------------------------------------------------------------------
diff --git a/dashboardv2/public/css/scss/theme.scss b/dashboardv2/public/css/scss/theme.scss
index dc56148..a691d17 100644
--- a/dashboardv2/public/css/scss/theme.scss
+++ b/dashboardv2/public/css/scss/theme.scss
@@ -130,7 +130,7 @@ a {
}
}
-a[href^="#!/"]:not(.btn, .not-blue-link) {
+.blue-link {
color: $color_havelock_blue_approx;
&:focus {
color: $color_havelock_blue_approx;
@@ -143,6 +143,11 @@ a[href^="#!/"]:not(.btn, .not-blue-link) {
}
}
+a[href^="#!/"]:not(.btn, .not-blue-link) {
+ @extend .blue-link;
+}
+
+
th {
text-transform: capitalize;
}
http://git-wip-us.apache.org/repos/asf/atlas/blob/4149b55b/dashboardv2/public/js/utils/CommonViewFunction.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/utils/CommonViewFunction.js b/dashboardv2/public/js/utils/CommonViewFunction.js
index 0fa8506..de5856c 100644
--- a/dashboardv2/public/js/utils/CommonViewFunction.js
+++ b/dashboardv2/public/js/utils/CommonViewFunction.js
@@ -216,10 +216,18 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
keyValue = extractObject(keyValue)
}
}
+ var val = "";
+ if (_.isObject(valueObject[key])) {
+ val = keyValue
+ } else if (Utils.isUrl(keyValue)) {
+ val = '<a target="_blank" class="blue-link" href="' + keyValue + '">' + keyValue + '</a>';
+ } else {
+ val = _.escape(keyValue);
+ }
if (isTable) {
- table += '<tr><td>' + _.escape(key) + '</td><td><div ' + (_.isObject(valueObject[key]) ? 'class="scroll-y"' : '') + '>' + (_.isObject(valueObject[key]) ? keyValue : _.escape(keyValue)) + '</div></td></tr>';
+ table += '<tr><td>' + _.escape(key) + '</td><td><div ' + (_.isObject(valueObject[key]) ? 'class="scroll-y"' : '') + '>' + val + '</div></td></tr>';
} else {
- table += '<div>' + (_.isObject(valueObject[key]) ? keyValue : _.escape(keyValue)) + '</div>';
+ table += '<div>' + val + '</div>';
}
});
http://git-wip-us.apache.org/repos/asf/atlas/blob/4149b55b/dashboardv2/public/js/utils/Utils.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/utils/Utils.js b/dashboardv2/public/js/utils/Utils.js
index 0e2b489..1de2106 100644
--- a/dashboardv2/public/js/utils/Utils.js
+++ b/dashboardv2/public/js/utils/Utils.js
@@ -41,6 +41,7 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
return options.el.popover(_.extend({
placement: 'auto bottom',
html: true,
+ animation: false,
template: '<div class="popover fixed-popover fade bottom"><div class="arrow"></div><h3 class="popover-title"></h3><div class="' + (options.contentClass ? options.contentClass : '') + ' popover-content"></div></div>'
}, options.popoverOptions));
}
@@ -642,6 +643,10 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
}
}
}
+ Utils.isUrl = function(url) {
+ var regexp = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/
+ return regexp.test(url);
+ }
$.fn.toggleAttribute = function(attributeName, firstString, secondString) {
if (this.attr(attributeName) == firstString) {
this.attr(attributeName, secondString);