Commit b93e9f35 by Shwetha GS

ATLAS-311 UI: Local storage for traits - caching [not cleared on refresh] To be…

ATLAS-311 UI: Local storage for traits - caching [not cleared on refresh] To be cleared on time lapse for 1hr (Anilg via shwethags)
parent 64de5233
...@@ -17,107 +17,106 @@ ...@@ -17,107 +17,106 @@
*/ */
.add-tag { .add-tag {
margin-top: -50px; margin-top: -50px;
} }
.inputs input{ .inputs input {
height: 50px; height: 50px;
border-radius: 0px; border-radius: 0px;
border: 1px solid #e3e3e3; border: 1px solid #e3e3e3;
color: #414141; color: #414141;
box-shadow: none; box-shadow: none;
} }
.inputs .control-label{ .inputs .control-label {
padding: 15px; padding: 15px;
padding-top: 15px !important; padding-top: 15px !important;
} }
.inputs button.addAttr, .inputs button.saveAttr{ .inputs button.addAttr,
height: 40px; .inputs button.saveAttr {
border-radius: 4px; height: 40px;
border: 1px solid #FFFFFF; border-radius: 4px;
color: #fff; border: 1px solid #FFFFFF;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); color: #fff;
font-weight: bold; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
} font-weight: bold;
.inputs button.addAttr{ }
background-color: #ff8e00; .inputs button.addAttr {
} background-color: #ff8e00;
.inputs pre{ }
border: 0; .inputs pre {
border-top: 1px solid #ddd; border: 0;
border-radius: 0; border-top: 1px solid #ddd;
margin-bottom: 0; border-radius: 0;
background-color: #dff0d8; margin-bottom: 0;
border-color: #d6e9c6; background-color: #dff0d8;
} border-color: #d6e9c6;
.inputs button.remove{ }
position: absolute; .inputs button.remove {
right: 28px; position: absolute;
bottom: 12px; right: 28px;
color: #FFFFFF; bottom: 12px;
border: 0; color: #FFFFFF;
border-radius: 4px; border: 0;
background-color: #a94442; border-radius: 4px;
} background-color: #a94442;
.appForm .panel{ }
.appForm .panel {
border-radius: 0 !important; border-radius: 0 !important;
} }
.appForm .panel-footer{ .appForm .panel-footer {
margin-bottom: 0; margin-bottom: 0;
} }
.appForm .panel-body {
.appForm .panel-body{
padding-bottom: 0; padding-bottom: 0;
} }
.input-spacing {
.input-spacing{ padding-bottom: 10px!important;
padding-bottom: 10px!important;
} }
.create-tag-entity .modal-footer {
.create-tag-entity .modal-footer{ border-top: 0;
border-top: 0;
} }
.tag-list {
.tag-list{ border: 1px solid #ddd;
border:1px solid #ddd; padding: 10px;
padding:10px; background-color: #F5F5F5;
background-color: #F5F5F5;
} }
.tag-list ul {
.tag-list ul{ padding-left: 0px;
padding-left: 0px;
} }
.error {
.error{ color: red;
color:red;
} }
.tag-list ul li {
.tag-list ul li{ display: inline;
display: inline; line-height: 30px;
line-height: 30px; border: none;
border:none; padding: 2px;
padding: 2px; background-color: inherit;
background-color: inherit; padding-right: 20px !important;
padding-right: 20px !important;
} }
.addTag{ .addTag {
text-align: center; text-align: center;
} }
.addTag img{ .addTag img {
cursor: pointer; cursor: pointer;
} }
.searchResults td{ .searchResults td {
border: 0; border: 0;
} }
.tagalign{ .tagalign {
margin-top: 14px; margin-top: 14px;
} }
.tagsAdded{ .tagsAdded {
display: inline; display: inline;
} }
.noTags { .noTags {
font-size: 24px; font-size: 24px;
font-weight: bold; font-weight: bold;
text-align: center; text-align: center;
}
.mtop3 {
margin-top: 3px;
} }
.mrt-8 {
margin-right: -8px;
} }
\ No newline at end of file
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
*/ */
'use strict'; 'use strict';
angular.module('dgc.navigation').controller('NavigationController', ['$scope', 'NavigationResource', angular.module('dgc.navigation').controller('NavigationController', ['$scope', 'NavigationResource', '$cacheFactory',
function($scope, NavigationResource) { function($scope, NavigationResource, $cacheFactory) {
$scope.updateVar = function(event) { $scope.updateVar = function(event) {
$scope.$$prevSibling.query = angular.element(event.target).text(); $scope.$$prevSibling.query = angular.element(event.target).text();
...@@ -29,5 +29,16 @@ angular.module('dgc.navigation').controller('NavigationController', ['$scope', ' ...@@ -29,5 +29,16 @@ angular.module('dgc.navigation').controller('NavigationController', ['$scope', '
$scope.leftnav = NavigationResource.get(); $scope.leftnav = NavigationResource.get();
}); });
setTimeout(function() {
var httpDefaultCache = $cacheFactory.get('$http');
httpDefaultCache.remove('/api/atlas/types?type=TRAIT');
}, 3600000);
$scope.refreshTags = function(){
var httpDefaultCache = $cacheFactory.get('$http');
httpDefaultCache.remove('/api/atlas/types?type=TRAIT');
$scope.leftnav = NavigationResource.get();
};
} }
]); ]);
\ No newline at end of file
...@@ -24,6 +24,7 @@ angular.module('dgc.navigation').factory('NavigationResource', ['$resource', fun ...@@ -24,6 +24,7 @@ angular.module('dgc.navigation').factory('NavigationResource', ['$resource', fun
'method': 'GET', 'method': 'GET',
'responseType': 'json', 'responseType': 'json',
'isArray': true, 'isArray': true,
'cache' : true,
'transformResponse': function(data) { 'transformResponse': function(data) {
var results = []; var results = [];
angular.forEach(data && data.results, function(val) { angular.forEach(data && data.results, function(val) {
......
...@@ -16,9 +16,14 @@ ...@@ -16,9 +16,14 @@
~ limitations under the License. ~ limitations under the License.
--> -->
<div data-ng-controller="NavigationController" class="mainTags leftNavigation"> <div data-ng-controller="NavigationController" class="mainTags leftNavigation">
<h4>Tags</h4> <div>
<h4 class="pull-left">Tags</h4>
<a href ng-click="refreshTags()" class="pull-right"> <img src="../img/refresh.png" style="margin: 5px;" title="Refresh Tags" ></a>
</div>
</br>
</br>
<div class="list-group"> <div class="list-group">
<a ng-repeat="nav in leftnav" ui-sref="search({ query: nav })" class="list-group-item limitSize" title="{{nav}}"><i class="fa fa-tag"></i> {{nav}} </a> <a ng-repeat="nav in leftnav" ui-sref="search({ query: nav })" class="list-group-item limitSize" title="{{nav}}"><i class="fa fa-tag"></i> {{nav}} </a>
</div> </div>
</div> </div>
\ No newline at end of file
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
*/ */
'use strict'; 'use strict';
angular.module('dgc.tags.definition').controller('DefinitionTagsController', ['$scope', '$resource', '$state', '$stateParams', 'lodash', 'AttributeDefinition', 'TagClasses', 'TagsResource', 'NotificationService', 'NavigationResource', angular.module('dgc.tags.definition').controller('DefinitionTagsController', ['$scope', '$resource', '$state', '$stateParams', 'lodash', 'AttributeDefinition', 'TagClasses', 'TagsResource', 'NotificationService', 'NavigationResource', '$cacheFactory',
function($scope, $resource, $state, $stateParams, _, AttributeDefinition, Categories, TagsResource, NotificationService, NavigationResource) { function($scope, $resource, $state, $stateParams, _, AttributeDefinition, Categories, TagsResource, NotificationService, NavigationResource, $cacheFactory) {
$scope.categoryList = Categories; $scope.categoryList = Categories;
$scope.category = 'TRAIT'; $scope.category = 'TRAIT';
$scope.tagModel = { $scope.tagModel = {
...@@ -40,6 +40,12 @@ angular.module('dgc.tags.definition').controller('DefinitionTagsController', ['$ ...@@ -40,6 +40,12 @@ angular.module('dgc.tags.definition').controller('DefinitionTagsController', ['$
$scope.categoryInst = Categories[$scope.category].clearTags(); $scope.categoryInst = Categories[$scope.category].clearTags();
}; };
$scope.refreshTags = function(){
var httpDefaultCache = $cacheFactory.get('$http');
httpDefaultCache.remove('/api/atlas/types?type=TRAIT');
$scope.typesList = NavigationResource.get();
};
$scope.save = function saveTag(form) { $scope.save = function saveTag(form) {
$scope.savedTag = null; $scope.savedTag = null;
if (form.$valid) { if (form.$valid) {
...@@ -53,6 +59,8 @@ angular.module('dgc.tags.definition').controller('DefinitionTagsController', ['$ ...@@ -53,6 +59,8 @@ angular.module('dgc.tags.definition').controller('DefinitionTagsController', ['$
TagsResource.save($scope.categoryInst.toJson()).$promise TagsResource.save($scope.categoryInst.toJson()).$promise
.then(function TagCreateSuccess() { .then(function TagCreateSuccess() {
NotificationService.info('"' + $scope.tagModel.typeName + '" has been created', false); NotificationService.info('"' + $scope.tagModel.typeName + '" has been created', false);
var httpDefaultCache = $cacheFactory.get('$http');
httpDefaultCache.remove('/api/atlas/types?type=TRAIT');
}).catch(function TagCreateFailed(error) { }).catch(function TagCreateFailed(error) {
NotificationService.error(error.data.error, false); NotificationService.error(error.data.error, false);
}).finally(function() { }).finally(function() {
......
...@@ -41,11 +41,16 @@ ...@@ -41,11 +41,16 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-2" for="ParentTag">Parent Tag</label> <label class="control-label col-sm-2" for="ParentTag">Parent Tag</label>
<div class="col-sm-4"> <div class="col-sm-5 mrt-8">
<select ng-model="selectedParent" class="form-control h160" id="ParentTag" name="ParentTag" multiple> <select ng-model="selectedParent" class="form-control h160" id="ParentTag" name="ParentTag" multiple>
<option ng-repeat="data in typesList" title="{{data}}">{{data}}</option> <option ng-repeat="data in typesList" title="{{data}}">{{data}}</option>
</select> </select>
</div> </div>
<div class="mtop3">
<a href ng-click="refreshTags()" class="pull-left">
<img src="../img/refresh.png" title="Refreh parent tag list">
</a>
</div>
</div> </div>
<ng-form name="attributeForm"> <ng-form name="attributeForm">
<div class="form-group" data-ng-class="{'has-error': attributeForm.name.$invalid && attributeForm.name.$dirty}" <div class="form-group" data-ng-class="{'has-error': attributeForm.name.$invalid && attributeForm.name.$dirty}"
......
...@@ -7,6 +7,7 @@ ATLAS-409 Atlas will not import avro tables with schema read from a file (dosset ...@@ -7,6 +7,7 @@ ATLAS-409 Atlas will not import avro tables with schema read from a file (dosset
ATLAS-379 Create sqoop and falcon metadata addons (venkatnrangan,bvellanki,sowmyaramesh via shwethags) ATLAS-379 Create sqoop and falcon metadata addons (venkatnrangan,bvellanki,sowmyaramesh via shwethags)
ALL CHANGES: ALL CHANGES:
ATLAS-311 UI: Local storage for traits - caching [not cleared on refresh] To be cleared on time lapse for 1hr (Anilg via shwethags)
ATLAS-106 Store createTimestamp and modified timestamp separately for an entity (dkantor via shwethags) ATLAS-106 Store createTimestamp and modified timestamp separately for an entity (dkantor via shwethags)
ATLAS-433 Fix checkstyle issues for common and notification module (shwethags) ATLAS-433 Fix checkstyle issues for common and notification module (shwethags)
ATLAS-183 Add a Hook in Storm to post the topology metadata (svenkat,yhemanth via shwethags) ATLAS-183 Add a Hook in Storm to post the topology metadata (svenkat,yhemanth via shwethags)
......
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