Skip to content

Commit

Permalink
Fix all events link (rancher#7059)
Browse files Browse the repository at this point in the history
* Fix all events link

* Minor update
  • Loading branch information
nwmac authored and bisht-richa committed Oct 5, 2022
1 parent fbaead7 commit cc4332f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
20 changes: 14 additions & 6 deletions shell/components/CommunityLinks.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,20 @@ export default {
}
// Custom links set from settings
if (this.uiCustomLinks) {
return JSON.parse(this.uiCustomLinks.value).reduce((prev, curr) => {
prev[curr.key] = curr.value;
return prev;
}, {});
if (!!this.uiCustomLinks?.value) {
try {
const customLinks = JSON.parse(this.uiCustomLinks.value);
if (Array.isArray(customLinks)) {
return customLinks.reduce((prev, curr) => {
prev[curr.key] = curr.value;
return prev;
}, {});
}
} catch (e) {
console.error('Could not parse custom links setting', e); // eslint-disable-line no-console
}
}
// Fallback
Expand Down
12 changes: 11 additions & 1 deletion shell/pages/c/_cluster/explorer/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,16 @@ export default {
hasDescription() {
return !!this.currentCluster?.spec?.description;
},
allEventsLink() {
return {
name: 'c-cluster-product-resource',
params: {
product: 'explorer',
resource: 'event',
}
};
}
},
Expand Down Expand Up @@ -487,7 +497,7 @@ export default {
<Tabbed @changed="tabChange">
<Tab name="cluster-events" :label="t('clusterIndexPage.sections.events.label')" :weight="2">
<span class="events-table-link">
<n-link :to="{name: 'c-cluster-explorer-event'}">
<n-link :to="allEventsLink">
<span>{{ t('glance.eventsTable') }}</span>
</n-link>
</span>
Expand Down

0 comments on commit cc4332f

Please sign in to comment.