Skip to content

Commit f85a0b1

Browse files
Rebase to aces/main
1 parent 4fd97ff commit f85a0b1

File tree

13 files changed

+38
-54
lines changed

13 files changed

+38
-54
lines changed

jsx/Panel.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ Panel.propTypes = {
153153
bold: PropTypes.bool,
154154
panelSize: PropTypes.string,
155155
style: PropTypes.object,
156+
children: PropTypes.node,
156157
};
157158
Panel.defaultProps = {
158159
initCollapsed: false,

modules/behavioural_qc/php/module.class.inc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,18 +78,18 @@ class Module extends \Module
7878
case 'study-progression':
7979
$DB = $factory->database();
8080
$data = $DB->pselectWithIndexKey(
81-
"SELECT
81+
"SELECT
8282
p.ProjectID,
8383
COUNT(*) AS count,
8484
CONCAT('$baseURL/behavioural_qc/?Project=', p.ProjectID)
8585
AS url,
8686
p.Name AS ProjectName
87-
FROM flag f
88-
JOIN session s ON f.SessionID = s.ID
87+
FROM flag f
88+
JOIN session s ON f.SessionID = s.ID
8989
JOIN Project p ON p.ProjectID = s.ProjectID
9090
WHERE DataID IS NOT NULL
91-
AND s.Active <> 'N'
92-
AND s.CenterID <> 1
91+
AND s.Active <> 'N'
92+
AND s.CenterID <> 1
9393
AND f.CommentID NOT LIKE 'DDE_%'
9494
GROUP BY p.Name",
9595
[],

modules/candidate_list/php/module.class.inc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,16 +121,16 @@ class Module extends \Module
121121
AS url,
122122
ProjectName
123123
FROM (
124-
SELECT
124+
SELECT
125125
c.PSCID,
126126
COALESCE(p.ProjectID, p2.ProjectID) AS ProjectID,
127127
COALESCE(p.Name, p2.Name) AS ProjectName
128128
FROM candidate c
129-
LEFT JOIN session s ON s.CandidateID = c.ID
129+
LEFT JOIN session s ON s.CandidateID = c.ID
130130
LEFT JOIN Project p ON p.ProjectID = s.ProjectID
131-
JOIN Project p2 ON c.RegistrationProjectID = p2.ProjectID
132-
WHERE c.Active <> 'N'
133-
AND s.Active <> 'N'
131+
JOIN Project p2 ON c.RegistrationProjectID = p2.ProjectID
132+
WHERE c.Active <> 'N'
133+
AND s.Active <> 'N'
134134
AND s.CenterID <> 1
135135
) AS sub
136136
GROUP BY ProjectID, ProjectName;",

modules/imaging_browser/php/module.class.inc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,15 @@ class Module extends \Module
129129
case 'study-progression':
130130
$DB = $factory->database();
131131
$data = $DB->pselectWithIndexKey(
132-
"SELECT
132+
"SELECT
133133
p.ProjectID,
134134
p.Name AS ProjectName,
135135
COUNT(s.ID) AS count,
136-
CONCAT('".$baseURL."/imaging_browser/?project=', p.Name) as url
136+
'".$baseURL."/imaging_browser' as url
137137
FROM session s
138138
JOIN Project p ON p.ProjectID = s.ProjectID
139139
JOIN mri_upload mu ON mu.SessionID = s.ID
140-
WHERE s.Active <> 'N'
140+
WHERE s.Active <> 'N'
141141
AND s.CenterID <> 1
142142
GROUP BY p.Name",
143143
[],

modules/statistics/css/WidgetIndex.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,4 +206,4 @@
206206
.filter-grid {
207207
grid-template-columns: 1fr;
208208
}
209-
}
209+
}

modules/statistics/css/recruitment.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@
4242
transform: translateY(-10px);
4343
background-color: #f9fdff;
4444
box-shadow: 0 12px 12px rgba(0, 0, 0, 0.25);
45-
}
45+
}

