Skip to content

Commit

Permalink
add hasFilterButton prop to only show button when there is a filter
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedhamidawan committed May 2, 2024
1 parent cd121b5 commit b2f963e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion client/src/components/Panels/Common/ToolSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ interface Props {
sectionName?: string;
expanded?: boolean;
sortItems?: boolean;
hasFilterButton?: boolean;
}
const props = withDefaults(defineProps<Props>(), {
Expand All @@ -46,6 +47,7 @@ const props = withDefaults(defineProps<Props>(), {
sectionName: "default",
expanded: false,
sortItems: true,
hasFilterButton: false,
});
const { config, isConfigLoaded } = useConfig();
Expand Down Expand Up @@ -170,7 +172,7 @@ function toggleMenu(nextState = !opened.value) {
<ToolPanelLinks :links="links" />
</div>
<button
v-if="isSection && toolStore.currentPanelView === 'default'"
v-if="isSection && props.hasFilterButton"
v-b-tooltip.hover.noninteractive.bottom
title="Show full section"
class="inline-icon-button"
Expand Down
3 changes: 2 additions & 1 deletion client/src/components/Panels/ToolBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const query = computed({
},
});
const { currentPanel } = storeToRefs(toolStore);
const { currentPanel, currentPanelView } = storeToRefs(toolStore);
const hasResults = computed(() => results.value.length > 0);
const queryTooShort = computed(() => query.value && query.value.length < 3);
const queryFinished = computed(() => query.value && queryPending.value != true);
Expand Down Expand Up @@ -304,6 +304,7 @@ function onToggle() {
v-if="panel"
:category="panel || {}"
:query-filter="queryFilter || undefined"
:has-filter-button="!!query && currentPanelView === 'default'"
@onClick="onToolClick"
@onFilter="onSectionFilter" />
</div>
Expand Down

0 comments on commit b2f963e

Please sign in to comment.