Skip to content

Commit 6b4866e

Browse files
authored
Merge pull request #1686 from griidc/release/6.65.0
Release/6.65.0
2 parents 2e9a6ac + fd2fb95 commit 6b4866e

18 files changed

+362
-262
lines changed

assets/static/css/dif.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,9 @@ img {
170170
#difFilterTools td {
171171
padding-bottom: 1rem;
172172
}
173+
#difFilterTools #fltResults {
174+
padding-left: .5em;
175+
}
173176

174177
input.dx-texteditor-input:focus-visible {
175178
outline-style: none !important;
@@ -185,3 +188,7 @@ input.dx-texteditor-input:focus-visible {
185188
outline-offset: 4px !important;
186189
outline-color: #2563eb !important;
187190
}
191+
192+
#difForm input[type="text"], textarea {
193+
padding-left: .5em;
194+
}

assets/static/js/datasetMonitoring.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,35 @@ $(() => {
4444
}).always(function () {
4545
dsmTreeList.option("disabled", false);
4646
const expandedKeys = groupStore.items().filter(({ expanded }) => expanded === true).map(key => key.id);
47+
48+
// Get query parameters from URL and store on respective variables
49+
const urlParams = new URLSearchParams(window.location.search);
50+
const fundingOrganization = urlParams.get('fundingOrganization');
51+
const fundingCycle = urlParams.get('fundingCycle');
52+
const researchGroup = urlParams.get('researchGroup');
53+
54+
// if any of the query parameters is present, expand the respective groups
55+
if (fundingOrganization) {
56+
const fundingOrganizationItem = groups.find(group => group.fundingOrganization === parseInt(fundingOrganization, 10));
57+
expandedKeys.push(fundingOrganizationItem.id);
58+
dsmTreeList.selectRows([fundingOrganizationItem.id], false);
59+
}
60+
61+
if (researchGroup) {
62+
const researchGroupItem = groups.find(group => group.researchGroup === parseInt(researchGroup, 10));
63+
const parentItem = groups.find(group => group.id === researchGroupItem.parent);
64+
expandedKeys.push(researchGroupItem.parent);
65+
expandedKeys.push(parentItem.parent);
66+
dsmTreeList.selectRows([researchGroupItem.id], false);
67+
}
68+
69+
if (fundingCycle) {
70+
const fundingCycleItem = groups.find(group => group.fundingCycle === parseInt(fundingCycle, 10));
71+
expandedKeys.push(fundingCycleItem.id);
72+
expandedKeys.push(fundingCycleItem.parent);
73+
dsmTreeList.selectRows([fundingCycleItem.id], false);
74+
}
75+
4776
dsmTreeList.option("expandedRowKeys", expandedKeys);
4877
});
4978
}
@@ -199,6 +228,17 @@ $(() => {
199228
parameters = Object.assign(parameters, { researchGroup: selectedItem.researchGroup });
200229
}
201230

231+
// Change current browser URL to add query parameters
232+
var currentUrl = new URL(window.location.href);
233+
var queryParams = new URLSearchParams();
234+
var urlPararameters = Object.assign({}, parameters);
235+
delete urlPararameters.datasetFilter;
236+
for (const key of Object.keys(urlPararameters)) {
237+
queryParams.set(key, urlPararameters[key]);
238+
}
239+
currentUrl.search = queryParams.toString();
240+
window.history.pushState({}, '', currentUrl);
241+
202242
$.ajax({
203243
url: Routing.generate("app_api_dataset_monitoring_datasets",
204244
parameters

0 commit comments

Comments
 (0)