-
Notifications
You must be signed in to change notification settings - Fork 127
Add support for uploading/deleting assets from a resource #2174
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
Conversation
Summary of ChangesHello @dsuren1, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces robust functionality for managing assets associated with resources. It enables users to seamlessly upload new files via a drag-and-drop interface and remove existing assets directly from the resource details page. This enhancement integrates new API endpoints, client-side logic for file handling and validation, and a user-friendly interface, significantly improving the resource management experience by allowing for richer content attachment and organization. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request introduces functionality for uploading and deleting assets associated with a resource. The changes are well-structured, touching upon API constants, client-side API calls, a new React component for asset management, and localization files. The implementation leverages modern React features and handles asynchronous operations effectively. However, I've identified a few issues concerning data validation, potential runtime errors, and inconsistencies in translation strings that should be addressed to improve the robustness and user experience of this new feature.
geonode_mapstore_client/client/js/plugins/ResourceDetails/components/DetailsAssets.jsx
Show resolved
Hide resolved
geonode_mapstore_client/client/js/plugins/ResourceDetails/components/DetailsAssets.jsx
Outdated
Show resolved
Hide resolved
geonode_mapstore_client/static/mapstore/gn-translations/data.de-DE.json
Outdated
Show resolved
Hide resolved
geonode_mapstore_client/static/mapstore/gn-translations/data.es-ES.json
Outdated
Show resolved
Hide resolved
geonode_mapstore_client/static/mapstore/gn-translations/data.fr-FR.json
Outdated
Show resolved
Hide resolved
geonode_mapstore_client/static/mapstore/gn-translations/data.it-IT.json
Outdated
Show resolved
Hide resolved
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.
I was trying to test it locally and I noticed that configuration related to assets tab was removed in this PR #2042.
- we should re-introduce the configuration of assets panel in the resources as before.
- the mouse click out close the panel also when clicking at the bottom of the panel. I think the click out node should be applied to the wrapper https://github.com/GeoNode/geonode-mapstore-client/blob/master/geonode_mapstore_client/client/js/plugins/ResourceDetails/ResourceDetails.jsx#L321
@allyoucanmap
I have added resource panel wrapper to extra nodes. So the click out should be prevented when clicking at the bottom panel |
allyoucanmap
left a comment
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.
@dsuren1 Related to the configuration we don't need to restore as you pointed out, I was confused because I was not able to see the assets tab in created dataset or other resources (e.g. maps).
Now that we have have the possibility to upload assets, the assets tab should be visible always when a user has can edit permissions
geonode_mapstore_client/client/js/plugins/ResourceDetails/ResourceDetails.jsx
Outdated
Show resolved
Hide resolved
…me_series * commit '89fc69cd1f20ce048a5e0e19baa8a06bfca466a7': Fix: 2154 : Download metadata available for everyone (GeoNode#2172) [create-pull-request] automated change (GeoNode#2179) Add support for uploading/deleting assets from a resource (GeoNode#2174) [create-pull-request] automated change (GeoNode#2178) [Fixes GeoNode#2055] Add compile:dev script using MAPSTORE_COMPILE_DEV=true for debug-friendly production builds (GeoNode#2056) Upgrade to Django 5.2 (GeoNode#2173)
Description
This PR adds support for uploading new assets and deleting existing ones from a resource
Screenshot