diff --git a/.storybook/preview-body.html b/.storybook/preview-body.html index 425189f7a..7667554cd 100644 --- a/.storybook/preview-body.html +++ b/.storybook/preview-body.html @@ -12,4 +12,5 @@ "https://github.com/digma-ai/digma-vscode-plugin#%EF%B8%8F-extension-settings"; window.wizardSkipInstallationStep; window.assetsRefreshInterval; + window.assetsSearch = true; diff --git a/assets/assets/index.ejs b/assets/assets/index.ejs index e835c736c..518434c7f 100644 --- a/assets/assets/index.ejs +++ b/assets/assets/index.ejs @@ -20,6 +20,7 @@ window.mainFont; window.codeFont; window.assetsRefreshInterval; + window.assetsSearch; diff --git a/src/components/Assets/AssetList/index.tsx b/src/components/Assets/AssetList/index.tsx index e6a695d67..e5d6a63ed 100644 --- a/src/components/Assets/AssetList/index.tsx +++ b/src/components/Assets/AssetList/index.tsx @@ -229,41 +229,45 @@ export const AssetList = (props: AssetListProps) => { - - - - - - - - - - Sort by - {sorting.criterion} - - - - - ({ - value: x, - label: x - }))} - onSelect={handleSortingMenuItemSelect} + {window.assetsSearch === true && ( + + + + + - - + + )} + + + + + Sort by + {sorting.criterion} + + + + + ({ + value: x, + label: x + }))} + onSelect={handleSortingMenuItemSelect} + /> + + + {sortedEntries.length > 0 ? ( diff --git a/src/components/Assets/AssetList/styles.ts b/src/components/Assets/AssetList/styles.ts index b3f8001be..30bdc8b39 100644 --- a/src/components/Assets/AssetList/styles.ts +++ b/src/components/Assets/AssetList/styles.ts @@ -49,6 +49,10 @@ export const Toolbar = styled.div` padding: 8px; `; +export const PopoverContainer = styled.div` + margin-left: auto; +`; + export const SearchInputContainer = styled.div` display: flex; position: relative; diff --git a/src/components/common/App/index.tsx b/src/components/common/App/index.tsx index cf6e5d32e..67db468f1 100644 --- a/src/components/common/App/index.tsx +++ b/src/components/common/App/index.tsx @@ -44,6 +44,18 @@ export const App = (props: AppProps) => { const [mainFont, setMainFont] = useState(defaultMainFont); const [codeFont, setCodeFont] = useState(defaultCodeFont); + useEffect(() => { + const handleKeyDown = (e: KeyboardEvent) => { + console.debug(e); + }; + + window.addEventListener("keydown", handleKeyDown); + + return () => { + window.removeEventListener("keydown", handleKeyDown); + }; + }, []); + useEffect(() => { if (!props.theme) { return; diff --git a/src/globals.d.ts b/src/globals.d.ts index c234c6bea..84ffeed7b 100644 --- a/src/globals.d.ts +++ b/src/globals.d.ts @@ -34,6 +34,7 @@ declare global { recentActivityDocumentationURL?: unknown; wizardSkipInstallationStep?: unknown; assetsRefreshInterval?: unknown; + assetsSearch?: unknown; insightsRefreshInterval?: unknown; } }