-
Notifications
You must be signed in to change notification settings - Fork 148
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
bug: add message to browse page when no subcoms #2864
base: master
Are you sure you want to change the base?
Conversation
95c9faa
to
fcb0205
Compare
/>, | ||
subCommunitiesContainer | ||
); | ||
if (apiEndpoint.length) { |
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 change is not clear to me. Is the apiEndpoint
unset when there are no sub communities?
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.
yep, we only include the 'subcommunities' endpoint to the links when the community is allowed to have children which means that the apiEndpoint is otherwise empty
@@ -12,6 +12,7 @@ | |||
{% set active_community_header_menu_item= 'browse' %} | |||
{% set subcommunities_endpoint = community["links"]["subcommunities"] %} | |||
{% set community_slug = community["slug"] %} | |||
{% set children_allowed = community["children"]["allow"] %} |
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.
There is already a _show_browse_page here: why is it not working correctly?
Is it in the case you have a direct link?
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 _show_browse_page
is for whether the Browse
link should appear in the menu. This variable children_allowed
is toggling whether we should link to the subcommunities react search kit page. When children aren't allowed this page 404s
<a class="align-self-center rel-ml-1" href="{{url_for('invenio_communities.communities_subcommunities', pid_value=community_slug)}}"> | ||
{{ _('See all')}} | ||
</a> | ||
{% endif %} | ||
</div> | ||
<div class="ui divider hidden"></div> | ||
<div id="subcommunities-container"></div> |
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.
Move data-api-endpoint
config here and change the react application to read this config. Also, the "No subcommunities" message can be computed on the level of the template instead of React.
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 made the changes and tested that it works :)
fcb0205
to
049a0c0
Compare
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.
LGTM!
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.
LGTM! 🚀
049a0c0
to
a5e1554
Compare
...o_app_rdm/communities_ui/templates/semantic-ui/invenio_communities/details/browse/index.html
Outdated
Show resolved
Hide resolved
a5e1554
to
61bf9c7
Compare
Children disabled. Before and after:
Children enabled (See all visible in after). Before and after: