diff --git a/src/components/Navigator.vue b/src/components/Navigator.vue
index bbc069faf..b621472a6 100644
--- a/src/components/Navigator.vue
+++ b/src/components/Navigator.vue
@@ -158,6 +158,7 @@ export default {
technology: technology.title,
technologyPath: technology.path || technology.url,
isTechnologyBeta: technology.beta,
+ isTechnologyDeprecated: technology.deprecated,
}
),
},
diff --git a/src/components/Navigator/NavigatorCard.vue b/src/components/Navigator/NavigatorCard.vue
index e3a0d2a82..1cb444816 100644
--- a/src/components/Navigator/NavigatorCard.vue
+++ b/src/components/Navigator/NavigatorCard.vue
@@ -32,18 +32,24 @@
@keydown.up.exact.capture.prevent="focusPrev"
@keydown.down.exact.capture.prevent="focusNext"
>
-
-
- {{ technology }}
-
-
-
+
+
+
+ {{ technology }}
+
+
+
+
@@ -184,6 +184,10 @@ export default {
type: Object,
default: () => ({}),
},
+ customTag: {
+ type: String,
+ require: false,
+ },
},
idState() {
return {
@@ -193,7 +197,7 @@ export default {
},
computed: {
isGroupMarker: ({ item: { type } }) => type === TopicTypes.groupMarker,
- isParent: ({ item, isGroupMarker }) => !!item.childUIDs.length && !isGroupMarker,
+ isParent: ({ item, isGroupMarker }) => !!item.childUIDs?.length && !isGroupMarker,
parentLabel: ({ item }) => `label-parent-${item.uid}`,
siblingsLabel: ({ item }) => `label-${item.uid}`,
usageLabel: ({ item }) => `usage-${item.uid}`,
@@ -204,7 +208,11 @@ export default {
),
isBeta: ({ item: { beta } }) => !!beta,
isDeprecated: ({ item: { deprecated } }) => !!deprecated,
- refComponent: ({ isGroupMarker }) => (isGroupMarker ? 'h3' : Reference),
+ refComponent: ({ isGroupMarker, customTag }) => {
+ if (customTag) return customTag;
+ if (isGroupMarker) return 'h3';
+ return Reference;
+ },
},
methods: {
toggleTree() {
diff --git a/tests/unit/components/Navigator/NavigatorCard.spec.js b/tests/unit/components/Navigator/NavigatorCard.spec.js
index 8f817a1d7..9cd61b4c9 100644
--- a/tests/unit/components/Navigator/NavigatorCard.spec.js
+++ b/tests/unit/components/Navigator/NavigatorCard.spec.js
@@ -320,6 +320,15 @@ describe('NavigatorCard', () => {
expect(wrapper.find('.post-head').text()).toBe('CustomPostHead');
});
+ it('exposes a #navigator-title slot', () => {
+ const wrapper = createWrapper({
+ scopedSlots: {
+ 'navigator-title': 'CustomNavigatorTitle
',
+ },
+ });
+ expect(wrapper.find('.navigator-title').text()).toBe('CustomNavigatorTitle');
+ });
+
it('exposes a #above-navigator-head slot', () => {
const wrapper = createWrapper({
scopedSlots: {
diff --git a/tests/unit/components/Navigator/NavigatorCardItem.spec.js b/tests/unit/components/Navigator/NavigatorCardItem.spec.js
index 817a06396..491d211a6 100644
--- a/tests/unit/components/Navigator/NavigatorCardItem.spec.js
+++ b/tests/unit/components/Navigator/NavigatorCardItem.spec.js
@@ -86,6 +86,16 @@ describe('NavigatorCardItem', () => {
expect(cardItem.attributes('data-nesting-index')).toBe(String(defaultProps.item.depth));
});
+ it('renders a custom tag for the leaf-link if customTag is defined', () => {
+ const wrapper = createWrapper({
+ propsData: {
+ customTag: 'button',
+ },
+ });
+ const leafLink = wrapper.find('.leaf-link');
+ expect(leafLink.is('button')).toBe(true);
+ });
+
it('renders the NavigationCardItem with an icon override', () => {
const navigatorReferences = {
iconRef: {