-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Feat/import model 146 #233
Merged
DonovanMaillard
merged 15 commits into
PnX-SI:project-FLA_NS
from
mvergez:feat/import-model-146
Oct 6, 2021
Merged
Feat/import model 146 #233
DonovanMaillard
merged 15 commits into
PnX-SI:project-FLA_NS
from
mvergez:feat/import-model-146
Oct 6, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Added an import button to import fields from a json (that can be exported from the report or can be generated by hand, only need source field and target field normally)
Clears all the fields when a json file is loaded Added comment and better display of errors
Add nomenclature import (not working for now) Did some refactor : added a FileService to read json data and to simplify the code
Moved code section to a function to be able to reuse it for the load from json functionnality Implemented this functionnality. Need to test
Model import is now done thanks to a modal when the user can provide the model name and the json file
Add modal to import mapping fields from json
When creating a new model, the form is automatically filled in but cleared afterwards... Try to fix this
Removed ForbiddenName directive since the API call make a toaster appear if the name is already taken Changed the file service to take a File as an input and not an event Removed some lines in the save mapping to try to fix the "empty form bug"
When the user imports a json, a new model is created and the form is filled. BUT: the select widget must be refresh to select the new model and since it is done concurrently, the json load was not done. Fix this by reading the json at the end. It will be more difficult with nomenclatures...
Removed the forbiddenModelName.directive.ts which is not used anymore
Fixed the nomenclature field import via json. Find that there is a subscribe in the content-mapping.service.ts which is not advised. So replaced it with a map and call subscribe in the component directly. Cleaner and there are no race between the form fields actualisation and their cleaning. First clean the fill the fields with the json file data
Close the modal when the user finishes to import the json for the nomenclature fields. Like it is done for the mapping fields
Removed edit slider in import modal since we do not want model edition with a json Did the same thing for the field-mapping.service.ts as it was done for the content-mapping.service.ts: change subscribe to map since subscribe is generally done in the component and not the service
Closed
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Objectif
Ces fichiers peuvent être crées à la main ou exportés depuis le rapport d'import (voir #158). Exemple d'un fichier :
Implémentation
Première implémentation : chargement depuis le front d'un fichier json et remplacement direct des champs par son contenu.
Si aucun champ n'a été mappé une erreur (via un toaster) est affichée.
Closes #146