Skip to content

Commit

Permalink
Ensure channel persists on all navigation items (#1680)
Browse files Browse the repository at this point in the history
* Ensure channel persists on all navigation items

* Add channel to sub charms
  • Loading branch information
Lukewh authored Oct 9, 2023
1 parent 2374269 commit e702d22
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion templates/details/configure-bundle.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<ul class="p-side-navigation__list">
{% for charm in package.store_front.bundle.charms %}
<li class="p-side-navigation__item">
<a href="{{ charm.name }}" class="p-side-navigation__link u-truncate{% if subpackage_path == charm.name %} is-active{% endif %}" role="tab" aria-controls="{{ charm.name }}" aria-selected="{% if subpackage.name == charm.name %}true{% else %}false{% endif %}">
<a href="{{ charm.name }}{% if channel_requested %}?channel={{channel_requested}}{% endif %}" class="p-side-navigation__link u-truncate{% if subpackage_path == charm.name %} is-active{% endif %}" role="tab" aria-controls="{{ charm.name }}" aria-selected="{% if subpackage.name == charm.name %}true{% else %}false{% endif %}">
<img class="p-side-navigation__icon" src="/{{ charm.name }}/icon" alt="{{ charm.name }}" width="16" height="16">
{{ charm.title }}
</a>
Expand Down
8 changes: 5 additions & 3 deletions webapp/store/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,9 +372,10 @@ def details_configuration(entity_name, path=None):

if not path and bundle_charms:
default_charm = bundle_charms[0]
return redirect(
f"/{entity_name}/configure/{default_charm['name']}"
)
redirect_url = f"/{entity_name}/configure/{default_charm['name']}"
if channel_request:
redirect_url = redirect_url + f"?channel={channel_request}"
return redirect(redirect_url)

if path:
if not any(d["name"] == path for d in bundle_charms):
Expand Down Expand Up @@ -552,6 +553,7 @@ def details_integrations(entity_name):
return render_template(
"details/integrations.html",
package=package,
channel_requested=channel_request,
)


Expand Down

0 comments on commit e702d22

Please sign in to comment.