Skip to content

Commit

Permalink
add custom columns (incl. text variables) in column picker #359
Browse files Browse the repository at this point in the history
  • Loading branch information
Rello committed Aug 14, 2023
1 parent b9a3a9a commit ee4b95d
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 1 deletion.
6 changes: 6 additions & 0 deletions css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,12 @@ table.dataTable tbody tr {
filter: var(--background-invert-if-dark);
}

.icon-analytics-gripLines {
background-image: url(../img/gripLines.svg);
filter: var(--background-invert-if-dark);
margin: 10px;
}

.filterVisualizationItem {
background-color: var(--color-background-dark);
padding: 5px;
Expand Down
5 changes: 5 additions & 0 deletions css/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,11 @@ table.dataTable tbody tr {
@include icon-color('column', 'analytics', $color-black, 1);
}

.icon-analytics-gripLines {
@include icon-color('gripLines', 'analytics', $color-black, 1);
margin: 10px;
}

.filterVisualizationItem {
background-color: var(--color-background-dark);
padding: 5px;
Expand Down
8 changes: 8 additions & 0 deletions img/gripLines.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -1465,6 +1465,9 @@ OCA.Analytics.Datasource = {
li.addEventListener("dragover", OCA.Analytics.Notification.handleDragOver);
li.addEventListener("drop", OCA.Analytics.Notification.handleDrop);

const gripLines = document.createElement('div')
gripLines.classList.add('icon-analytics-gripLines', 'sidebarPointer');

const checkbox = document.createElement("input");
checkbox.type = "checkbox";
checkbox.id = item.id;
Expand All @@ -1478,6 +1481,7 @@ OCA.Analytics.Datasource = {
spanContent.style.marginLeft = '10px';
spanContent.style.color = 'var(--color-text-maxcontrast)';
item.contenteditable === true ? spanContent.contentEditable = 'true' : false;
li.appendChild(gripLines);
li.appendChild(checkbox);
li.appendChild(span);
li.appendChild(spanContent);
Expand Down
2 changes: 1 addition & 1 deletion js/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ OCA.Analytics.Filter = {
} catch (e) {
dataOptions = '';
}
let distinctCategories = OCA.Analytics.Core.getDistinctValues(OCA.Analytics.currentReportData.data);
let distinctCategories = OCA.Analytics.Core.getDistinctValues(OCA.Analytics.currentReportData.data, 0);
if (dataOptions === null) dataOptions = {};

// check if defined dataoptions don´t match the number of dataseries anymore
Expand Down

0 comments on commit ee4b95d

Please sign in to comment.