Skip to content

Commit

Permalink
fix: only show bases that actually support the selected arch
Browse files Browse the repository at this point in the history
  • Loading branch information
M7mdisk committed Nov 8, 2024
1 parent 621e9ab commit 4beddc7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions static/js/src/public/details/channelMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ const init = (packageName: string, channelMapButton: HTMLElement) => {
"[data-channel-map-channel]"
) as NodeListOf<Element>;

const supportedBases = channelMap?.querySelectorAll(
"[data-base-revision-supported]"
) as NodeListOf<Element>;

const selectChannel = (track: string, channel: string) => {
const page = window.location.pathname;

Expand Down Expand Up @@ -132,6 +136,18 @@ const init = (packageName: string, channelMapButton: HTMLElement) => {
}
});

supportedBases.forEach((el) => {
const matchesBase =
el?.getAttribute("data-base-revision-supported") === "True" ||
baseValue === "any";

if (matchesBase) {
el.classList.remove("u-hide");
} else {
el.classList.add("u-hide");
}
});

hideOlderChannels();
}

Expand Down
2 changes: 1 addition & 1 deletion templates/partial/_channel-map.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<td data-heading="Runs on">
<div class="series-tags u-no-margin--top">
{% for base in channel_data.all_bases %}
<span class="series-tag">{{ base }}</span>
<span class="series-tag" data-base-revision-supported="{{ base in release_data.bases }}" >{{ base }}</span>
{% endfor %}
</div>
</td>
Expand Down

0 comments on commit 4beddc7

Please sign in to comment.