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

OpenVPN: Add shortcuts in main profile view #1167

Merged
merged 18 commits into from
Feb 12, 2025
Merged

Conversation

keeshux
Copy link
Member

@keeshux keeshux commented Feb 12, 2025

Some useful shortcuts can be replicated in the main profile screen.

Requirements:

  • Modules implementing ModuleDestinationProviding return a navigationDestination() to navigate to module-specific routes (e.g. OpenVPN credentials). This was done in Move module destinations to standalone entities #1166
  • In order to navigate to the module routes from the main ProfileCoordinator view, it must have a navigationDestination() attached for each of the modules, without knowing the concrete route types

Here is how this is accomplished in a generic fashion:

  1. ProfileEditor.navigationDestinations() iterates over each ModuleDestinationProviding to return a list of navigationDestination(), implemented as a ViewModifier
  2. With this in place, module routes can be pushed with a NavigationLink from the main profile view
  3. Lastly, in the profile view, we add a section for each module implementing ModuleShortcutsProviding, where the module may return a list of convenient shortcuts, e.g. in the form of the NavigationLink in 2

Start with some OpenVPN entries:

  • Provider server
  • Credentials (if needed)

Some refactoring was necessary:

  • Load ModulePreferences in the module destinations via ModulePreferencesModifier, rather than in the module view (may revisit later)
  • Due to the above, move "Remote endpoints" from "Configuration" to a separate destination (also less messy)
  • Group complex module views (OpenVPN/WireGuard) into folders
  • Reuse ProviderServerRow for consistency across modules/shortcuts

@keeshux keeshux self-assigned this Feb 12, 2025
@keeshux keeshux added OpenVPN enhancement New feature or request labels Feb 12, 2025
@keeshux keeshux added this to the 3.1.0 / UX milestone Feb 12, 2025
@keeshux keeshux merged commit 9974ca6 into master Feb 12, 2025
@keeshux keeshux deleted the feature/module-shortcuts branch February 12, 2025 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request OpenVPN
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant