New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #9798: UI to display tags #1421
Fixes #9798: UI to display tags #1421
Conversation
Commit modified |
65773e2
to
4cbe842
Compare
@@ -640,6 +716,8 @@ class RuleGrid( | |||
val t5 = System.currentTimeMillis | |||
TimingDebugLogger.trace(s"Rule grid: transforming into data: get rule data: callback: ${t5-t4}ms") | |||
|
|||
val tags = """[{"key":"environment","value":"production"},{"key":"customer","value":"Acme prod"}]""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should use the tag stored in the Rule object
@@ -218,7 +218,7 @@ object DisplayDirectiveTree extends Loggable { | |||
} | |||
val htmlId = s"jsTree-${directive.id.value}" | |||
override val attrs = ( | |||
("data-jstree" -> """{ "type" : "directive" }""") :: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should use the Tags stored in the directive object
@@ -385,6 +393,7 @@ function createRuleTable(gridId, data, needCheckbox, needActions, needCompliance | |||
|
|||
// Choose which columns should be included | |||
var columns = []; | |||
columns.push(tags); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you had pushed them at the end you would'nt have to change the filter column ;) but since it's done, it's ok!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will remember it ;)
@@ -523,6 +539,7 @@ function createRuleComplianceTable(gridId, data, contextPath, refresh) { | |||
, "oLanguage": { | |||
"sSearch": "" | |||
} | |||
, "columnDefs": [{ "visible": false, "targets": 0 }] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's in reporting table, is it hiding the first column ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I think I just forgot to delete this line!
</style> | ||
<link media="screen" href="/style/rudder/rudder-tags.css" rel="stylesheet" type="text/css"> | ||
<script type="text/javascript" src="/javascript/rudder/angular/filters.js"></script> | ||
<script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you put it in a file (directive.js or directive-filter.js)
Apart the small comments it seems ok ! |
@@ -0,0 +1,51 @@ | |||
var app = angular.module('tags', []); | |||
var xxxx; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This var should be remmoved, or renamed :)
Commit modified |
4cbe842
to
c620ecc
Compare
PR rebased |
c620ecc
to
41826a3
Compare
Commit modified |
41826a3
to
7babfe3
Compare
@@ -165,6 +165,7 @@ class RuleGrid( | |||
def asyncDisplayAllRules(onlyRules: Option[Set[RuleId]], showComplianceColumns: Boolean, showRecentChanges: Boolean) = { | |||
AnonFunc(SHtml.ajaxCall(JsNull, (s) => { | |||
|
|||
val defaultTag = Tags(Set(Tag(TagName("env"),TagValue("prod")))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove the default tags ?
""" | ||
<div id={htmlId_rulesGridZone}> | ||
<span class="error" id="ruleTableError">{errorProperty.getOrElse("")}</span> | ||
<div id={htmlId_modalReportsPopup} class="nodisplay"> | ||
<div id={htmlId_reportsPopup} ></div> | ||
</div> | ||
<div id="showFiltersRules" ng-controller="filterTagRuleCtrl" class="filters tw-bs" ng-cloak=""> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you put all of this in an html file and include it here ?
|
||
var listTags = tags | ||
def cfTagsConfiguration(controllerID:String) = | ||
<div class="row form-group" ng-controller={{controllerID}} ng-cloak="" > |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be better if html was in an html file and only modifying the ng-controller attribute using lift css selector (like we do for directive inputs"
Commit modified |
7babfe3
to
9f0d717
Compare
} | ||
|
||
// PLUGIN JSTREE : SEARCH-TAG | ||
$.jstree.plugins.searchtag = function (options, parent) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That Plugin should be in a separate file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added into common layout before tree.js
@@ -0,0 +1,533 @@ | |||
var app = angular.module('filters', []); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to add the license to the top of the fule
@@ -0,0 +1,68 @@ | |||
var app = angular.module('tags', []); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need license too
app.controller('tagsRuleCtrl', function ($scope, $http, $location, $timeout) { | ||
$scope.scopeFilter; | ||
|
||
$scope.init = function(treeId, tags){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need treeid ? ( I saw it as a constant )
} | ||
var temp; | ||
for (key in jsonTags){ | ||
temp = {'key':key, 'value':jsonTags[key]}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Temp should be declared here
@@ -0,0 +1,15 @@ | |||
$(document).ready(function(){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need license
We will treat those remarks in a new PR |
OK, merging this PR |
https://www.rudder-project.org/redmine/issues/9798