diff --git a/dashboard/src/components/GlobalSearch/QuickSearch.tsx b/dashboard/src/components/GlobalSearch/QuickSearch.tsx index 37eedacfe25..c8eba94903c 100644 --- a/dashboard/src/components/GlobalSearch/QuickSearch.tsx +++ b/dashboard/src/components/GlobalSearch/QuickSearch.tsx @@ -198,24 +198,24 @@ const QuickSearch = () => { entities = !isEmpty(searchResults?.entities) ? searchResults?.entities?.map((entityDef: any) => { - const { name }: { name: string; found: boolean; key: any } = - extractKeyValueFromEntity(entityDef); - return { - title: `${name}`, - parent: entityDef.typeName, - types: "Entities", - entityObj: entityDef - }; - }) + const { name }: { name: string; found: boolean; key: any } = + extractKeyValueFromEntity(entityDef); + return { + title: `${name}`, + parent: entityDef.typeName, + types: "Entities", + entityObj: entityDef + }; + }) : [{ title: "No Entities Found", types: "Entities" }]; suggestionNames = !isEmpty(suggestions) ? suggestions.map((suggestion: any) => { - return { - title: `${suggestion}`, - types: "Suggestions" - }; - }) + return { + title: `${suggestion}`, + types: "Suggestions" + }; + }) : [{ title: "No Suggestions Found", types: "Suggestions" }]; setOptions([...entities, ...suggestionNames] as GlobalOptionRow[]); @@ -388,7 +388,6 @@ const QuickSearch = () => { className="global-search-stack" alignItems="center" gap="0.5rem" - sx={{ minWidth: 0, flexShrink: 1 }} > { disablePortal className="global-search-autocomplete" sx={{ - minWidth: 150, - flex: "1 1 280px", + minWidth: 280, + flex: 1, "& + .MuiAutocomplete-popper .MuiAutocomplete-option": { backgroundColor: "white" }, @@ -494,14 +493,14 @@ const QuickSearch = () => { const { entityObj, types, parent } = typeof option !== "string" && - "entityObj" in option && - "types" in option && - "parent" in option + "entityObj" in option && + "types" in option && + "parent" in option ? (option as { - entityObj: { status?: string; guid?: string }; - types: string; - parent: string; - }) + entityObj: { status?: string; guid?: string }; + types: string; + parent: string; + }) : { entityObj: null, types: "", parent: "" }; const title = typeof option !== "string" && "title" in option @@ -557,7 +556,7 @@ const QuickSearch = () => { to={{ pathname: href }} color={ entityObj?.status && - entityStateReadOnly[entityObj.status] + entityStateReadOnly[entityObj.status] ? "error" : "primary" } @@ -567,48 +566,48 @@ const QuickSearch = () => { )} {types === "Entities" && !isEmpty(entityObj) ? parts.map((part, index) => ( - - {entityObj?.guid !== "-1" && !part.highlight ? ( - + {entityObj?.guid !== "-1" && !part.highlight ? ( + - {part.text} - - ) : ( - part.text - )} - - )) + ? "error" + : "primary" + } + > + {part.text} + + ) : ( + part.text + )} + + )) : parts.map((part, index) => ( - - {part.text} - - ))} + + {part.text} + + ))} {types === "Entities" && !isEmpty(entityObj) && ` (${parent})`} diff --git a/dashboard/src/views/Layout/Header.tsx b/dashboard/src/views/Layout/Header.tsx index 31556391d11..80fc2dc0627 100644 --- a/dashboard/src/views/Layout/Header.tsx +++ b/dashboard/src/views/Layout/Header.tsx @@ -182,14 +182,14 @@ const Header: React.FC
= ({ )} {location.pathname !== "/" && location.pathname !== "/search" && ( -
+
)} {(location.pathname === "/" || location.pathname === "/search") && (
)} -
+