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

JobList: Filter jobs with tasks #83

Open
VallariAg opened this issue Aug 16, 2024 · 1 comment
Open

JobList: Filter jobs with tasks #83

VallariAg opened this issue Aug 16, 2024 · 1 comment
Assignees
Labels
enhancement Making existing feature better

Comments

@VallariAg
Copy link
Member

VallariAg commented Aug 16, 2024

Seeing as we receive so much data about jobs in JobList, we can use it to add useful filter options like filter by task name.
Pros:

  1. JobList sends 1 request to paddles and gets all of job data. Pagination happens on client side, and so can these filtering on job data.
  2. If there is problem with a task, user can filter jobs which include that task so it's easier to inspect jobs that run that task.

POC:
Filtered 18 jobs (out of total 244 jobs) which have "ceph.healthy" task. It was pretty fast too.
The task column shows "number of total tasks" because I'm not sure what's the appropriate data to show there.
image

I added this in JobList:

  {
    header: "tasks",
    id: "tasks",
    Cell: ({ row }) => {
      return (
        <div>{Object.keys(row.original.tasks || {}).length}</div>
      );
    },
    accessorFn: (row: Job) => (Object.keys(row.tasks || {})),
    size: 150,
    enableColumnFilter: true,
    filterFn: (row, id, filterValue) => {
      return (row.original.tasks?.some(task => filterValue in task)) || false 
    } 
  },

Use-case: searching for jobs setup with cephadm, we can look for "cephadm.install" task.

@VallariAg VallariAg added the enhancement Making existing feature better label Aug 16, 2024
@VallariAg VallariAg self-assigned this Aug 16, 2024
@VallariAg
Copy link
Member Author

VallariAg commented Aug 21, 2024

https://www.material-react-table.com/docs/guides/global-filtering#remote-demo

Global Filtering is interesting which lets us search data across all rows of all columns, we can add this to JobsList easily since it has client side rendering. It also allows to search on hidden columns (so we can hide "tasks" column by default).

Each column can have it's own globalFilterFn so we can have fuzzy search filter on some columns like "job description" and custom filter on "tasks" column.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Making existing feature better
Projects
None yet
Development

No branches or pull requests

1 participant