Commit e31934c06014eb74966cc18c813a0e5dddb702d8
1 parent
efb059b1
group by bug fix
Showing
3 changed files
with
36 additions
and
33 deletions
controllets/datalet-selection-controllet/datalet-selection-controllet.html
| ... | ... | @@ -232,7 +232,7 @@ |
| 232 | 232 | </paper-menu> |
| 233 | 233 | </paper-dropdown-menu> |
| 234 | 234 | <div class="info_button"> |
| 235 | - <paper-icon-button id="gb" on-click="_addOrder" icon="unfold-more" title="unsort"></paper-icon-button> | |
| 235 | + <paper-icon-button id="gb" on-click="_addOrder" icon="unfold-more" title=""></paper-icon-button> | |
| 236 | 236 | </div> |
| 237 | 237 | </div> |
| 238 | 238 | |
| ... | ... | @@ -250,7 +250,7 @@ |
| 250 | 250 | </paper-menu> |
| 251 | 251 | </paper-dropdown-menu> |
| 252 | 252 | <div class="info_button"> |
| 253 | - <paper-icon-button id={{_fieldName(item)}} on-click="_addOrder" icon="unfold-more" title="unsort"></paper-icon-button> | |
| 253 | + <paper-icon-button id={{_fieldName(item)}} on-click="_addOrder" icon="unfold-more" title=""></paper-icon-button> | |
| 254 | 254 | </div> |
| 255 | 255 | </div> |
| 256 | 256 | </template> |
| ... | ... | @@ -439,24 +439,34 @@ |
| 439 | 439 | |
| 440 | 440 | _showGroupedFields : function(e) { |
| 441 | 441 | var index = e.target.id; |
| 442 | - var isSelected = false; | |
| 443 | 442 | var temp = []; |
| 444 | 443 | |
| 444 | +// var isSelected = false; | |
| 445 | +// for (var i = 0; i < this.selectedFields.length; i++) { | |
| 446 | +// if (this.selectedFields[i]) { | |
| 447 | +// if (this.selectedFields[i].indexOf(this.fields[index]) > -1) { | |
| 448 | +// isSelected = true; | |
| 449 | +// } | |
| 450 | +// else { | |
| 451 | +// temp.push(this.selectedFields[i]); | |
| 452 | +// } | |
| 453 | +// } | |
| 454 | +// } | |
| 455 | +// | |
| 456 | +// if (isSelected) | |
| 457 | +// this.groupedFields = this._copy(temp); | |
| 458 | +// else | |
| 459 | +// this.groupedFields =[]; | |
| 460 | + | |
| 445 | 461 | for (var i = 0; i < this.selectedFields.length; i++) { |
| 446 | 462 | if (this.selectedFields[i]) { |
| 447 | - if (this.selectedFields[i].indexOf(this.fields[index]) > -1) { | |
| 448 | - isSelected = true; | |
| 449 | - } | |
| 450 | - else { | |
| 451 | - temp.push(this.selectedFields[i]) | |
| 463 | + if (i != index) { | |
| 464 | + temp.push(this.selectedFields[i]); | |
| 452 | 465 | } |
| 453 | 466 | } |
| 454 | 467 | } |
| 455 | 468 | |
| 456 | - if (isSelected) | |
| 457 | - this.groupedFields = this._copy(temp); | |
| 458 | - else | |
| 459 | - this.groupedFields =[]; | |
| 469 | + this.groupedFields = this._copy(temp); | |
| 460 | 470 | |
| 461 | 471 | this.async(function() { |
| 462 | 472 | var ddls = document.getElementsByTagName("paper-dropdown-menu"); |
| ... | ... | @@ -566,22 +576,13 @@ |
| 566 | 576 | this.selectedDatalet = this.preselectedDatalet; |
| 567 | 577 | this.selectedFields = this._copy(this.fields); |
| 568 | 578 | |
| 569 | - | |
| 570 | -// this.params["filters"] = JSON.stringify(this.filters); | |
| 571 | -// this.params["aggregators"] = JSON.stringify(this.aggregators); | |
| 572 | -// this.params["orders"] = JSON.stringify(this.orders); | |
| 573 | - | |
| 574 | -// this.filters = JSON.parse(this.dataletPreset["filters"]);/*no?*/ | |
| 579 | +// this.filters = JSON.parse(this.dataletPreset["filters"]); | |
| 575 | 580 | // this.aggregators = JSON.parse(this.dataletPreset["aggregators"]); |
| 576 | 581 | // this.orders = JSON.parse(this.dataletPreset["orders"]); |
| 577 | 582 | |
| 578 | - /*sss*/ | |
| 579 | - | |
| 580 | 583 | this.async(function() { |
| 581 | 584 | this.selectedFields = this._copy(this.fields); |
| 582 | 585 | |
| 583 | - | |
| 584 | - | |
| 585 | 586 | //set info labels options |
| 586 | 587 | var textarea = this.$.datalet_selection_labels.querySelectorAll("paper-textarea"); |
| 587 | 588 | textarea[0].value = this.dataletPreset["description"]; |
| ... | ... | @@ -710,21 +711,21 @@ |
| 710 | 711 | |
| 711 | 712 | if(icon.indexOf("unfold-more") > -1){ |
| 712 | 713 | t.setAttribute("icon", "expand-less"); |
| 713 | - t.setAttribute("title", "sort ascending"); | |
| 714 | + t.setAttribute("title", ln["sortAscending_" + ln["localization"]]); | |
| 714 | 715 | var orders = this.orders.filter(function (el) { return el.field !== name; }); |
| 715 | 716 | orders.push({"field": name, "operation": "ASC"}); |
| 716 | 717 | this.orders = this._copy(orders); |
| 717 | 718 | } |
| 718 | 719 | else if(icon.indexOf("expand-less") > -1){ |
| 719 | 720 | t.setAttribute("icon", "expand-more"); |
| 720 | - t.setAttribute("title", "sort descending"); | |
| 721 | + t.setAttribute("title", ln["sortDescending_" + ln["localization"]]); | |
| 721 | 722 | var orders = this.orders.filter(function (el) { return el.field !== name; }); |
| 722 | 723 | orders.push({"field": name, "operation": "DESC"}); |
| 723 | 724 | this.orders = this._copy(orders); |
| 724 | 725 | } |
| 725 | 726 | else if(icon.indexOf("expand-more") > -1){ |
| 726 | 727 | t.setAttribute("icon", "unfold-more"); |
| 727 | - t.setAttribute("title", "unsort"); | |
| 728 | + t.setAttribute("title", ln["unsort_" + ln["localization"]]); | |
| 728 | 729 | var orders = this.orders.filter(function (el) { return el.field !== name; }); |
| 729 | 730 | this.orders = this._copy(orders); |
| 730 | 731 | } |
| ... | ... | @@ -773,7 +774,7 @@ |
| 773 | 774 | } |
| 774 | 775 | }, |
| 775 | 776 | |
| 776 | - _updateParams : function(){/*sss*/ | |
| 777 | + _updateParams : function(){ | |
| 777 | 778 | var textarea = this.$.datalet_selection_labels.querySelectorAll("paper-textarea"); |
| 778 | 779 | this.params["description"] = textarea[0].value; |
| 779 | 780 | |
| ... | ... | @@ -922,9 +923,6 @@ |
| 922 | 923 | |
| 923 | 924 | $("#datalet_selection_inputs").height(h); |
| 924 | 925 | $("#datalet_selection_labels").height(h); |
| 925 | -// if(this.modify) | |
| 926 | -// $("#datalet_selection_datalet").height(h-128); | |
| 927 | -// else | |
| 928 | 926 | $("#datalet_selection_datalet").height(h); |
| 929 | 927 | } |
| 930 | 928 | ... | ... |
controllets/datalet-selection-controllet/demo/index.html
| ... | ... | @@ -18,8 +18,10 @@ |
| 18 | 18 | |
| 19 | 19 | <body> |
| 20 | 20 | |
| 21 | -<datalet-selection-controllet fields='["result,records,Anno","result,records,Cinesi","result,records,Albanesi","result,records,Rumeni","result,records,Pakistani","result,records,Marocchini","result,records,Altri stranieri" ]' data-url="http://ckan.routetopa.eu/api/action/datastore_search?resource_id=e04338cf-7a92-4221-81c6-fe12f41003d5" deep-url="http://172.16.15.38/DEEalerProvider/DEEP/" datalets-list-url="http://172.16.15.38/DEEalerProvider/DEEP/datalets-list"></datalet-selection-controllet> | |
| 21 | +<!--<datalet-selection-controllet fields='["result,records,Anno","result,records,Cinesi","result,records,Albanesi","result,records,Rumeni","result,records,Pakistani","result,records,Marocchini","result,records,Altri stranieri" ]' data-url="http://ckan.routetopa.eu/api/action/datastore_search?resource_id=e04338cf-7a92-4221-81c6-fe12f41003d5" deep-url="http://172.16.15.38/DEEalerProvider/DEEP/" datalets-list-url="http://172.16.15.38/DEEalerProvider/DEEP/datalets-list"></datalet-selection-controllet>--> | |
| 22 | + | |
| 22 | 23 | <!--<datalet-selection-controllet fields='["records,fields,title", "records,fields,published"]' data-url="https://data.issy.com/api/records/1.0/search?dataset=flux-rss-des-offres-demplois-a-issy-les-moulineaux&sort=published&facet=published&refine.published=2015%2F10" deep-url="http://172.16.15.38/DEEalerProvider/DEEP/" datalets-list-url="http://172.16.15.38/DEEalerProvider/DEEP/datalets-list"></datalet-selection-controllet>--> |
| 24 | +<datalet-selection-controllet fields='["records,fields,annee", "records,fields,preteur", "records,fields,capital_restant_du"]' data-url="https://data.issy.com/api/records/1.0/search/?dataset=repartitiondeladetteparpreteursau3112n-feuille1&rows=56&sort=-annee" deep-url="http://172.16.15.38/DEEalerProvider/DEEP/" datalets-list-url="http://172.16.15.38/DEEalerProvider/DEEP/datalets-list"></datalet-selection-controllet> | |
| 23 | 25 | |
| 24 | 26 | </body> |
| 25 | 27 | ... | ... |
locales/controllet_ln.js
| ... | ... | @@ -33,9 +33,12 @@ ln["filterField_en"] = "Field"; |
| 33 | 33 | ln["filterOperation_en"] = "Operation"; |
| 34 | 34 | ln["filterValue_en"] = "Value"; |
| 35 | 35 | ln["contains_en"] = "contains"; |
| 36 | -ln["start_en"] = "start"; | |
| 37 | -ln["ends_en"] = "ends"; | |
| 38 | - | |
| 36 | +ln["start_en"] = "start with"; | |
| 37 | +ln["ends_en"] = "ends with"; | |
| 38 | +ln["sortAscending_en"] = "sorted ascending"; | |
| 39 | +ln["sortDescending_en"] = "sorted descending"; | |
| 40 | +ln["unsort_en"] = "unsorted"; | |
| 41 | +ln["countOf_en"] = "COUNT of"; | |
| 39 | 42 | |
| 40 | 43 | ln["datatable_it"] = "tabella"; |
| 41 | 44 | ln["barchart_it"] = "bar-chart"; | ... | ... |