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

Fixes #38090 - Add filtering to job invocation hosts table #934

Merged
merged 6 commits into from
Jan 28, 2025
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Make lints happy
adamruzicka authored and kmalyjur committed Jan 28, 2025
commit 0dd341438bac8b2b93491e1c5f601c4b0df4018f
9 changes: 6 additions & 3 deletions webpack/JobInvocationDetail/JobInvocationHostTable.js
Original file line number Diff line number Diff line change
@@ -55,11 +55,14 @@ const JobInvocationHostTable = ({
? `job_invocation.result = ${filter}`
: null;
const parts = [dropdownFilterClause, search];
return parts.filter((x) => x).map((fragment) => `(${fragment}})`).join(' AND ');
return parts
.filter(x => x)
.map(fragment => `(${fragment}})`)
.join(' AND ');
};

const filter = constructFilter();
const defaultParams = filter != '' ? { search: filter } : {};
const search = constructFilter();
const defaultParams = search !== '' ? { search } : {};
if (urlPage) defaultParams.page = Number(urlPage);
if (urlPerPage) defaultParams.per_page = Number(urlPerPage);
const [expandedHost, setExpandedHost] = useState([]);