Skip to content

Conversation

@dsuren1
Copy link

@dsuren1 dsuren1 commented Oct 2, 2025

Description

This PR adds support for uploading new assets and deleting existing ones from a resource

Screenshot

image

@dsuren1 dsuren1 requested a review from allyoucanmap October 2, 2025 11:08
@dsuren1 dsuren1 self-assigned this Oct 2, 2025
@dsuren1 dsuren1 added enhancement New feature or request geonode-ui labels Oct 2, 2025
@gemini-code-assist
Copy link

Summary of Changes

Hello @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

  • API Endpoint & Functions: New /api/v2/assets endpoint and corresponding uploadAsset and deleteAsset functions have been introduced to handle asset management.
  • Enhanced Asset Management UI: The DetailsAssets component has been significantly refactored to include a drag-and-drop interface for uploading new assets and a delete option for existing ones, complete with validation and notification feedback.
  • Utility Functions: New utility functions like getSupportedDocumentTypes were added to manage allowed file types for uploads.
  • Internationalization: New translation keys have been added across multiple languages to support the new asset upload and delete features.
  • Styling Updates: The UI for asset management, including the upload dropzone and delete buttons, has received new styling.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@dsuren1 dsuren1 changed the title Add support for uploading new assets and deleting existing ones from a resource Add support for uploading/deleting assets from a resource Oct 2, 2025
Copy link

@gemini-code-assist gemini-code-assist bot left a 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.

Copy link
Collaborator

@allyoucanmap allyoucanmap left a 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.

@dsuren1
Copy link
Author

dsuren1 commented Oct 7, 2025

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.

@allyoucanmap
The assets tab was not removed but was made ResourceDetails plugin's default tab configuration. The tab is hidden when resource has no assets information associated. The assets is added as an additional property to resource.

  • 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

I have added resource panel wrapper to extra nodes. So the click out should be prevented when clicking at the bottom panel

@dsuren1 dsuren1 requested a review from allyoucanmap October 7, 2025 06:04
Copy link
Collaborator

@allyoucanmap allyoucanmap left a 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

@dsuren1 dsuren1 requested a review from allyoucanmap October 7, 2025 12:11
@allyoucanmap allyoucanmap merged commit eb62a99 into GeoNode:master Oct 7, 2025
1 check passed
dsuren1 added a commit to dsuren1/geonode-mapstore-client that referenced this pull request Oct 9, 2025
…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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request geonode-ui

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants