From 8cadfd727809a812a557fc81b646abee9f66d5d2 Mon Sep 17 00:00:00 2001 From: Anilsg Date: Mon, 2 Nov 2015 21:16:25 +0530 Subject: [PATCH] ATLAS-214 and ATLAS-219 - hive_table schema display , Add ability to detach trait from the entity --- dashboard/public/css/common.css | 9 +++++++++ dashboard/public/css/tags.css | 1 + .../modules/details/detailsController.js | 2 +- .../public/modules/details/detailsResource.js | 4 ++++ .../tags/instance/instanceTagsController.js | 20 +++++++++++++++++++ .../modules/tags/instance/views/tags.html | 4 ++-- 6 files changed, 37 insertions(+), 3 deletions(-) diff --git a/dashboard/public/css/common.css b/dashboard/public/css/common.css index fa5974ba9..1d50f8f2b 100644 --- a/dashboard/public/css/common.css +++ b/dashboard/public/css/common.css @@ -337,3 +337,12 @@ Tags on Home Page design white-space: nowrap; text-transform: capitalize; } + +.maxwidth125px { + max-width: 125px !important; +} + +.anchorAbsolute { + position: absolute; + right: 4px; +} \ No newline at end of file diff --git a/dashboard/public/css/tags.css b/dashboard/public/css/tags.css index 50dfbbfa9..4601be9ff 100644 --- a/dashboard/public/css/tags.css +++ b/dashboard/public/css/tags.css @@ -97,6 +97,7 @@ border:none; padding: 2px; background-color: inherit; + padding-right: 20px !important; } .addTag{ text-align: center; diff --git a/dashboard/public/modules/details/detailsController.js b/dashboard/public/modules/details/detailsController.js index 3a1dc2433..ddd2a11d6 100644 --- a/dashboard/public/modules/details/detailsController.js +++ b/dashboard/public/modules/details/detailsController.js @@ -30,7 +30,7 @@ angular.module('dgc.details').controller('DetailsController', ['$window', '$scop console.log(data); $scope.schemas = data; $scope.tableName = data.values.name; - $scope.isTable = data.typeName === 'Table'; + $scope.isTable = (typeof data.typeName != 'undefined' && data.typeName.toLowerCase().indexOf('table') != -1) ? true : false; $scope.onActivate('io'); }); diff --git a/dashboard/public/modules/details/detailsResource.js b/dashboard/public/modules/details/detailsResource.js index a76559547..0c28edde8 100644 --- a/dashboard/public/modules/details/detailsResource.js +++ b/dashboard/public/modules/details/detailsResource.js @@ -32,6 +32,10 @@ angular.module('dgc.details').factory('DetailsResource', ['$resource', function( saveTag: { method: 'POST', url: '/api/atlas/entity/:id/traits' + }, + detachTag : { + method: 'DELETE', + url: '/api/atlas/entity/:id/traits/:tagName' } }); diff --git a/dashboard/public/modules/tags/instance/instanceTagsController.js b/dashboard/public/modules/tags/instance/instanceTagsController.js index 69a44baf6..81b8299f4 100644 --- a/dashboard/public/modules/tags/instance/instanceTagsController.js +++ b/dashboard/public/modules/tags/instance/instanceTagsController.js @@ -48,6 +48,26 @@ angular.module('dgc.tags.instance').controller('InstanceTagController', ['$scope id: $scope.id }); }; + + $scope.detachTag = function($event, name) { + var r = confirm("Please confirm delete."); + if (r == true) { + DetailsResource.detachTag({ + id: $stateParams.id, + tagName: name + }, function(data) { + console.log("Detached Tag"); + console.log(data); + + if (data.requestId != undefined && data.GUID == $stateParams.id && data.traitName == name) { + var curent = $event.currentTarget; + curent.parentElement.remove(); + $(".popover").remove(); + } + }); + } + }; + getResourceData(); $scope.$on('refreshResourceData', getResourceData); } diff --git a/dashboard/public/modules/tags/instance/views/tags.html b/dashboard/public/modules/tags/instance/views/tags.html index d41da408d..c0436023b 100644 --- a/dashboard/public/modules/tags/instance/views/tags.html +++ b/dashboard/public/modules/tags/instance/views/tags.html @@ -19,8 +19,8 @@

Tags