Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import { Box, HStack } from "@chakra-ui/react";
import { Box, HStack, VStack } from "@chakra-ui/react";
import type { MultiValue } from "chakra-react-select";
import { useCallback, useState } from "react";
import { useSearchParams } from "react-router-dom";
Expand Down Expand Up @@ -189,8 +189,8 @@ export const DagsFilters = () => {
});

return (
<HStack justifyContent="space-between">
<HStack gap={4}>
<VStack alignItems="stretch" gap={2}>
<HStack justifyContent="space-between">
<StateFilters
isAll={isAll}
isFailed={isFailed}
Expand All @@ -200,30 +200,36 @@ export const DagsFilters = () => {
needsReview={needsReview === "true"}
onStateChange={handleStateChange}
/>
<PausedFilter
defaultShowPaused={defaultShowPaused}
onPausedChange={handlePausedChange}
showPaused={showPaused}
/>
<TagFilter
onMenuScrollToBottom={() => {
void fetchNextPage();
}}
onMenuScrollToTop={() => {
void fetchPreviousPage();
}}
onSelectTagsChange={handleSelectTagsChange}
onTagModeChange={handleTagModeChange}
onUpdate={setPattern}
selectedTags={selectedTags}
tagFilterMode={tagFilterMode}
tags={data?.pages.flatMap((dagResponse) => dagResponse.tags) ?? []}
/>
<FavoriteFilter onFavoriteChange={handleFavoriteChange} showFavorites={showFavorites} />
</HStack>
<Box>
<ResetButton filterCount={filterCount} onClearFilters={onClearFilters} />
</Box>
</HStack>
</HStack>
<HStack alignItems="flex-start" gap={1} justifyContent="flex-start">
<Box flexShrink={0} width={24}>
<PausedFilter
defaultShowPaused={defaultShowPaused}
onPausedChange={handlePausedChange}
showPaused={showPaused}
/>
</Box>
<Box flexShrink={0} width={64}>
<TagFilter
onMenuScrollToBottom={() => {
void fetchNextPage();
}}
onMenuScrollToTop={() => {
void fetchPreviousPage();
}}
onSelectTagsChange={handleSelectTagsChange}
onTagModeChange={handleTagModeChange}
onUpdate={setPattern}
selectedTags={selectedTags}
tagFilterMode={tagFilterMode}
tags={data?.pages.flatMap((dagResponse) => dagResponse.tags) ?? []}
/>
</Box>
<Box flexShrink={0} width={24}>
<FavoriteFilter onFavoriteChange={handleFavoriteChange} showFavorites={showFavorites} />
</Box>
</HStack>
</VStack>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ export const FavoriteFilter = ({ onFavoriteChange, showFavorites }: Props) => {
onValueChange={onFavoriteChange}
value={[showFavorites ?? "all"]}
>
<Select.Trigger colorPalette="brand" isActive={Boolean(showFavorites)}>
<Select.ValueText width={20} />
<Select.Trigger colorPalette="brand" isActive={Boolean(showFavorites)} width="100%">
<Select.ValueText />
</Select.Trigger>
<Select.Content>
{enabledOptions.items.map((option) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ export const PausedFilter = ({ defaultShowPaused, onPausedChange, showPaused }:
onValueChange={onPausedChange}
value={[showPaused ?? defaultShowPaused]}
>
<Select.Trigger colorPalette="brand" isActive={Boolean(showPaused)}>
<Select.ValueText width={20} />
<Select.Trigger colorPalette="brand" isActive={Boolean(showPaused)} width="100%">
<Select.ValueText />
</Select.Trigger>
<Select.Content>
{enabledOptions.items.map((option) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import { Field, HStack, Text } from "@chakra-ui/react";
import { Field, HStack, Text, VStack } from "@chakra-ui/react";
import { Select as ReactSelect, type MultiValue } from "chakra-react-select";
import { useTranslation } from "react-i18next";

Expand Down Expand Up @@ -46,8 +46,8 @@ export const TagFilter = ({
const { t: translate } = useTranslation("common");

return (
<>
<Field.Root>
<VStack alignItems="flex-start" gap={1} width="100%">
<Field.Root width="100%">
<ReactSelect
aria-label={translate("table.filterByTag")}
chakraStyles={{
Expand All @@ -57,11 +57,12 @@ export const TagFilter = ({
}),
container: (provided) => ({
...provided,
minWidth: 64,
width: "100%",
}),
control: (provided) => ({
...provided,
colorPalette: "brand",
width: "100%",
}),
menu: (provided) => ({
...provided,
Expand Down Expand Up @@ -105,6 +106,6 @@ export const TagFilter = ({
</Text>
</HStack>
)}
</>
</VStack>
);
};
Loading