Skip to content

Commit

Permalink
ATLAS-214 and ATLAS-219 - hive_table schema display , Add ability to …
Browse files Browse the repository at this point in the history
…detach trait from the entity
  • Loading branch information
AnilGayakwad authored and DarshanKumar89 committed Nov 3, 2015
1 parent 69185f2 commit 8cadfd7
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 3 deletions.
9 changes: 9 additions & 0 deletions dashboard/public/css/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
1 change: 1 addition & 0 deletions dashboard/public/css/tags.css
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
border:none;
padding: 2px;
background-color: inherit;
padding-right: 20px !important;
}
.addTag{
text-align: center;
Expand Down
2 changes: 1 addition & 1 deletion dashboard/public/modules/details/detailsController.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});

Expand Down
4 changes: 4 additions & 0 deletions dashboard/public/modules/details/detailsResource.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
});

Expand Down
20 changes: 20 additions & 0 deletions dashboard/public/modules/tags/instance/instanceTagsController.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions dashboard/public/modules/tags/instance/views/tags.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
<div class="container tag-list wordBreak">
<h4>Tags</h4>
<ul>
<li ng-repeat="trait in traitsList" class="list-group-item pointer tabsearchanchor" popover="{{trait.values}}" popover-title="{{trait.typeName}} Values" popover-trigger="mouseenter" >
{{trait.typeName}} </li>
<li ng-repeat="trait in traitsList" class="list-group-item pointer tabsearchanchor maxwidth125px" popover="{{trait.values}}" popover-title="{{trait.typeName}} Values" popover-trigger="mouseenter" >
{{trait.typeName}} <a href="" class="anchorAbsolute" ng-click="detachTag($event, trait.typeName)"> <i class="fa fa-times"></i> </a> </li>

<li class="list-group-item"><a ng-click="openAddTag()" href=""
class="add-tag btn btn-primary">Add tag</a></li>
Expand Down

0 comments on commit 8cadfd7

Please sign in to comment.