Skip to content

Commit

Permalink
Merge pull request #4383 from systeminit/fix(web)-Disable-search-on-c…
Browse files Browse the repository at this point in the history
…omponent-debug-view

fix(web): Disable search on component debug view
  • Loading branch information
stack72 authored Aug 20, 2024
2 parents 1bb342e + 3e0136e commit cbae6d1
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions app/web/src/components/Debug/ComponentDebugDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
<ErrorMessage :requestStatus="fetchDebugReqStatus" />
</template>
<template v-else-if="fetchDebugReqStatus.isSuccess && debugData">
<SiSearch
<!-- <SiSearch
ref="searchRef"
autoSearch
disableFilters
@search="onSearchUpdated"
/>
/> -->
<div ref="debugParent" class="border border-neutral-500 m-xs">
<!-- Component -->
<TreeNode
Expand Down Expand Up @@ -53,7 +53,7 @@
<TreeNode
v-for="attribute in debugData.attributes"
:key="attribute.path"
defaultOpen
:defaultOpen="false"
:label="attribute.path"
alwaysShowArrow
enableGroupToggle
Expand All @@ -80,7 +80,7 @@
<TreeNode
v-for="attribute in debugData.inputSockets"
:key="attribute.name"
defaultOpen
:defaultOpen="false"
:label="attribute.name"
alwaysShowArrow
enableGroupToggle
Expand All @@ -107,7 +107,7 @@
<TreeNode
v-for="attribute in debugData.outputSockets"
:key="attribute.name"
defaultOpen
:defaultOpen="false"
:label="attribute.name"
alwaysShowArrow
enableGroupToggle
Expand All @@ -133,12 +133,12 @@ import {
import { PropType, computed, onMounted, ref } from "vue";
import { useComponentsStore } from "@/store/components.store";
import { ComponentId } from "@/api/sdf/dal/component";
import SiSearch from "@/components/SiSearch.vue";
// import SiSearch from "@/components/SiSearch.vue";
import AttributeDebugView from "./AttributeDebugView.vue";
import SocketDebugView from "./SocketDebugView.vue";
import DebugViewItem from "./DebugViewItem.vue";
const searchRef = ref<InstanceType<typeof SiSearch>>();
// const searchRef = ref<InstanceType<typeof SiSearch>>();
const debugParent = ref<InstanceType<typeof Element>>();
const searchString = ref("");
Expand All @@ -156,23 +156,23 @@ function _findChildren(elm: Element) {
for (const child of elm.children) _findChildren(child);
}
function onSearchUpdated(newFilterString: string) {
searchString.value = newFilterString.trim();
if (!searchString.value) {
for (const elm of document.getElementsByClassName("search-found")) {
elm.classList.remove("search-found");
}
} else {
if (debugParent.value) {
for (const child of debugParent.value.children) {
_findChildren(child);
}
const found = document.getElementsByClassName("search-found");
if (found.length > 0)
found[0]?.scrollIntoView({ behavior: "smooth", block: "nearest" });
}
}
}
// function onSearchUpdated(newFilterString: string) {
// searchString.value = newFilterString.trim();
// if (!searchString.value) {
// for (const elm of document.getElementsByClassName("search-found")) {
// elm.classList.remove("search-found");
// }
// } else {
// if (debugParent.value) {
// for (const child of debugParent.value.children) {
// _findChildren(child);
// }
// const found = document.getElementsByClassName("search-found");
// if (found.length > 0)
// found[0]?.scrollIntoView({ behavior: "smooth", block: "nearest" });
// }
// }
// }
const componentsStore = useComponentsStore();
Expand Down

0 comments on commit cbae6d1

Please sign in to comment.