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
......@@ -19,18 +19,19 @@
.add-tag {
margin-top: -50px;
}
.inputs input{
.inputs input {
height: 50px;
border-radius: 0px;
border: 1px solid #e3e3e3;
color: #414141;
box-shadow: none;
}
.inputs .control-label{
.inputs .control-label {
padding: 15px;
padding-top: 15px !important;
}
.inputs button.addAttr, .inputs button.saveAttr{
.inputs button.addAttr,
.inputs button.saveAttr {
height: 40px;
border-radius: 4px;
border: 1px solid #FFFFFF;
......@@ -38,10 +39,10 @@
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
font-weight: bold;
}
.inputs button.addAttr{
.inputs button.addAttr {
background-color: #ff8e00;
}
.inputs pre{
.inputs pre {
border: 0;
border-top: 1px solid #ddd;
border-radius: 0;
......@@ -49,7 +50,7 @@
background-color: #dff0d8;
border-color: #d6e9c6;
}
.inputs button.remove{
.inputs button.remove {
position: absolute;
right: 28px;
bottom: 12px;
......@@ -58,66 +59,64 @@
border-radius: 4px;
background-color: #a94442;
}
.appForm .panel{
.appForm .panel {
border-radius: 0 !important;
}
.appForm .panel-footer{
.appForm .panel-footer {
margin-bottom: 0;
}
.appForm .panel-body{
.appForm .panel-body {
padding-bottom: 0;
}
.input-spacing{
.input-spacing {
padding-bottom: 10px!important;
}
.create-tag-entity .modal-footer{
.create-tag-entity .modal-footer {
border-top: 0;
}
.tag-list{
border:1px solid #ddd;
padding:10px;
.tag-list {
border: 1px solid #ddd;
padding: 10px;
background-color: #F5F5F5;
}
.tag-list ul{
.tag-list ul {
padding-left: 0px;
}
.error{
color:red;
.error {
color: red;
}
.tag-list ul li{
.tag-list ul li {
display: inline;
line-height: 30px;
border:none;
border: none;
padding: 2px;
background-color: inherit;
padding-right: 20px !important;
}
.addTag{
.addTag {
text-align: center;
}
.addTag img{
.addTag img {
cursor: pointer;
}
.searchResults td{
.searchResults td {
border: 0;
}
.tagalign{
.tagalign {
margin-top: 14px;
}
.tagsAdded{
.tagsAdded {
display: inline;
}
.noTags {
font-size: 24px;
font-weight: bold;
text-align: center;
}
.mtop3 {
margin-top: 3px;
}
.mrt-8 {
margin-right: -8px;
}
\ No newline at end of file
......@@ -17,8 +17,8 @@
*/
'use strict';
angular.module('dgc.navigation').controller('NavigationController', ['$scope', 'NavigationResource',
function($scope, NavigationResource) {
angular.module('dgc.navigation').controller('NavigationController', ['$scope', 'NavigationResource', '$cacheFactory',
function($scope, NavigationResource, $cacheFactory) {
$scope.updateVar = function(event) {
$scope.$$prevSibling.query = angular.element(event.target).text();
......@@ -29,5 +29,16 @@ angular.module('dgc.navigation').controller('NavigationController', ['$scope', '
$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
'method': 'GET',
'responseType': 'json',
'isArray': true,
'cache' : true,
'transformResponse': function(data) {
var results = [];
angular.forEach(data && data.results, function(val) {
......
......@@ -17,7 +17,12 @@
-->
<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">
<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>
......
......@@ -17,8 +17,8 @@
*/
'use strict';
angular.module('dgc.tags.definition').controller('DefinitionTagsController', ['$scope', '$resource', '$state', '$stateParams', 'lodash', 'AttributeDefinition', 'TagClasses', 'TagsResource', 'NotificationService', 'NavigationResource',
function($scope, $resource, $state, $stateParams, _, AttributeDefinition, Categories, 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, $cacheFactory) {
$scope.categoryList = Categories;
$scope.category = 'TRAIT';
$scope.tagModel = {
......@@ -40,6 +40,12 @@ angular.module('dgc.tags.definition').controller('DefinitionTagsController', ['$
$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.savedTag = null;
if (form.$valid) {
......@@ -53,6 +59,8 @@ angular.module('dgc.tags.definition').controller('DefinitionTagsController', ['$
TagsResource.save($scope.categoryInst.toJson()).$promise
.then(function TagCreateSuccess() {
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) {
NotificationService.error(error.data.error, false);
}).finally(function() {
......
......@@ -41,11 +41,16 @@
</div>
<div class="form-group">
<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>
<option ng-repeat="data in typesList" title="{{data}}">{{data}}</option>
</select>
</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>
<ng-form name="attributeForm">
<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
ATLAS-379 Create sqoop and falcon metadata addons (venkatnrangan,bvellanki,sowmyaramesh via shwethags)
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-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)
......
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