Skip to content

Commit

Permalink
Table maintenance dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
Rello committed Apr 10, 2024
1 parent cd2649d commit 08c0b88
Show file tree
Hide file tree
Showing 14 changed files with 190 additions and 342 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
- copy data loads

### Changed
- DataTables v2
- DataTables 2.0.3
- Code cleanup and refactoring

### Fixed
- console error when using timestamps for 1-column raw data #384
- css deprecation
- add nonce to js scripts
- CSP issues in NC28 with js scripts

## 4.12.0 - 2023-12-11
### Added
Expand Down
13 changes: 4 additions & 9 deletions js/3rdParty/datatables.min.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion js/advanced.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ OCA.Analytics.Advanced.Dataload = {
placeholder: optionSelectOptions
});
datasetOptions.push({id: 'filterValue', name: t('analytics', 'Value'), placeholder: ''});
OCA.Analytics.datasourceOptions[0] = datasetOptions;
OCA.Analytics.datasources.options[0] = datasetOptions;
},

buildDataloadRow: function (dataload) {
Expand Down Expand Up @@ -280,6 +280,7 @@ OCA.Analytics.Advanced.Dataload = {

document.getElementById('dataloadDetail').dataset.dataloadId = dataload['id'];
document.getElementById('dataloadName').value = dataload['name'];
document.getElementById('dataloadType').innerText = OCA.Analytics.datasources.datasources[dataload['datasource']];
OCA.Analytics.Visualization.showElement('dataloadDetailHeader');
OCA.Analytics.Visualization.showElement('dataloadDetailButtons');
OCA.Analytics.Visualization.showElement('dataloadDetailDelete');
Expand Down
18 changes: 10 additions & 8 deletions js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ OCA.Analytics = Object.assign({}, OCA.Analytics, {
isAdvanced: false,
currentReportData: {},
chartObject: null,
tableObject: null,
tableObject: [],
// flexible mapping depending on type required by the used chart library
chartTypeMapping: {
'datetime': 'line',
Expand All @@ -46,7 +46,7 @@ OCA.Analytics = Object.assign({}, OCA.Analytics, {
'line': 'line',
'doughnut': 'doughnut'
},
datasourceOptions: [],
datasources: [],
datasets: [],
reports: [],
unsavedFilters: null,
Expand Down Expand Up @@ -276,10 +276,12 @@ OCA.Analytics.UI = {
OCA.Analytics.Visualization.showElement('analytics-intro');
document.getElementById('app-sidebar').classList.add('disappear');
} else {
if (OCA.Analytics.tableObject !== null) {
OCA.Analytics.tableObject.destroy();
OCA.Analytics.tableObject = null;
}
let key = Object.keys(OCA.Analytics.tableObject)[0];
if (key !== undefined) {
OCA.Analytics.tableObject[key].destroy();
}

OCA.Analytics.tableObject = [];
OCA.Analytics.Visualization.hideElement('chartContainer');
OCA.Analytics.Visualization.hideElement('chartLegendContainer');
document.getElementById('chartContainer').innerHTML = '';
Expand Down Expand Up @@ -801,7 +803,7 @@ OCA.Analytics.Datasource = {
});
let data = await response.json();

OCA.Analytics.datasourceOptions = data['options'];
OCA.Analytics.datasources = data;
let options = document.createDocumentFragment();
let option = document.createElement('option');
option.value = '';
Expand Down Expand Up @@ -838,7 +840,7 @@ OCA.Analytics.Datasource = {
},

buildDatasourceRelatedForm: function (datasource) {
let template = OCA.Analytics.datasourceOptions[datasource];
let template = OCA.Analytics.datasources.options[datasource];
let form = document.createElement('div');
let insideSection = false;
form.id = 'dataSourceOptions';
Expand Down
Loading

0 comments on commit 08c0b88

Please sign in to comment.