Skip to content

Commit 47033b0

Browse files
committed
create constants for X-axis grouping options
1 parent 691c82b commit 47033b0

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

webapp/TargetedMS/js/QCTrendPlotPanel.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,13 @@ Ext4.define('LABKEY.targetedms.QCTrendPlotPanel', {
9090
// Shared column widths (px) so the Excluded-replicates radios line up under the X-axis grouping radios.
9191
XAXIS_COL_WIDTHS: [100, 82, 80],
9292

93+
// Radio inputValues for the X-axis grouping option.
94+
XAXIS_GROUPING: {
95+
REPLICATE: 'replicate',
96+
DATE: 'date',
97+
CALENDAR: 'calendar'
98+
},
99+
93100
// Max number of plots/series to show per page
94101
maxCount: 50,
95102

@@ -1032,8 +1039,8 @@ Ext4.define('LABKEY.targetedms.QCTrendPlotPanel', {
10321039
return;
10331040
}
10341041
const val = radio.inputValue;
1035-
const newCalendarX = val === 'calendar';
1036-
const newGroupedX = val === 'date' || val === 'calendar';
1042+
const newCalendarX = val === me.XAXIS_GROUPING.CALENDAR;
1043+
const newGroupedX = val === me.XAXIS_GROUPING.DATE || val === me.XAXIS_GROUPING.CALENDAR;
10371044
// ignore the change event fired for the initially-checked radio during construction
10381045
if (newCalendarX === me.calendarX && newGroupedX === me.groupedX) {
10391046
return;
@@ -1060,7 +1067,7 @@ Ext4.define('LABKEY.targetedms.QCTrendPlotPanel', {
10601067
boxLabel: 'per replicate',
10611068
width: colWidths[0],
10621069
id: 'x-axis-grouping-replicate',
1063-
inputValue: 'replicate',
1070+
inputValue: this.XAXIS_GROUPING.REPLICATE,
10641071
checked: this.groupedX === false,
10651072
listeners: {
10661073
change: onChange,
@@ -1073,7 +1080,7 @@ Ext4.define('LABKEY.targetedms.QCTrendPlotPanel', {
10731080
boxLabel: 'per date',
10741081
width: colWidths[1],
10751082
id: 'x-axis-grouping-date',
1076-
inputValue: 'date',
1083+
inputValue: this.XAXIS_GROUPING.DATE,
10771084
checked: this.groupedX === true && this.calendarX !== true,
10781085
listeners: {
10791086
change: onChange,
@@ -1086,7 +1093,7 @@ Ext4.define('LABKEY.targetedms.QCTrendPlotPanel', {
10861093
boxLabel: 'calendar',
10871094
width: colWidths[2],
10881095
id: 'x-axis-grouping-calendar',
1089-
inputValue: 'calendar',
1096+
inputValue: this.XAXIS_GROUPING.CALENDAR,
10901097
checked: this.groupedX === true && this.calendarX === true,
10911098
listeners: {
10921099
change: onChange,

0 commit comments

Comments
 (0)