-
Notifications
You must be signed in to change notification settings - Fork 4
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
Bulk Upload #91
Open
davegson
wants to merge
113
commits into
master
Choose a base branch
from
feature/bulk-upload
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Bulk Upload #91
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
- data is stored in store/bulk-upload.js - basic UI elements - closing and revisiting page works, as it grabs previously set data from store
- better UX - also prevents double mapping of same column
more consistent than sometimes using it and sometimes using direct $store
- change that you can select CSV or a defined phaidra element
instead of having a form for each field, just load the phaidra element inputs - the vue will then take care of loading the appropriate values
since ; splits the columns, it must be different than ;
use vuex state instead of old store solutions which no longer worked also cleaned up a lot of the code to be much simpler
now each field both have a source and a value, which makes it easier to differentiate between csv source and phaidra fields
simplifies logic & removes unneeded code
the method getSubFieldMapping only is triggered in multi-fields, so no need for those if elses
first row in csv are headers an should not be displayed as a data row
in order to also show optional phaidra sub-fields and not default source from phaidra even if unsourced
made logic a lot simpler, less if else trees
this will make it easier to re-use
the setting of columns was unnecessary since it can be derived from the csvContent so just define a getter in bulk-upload.js and use that wherever headers are needed
also make it hard to tinker around with stuff more. Disable back & upload button, overlay upload form
left overs from another logic structure
try to get as much info from field-settings page as possible, making the logic in upload less complex
reduces file size of upload.vue
instead of havig a method simply accessing data through getters, just get the values directly. Simpler. Better. Cleaner.
copied from Rasta's uploader implementation. Some phaidra fields need this in order to properly set data
csv sources also need to structure their logic off of field-settings as the data - this moves further logic into field-settings (the main source of phaidra field logic)
this way we can easily customize what needs to be done for every csv field. EG: we split keywords by ',' so an array is passed to API. Which needs that format to correctly create the keywords
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in 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.
About the Code Structure:
we have 4 steps to go through for a bulk upload with 4 routes
when only /bulk-upload is called, the index redirects the user to their last step via middleware
the main config is in field-settings.js, where as much logic is derived from as possible. The idea is that you can configure that file and through that you can change or add more fields. I think there are still places where we can export its custom logic into the field-settings, but so you understand the overall goal. Especially since there is lots of custom logic for each phaidra component - this was the attempt of unifying all that logic.
another central place of logic is store/bulk-upload.js, which defines all logic for Local Storage
all other files basically reference to those two main logic files but also have individual logic where needed
that's it for the intro - looking forward to hear from your experienced perspective!