Skip to content

Commit

Permalink
refactor(dashboard): restructure expected data retrieval
Browse files Browse the repository at this point in the history
  • Loading branch information
bryson-g committed Dec 16, 2024
1 parent 3291d76 commit 9207829
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,16 @@ import { getCronTimeWindow } from '@/app/utils/getCronTimeWindow'
import { parseExpression } from 'cron-parser'
import { utcToLocalDateTime } from '@/app/utils'
import { SearchVariableDialog } from './SearchVariableDialog'
import { SearchFooter } from '@/app/[tenantId]/components/SearchFooter'

export const ScheduledWfRuns = ({ scheduledWfRuns, spec }: { scheduledWfRuns: ScheduledWfRun[]; spec: WfSpec }) => {
export const ScheduledWfRuns = (spec: WfSpec) => {
const [currentWindow, setWindow] = useState<TimeRange>(-1)
const [filteredScheduledWfRuns, setFilteredScheduledWfRuns] = useState<ScheduledWfRun[]>(scheduledWfRuns)
const [filteredScheduledWfRuns, setFilteredScheduledWfRuns] = useState<ScheduledWfRun[]>([])

const searchParams = useSearchParams()
const status = searchParams.get('status') ? getStatus(searchParams.get('status')) || 'ALL' : 'ALL'
const [limit, setLimit] = useState<number>(SEARCH_DEFAULT_LIMIT)


useEffect(() => {
setFilteredScheduledWfRuns(
Expand Down Expand Up @@ -56,6 +62,7 @@ export const ScheduledWfRuns = ({ scheduledWfRuns, spec }: { scheduledWfRuns: Sc
</SelectionLink>
))}
</div>
<SearchFooter currentLimit={limit} setLimit={setLimit} hasNextPage={hasNextPage} fetchNextPage={fetchNextPage} />
</div>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const WfSpec: FC<WfSpecProps> = ({ spec, ScheduleWfSpec }) => {
<WfRuns {...spec} />
</TabsContent>
<TabsContent value="schedule">
<ScheduledWfRuns spec={spec} scheduledWfRuns={ScheduleWfSpec} />
<ScheduledWfRuns {...spec} />
</TabsContent>
</Tabs>
</>
Expand Down

0 comments on commit 9207829

Please sign in to comment.