bull-board icon indicating copy to clipboard operation
bull-board copied to clipboard

Add pin job functionality

Open theoilie opened this issue 1 year ago • 4 comments

  • Closes #424
  • Adds a new "Pin" button to the right of each job's ID
  • Click the Pin button to toggle pinning the job
  • Pinned jobs stay at the top of the page and have a border and highlighted Pin button to differentiate them
  • Pinned jobs maintain their order (sorted by ID)

https://user-images.githubusercontent.com/4657956/182306289-11e8a847-f6a0-49b3-88d8-934153c76b44.mov

theoilie avatar Aug 02 '22 06:08 theoilie

Hi @theoilie thank you for the PR.

Few concerns,

  1. Does it apply the pinning for all job statuses or only for the latest one?
  2. What happens if the job finished & it pinned?
  3. The place that you've put the button won't work with long ids (this is the default), maybe it is better to put to button with the job action button? WDYT?

felixmosh avatar Aug 02 '22 07:08 felixmosh

Hey @felixmosh thanks for your feedback --

  1. The typical flow for me is to look at completed jobs so I'd only pin in that status, but currently this pins across all statuses within the same queue.
  2. It will stay pinned at the top no matter what the status is or what status tab you're viewing. So if it finishes it doesn't move away from the top.
  3. I can move the button elsewhere, but making it as an action prevents using it in readOnly mode. In my use case we use readOnly but we still want to be able to pin a job because it's just visual and doesn't actually change the job. What if I put it as a new row/div below the job ID instead of to the side of it? (see video below)

Updated demo (I also fixed a sorting bug after taking this demo, so please ignore that part -- it's correctly sorting by processedOn now):

https://user-images.githubusercontent.com/4657956/182493195-ea96d112-3b35-4a23-9ca0-2a6c19693697.mov

theoilie avatar Aug 02 '22 23:08 theoilie

Thank you for the update.

Do you know what will happen if the job has removeOnComplete flag?

felixmosh avatar Aug 03 '22 09:08 felixmosh

Thank you for the update.

Do you know what will happen if the job has removeOnComplete flag?

Good question -- supporting this directly would've been messy with supporting the KeepOptions flag and others, so I pushed a change to go the more generic route and only show jobs in the Status that is currently in view. This means that now removeOnComplete and removeOnFail will be respected, and changing Status tabs will also unpin jobs. This should be fine because the typical use case for pinning a job is only to view it in that same Status tab.

theoilie avatar Aug 08 '22 03:08 theoilie

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Nov 06 '22 03:11 stale[bot]