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

Toggle Folders with Routes #1188

Open
nvanderwaal opened this issue Nov 16, 2023 · 5 comments · May be fixed by #1323
Open

Toggle Folders with Routes #1188

nvanderwaal opened this issue Nov 16, 2023 · 5 comments · May be fixed by #1323
Assignees
Labels
feature New feature request

Comments

@nvanderwaal
Copy link

Feature Request for Mockoon: Toggle Folders with Routes

Overview

Mockoon is a great tool for developers, as it provides the capability to organize routes into folders. This feature request aims to enhance the user experience even further by allowing folders containing routes to be toggled on and off (enabled/disabled) with a single action. By including this feature, users will be able to quickly and easily manage the availability of a group of routes without manually toggling each route individually.

Proposed Functionality

  1. Folder Toggle Icon: Add a toggle icon inside the dropdown of a folder in the route list, which allows users to enable or disable all routes within that folder simultaneously.

  2. Folder Toggle State: The folder should indicate the current state (enabled/disabled) of its associated routes by providing a clear visual cue for the user, such as a red line similar to the one used for routes.

  3. Mixed State: In case the folder contains a mix of enabled and disabled routes, the folder should show a mixed state (e.g., an orange line) to reflect this.

  4. Inheritance: When adding a new route to a folder, the route should inherit the toggle state of the folder it's being added to by default.

  5. Bulk Toggling: When the user toggles a folder on or off, all the routes within that folder should also be enabled or disabled accordingly, making it easy to manage groups of routes quickly.

Implementing this folder toggle feature will empower Mockoon users to work more effectively and efficiently with their route configurations. The ability to enable or disable multiple routes within a folder with a single action will save users time and contribute to an enhanced user experience overall.

@255kb 255kb added the feature New feature request label Jan 16, 2024
@santiagocarod
Copy link

Hi

I would like to take a look into this.

Please let me know!

Thanks

@255kb
Copy link
Member

255kb commented Feb 26, 2024

@santiagocarod sure you can, I will assign the issue to you.

My opinion on this proposed feature:

I would like to avoid adding a new status on the folder in the data model.
Each Route is listed as disabled in the desktop app settings. When running a mock with the CLI or serverless package, a list of uuids or keywords/path can be provided to disable them at runtime.

  1. yes, that makes sense
  2. why not, but only based on the route disabled status. It could be a red bar like for the route, eventually dashed, when only some route are disabled.
    image
  3. See no. 2. I would prefer a dashed red line, as orange/yellow is rather used for information requiring the user attention.
  4. As we shouldn't introduce a folder toggle state, I'm not sure about the inheritance. Maybe if al children are disabled, the new route could be disabled too? It's the only useful case I see.
  5. As we shouldn't introduce a folder toggle state, that is redundant with no. 1.

Main tasks that would be required:

  • adding a new context menu entry on folders to toggle its routes.
  • adding a new toggle state (right red bar) on the folder, summarizing it's own routes states.
  • making the CLI and serverless "keyword" look both in the paths and folder names.

Questions: should all this be recursive? Meaning, toggling applies to all the children, recursively. Same for the red bar indicator. Should it take into account all the children toggle states recursively? I would say no, to simplify this PR.

Happy to discuss here or on Discord.

@santiagocarod
Copy link

@255kb
Hi Guillaume!

Perfect, thanks

I'm checking it out right now as a first look.

I understand that you would like to avoid adding the status for the Folder data model, should I go with the same approach as the project currently has with disabledRoutes and collapsedFolders?

@255kb
Copy link
Member

255kb commented Feb 26, 2024

@santiagocarod I think we could go without adding any new state. For example, disabling from the folder menu could disable all the children route one by one. Like that we keep the feature small enough. What do you think?

@santiagocarod
Copy link

Yes, agree!
I think we can go step by step and keep things simple.
I think I got this functionality, let me make a PR with this

santiagocarod added a commit to santiagocarod/mockoon that referenced this issue Feb 26, 2024
@santiagocarod santiagocarod linked a pull request Feb 26, 2024 that will close this issue
5 tasks
santiagocarod added a commit to santiagocarod/mockoon that referenced this issue Feb 27, 2024
santiagocarod added a commit to santiagocarod/mockoon that referenced this issue Feb 27, 2024
 Toggle all direct children from folder mockoon mockoon#1188
santiagocarod added a commit to santiagocarod/mockoon that referenced this issue Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature request
Projects
Status: In progress
Development

Successfully merging a pull request may close this issue.

3 participants