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

WIP: Add ability to reorder Workspaces using drag and drop #497

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

SpecialAro
Copy link
Member

@SpecialAro SpecialAro commented Jul 19, 2022

Pre-flight Checklist

  1. Please remember that if you are logging a bug for some service that has stopped working or is working incorrectly, please log the bug here
  2. If you are requesting support for a new service in Ferdium, please log it here
  3. Please remember to read the self-help documentation - in case it helps you unblock yourself for issues related to older versions of recipes that were installed on your machine. (These will get automatically upgraded when you upgrade to the newer versions of Ferdium, but to get new recipes between Ferdium releases, this documentation is quite useful.)
  4. Please ensure you've completed all of the following.

Description of Change

Add order ability to Workspaces

Motivation and Context

This is a WIP for adding the ability of order Workspaces in the Workspace Drawer and in the Workspace Settings.
The idea is to fix #146.

To do:

  • Add order buttons to the Workspace Drawer
  • Add order functionality to the buttons on the Workspace Drawer (mobx is complaining about this given I'm not using an action for changing the index)
  • Add order buttons to the Workspace Settings
  • Add the same functionality to the buttons on Workspace Settings

I think I'm needing some help setting up the actions to reorder workspaces - as it is now, the workspaces are reordered but only until the Ferdium restarts/reloads, which is due to the fact that the "new" order is not being saved in the API. If anyone can help me with that I would really appreciate it :D

Screenshots

(so far... )
image
image

Checklist

  • My pull request is properly named
  • The changes respect the code style of the project (npm run prepare-code)
  • npm test passes
  • I tested/previewed my changes locally

Release Notes

@SpecialAro SpecialAro requested a review from a team July 19, 2022 15:45
@SpecialAro SpecialAro self-assigned this Jul 19, 2022
name={workspace.name}
isActive={actualWorkspace === workspace}
onClick={() => {
if (actualWorkspace === workspace) return;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would personally place the return within brackets on the next line as this is easier to read.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You and I both... But eslint didn't like it that way 🤣

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eslint config can be modified 🌚

@cino
Copy link
Contributor

cino commented Jul 19, 2022

So to update the order in the API we would need to create/update some endpoints to support that. I'm a little in doubt if we wanna implement that in the current API version or wait for the v2 to be completed and make it fully testable

@SpecialAro
Copy link
Member Author

So to update the order in the API we would need to create/update some endpoints to support that. I'm a little in doubt if we wanna implement that in the current API version or wait for the v2 to be completed and make it fully testable

Maybe we can wait for the V2 to be completed 😁

@vraravam
Copy link
Contributor

Maybe we can wait for the V2 to be completed 😁

in that case, do we want to hold 6.0.0 release?

@SpecialAro
Copy link
Member Author

in that case, do we want to hold 6.0.0 release?

I don't think we need to hold back for this PR. We can easily then merge new features in a minor/patch version or so.
But if you think it is better to have the internal-server v2 working, maybe we can wait.
What do you think?

@vraravam vraravam changed the title WIP: Add order ability to Workspaces WIP: Add ability to reorder Workspaces using drag and drop Jul 21, 2022
@m-roberts
Copy link

m-roberts commented Sep 24, 2022

I would love to see this completed!

I think I'm needing some help setting up the actions to reorder workspaces - as it is now, the workspaces are reordered but only until the Ferdium restarts/reloads, which is due to the fact that the "new" order is not being saved in the API. If anyone can help me with that I would really appreciate it :D

I have some notes/thoughts that I've started writing as early thoughts that I may use to attempt to make some changes:

  • The API server and internal server both need to be updated for full support.
  • Services can be re-ordered with ServiceController.reorder, and I suspect that app/Controllers/Http/WorkspaceController.js (in both places) just needs a similar implementation.
  • reorderService function in src/api/server/ServerApi.ts routes to ServiceController.reorder.
  • I am not quite clear on this right now, as there is a ServicesApi but not a WorkspacesApi.

m-roberts added a commit to m-roberts/ferdium-app that referenced this pull request Dec 24, 2022
m-roberts added a commit to m-roberts/ferdium-app that referenced this pull request Dec 24, 2022
@ThinkSalat
Copy link

Amazing, would love to see this possibility. The only alternative is deleting and recreating workspaces.

@mpiniarski
Copy link

Any updates here?
I can pick it up and finish the implementation.

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.

Feature: Reorder Workspaces
6 participants