Commit ab6e6420 by Suma Shivaprasad

ATLAS-402 UI : Validation of Associating a Tag (darshankumar89 via sumasai)

parent 125cdf5a
...@@ -73,7 +73,7 @@ ...@@ -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> <td class="addTag"><img ng-src="img/addTag.png" tooltip="Add Tag" ng-click="openAddTagHome(result['$id$'].id || result.guid)"></td>
</tr> </tr>
<tr ng-if="isTag(resultType)" ng-repeat="result in filteredResults track by $index"> <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> <a data-ng-if="res == 'guid'" data-ui-sref="details({id:result[res]})">{{result[res]}}</a>
......
...@@ -18,14 +18,14 @@ ...@@ -18,14 +18,14 @@
'use strict'; 'use strict';
angular.module('dgc.tags.instance').controller('CreateTagController', ['$scope', 'DetailsResource', '$modalInstance', 'typesList', 'lodash', 'TagsResource', '$stateParams', '$rootScope', 'TagClasses', 'NotificationService', 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) { if (typesList) {
$scope.typesList = typesList; $scope.typesList = typesList;
} }
var $$ = angular.element; var $$ = angular.element;
$scope.categoryList = Categories; $scope.categoryList = Categories;
$scope.category = 'TRAIT'; $scope.category = 'TRAIT';
$scope.isSuccess = false;
$scope.getAttributeDefinations = function() { $scope.getAttributeDefinations = function() {
$scope.propertiesList = {}; $scope.propertiesList = {};
$scope.isRequired = {}; $scope.isRequired = {};
...@@ -59,6 +59,7 @@ angular.module('dgc.tags.instance').controller('CreateTagController', ['$scope', ...@@ -59,6 +59,7 @@ angular.module('dgc.tags.instance').controller('CreateTagController', ['$scope',
}); });
}; };
$scope.ok = function($event, tagDefinitionform) { $scope.ok = function($event, tagDefinitionform) {
$scope.isSuccess = false;
if (tagDefinitionform.$valid) { if (tagDefinitionform.$valid) {
var requestObject = { var requestObject = {
"jsonClass": "org.apache.atlas.typesystem.json.InstanceSerialization$_Struct", "jsonClass": "org.apache.atlas.typesystem.json.InstanceSerialization$_Struct",
...@@ -79,8 +80,8 @@ angular.module('dgc.tags.instance').controller('CreateTagController', ['$scope', ...@@ -79,8 +80,8 @@ angular.module('dgc.tags.instance').controller('CreateTagController', ['$scope',
$$("#" + $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>"); $$("#" + $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); $scope.successmessage = 'Tag "' + $scope.selectedType + '" has been added to entity';
$modalInstance.close(true); $scope.isSuccess = true;
}).catch(function(err) { }).catch(function(err) {
$scope.isError = true; $scope.isError = true;
$scope.error = err.data.error; $scope.error = err.data.error;
......
...@@ -67,26 +67,25 @@ angular.module('dgc.tags.instance').controller('InstanceTagController', ['$scope ...@@ -67,26 +67,25 @@ angular.module('dgc.tags.instance').controller('InstanceTagController', ['$scope
$scope.detachTag = function($event, name) { $scope.detachTag = function($event, name) {
$scope.displayName = name; $scope.displayName = name;
$$('#btnDelete').modal().on('click', function(e) { };
e.preventDefault();
$$("#myModal").modal();
DetailsResource.detachTag({ $scope.removeTag = function() {
id: $stateParams.id, $$("#myModal").modal();
tagName: name var name = $scope.displayName;
}, function(data) { DetailsResource.detachTag({
id: $stateParams.id,
tagName: name
}, function(data) {
if (data.requestId !== undefined && data.GUID === $stateParams.id && data.traitName === name) { if (data.requestId !== undefined && data.GUID === $stateParams.id && data.traitName === name) {
$$($event.currentTarget).closest('tr').remove(); $$("#" + name).remove();
delete $scope.traitsList[name]; delete $scope.traitsList[name];
if ($.isEmptyObject($scope.traitsList)) { if ($.isEmptyObject($scope.traitsList)) {
$scope.noTags = true; $scope.noTags = true;
} else { } else {
$scope.noTags = false; $scope.noTags = false;
}
} }
}
});
}); });
}; };
......
...@@ -20,9 +20,12 @@ ...@@ -20,9 +20,12 @@
</div> </div>
<div class="modal-body"> <div class="modal-body">
<div class="form-group"> <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}} {{error}}
</div> </div>
<div class="alert alert-success" ng-if="isSuccess" >
{{successmessage}}
</div>
</div> </div>
<form name="tagDefinitionform" class="css-form" novalidate> <form name="tagDefinitionform" class="css-form" novalidate>
<div class="form-group hide"> <div class="form-group hide">
...@@ -40,7 +43,7 @@ ...@@ -40,7 +43,7 @@
<label class="control-label col-sm-4" for="tagDefinition">Tag definition</label> <label class="control-label col-sm-4" for="tagDefinition">Tag definition</label>
<div class="col-sm-8 input-spacing"> <div class="col-sm-8 input-spacing">
<select ng-model="selectedType" class="form-control" id="tagDefinition" name="tagDefinition" <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> <option ng-repeat="data in typesList " title="{{data}}">{{data}}</option>
</select> </select>
</div> </div>
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
</tr> </tr>
</thead> </thead>
<tbody> <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" > <td class="col-lg-5" >
{{trait.typeName}} {{trait.typeName}}
</td> </td>
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal" ng-click="cancel()">Close</button> <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> </div>
</div> </div>
......
...@@ -15,6 +15,7 @@ ATLAS-3 Mixed Index creation fails with Date types (sumasai via shwethags) ...@@ -15,6 +15,7 @@ ATLAS-3 Mixed Index creation fails with Date types (sumasai via shwethags)
ATLAS-47 Entity mutations for complex types (sumasai via shwethags) ATLAS-47 Entity mutations for complex types (sumasai via shwethags)
ALL CHANGES: 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-395 UI : In details page maps not displayed for different data models (darshankumar89 via sumasai)
ATLAS-394 Fix BaseResourceIT.waitForNotification (shwethags via sumasai) ATLAS-394 Fix BaseResourceIT.waitForNotification (shwethags via sumasai)
ATLAS-385 Support for Lineage for entities with SuperType as DataSet (anilsg via sumasai) ATLAS-385 Support for Lineage for entities with SuperType as DataSet (anilsg via sumasai)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment