- 
                Notifications
    You must be signed in to change notification settings 
- Fork 2
feat(save_and_load): add import/export methods #249
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
base: next
Are you sure you want to change the base?
Conversation
…persistence create project manager plugin for import/export operations update tests for new functionality and async loading
…ns/OpenGeodeWeb-Front into feat/save_and_load
…b-Front into feat/save_and_load
        
          
                plugins/project_manager.js
              
                Outdated
          
        
      There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quel est l'objectif de ce plug-in, c'est pas déjà le rôle de l'app store?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pour moi l'app_store ne fait que de la gestion d'état sans créer de fichier ni réseau. Il permet de créer un snapshot avec le save() sous forme d'objet.
Le plugin utilise les méthode de l'appStore pour transformer le snapshot en JSON et créé un Blob, enfin lance un téléchargement pour le save.
Pour moi, le plugin utilise app_store comme moteur de snapshot et ne réimplémente pas le save & load
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je crois que je comprends, dans l'idée il faudrait :
exporter : compresser l'état de Project_folder_path et lui passer aussi le snapshot pour restaurer le style, etc. et ziper le tout
importer : recoit le zip, remplace le project_folder actuel et utilise aussi le snapshot qui sera utilisé par les stores dans le Front
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Un plug-in de pinia, c'est globalement l'idée d'ajouter une fonctionalité à tous les stores ou certains. Là, ce que tu veux ajouter ces pas vraiment en line avec pinia et les stores mais plutôt une action spécifique de l'app store. Qui en effet est un peu plus complexe que juste l'app store, ta question est pertinente.
Peut-être qu'il faut mettre la logique de ton plug-in dans un composable qui utiliserait l'app store et le geode store ? @JulienChampagnol qu'en penses tu ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je vais voir pour porter project_manager en tant que composable et non en tant que plugin Pinia et en même temps utiliser le store geode.js
…ns/OpenGeodeWeb-Front into feat/save_and_load
…ns/OpenGeodeWeb-Front into feat/save_and_load
…ns/OpenGeodeWeb-Front into feat/save_and_load
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JulienChampagnol que penses tu de cette proposition ?
        
          
                composables/project_manager.js
              
                Outdated
          
        
      | const url = `${geode.base_url}${schema.$id}` | ||
| const method = schema.methods[0] | ||
|  | ||
| const response = await fetch(url, { | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pk ne pas utiliser api_fetch?
        
          
                composables/project_manager.js
              
                Outdated
          
        
      | const filename = response.headers.get("new-file-name") | ||
| const urlObject = URL.createObjectURL(blob) | ||
| const a = document.createElement("a") | ||
| a.href = urlObject | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JulienChampagnol tu n'avais pas utilisé un truc pour faire ça simplement ?
…persistence
create project manager plugin for import/export operations update tests for new functionality and async loading