-
-
Notifications
You must be signed in to change notification settings - Fork 373
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
Custom job data formatter #204
Conversation
User can now specify AdapterOptions passed to the BullAdapter on creation. In this user can specify the jobParser, which provides an alternative way to parse job data to be displayed in the Jobs List UI
@@ -88,11 +91,11 @@ const getDataForQueues = async ( | |||
const status = | |||
query[name] === 'latest' ? statuses : (query[name] as JobStatus[]) | |||
const jobs = await queue.getJobs(status, 0, 10) | |||
|
|||
const formatter = formatJob(queue.options?.dataFormatter) |
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.
I think that it is better to incapsulate the formatting part inside the adapters (inside getJobs
), therefore, making AdapterOptions
as private
field.
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.
Yasss, maybe this is more correct. Will update 👍
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.
I tried to do this but reached the extent of my typescript knowledge and am bumbling around trying to figure it out. Sorry no more time to spend on it now.
Thank you for this PR, it is a great idea to filter out some data fields :] |
I think that it can be handled from a different angle, since the issue that you are trying to solve related to many cards with heavy data, I think that we should consider some virtual-scroller implementation. Do you think this will solve your issue? |
It will solve the heavy DOM issue, but I also want to not show personal data in the UI :) |
Summary
User can now specify AdapterOptions passed to the BullAdapter on creation. In this user can specify the dataFormatter, which provides an alternative way to parse job data to be displayed in the Jobs List UI.
Rationale
I have a rather large payload that I send over my queue, and parsing that causes the UI to be very unresponsive. Using a custom data parser I can now instead show a subset of the full payload in the UI.