Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: fix frontend for multiple schedule #189

Merged
merged 1 commit into from
Jul 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions admin/src/components/DAGTable.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { HTMLProps } from "react";
import React from "react";
import {
createTable,
useTableInstance,
Expand All @@ -7,7 +7,6 @@ import {
SortingState,
getFilteredRowModel,
ColumnFiltersState,
Row,
ExpandedState,
getExpandedRowModel,
} from "@tanstack/react-table";
Expand Down Expand Up @@ -237,14 +236,26 @@ const defaultColumns = [
table.createDataColumn("Type", {
id: "Schedule",
header: "Schedule",
enableSorting: false,
enableSorting: true,
cell: (props) => {
const data = props.row.original!;
if (data.Type == DAGDataType.DAG) {
const sc = data.DAG.Config.ScheduleExp;
if (sc) {
const schedules = data.DAG.Config.ScheduleExp;
if (schedules) {
return (
<Chip sx={{ fontWeight: "semibold" }} size="small" label={sc} />
<React.Fragment>
{schedules.map((s) => (
<Chip
key={s}
sx={{
fontWeight: "semibold",
marginRight: 1,
}}
size="small"
label={s}
/>
))}
</React.Fragment>
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion admin/src/models/Config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Step } from "./Step";
export type Config = {
ConfigPath: string;
Name: string;
ScheduleExp: string;
ScheduleExp: string[];
Group: string;
Tags: string[];
Description: string;
Expand Down