Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .storybook/preview-body.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@
"https://github.com/digma-ai/digma-vscode-plugin#%EF%B8%8F-extension-settings";
window.wizardSkipInstallationStep;
window.assetsRefreshInterval;
window.assetsSearch = true;
</script>
1 change: 1 addition & 0 deletions assets/assets/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
window.mainFont;
window.codeFont;
window.assetsRefreshInterval;
window.assetsSearch;
</script>
<script src="/index.js"></script>
</body>
Expand Down
72 changes: 38 additions & 34 deletions src/components/Assets/AssetList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -229,41 +229,45 @@ export const AssetList = (props: AssetListProps) => {
</s.ItemsCount>
</s.Header>
<s.Toolbar>
<s.SearchInputContainer>
<s.SearchInputIconContainer>
<MagnifierIcon color={searchInputIconColor} />
</s.SearchInputIconContainer>
<s.SearchInput
placeholder="Search"
onChange={handleSearchInputChange}
/>
</s.SearchInputContainer>
<Popover
open={isSortingMenuOpen}
onOpenChange={setIsSortingMenuOpen}
placement={"bottom-start"}
>
<PopoverTrigger onClick={handleSortingMenuToggle}>
<s.SortingMenuContainer>
<span>Sort by</span>
<s.SortingLabel>{sorting.criterion}</s.SortingLabel>
<ChevronIcon
direction={isSortingMenuOpen ? Direction.UP : Direction.DOWN}
color={sortingMenuChevronColor}
/>
</s.SortingMenuContainer>
</PopoverTrigger>
<PopoverContent className={"Popover"}>
<Menu
title={"Sort by"}
items={Object.values(SORTING_CRITERION).map((x) => ({
value: x,
label: x
}))}
onSelect={handleSortingMenuItemSelect}
{window.assetsSearch === true && (
<s.SearchInputContainer>
<s.SearchInputIconContainer>
<MagnifierIcon color={searchInputIconColor} />
</s.SearchInputIconContainer>
<s.SearchInput
placeholder="Search"
onChange={handleSearchInputChange}
/>
</PopoverContent>
</Popover>
</s.SearchInputContainer>
)}
<s.PopoverContainer>
<Popover
open={isSortingMenuOpen}
onOpenChange={setIsSortingMenuOpen}
placement={"bottom-start"}
>
<PopoverTrigger onClick={handleSortingMenuToggle}>
<s.SortingMenuContainer>
<span>Sort by</span>
<s.SortingLabel>{sorting.criterion}</s.SortingLabel>
<ChevronIcon
direction={isSortingMenuOpen ? Direction.UP : Direction.DOWN}
color={sortingMenuChevronColor}
/>
</s.SortingMenuContainer>
</PopoverTrigger>
<PopoverContent className={"Popover"}>
<Menu
title={"Sort by"}
items={Object.values(SORTING_CRITERION).map((x) => ({
value: x,
label: x
}))}
onSelect={handleSortingMenuItemSelect}
/>
</PopoverContent>
</Popover>
</s.PopoverContainer>
</s.Toolbar>
{sortedEntries.length > 0 ? (
<s.List>
Expand Down
4 changes: 4 additions & 0 deletions src/components/Assets/AssetList/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
12 changes: 12 additions & 0 deletions src/components/common/App/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/globals.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ declare global {
recentActivityDocumentationURL?: unknown;
wizardSkipInstallationStep?: unknown;
assetsRefreshInterval?: unknown;
assetsSearch?: unknown;
insightsRefreshInterval?: unknown;
}
}
Expand Down