-
Notifications
You must be signed in to change notification settings - Fork 6
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
dashboard: Add search box and link to URL #22
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor changes again - Sorry D:
pages/index.js
Outdated
// Filters the jobs s.t. all values must be contained in the name. | ||
const matchAll = (filteredJobs, urlParams) => { | ||
const values = urlParams.getAll("value"); | ||
return filteredJobs.filter((job) => { | ||
const jobName = job.name.toLowerCase(); | ||
return values.every((val) => { | ||
const decodedValue = decodeURIComponent(val).toLowerCase(); | ||
return jobName.includes(decodedValue); | ||
}); | ||
}); | ||
}; | ||
|
||
// Filters the jobs s.t. at least one value must be contained in the name. | ||
const matchAny = (filteredJobs, urlParams) => { | ||
const values = urlParams.getAll("value"); | ||
return filteredJobs.filter((job) => { | ||
const jobName = job.name.toLowerCase(); | ||
return values.some((val) => { | ||
const decodedValue = decodeURIComponent(val).toLowerCase(); | ||
return jobName.includes(decodedValue); | ||
}); | ||
}); | ||
}; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there not already an existing implementation for this somewhere? Just curious
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do you mean? Besides .some/.every?
We could pull the values out of the URL before passing them into the function. Then, it's just a filter. A little simpler maybe?
fe876d0
to
bcb9abc
Compare
0d7a6c6
to
cee8258
Compare
Added a script that fetches PR data and created a separate view on the dashboard. Tweaked dotenv require. Fixes kata-containers#1 Signed-off-by: Anna Finn <[email protected]>
Added code to get rerun information to both fetch scripts. Display the reruns as a superscript in the rowExpansionTemplate with the result/URL. Fixes: kata-containers#8 Signed-off-by: Anna Finn <[email protected]>
Added a separate view to display all tests for a given PR. Added the display to the URL, rowExpansionTemplate is unchanged. Fixes: kata-containers#12 Signed-off-by: Anna Finn <[email protected]>
Adds an input form for searching job names. Searches are appended to the URL. Fixes kata-containers#4 Signed-off-by: Anna Finn <[email protected]>
Changes
To reimplement, define clearSearch:
Modify handleSearch:
Add buttons to use:
|
Needed
Description
Possible Feature
Testing
in prod:
Default:
Searching with the form appends to URL:
Adding another search with "Keep Search Terms" appends to the URL:
(will update matchMode (and/or) if it changes)
Adding another search without "Keep Search Terms" appends to the URL:
Selecting "Clear Search":