-
Notifications
You must be signed in to change notification settings - Fork 1
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
NMR #214
NMR #214
Conversation
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.
The code looks very good! Just some comments line:
app/assets/javascripts/3dbio_viewer/src/data/repositories/NMRApiRepository.ts
Show resolved
Hide resolved
app/assets/javascripts/3dbio_viewer/src/data/repositories/NMRApiRepository.ts
Outdated
Show resolved
Hide resolved
} | ||
|
||
saveNMRTarget(target: NMRFragmentTarget) { | ||
const targetKeys = ["name", "uniprotId", "start", "end", "fragments"]; |
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.
This save
does not belong to NMRApiRepository, note how we are not using the api. In the past, we'd create some export repository + a JSON data implementation. However, Jorge's advice is not to have import/export features as repositories, instead do it in the presentation (webapp, script) layer. So the use case simply gets the entity values (getNMRTarget) and the generation of the JSON+save is done in the react app (to keep it clean, in a different file, but in the presentation layer)
📌 References
📝 Implementation
Added NMR Dialog with a list of the NMR fragments of each Target. Added two loaders and a pagination. On first glance, a simple request is made to retrieve the 25 first fragments and the count of them to be able to build the pagination. Later, each time the page is changed, it will trigger a new request to the API. An "Export all fragments" function has been added: it will first get the pagination count, in order to build all the needed requests to fullfill all the fragments of the target sequentially.
🎨 Screenshots
🔥 Testing
Please note the feature of being able to cancel the "export all fragments" request.