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

✨ Export/Import settings to and from a json file support for the UI #629

Open
wants to merge 8 commits into
base: rolling
Choose a base branch
from

Conversation

neon-mmd
Copy link
Owner

@neon-mmd neon-mmd commented Nov 2, 2024

What does this PR do?

This PR provides the functionality to import and export user preferences from the search engine.

Why is this change important?

This change is essential as it provides the functionality for the users to easily export saved user preferences from the UI to their machines for backup. So that when the user change browsers or machines, then the user can easily import their backuped preferences for the UI. Additionally this change can also allow the user to write a json file with custom values which can be used to import their preferred custom preferences for the UI.

Screenshots

temp

How to test this PR locally?

It can be tested by installing and running Websurfx as mentioned in the docs and on the readme and by launching the browser and thoroughly testing. By saving some preferences on the UI via the settings page and exporting it as a json file and then clearing cookies for the search engine UI and then re-importing the json file. Additionally further checks can be carried by editing the backup file and providing inavlid values and testing whether the json values get santized as intended.

Author's checklist

  • Provide export/import buttons on the settings page.
  • Theme the buttons on the page.
  • Add functionality/logic for the buttons.
  • Refactor the API to support parsing of json data.
  • Bump the app verson to v1.21.0.

Related issues

Closes #427

…ute to handle post requests (#427)

- Add a new route `/download` which handles the export functionality of
  the user preferences as a `json` file.
- Update the `/settings` route to handle post requests for handling the
  import functionality of the user preferences. Also, taking care of the
  sanitization of the user provided `json` values.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

✨ Export/Import settings to and from a json file support for the UI
2 participants