Commit ab6e6420 by Suma Shivaprasad

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

parent 125cdf5a
......@@ -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>
......
......@@ -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 @@ angular.module('dgc.tags.instance').controller('CreateTagController', ['$scope',
});
};
$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 @@ 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>");
}
}
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;
......
......@@ -67,26 +67,25 @@ angular.module('dgc.tags.instance').controller('InstanceTagController', ['$scope
$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;
}
});
}
});
};
......
......@@ -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>
......
......@@ -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>
......
......@@ -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)
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)
......
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