mirror of
https://github.com/fleetdm/fleet
synced 2026-04-21 13:37:30 +00:00
Reload view after canceling script, and update time validation (#32242)
for #32238 # Details * After a script is canceled, refresh the current tab to show that the canceled script is no longer there * When scheduling a script, check the specified time against UTC, not current timezone time of day. # Checklist for submitter ## Testing - [X] QA'd all new/changed functionality manually For unreleased bug fixes in a release candidate, one of: - [X] Confirmed that the fix is not expected to adversely impact load test results
This commit is contained in:
parent
87880ee28d
commit
4ce8a095c7
2 changed files with 10 additions and 4 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import React, { useCallback, useEffect, useState } from "react";
|
||||
import React, { useCallback, useEffect, useRef, useState } from "react";
|
||||
import { useQueryClient } from "react-query";
|
||||
import { Tab, TabList, TabPanel, Tabs } from "react-tabs";
|
||||
|
||||
|
|
@ -17,7 +17,7 @@ import ProgressBar from "components/ProgressBar";
|
|||
import SectionHeader from "components/SectionHeader";
|
||||
import TabNav from "components/TabNav";
|
||||
import TabText from "components/TabText";
|
||||
import PaginatedList from "components/PaginatedList";
|
||||
import PaginatedList, { IPaginatedListHandle } from "components/PaginatedList";
|
||||
import { HumanTimeDiffWithFleetLaunchCutoff } from "components/HumanTimeDiffWithDateTip";
|
||||
import Icon from "components/Icon/Icon";
|
||||
|
||||
|
|
@ -68,6 +68,10 @@ const ScriptBatchProgress = ({
|
|||
const [batchCount, setBatchCount] = useState<number | null>(null);
|
||||
const [updating, setUpdating] = useState(false);
|
||||
|
||||
const paginatedListRef = useRef<IPaginatedListHandle<IScriptBatchSummaryV2>>(
|
||||
null
|
||||
);
|
||||
|
||||
const statusParam = location?.query.status;
|
||||
|
||||
const selectedStatus = statusParam as ScriptBatchStatus;
|
||||
|
|
@ -288,6 +292,7 @@ const ScriptBatchProgress = ({
|
|||
</div>
|
||||
)}
|
||||
<PaginatedList<IScriptBatchSummaryV2>
|
||||
ref={paginatedListRef}
|
||||
count={batchCount || 0}
|
||||
fetchPage={fetchPage}
|
||||
onClickRow={onClickRow}
|
||||
|
|
@ -329,6 +334,7 @@ const ScriptBatchProgress = ({
|
|||
scriptBatchExecutionDetails={{ ...batchDetailsForSummary }}
|
||||
onCancel={() => {
|
||||
setShowBatchDetailsForSummary(null);
|
||||
paginatedListRef.current?.reload();
|
||||
}}
|
||||
router={router}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -98,8 +98,8 @@ const FORM_VALIDATIONS: IFormValidations = {
|
|||
return true; // If date is invalid, skip time validation
|
||||
}
|
||||
const parsedDate = parse(
|
||||
`${formData.date} ${formData.time}`,
|
||||
"yyyy-MM-dd HH:mm",
|
||||
`${formData.date} ${formData.time}:00.000Z`,
|
||||
"yyyy-MM-dd HH:mm:ss.SSSX",
|
||||
new Date()
|
||||
);
|
||||
return parsedDate >= new Date();
|
||||
|
|
|
|||
Loading…
Reference in a new issue