Skip to content

Commit

Permalink
Merge pull request #1686 from griidc/release/6.65.0
Browse files Browse the repository at this point in the history
Release/6.65.0
  • Loading branch information
mickel1138 authored Dec 3, 2024
2 parents 2e9a6ac + fd2fb95 commit 6b4866e
Show file tree
Hide file tree
Showing 18 changed files with 362 additions and 262 deletions.
7 changes: 7 additions & 0 deletions assets/static/css/dif.css
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ img {
#difFilterTools td {
padding-bottom: 1rem;
}
#difFilterTools #fltResults {
padding-left: .5em;
}

input.dx-texteditor-input:focus-visible {
outline-style: none !important;
Expand All @@ -185,3 +188,7 @@ input.dx-texteditor-input:focus-visible {
outline-offset: 4px !important;
outline-color: #2563eb !important;
}

#difForm input[type="text"], textarea {
padding-left: .5em;
}
40 changes: 40 additions & 0 deletions assets/static/js/datasetMonitoring.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,35 @@ $(() => {
}).always(function () {
dsmTreeList.option("disabled", false);
const expandedKeys = groupStore.items().filter(({ expanded }) => expanded === true).map(key => key.id);

// Get query parameters from URL and store on respective variables
const urlParams = new URLSearchParams(window.location.search);
const fundingOrganization = urlParams.get('fundingOrganization');
const fundingCycle = urlParams.get('fundingCycle');
const researchGroup = urlParams.get('researchGroup');

// if any of the query parameters is present, expand the respective groups
if (fundingOrganization) {
const fundingOrganizationItem = groups.find(group => group.fundingOrganization === parseInt(fundingOrganization, 10));
expandedKeys.push(fundingOrganizationItem.id);
dsmTreeList.selectRows([fundingOrganizationItem.id], false);
}

if (researchGroup) {
const researchGroupItem = groups.find(group => group.researchGroup === parseInt(researchGroup, 10));
const parentItem = groups.find(group => group.id === researchGroupItem.parent);
expandedKeys.push(researchGroupItem.parent);
expandedKeys.push(parentItem.parent);
dsmTreeList.selectRows([researchGroupItem.id], false);
}

if (fundingCycle) {
const fundingCycleItem = groups.find(group => group.fundingCycle === parseInt(fundingCycle, 10));
expandedKeys.push(fundingCycleItem.id);
expandedKeys.push(fundingCycleItem.parent);
dsmTreeList.selectRows([fundingCycleItem.id], false);
}

dsmTreeList.option("expandedRowKeys", expandedKeys);
});
}
Expand Down Expand Up @@ -199,6 +228,17 @@ $(() => {
parameters = Object.assign(parameters, { researchGroup: selectedItem.researchGroup });
}

// Change current browser URL to add query parameters
var currentUrl = new URL(window.location.href);
var queryParams = new URLSearchParams();
var urlPararameters = Object.assign({}, parameters);
delete urlPararameters.datasetFilter;
for (const key of Object.keys(urlPararameters)) {
queryParams.set(key, urlPararameters[key]);
}
currentUrl.search = queryParams.toString();
window.history.pushState({}, '', currentUrl);

$.ajax({
url: Routing.generate("app_api_dataset_monitoring_datasets",
parameters
Expand Down
Loading

0 comments on commit 6b4866e

Please sign in to comment.