Skip to content

Commit 798ece4

Browse files
committed
Disable report button when loading
1 parent b956608 commit 798ece4

File tree

8 files changed

+9
-9
lines changed

8 files changed

+9
-9
lines changed

src/reports/CombinedReportPage.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ const CombinedReportPage = () => {
7373
)}
7474
<div className={classes.containerMain}>
7575
<div className={classes.header}>
76-
<ReportFilter handleSubmit={handleSubmit} showOnly multiDevice includeGroups />
76+
<ReportFilter handleSubmit={handleSubmit} showOnly multiDevice includeGroups loading={loading} />
7777
</div>
7878
<Table>
7979
<TableHead>

src/reports/EventReportPage.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ const EventReportPage = () => {
167167
)}
168168
<div className={classes.containerMain}>
169169
<div className={classes.header}>
170-
<ReportFilter handleSubmit={handleSubmit} handleSchedule={handleSchedule}>
170+
<ReportFilter handleSubmit={handleSubmit} handleSchedule={handleSchedule} loading={loading}>
171171
<div className={classes.filterItem}>
172172
<FormControl fullWidth>
173173
<InputLabel>{t('reportEventTypes')}</InputLabel>

src/reports/RouteReportPage.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ const RouteReportPage = () => {
118118
)}
119119
<div className={classes.containerMain}>
120120
<div className={classes.header}>
121-
<ReportFilter handleSubmit={handleSubmit} handleSchedule={handleSchedule} multiDevice>
121+
<ReportFilter handleSubmit={handleSubmit} handleSchedule={handleSchedule} multiDevice loading={loading}>
122122
<ColumnSelect
123123
columns={columns}
124124
setColumns={setColumns}

src/reports/StatisticsPage.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const StatisticsPage = () => {
5353
return (
5454
<PageLayout menu={<ReportsMenu />} breadcrumbs={['reportTitle', 'statisticsTitle']}>
5555
<div className={classes.header}>
56-
<ReportFilter handleSubmit={handleSubmit} showOnly ignoreDevice>
56+
<ReportFilter handleSubmit={handleSubmit} showOnly ignoreDevice loading={loading}>
5757
<ColumnSelect columns={columns} setColumns={setColumns} columnsArray={columnsArray} />
5858
</ReportFilter>
5959
</div>

src/reports/StopReportPage.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ const StopReportPage = () => {
129129
)}
130130
<div className={classes.containerMain}>
131131
<div className={classes.header}>
132-
<ReportFilter handleSubmit={handleSubmit} handleSchedule={handleSchedule}>
132+
<ReportFilter handleSubmit={handleSubmit} handleSchedule={handleSchedule} loading={loading}>
133133
<ColumnSelect columns={columns} setColumns={setColumns} columnsArray={columnsArray} />
134134
</ReportFilter>
135135
</div>

src/reports/SummaryReportPage.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ const SummaryReportPage = () => {
116116
return (
117117
<PageLayout menu={<ReportsMenu />} breadcrumbs={['reportTitle', 'reportSummary']}>
118118
<div className={classes.header}>
119-
<ReportFilter handleSubmit={handleSubmit} handleSchedule={handleSchedule} multiDevice includeGroups>
119+
<ReportFilter handleSubmit={handleSubmit} handleSchedule={handleSchedule} multiDevice includeGroups loading={loading}>
120120
<div className={classes.filterItem}>
121121
<FormControl fullWidth>
122122
<InputLabel>{t('sharedType')}</InputLabel>

src/reports/TripReportPage.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ const TripReportPage = () => {
173173
)}
174174
<div className={classes.containerMain}>
175175
<div className={classes.header}>
176-
<ReportFilter handleSubmit={handleSubmit} handleSchedule={handleSchedule}>
176+
<ReportFilter handleSubmit={handleSubmit} handleSchedule={handleSchedule} loading={loading}>
177177
<ColumnSelect columns={columns} setColumns={setColumns} columnsArray={columnsArray} />
178178
</ReportFilter>
179179
</div>

src/reports/components/ReportFilter.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import SplitButton from '../../common/components/SplitButton';
1111
import SelectField from '../../common/components/SelectField';
1212
import { useRestriction } from '../../common/util/permissions';
1313

14-
const ReportFilter = ({ children, handleSubmit, handleSchedule, showOnly, ignoreDevice, multiDevice, includeGroups }) => {
14+
const ReportFilter = ({ children, handleSubmit, handleSchedule, showOnly, ignoreDevice, multiDevice, includeGroups, loading }) => {
1515
const classes = useReportStyles();
1616
const dispatch = useDispatch();
1717
const t = useTranslation();
@@ -33,7 +33,7 @@ const ReportFilter = ({ children, handleSubmit, handleSchedule, showOnly, ignore
3333
const [calendarId, setCalendarId] = useState();
3434

3535
const scheduleDisabled = button === 'schedule' && (!description || !calendarId);
36-
const disabled = (!ignoreDevice && !deviceId && !deviceIds.length && !groupIds.length) || scheduleDisabled;
36+
const disabled = (!ignoreDevice && !deviceId && !deviceIds.length && !groupIds.length) || scheduleDisabled || loading;
3737

3838
const handleClick = (type) => {
3939
if (type === 'schedule') {

0 commit comments

Comments
 (0)