ATLAS-402 UI : Validation of Associating a Tag (darshankumar89 via sumasai)
diff --git a/dashboard/public/modules/search/views/search.html b/dashboard/public/modules/search/views/search.html
index 4bb59af..306fb27 100644
--- a/dashboard/public/modules/search/views/search.html
+++ b/dashboard/public/modules/search/views/search.html
@@ -73,7 +73,7 @@
<td class="addTag"><img ng-src="img/addTag.png" tooltip="Add Tag" ng-click="openAddTagHome(result['$id$'].id || result.guid)"></td>
</tr>
<tr ng-if="isTag(resultType)" ng-repeat="result in filteredResults track by $index">
- <td data-ng-if="isObject(result) && !isString(result) && res != 'id'" data-ng-repeat="res in transformedProperties track by $index">
+ <td data-ng-if="isObject(result) && !isString(result) && res != 'id'" data-ng-repeat="res in transformedProperties track by $index" class="wordBreak">
<a data-ng-if="res == 'guid'" data-ui-sref="details({id:result[res]})">{{result[res]}}</a>
diff --git a/dashboard/public/modules/tags/instance/createTagController.js b/dashboard/public/modules/tags/instance/createTagController.js
index b8e8c9f..28c0539 100644
--- a/dashboard/public/modules/tags/instance/createTagController.js
+++ b/dashboard/public/modules/tags/instance/createTagController.js
@@ -18,14 +18,14 @@
'use strict';
angular.module('dgc.tags.instance').controller('CreateTagController', ['$scope', 'DetailsResource', '$modalInstance', 'typesList', 'lodash', 'TagsResource', '$stateParams', '$rootScope', 'TagClasses', 'NotificationService',
- function($scope, DetailsResource, $modalInstance, typesList, _, TagsResource, $stateParams, $rootScope, Categories, NotificationService) {
+ function($scope, DetailsResource, $modalInstance, typesList, _, TagsResource, $stateParams, $rootScope, Categories) {
if (typesList) {
$scope.typesList = typesList;
}
var $$ = angular.element;
$scope.categoryList = Categories;
$scope.category = 'TRAIT';
-
+ $scope.isSuccess = false;
$scope.getAttributeDefinations = function() {
$scope.propertiesList = {};
$scope.isRequired = {};
@@ -59,6 +59,7 @@
});
};
$scope.ok = function($event, tagDefinitionform) {
+ $scope.isSuccess = false;
if (tagDefinitionform.$valid) {
var requestObject = {
"jsonClass": "org.apache.atlas.typesystem.json.InstanceSerialization$_Struct",
@@ -79,8 +80,8 @@
$$("#" + $stateParams.tId+"_schema").append("<a class='tabsearchanchor ng-binding ng-scope' data-ui-sref='search({query: " + tagName + "})' title='" + tagName + "' href='#!/search?query=" + tagName + "'>" + tagName + "<span> </span></a>");
}
}
- NotificationService.info('Tag "' + $scope.selectedType + '" has been added to entity', true);
- $modalInstance.close(true);
+ $scope.successmessage = 'Tag "' + $scope.selectedType + '" has been added to entity';
+ $scope.isSuccess = true;
}).catch(function(err) {
$scope.isError = true;
$scope.error = err.data.error;
diff --git a/dashboard/public/modules/tags/instance/instanceTagsController.js b/dashboard/public/modules/tags/instance/instanceTagsController.js
index 42e22dc..8341c10 100644
--- a/dashboard/public/modules/tags/instance/instanceTagsController.js
+++ b/dashboard/public/modules/tags/instance/instanceTagsController.js
@@ -67,26 +67,25 @@
$scope.detachTag = function($event, name) {
$scope.displayName = name;
- $$('#btnDelete').modal().on('click', function(e) {
- e.preventDefault();
- $$("#myModal").modal();
+ };
- DetailsResource.detachTag({
- id: $stateParams.id,
- tagName: name
- }, function(data) {
+ $scope.removeTag = function() {
+ $$("#myModal").modal();
+ var name = $scope.displayName;
+ DetailsResource.detachTag({
+ id: $stateParams.id,
+ tagName: name
+ }, function(data) {
- if (data.requestId !== undefined && data.GUID === $stateParams.id && data.traitName === name) {
- $$($event.currentTarget).closest('tr').remove();
- delete $scope.traitsList[name];
- if ($.isEmptyObject($scope.traitsList)) {
- $scope.noTags = true;
- } else {
- $scope.noTags = false;
- }
+ if (data.requestId !== undefined && data.GUID === $stateParams.id && data.traitName === name) {
+ $$("#" + name).remove();
+ delete $scope.traitsList[name];
+ if ($.isEmptyObject($scope.traitsList)) {
+ $scope.noTags = true;
+ } else {
+ $scope.noTags = false;
}
-
- });
+ }
});
};
diff --git a/dashboard/public/modules/tags/instance/views/createTag.html b/dashboard/public/modules/tags/instance/views/createTag.html
index 2184b56..d0e74a8 100644
--- a/dashboard/public/modules/tags/instance/views/createTag.html
+++ b/dashboard/public/modules/tags/instance/views/createTag.html
@@ -20,9 +20,12 @@
</div>
<div class="modal-body">
<div class="form-group">
- <div align="center" class="error col-sm-12 tabsearchResult pointer" title="{{error}}" ng-if="isError">
+ <div align="center" class="error col-sm-12 tabsearchResult pointer" title="{{error}}" ng-show="isError">
{{error}}
</div>
+ <div class="alert alert-success" ng-if="isSuccess" >
+ {{successmessage}}
+ </div>
</div>
<form name="tagDefinitionform" class="css-form" novalidate>
<div class="form-group hide">
@@ -40,7 +43,7 @@
<label class="control-label col-sm-4" for="tagDefinition">Tag definition</label>
<div class="col-sm-8 input-spacing">
<select ng-model="selectedType" class="form-control" id="tagDefinition" name="tagDefinition"
- ng-change="getAttributeDefinations(); isError =false" required>
+ ng-change="getAttributeDefinations(); isError =false; isSuccess=false;" required>
<option ng-repeat="data in typesList " title="{{data}}">{{data}}</option>
</select>
</div>
diff --git a/dashboard/public/modules/tags/instance/views/tags.html b/dashboard/public/modules/tags/instance/views/tags.html
index 64e922e..29f6583 100644
--- a/dashboard/public/modules/tags/instance/views/tags.html
+++ b/dashboard/public/modules/tags/instance/views/tags.html
@@ -30,7 +30,7 @@
</tr>
</thead>
<tbody>
- <tr ng-repeat="trait in traitsList" class="pointer" ng-if="!noTags">
+ <tr ng-repeat="trait in traitsList" class="pointer" ng-if="!noTags" id="{{trait.typeName}}">
<td class="col-lg-5" >
{{trait.typeName}}
</td>
@@ -56,7 +56,7 @@
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal" ng-click="cancel()">Close</button>
- <button type="button" id="btnDelete" class="btn btn-primary" data-dismiss="modal">Delete</button>
+ <button type="button" id="btnDelete" class="btn btn-primary" data-dismiss="modal" ng-click="removeTag()">Delete</button>
</div>
</div>
</div>
diff --git a/release-log.txt b/release-log.txt
index 25f1f78..8fc9ccf 100644
--- a/release-log.txt
+++ b/release-log.txt
@@ -9,6 +9,7 @@
ATLAS-47 Entity mutations for complex types (sumasai via shwethags)
ALL CHANGES:
+ATLAS-402 UI : Validation of Associating a Tag (darshankumar89 via sumasai)
ATLAS-395 UI : In details page maps not displayed for different data models (darshankumar89 via sumasai)
ATLAS-394 Fix BaseResourceIT.waitForNotification (shwethags via sumasai)
ATLAS-385 Support for Lineage for entities with SuperType as DataSet (anilsg via sumasai)