Commit 7464051fdfcec4942804e40f8299f71725851541

Authored by Renato De Donato
1 parent 7487ff51

not contains

controllets/filters-controllet/filters-controllet.html
@@ -132,7 +132,8 @@ @@ -132,7 +132,8 @@
132 </paper-dropdown-menu> 132 </paper-dropdown-menu>
133 </th> 133 </th>
134 <th> 134 <th>
135 - <paper-input id="filter_value" label="Value" class="base_input" maxlength="16" auto-validate pattern="^[_a-zA-Z0-9]*" error-message="Invalid value!"></paper-input> 135 + <paper-input id="filter_value" label="Value" class="base_input" maxlength="32" auto-validate pattern="^[.:,;+-_ a-zA-Z0-9]*" error-message="Invalid value!"></paper-input>
  136 + <!--"^[_a-zA-Z0-9]*"-->
136 </th> 137 </th>
137 <th class="filters_cell_button"> 138 <th class="filters_cell_button">
138 <paper-icon-button on-click="_addFilter" icon="add-circle" class="add"></paper-icon-button> 139 <paper-icon-button on-click="_addFilter" icon="add-circle" class="add"></paper-icon-button>
@@ -169,7 +170,7 @@ @@ -169,7 +170,7 @@
169 170
170 operations : { 171 operations : {
171 type : Array, 172 type : Array,
172 - value : ["=", "!=", ">", ">=", "<", "<=", "contains", "start", "ends"] 173 + value : ["=", "!=", ">", ">=", "<", "<=", "contains", "not contains", "start", "ends"]
173 }, 174 },
174 175
175 filters : { 176 filters : {
@@ -257,6 +258,8 @@ @@ -257,6 +258,8 @@
257 }, 258 },
258 259
259 _getOperationlName: function(operation) { 260 _getOperationlName: function(operation) {
  261 + if(operation.indexOf("not") > -1)
  262 + return ln["notContains_" + ln["localization"]];
260 if(operation.indexOf("contains") > -1) 263 if(operation.indexOf("contains") > -1)
261 return ln["contains_" + ln["localization"]]; 264 return ln["contains_" + ln["localization"]];
262 if(operation.indexOf("start") > -1) 265 if(operation.indexOf("start") > -1)
datalets/base-ajax-json-alasql-datalet/static/js/AjaxJsonAlasqlBehavior.js
@@ -119,6 +119,8 @@ var AjaxJsonAlasqlBehavior = { @@ -119,6 +119,8 @@ var AjaxJsonAlasqlBehavior = {
119 for (var i=0; i < filters.length; i++) { 119 for (var i=0; i < filters.length; i++) {
120 if(filters[i]["operation"] == "contains") 120 if(filters[i]["operation"] == "contains")
121 where += filters[i]["field"] + " like '%" + filters[i]["value"] + "%' AND "; 121 where += filters[i]["field"] + " like '%" + filters[i]["value"] + "%' AND ";
  122 + else if(filters[i]["operation"] == "not contains")
  123 + where += filters[i]["field"] + " not like '%" + filters[i]["value"] + "%' AND ";
122 else if(filters[i]["operation"] == "start") 124 else if(filters[i]["operation"] == "start")
123 where += filters[i]["field"] + " like '" + filters[i]["value"] + "%' AND "; 125 where += filters[i]["field"] + " like '" + filters[i]["value"] + "%' AND ";
124 else if(filters[i]["operation"] == "ends") 126 else if(filters[i]["operation"] == "ends")
locales/controllet_ln.js
@@ -34,6 +34,7 @@ ln[&quot;filterField_en&quot;] = &quot;Field&quot;; @@ -34,6 +34,7 @@ ln[&quot;filterField_en&quot;] = &quot;Field&quot;;
34 ln["filterOperation_en"] = "Operation"; 34 ln["filterOperation_en"] = "Operation";
35 ln["filterValue_en"] = "Value"; 35 ln["filterValue_en"] = "Value";
36 ln["contains_en"] = "contains"; 36 ln["contains_en"] = "contains";
  37 +ln["notContains_en"] = "not contains";
37 ln["start_en"] = "start with"; 38 ln["start_en"] = "start with";
38 ln["ends_en"] = "ends with"; 39 ln["ends_en"] = "ends with";
39 40
@@ -148,6 +149,7 @@ ln[&quot;filterField_it&quot;] = &quot;Campo&quot;; @@ -148,6 +149,7 @@ ln[&quot;filterField_it&quot;] = &quot;Campo&quot;;
148 ln["filterOperation_it"] = "Operazione"; 149 ln["filterOperation_it"] = "Operazione";
149 ln["filterValue_it"] = "Valore"; 150 ln["filterValue_it"] = "Valore";
150 ln["contains_it"] = "contiene"; 151 ln["contains_it"] = "contiene";
  152 +ln["notContains_it"] = "non contiene";
151 ln["start_it"] = "inizia con"; 153 ln["start_it"] = "inizia con";
152 ln["ends_it"] = "finisce con"; 154 ln["ends_it"] = "finisce con";
153 155
@@ -262,6 +264,7 @@ ln[&quot;filterField_fr&quot;] = &quot;Field&quot;; @@ -262,6 +264,7 @@ ln[&quot;filterField_fr&quot;] = &quot;Field&quot;;
262 ln["filterOperation_fr"] = "Operation"; 264 ln["filterOperation_fr"] = "Operation";
263 ln["filterValue_fr"] = "Value"; 265 ln["filterValue_fr"] = "Value";
264 ln["contains_fr"] = "contains"; 266 ln["contains_fr"] = "contains";
  267 +ln["notContains_fr"] = "not contains";
265 ln["start_fr"] = "start with"; 268 ln["start_fr"] = "start with";
266 ln["ends_fr"] = "ends with"; 269 ln["ends_fr"] = "ends with";
267 270
@@ -376,6 +379,7 @@ ln[&quot;filterField_nl&quot;] = &quot;Field&quot;; @@ -376,6 +379,7 @@ ln[&quot;filterField_nl&quot;] = &quot;Field&quot;;
376 ln["filterOperation_nl"] = "Operation"; 379 ln["filterOperation_nl"] = "Operation";
377 ln["filterValue_nl"] = "Value"; 380 ln["filterValue_nl"] = "Value";
378 ln["contains_nl"] = "contains"; 381 ln["contains_nl"] = "contains";
  382 +ln["notContains_nl"] = "not contains";
379 ln["start_nl"] = "start with"; 383 ln["start_nl"] = "start with";
380 ln["ends_nl"] = "ends with"; 384 ln["ends_nl"] = "ends with";
381 385