From eb2279cf8d89179a1391d111517e4e1e9d2eb26e Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Fri, 25 Oct 2024 10:01:28 -0700 Subject: [PATCH] [Backport 2.x] Added HOURS option for source refresh interval. (#1191) * Added HOURS option for source refresh interval. (#1190) Signed-off-by: AWSHurneyt (cherry picked from commit 1c31032b38d0c99850097b72095ed30362f6e1d0) Signed-off-by: github-actions[bot] * Fix cache cypress hashfile path. Signed-off-by: AWSHurneyt * Reverted change to hash path. Signed-off-by: AWSHurneyt --------- Signed-off-by: AWSHurneyt Signed-off-by: github-actions[bot] Co-authored-by: github-actions[bot] Co-authored-by: AWSHurneyt --- .../ThreatIntelSourceDetails/ThreatIntelSourceDetails.tsx | 5 ++++- .../AddThreatIntelSource/AddThreatIntelSource.tsx | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/public/pages/ThreatIntel/components/ThreatIntelSourceDetails/ThreatIntelSourceDetails.tsx b/public/pages/ThreatIntel/components/ThreatIntelSourceDetails/ThreatIntelSourceDetails.tsx index 2462d3d2..de21cff7 100644 --- a/public/pages/ThreatIntel/components/ThreatIntelSourceDetails/ThreatIntelSourceDetails.tsx +++ b/public/pages/ThreatIntel/components/ThreatIntelSourceDetails/ThreatIntelSourceDetails.tsx @@ -234,7 +234,10 @@ export const ThreatIntelSourceDetails: React.FC = }} onScheduleChange={onIntervalChange} readonly={isReadOnly || !enabled} - scheduleUnitOptions={[defaultIntervalUnitOptions.DAYS]} + scheduleUnitOptions={[ + defaultIntervalUnitOptions.HOURS, + defaultIntervalUnitOptions.DAYS, + ]} /> {(!isReadOnly || !enabled) && ( diff --git a/public/pages/ThreatIntel/containers/AddThreatIntelSource/AddThreatIntelSource.tsx b/public/pages/ThreatIntel/containers/AddThreatIntelSource/AddThreatIntelSource.tsx index cf72ed7f..90c3ba9f 100644 --- a/public/pages/ThreatIntel/containers/AddThreatIntelSource/AddThreatIntelSource.tsx +++ b/public/pages/ThreatIntel/containers/AddThreatIntelSource/AddThreatIntelSource.tsx @@ -99,7 +99,7 @@ export const AddThreatIntelSource: React.FC = ({ interval: { start_time: Date.now(), period: 1, - unit: 'DAYS', + unit: defaultIntervalUnitOptions.HOURS.value, }, }); const [sourceType, setSourceType] = useState<'S3_CUSTOM' | 'IOC_UPLOAD'>('S3_CUSTOM'); @@ -545,7 +545,10 @@ export const AddThreatIntelSource: React.FC = ({ unit: schedule.interval.unit, }, }} - scheduleUnitOptions={[defaultIntervalUnitOptions.DAYS]} + scheduleUnitOptions={[ + defaultIntervalUnitOptions.HOURS, + defaultIntervalUnitOptions.DAYS, + ]} onScheduleChange={onIntervalChange} />