modules/statistics/jsx/WidgetIndex.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const WidgetIndex = (props) => {
3434
let {title, chartType, options} = chartDetails[section][chartID];
3535
return (
3636
<div
37-
className ="site-breakdown-card"
37+
className ="chart-card"
3838
>
3939
{/* Chart Title and Toggle */}
4040
<div className ='chart-header'>
@@ -207,7 +207,9 @@ const WidgetIndex = (props) => {
207207
}
208208
}
209209
const queryString = '?' + new URLSearchParams(formObject).toString();
210-
let newChartDetails = {...chartDetails};
210+
let newChartDetails = {...clearedChartDetails};
211+
212+
const chartPromises = [];
211213
Object.keys(chartDetails[section]).forEach(
212214
(chart) => {
213215
// update filters
@@ -226,9 +228,13 @@ const WidgetIndex = (props) => {
226228
newChartDetails[section][chart] = data[section][chart];
227229
}
228230
);
231+
chartPromises.push(chartPromise);
229232
}
230233
);
231-
setChartDetails(newChartDetails);
234+
235+
Promise.all(chartPromises).then(() => {
236+
setChartDetails(newChartDetails);
237+
});
232238
};
233239

234240
/**

modules/statistics/jsx/widgets/helpers/chartBuilder.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,10 +236,8 @@ const createLineChart = (data, columns, id, label, targetModal, titlePrefix) =>
236236

237237
name = nameFormat(d[i].name);
238238
value = valueFormat(d[i].value, d[i].ratio, d[i].id, d[i].index);
239-
240239
// Calculate percentage based on grand total of entire dataset
241240
let percentage = grandTotal > 0 ? ((d[i].value / grandTotal) * 100).toFixed(1) : 0;
242-
243241
bgcolor = $$.levelColor ? $$.levelColor(d[i].value) : color(d[i].id);
244242

245243
text += "<tr class='" + $$.CLASS.tooltipName + "-" + d[i].id + "'>";

modules/statistics/jsx/widgets/helpers/queryChartForm.js

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -54,21 +54,6 @@ const QueryChartForm = (props) => {
5454
}
5555
}
5656

57-
setFormDataObj((prevState) => {
58-
const newFormData = {
59-
...prevState,
60-
[formElement]: normalizedValue,
61-
};
62-
if (
63-
(normalizedValue !== undefined
64-
|| prevState[formElement] !== undefined)
65-
&& !(formElement.includes('date') && value < '1900-01-01')
66-
) {
67-
props.callback(newFormData);
68-
}
69-
return newFormData;
70-
});
71-
7257
const newFormData = {
7358
...formDataObj,
7459
[formElement]: normalizedValue,

modules/statistics/jsx/widgets/recruitment.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const Recruitment = (props) => {
3232
dataType: 'pie',
3333
label: 'Age (Years)',
3434
options: {pie: 'pie', bar: 'bar'},
35-
yLabel: 'Candidates registered',
35+
yLabel: t('Candidates registered', {ns: 'statistics'}),
3636
legend: 'under',
3737
chartObject: null,
3838
},
@@ -43,7 +43,7 @@ const Recruitment = (props) => {
4343
dataType: 'pie',
4444
label: 'Ethnicity',
4545
options: {pie: 'pie', bar: 'bar'},
46-
yLabel: 'Candidates registered',
46+
yLabel: t('Candidates registered', {ns: 'statistics'}),
4747
legend: 'under',
4848
chartObject: null,
4949
},
@@ -57,7 +57,7 @@ const Recruitment = (props) => {
5757
label: 'Participants',
5858
legend: '',
5959
options: {pie: 'pie', bar: 'bar'},
60-
yLabel: 'Candidates registered',
60+
yLabel: t('Candidates registered', {ns: 'statistics'}),
6161
chartObject: null,
6262
},
6363
'siterecruitment_bysex': {
@@ -67,7 +67,7 @@ const Recruitment = (props) => {
6767
dataType: 'bar',
6868
legend: 'under',
6969
options: {bar: 'bar', pie: 'pie'},
70-
yLabel: 'Candidates registered',
70+
yLabel: t('Candidates registered', {ns: 'statistics'}),
7171
chartObject: null,
7272
},
7373
},
@@ -79,7 +79,7 @@ const Recruitment = (props) => {
7979
dataType: 'line',
8080
legend: '',
8181
options: {line: 'line'},
82-
yLabel: 'Candidates registered',
82+
yLabel: t('Candidates registered', {ns: 'statistics'}),
8383
chartObject: null,
8484
},
8585
},

0 commit comments

Comments
 (0)