Skip to content

Commit

Permalink
should auto re-apply when options changed
Browse files Browse the repository at this point in the history
  • Loading branch information
xloypaypa authored and kevinlzw committed Jan 13, 2023
1 parent df40c69 commit 85448a3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions frontend/src/pages/dashboard/components/DashboardTopPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,18 @@ export const DashboardTopPanel: FC<DashboardTopPanelProps> = ({ projectId }) =>
syncFourKeyMetrics(formValues);
};

useEffect(() => {
formValues.pipelines = formValues.pipelines.filter(pipeline =>
pipelineOptions.some(
option =>
option.value === pipeline.value &&
option.children?.some(childOption => childOption.value === pipeline.childValue)
)
);
setFormValues(formValues);
onApply(formValues);
}, [pipelineOptions]);

// Auto sync related logic
const [autoSyncPeriod, setAutoSyncPeriod] = useState<AutoSyncOption>(AUTO_SYNC_OPTIONS[0]);
const [autoSyncJob, setAutoSyncJob] = useState<NodeJS.Timeout | null>(null);
Expand Down

0 comments on commit 85448a3

Please sign in to comment.