Skip to content
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

pass config to deposit_create and deposit_edit #2889

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

karkraeg
Copy link
Member

@karkraeg karkraeg commented Oct 25, 2024

❤️ Thank you for your contribution!

Description

In order to fix inveniosoftware/invenio-rdm-records#1846 this passes current_app.config["APP_RDM_USER_DASHBOARD_ROUTES"]["uploads"] to the deposit form react app.

Checklist

Ticks in all boxes and 🟢 on all GitHub actions status checks are required to merge:

Reminder

By using GitHub, you have already agreed to the GitHub’s Terms of Service including that:

  1. You license your contribution under the same terms as the current repository’s license.
  2. You agree that you have the right to license your contribution under the current repository’s license.

@karkraeg
Copy link
Member Author

As @utnapischtim pointed out there is another place where the URL is hardcoded:

<RDMNoSearchResults {...props} searchPath="/me/uploads" />

I'll check if this can use the passed config as well

@karkraeg
Copy link
Member Author

As @utnapischtim pointed out there is another place where the URL is hardcoded:

<RDMNoSearchResults {...props} searchPath="/me/uploads" />

I'll check if this can use the passed config as well

As this is unrelated to this PR I'd vote for creating a new Issue for this

@@ -385,11 +385,14 @@ def deposit_create(community=None):
community_theme = community.get("theme", {})

community_use_jinja_header = bool(community_theme)

dashboard_uploads_route = current_app.config["APP_RDM_USER_DASHBOARD_ROUTES"][
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, thinking out loud, can we maybe pass down the dashboard routes object and just use the uploads subkey on the places that needed it? I am thinking e.g. you might need in some point to connect to /me/communities so it would be more flexible to have the information available. What do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
dashboard_uploads_route = current_app.config["APP_RDM_USER_DASHBOARD_ROUTES"][
dashboard_routes = current_app.config["APP_RDM_USER_DASHBOARD_ROUTES"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deleting a draft redirects to a hardcoded URL
2 participants