Skip to content

Commit c121636

Browse files
committed
Merge branch 'main' into r102139999/hardcoded-strings-i18n
2 parents d444249 + f7e8dd1 commit c121636

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

src/components/Navigator/NavigatorCard.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,10 @@ export default {
227227
type: Boolean,
228228
default: false,
229229
},
230+
hideAvailableTags: {
231+
type: Boolean,
232+
default: false,
233+
},
230234
},
231235
mixins: [
232236
keyboardNavigation,
@@ -270,8 +274,9 @@ export default {
270274
selectedTags,
271275
renderableChildNodesMap,
272276
apiChangesObject,
277+
hideAvailableTags,
273278
}) {
274-
if (selectedTags.length) return [];
279+
if (hideAvailableTags || selectedTags.length) return [];
275280
const apiChangesTypesSet = new Set(Object.values(apiChangesObject));
276281
const tagLabelsSet = new Set(Object.values(FILTER_TAGS_TO_LABELS));
277282
const generalTags = new Set([HIDE_DEPRECATED]);

tests/unit/components/Navigator.spec.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ describe('Navigator', () => {
148148
apiChanges: null,
149149
allowHiding: true,
150150
navigatorReferences,
151+
hideAvailableTags: false,
151152
});
152153
});
153154

@@ -187,6 +188,7 @@ describe('Navigator', () => {
187188
apiChanges: null,
188189
allowHiding: true,
189190
navigatorReferences,
191+
hideAvailableTags: false,
190192
});
191193
});
192194

tests/unit/components/Navigator/NavigatorCard.spec.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,6 +1164,19 @@ describe('NavigatorCard', () => {
11641164
expect(all.at(3).props('item')).toEqual(root0Child1GrandChild0);
11651165
});
11661166

1167+
it('allows hiding all available tags', async () => {
1168+
attachDivWithID(root0Child0.uid);
1169+
const wrapper = createWrapper();
1170+
await flushPromises();
1171+
const filter = wrapper.find(FilterInput);
1172+
expect(filter.props('tags')).toHaveLength(2);
1173+
wrapper.setProps({
1174+
hideAvailableTags: true,
1175+
});
1176+
await flushPromises();
1177+
expect(filter.props('tags')).toEqual([]);
1178+
});
1179+
11671180
it('allows filtering the items using Tags, opening all items, that have matches in children', async () => {
11681181
attachDivWithID(root0Child0.uid);
11691182
const wrapper = createWrapper();

0 commit comments

Comments
 (0)