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

Tracking issue: Load default presets #395

Closed
2 tasks done
tomasciccola opened this issue Nov 29, 2023 · 3 comments
Closed
2 tasks done

Tracking issue: Load default presets #395

tomasciccola opened this issue Nov 29, 2023 · 3 comments
Assignees
Labels
mvp Requirement for MVP

Comments

@tomasciccola
Copy link
Contributor

tomasciccola commented Nov 29, 2023

Description

When a project is created the user should get the default presets with its associated fields and icons. What we end up after talking with @gmaclennan is the following:

  1. Bundle the default config file inside the app (probably on this repo). This can change in terms of user need. i.e. the config could be distributed as a regular file that gets loaded through a dialog in the frontent.
  2. When creating a new project, we first delete all the presets in the db (to avoid db bloat) and then load and write to the db the default fields, icons and lastly the presets.
  3. After inviting a new peer to the project, they would get all the default presets from the project creator

Additionally we discussed replacing the format from a tarball to a zip (since it can be open in every OS without a command line) and the extension from .mapeosettings to .mapeoconfig.
I've already created the issue on the mapeo-settings-builder repo to take that into account for future configs

@tomasciccola tomasciccola self-assigned this Nov 29, 2023
@gmaclennan
Copy link
Member

2. When creating a new project, we first delete all the presets in the db (to avoid db bloat) and then load and write to the db the default fields, icons and lastly the presets.

Just a note that the deletion of presets, fields and icons as the first step in adding a new config file is not to avoid db bloat (because it's an immutable database it gets even bigger with deletions), it's a quick-and-dirty way to avoid ending up with duplicate presets. We should do something smarter (e.g. deterministically hashing presets, fields and icons so that we don't delete and recreate ones that have not changed), but that can be a follow up I think.

3. After inviting a new peer to the project, they would get all the default presets from the project creator

Just to note that this task doesn't require anything here - the invite flow already syncs presets before completion.

@gmaclennan
Copy link
Member

Can you split this into two issues:

  1. Add a project.importConfig({ pathToConfigFile }) method that imports presets, fields and icons from a config file into the database.
  2. Pre-populate the database with default config when a project is first created.

(1) should be done first, then we can work on (2) separately.

@tomasciccola tomasciccola changed the title Load default presets Tracking issue: Load default presets Dec 4, 2023
@ximenabb ximenabb added the mvp Requirement for MVP label Feb 8, 2024
@tomasciccola
Copy link
Contributor Author

Does it make sense to close this? There's follow up work on loading a config, so maybe we could add tasks to this issue and keep it open? (I'm fine either way...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mvp Requirement for MVP
Projects
None yet
Development

No branches or pull requests

3 participants