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

details header: remove hardcoded header, remove empty tabs #996

Merged
merged 1 commit into from
Aug 17, 2023

Conversation

jennur
Copy link
Member

@jennur jennur commented Aug 14, 2023

Closes https://github.com/zenodo/rdm-project/issues/172, closes inveniosoftware/invenio-app-rdm#2327

  • Removes "about" and/or "curation policy" tabs if no content
  • Removes hard coded headline for Curation policy

No page contents added:
Screenshot 2023-08-14 at 15 34 35
Only curation policy content added:
Screenshot 2023-08-14 at 15 35 11
Both added:
Screenshot 2023-08-14 at 15 35 41

@jennur jennur force-pushed the community-tabs branch 7 times, most recently from b944849 to b77efb4 Compare August 16, 2023 13:00
@zzacharo zzacharo merged commit 16bb677 into inveniosoftware:master Aug 17, 2023
6 checks passed
Copy link
Contributor

@ntarocco ntarocco left a comment

Choose a reason for hiding this comment

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

@jennur @kpsherva I have added a few extra comments, sorry for the late review!

@@ -29,6 +29,7 @@ def view(**kwargs):
id_=pid_value, identity=g.identity
)
kwargs["community"] = community
request.community = community.to_dict()
Copy link
Contributor

Choose a reason for hiding this comment

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

We normally use the g context, and not the request context. From the Flask doc:

  • g: This is a good place to store resources during a request.
  • request: To access incoming request data, you can use the global request object. Flask parses incoming request data for you and gives you access to it through that global object.

Minor: community.to_dict() is repeated below, it could be set once, and re-used.

Moderate: can you add a comment to explain why? It won't be easy to understand why this was done, and it might break quite easily.

@@ -65,6 +65,26 @@ def _can_create_community():
return can_create


def _has_about_page_content():
"""Function used to check if about page has content."""
community = request.community
Copy link
Contributor

Choose a reason for hiding this comment

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

See comment above about using g instead. Very minor: I would also call it current_community to make it very clear.

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.

Tab should not show for empty about/curation policy page
5 participants