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

feat: Add ability to re-arrange job queue's items #1692

Merged

Conversation

mdziekon
Copy link
Contributor

Description

This PR adds the ability to re-arrange job queue's items, by using the following actions:

  • Move to the queue's start (make it the first item)
    • Displayed for all items beside first
  • Move to the queue's end (make it the last item)
    • Displayed for all items beside last
  • Move item up
    • Displayed for all items beside first & second
    • Second item already has "move to start", which is funtionally the same
  • Move item down
    • Displayed for all items beside last & next to last
    • Next to last item already has "move to end", which is funtionally the same

All of the actions are available via the context menu (Right-click on the queue's entry). While "move up" & "move down" are probably not ideal for quick re-arrangements (drap & drop would be much easier to use), I think it's good enough for now, most definitely better than no such feature at all. The internal implementation is done is such a way, that if anyone would like to improve this by implementing the mentioned drag & drop, the re-arrangement "backend" is already there, ready to be reused. I think this could also be reused to implement the requested "Start printing from anywhere in the queue" feature, however I'm not versed enough in the Vue's ecosystem to implement that at this moment.

Since the modified component is properly being reused across Job Queue panel on the Dashboard and the Files list, the implemented features are available for both of these views.

Additional changes:

  • StatusPanelJobqueueEntry component no longer relies of its status of being "first" to display the "print button"
    • This approach clashed with reusability of the implemented, new features
    • New approach (showPrintButtonForFirst flag) clearly represents the purpose, while the previous implementation required internal knowledge to understand why the button was being displayed or not

Related Tickets & Documents

Mobile & Desktop Screenshots/Recordings

(see next comment)

[optional] Are there any post-deployment tasks we need to perform?

N/A

Signed-off-by: Michał Dziekoński <michal.dziekonski+github@gmail.com>
Signed-off-by: Michał Dziekoński <michal.dziekonski+github@gmail.com>
Signed-off-by: Michał Dziekoński <michal.dziekonski+github@gmail.com>
Signed-off-by: Michał Dziekoński <michal.dziekonski+github@gmail.com>
Signed-off-by: Michał Dziekoński <michal.dziekonski+github@gmail.com>
Signed-off-by: Michał Dziekoński <michal.dziekonski+github@gmail.com>
Signed-off-by: Michał Dziekoński <michal.dziekonski+github@gmail.com>
(second & next to last items)

Signed-off-by: Michał Dziekoński <michal.dziekonski+github@gmail.com>
@mdziekon
Copy link
Contributor Author

mdziekon commented Dec 16, 2023

Mobile & Desktop Screenshots/Recordings

One item only (no re-arrange) buttons

obraz

Three items, re-arrange buttons displayed for each

obraz

Multiple items, re-arrange first item

obraz

Multiple items, re-arrange second item

obraz

Multiple items, re-arrange middle item

obraz

Multiple items, re-arrange next to last item

obraz

Multiple items, re-arrange last item

obraz

Multiple items, job queue overflow (Dashboard only), re-arrange last DISPLAYED item (queue is longer)

obraz

Multiple items, Files view, re-arrange second to last item

obraz

Copy link
Contributor

Language file analysis report:

File Missing Keys Unused Keys
en.json 0 0
pl.json 30 1

2 similar comments
Copy link
Contributor

Language file analysis report:

File Missing Keys Unused Keys
en.json 0 0
pl.json 30 1

Copy link
Contributor

Language file analysis report:

File Missing Keys Unused Keys
en.json 0 0
pl.json 30 1

@mdziekon mdziekon force-pushed the feature/job-queue-rearrange-items branch 2 times, most recently from c5921b8 to 5e9d618 Compare December 16, 2023 18:44
Copy link
Contributor

Language file analysis report:

File Missing Keys Unused Keys
en.json 0 0
pl.json 30 1

Signed-off-by: Michał Dziekoński <michal.dziekonski+github@gmail.com>
Signed-off-by: Michał Dziekoński <michal.dziekonski+github@gmail.com>
Signed-off-by: Michał Dziekoński <michal.dziekonski+github@gmail.com>
@mdziekon mdziekon force-pushed the feature/job-queue-rearrange-items branch from 5e9d618 to fd09c33 Compare December 16, 2023 18:45
Copy link
Contributor

Language file analysis report:

File Missing Keys Unused Keys
en.json 0 0
pl.json 30 1

1 similar comment
Copy link
Contributor

Language file analysis report:

File Missing Keys Unused Keys
en.json 0 0
pl.json 30 1

@meteyou
Copy link
Member

meteyou commented Dec 16, 2023

Thx for the PR. Would it be also possible with a "drag & drop" option like the resort function of "expert macro panel"?

@mdziekon
Copy link
Contributor Author

mdziekon commented Dec 16, 2023

Thx for the PR. Would it be also possible with a "drag & drop" option like the resort function of "expert macro panel"?

@meteyou

Hi, I'm not sure if you asked me to do that in this PR, or is it technically possible to achieve that in the future (as in, in a separate PR), so I'll answer both:

  • Can I implement "drap & drop" in this PR?
    • No, currently I'm not experienced enough in the Vue ecosystem.
    • I did briefly experiment with draggable just now, and while I think the callback should supply necessary data to pass them into changePosition action, the styling gets completely wrecked. Looking at draggable usages, none uses tables to display the entries, so I'm not even sure if draggable is compatible with tables. But as I said, I'm not a "Vue guy" on a day to day basis, so maybe someone else has a better idea how to achieve it.
    • I think you'll need someone else to be a champion of said improvement. I would recommend treating this PR as a stop-gap solution, while waiting for someone else to step up and implement the drag & drop.
  • Can "drag & drop" be achieved using currently implemented action?
    • Yes, I think so, as I said above while investigating draggable component. The changePosition action requires only the "final position", which as far as I can tell, draggable does provide in its callback. It's the presentation that needs to be figured out, not the final re-arrangement, which is already done.

@meteyou
Copy link
Member

meteyou commented Dec 16, 2023

@mdziekon Thank you for your reply. Please just let this PR open, and I'll take a closer look at it. Because the option "maintainers are allowed to edit this pull request", I can continue working on it.

@Master92
Copy link

I'd just like to stop by and say thank you for this PR. This is exactly the feature I was just looking for at this very moment! 😃

Drag and drop support would be really nice, though. 👍

@AdamBarnas
Copy link

AdamBarnas commented Jan 18, 2024

I just started using job queue and first thing i thought was it needs this feature. So as soon as I started searching for it I found this PR. Great job @mdziekon. I'm looking forward to use it as soon as it is merged. Is there a way to try it out sooner?

Copy link
Contributor

github-actions bot commented Feb 3, 2024

Language file analysis report:

File Missing Keys Unused Keys
en.json 0 7
pl.json 65 10

Signed-off-by: Stefan Dej <meteyou@gmail.com>
Copy link
Contributor

github-actions bot commented Feb 3, 2024

Language file analysis report:

File Missing Keys Unused Keys
en.json 0 7
pl.json 65 10

Signed-off-by: Stefan Dej <meteyou@gmail.com>
Signed-off-by: Stefan Dej <meteyou@gmail.com>
Signed-off-by: Stefan Dej <meteyou@gmail.com>
Copy link
Contributor

github-actions bot commented Feb 3, 2024

Language file analysis report:

File Missing Keys Unused Keys
en.json 0 7
pl.json 66 10

Signed-off-by: Stefan Dej <meteyou@gmail.com>
Copy link
Contributor

github-actions bot commented Feb 3, 2024

Language file analysis report:

File Missing Keys Unused Keys
en.json 0 0
pl.json 66 10

Signed-off-by: Stefan Dej <meteyou@gmail.com>
Copy link
Contributor

github-actions bot commented Feb 3, 2024

Language file analysis report:

File Missing Keys Unused Keys
en.json 0 0
pl.json 66 4

@meteyou meteyou merged commit 9418603 into mainsail-crew:develop Feb 3, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants