Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update headless ui library version #2217

Merged
merged 5 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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 @@ -25,8 +25,8 @@ const Tags = ({
setSelectedTag,
scanType,
}: {
selectedTag: ImageTagType;
setSelectedTag: React.Dispatch<React.SetStateAction<ImageTagType>>;
selectedTag: ImageTagType | null;
setSelectedTag: React.Dispatch<React.SetStateAction<ImageTagType | null>>;
scanType: ScanTypeEnum;
}) => {
const dockerImageName = useScanResults({
Expand Down Expand Up @@ -73,7 +73,7 @@ const InputForm = ({
toScanData: ToScanDataType;
setToScanData: React.Dispatch<React.SetStateAction<ToScanDataType>>;
}) => {
const [selectedTag, setSelectedTag] = useState<ImageTagType>({
const [selectedTag, setSelectedTag] = useState<ImageTagType | null>({
nodeId,
nodeName: '',
tagList: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import { ScanTypeEnum } from '@/types/common';

export type Props = {
scanType: ScanTypeEnum | 'none';
onChange?: (value: ImageTagType) => void;
onChange?: (value: ImageTagType | null) => void;
onClearAll?: () => void;
defaultSelectedTag?: ImageTagType;
defaultSelectedTag?: ImageTagType | null;
valueKey?: 'nodeId' | 'nodeName';
active?: boolean;
triggerVariant?: 'select' | 'button';
Expand All @@ -35,16 +35,16 @@ const SearchableTag = ({
filter,
}: Props) => {
const [searchText, setSearchText] = useState('');
const [selectedTag, setSelectedTag] = useState<ImageTagType | undefined>(() => {
return defaultSelectedTag;
const [selectedTag, setSelectedTag] = useState<ImageTagType | null>(() => {
return defaultSelectedTag ?? null;
});

const isSelectVariantType = useMemo(() => {
return triggerVariant === 'select';
}, [triggerVariant]);

useEffect(() => {
setSelectedTag(defaultSelectedTag ?? undefined);
setSelectedTag(defaultSelectedTag ?? null);
}, [defaultSelectedTag]);

const { data, isFetchingNextPage, hasNextPage, fetchNextPage } =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,6 @@ const Filters = () => {
</Combobox>
<Combobox
value={searchParams.get('malwareScanStatus')}
nullable
onQueryChange={(query) => {
setMalwareScanStatusSearchText(query);
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,6 @@ const Filters = () => {
</Combobox>
<Combobox
value={searchParams.get('complianceScanStatus')}
nullable
onQueryChange={(query) => {
setComplianceScanStatusSearchText(query);
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ const Filters = () => {
<div className="flex gap-2">
<Combobox
value={searchParams.get('vulnerabilityScanStatus')}
nullable
onQueryChange={(query) => {
setVulnerabilityScanStatusSearchText(query);
}}
Expand Down Expand Up @@ -279,7 +278,6 @@ const Filters = () => {
</Combobox>
<Combobox
value={searchParams.get('secretScanStatus')}
nullable
onQueryChange={(query) => {
setSecretScanStatusSearchText(query);
}}
Expand Down Expand Up @@ -313,7 +311,6 @@ const Filters = () => {
</Combobox>
<Combobox
value={searchParams.get('malwareScanStatus')}
nullable
onQueryChange={(query) => {
setMalwareScanStatusSearchText(query);
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,6 @@ const Filters = () => {
</Combobox>
<Combobox
value={searchParams.get('secretScanStatus')}
nullable
onQueryChange={(query) => {
setSecretScanStatusSearchText(query);
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ const Filters = () => {
value={THREAT_TYPES.find((threatType) => {
return threatType.value === searchParams.get('type');
})}
nullable
onQueryChange={(query) => {
setThreatTypeSearchText(query);
}}
Expand Down Expand Up @@ -190,7 +189,6 @@ const Filters = () => {
value={THREAT_GRAPH_SCOPE.find((scope) => {
return scope.value === searchParams.get('cloud_resource_only');
})}
nullable
onQueryChange={(query) => {
setScopeSearchText(query);
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ function SearchableServiceType() {
return (
<Combobox
value={selected}
nullable
multiple
onEndReached={onEndReached}
startIcon={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,6 @@ function Filters() {
/>
<Combobox
value={searchParams.get('vulnerabilityScanStatus')}
nullable
onQueryChange={(query) => {
setVulnerabilityScanStatusSearchText(query);
}}
Expand Down Expand Up @@ -315,7 +314,6 @@ function Filters() {
</Combobox>
<Combobox
value={searchParams.get('secretScanStatus')}
nullable
onQueryChange={(query) => {
setSecretScanStatusSearchText(query);
}}
Expand Down Expand Up @@ -352,7 +350,6 @@ function Filters() {
</Combobox>
<Combobox
value={searchParams.get('malwareScanStatus')}
nullable
onQueryChange={(query) => {
setMalwareScanStatusSearchText(query);
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,6 @@ function Filters() {
/>
<Combobox
value={searchParams.get('vulnerabilityScanStatus')}
nullable
onQueryChange={(query) => {
setVulnerabilityScanStatusSearchText(query);
}}
Expand Down Expand Up @@ -352,7 +351,6 @@ function Filters() {
</Combobox>
<Combobox
value={searchParams.get('secretScanStatus')}
nullable
onQueryChange={(query) => {
setSecretScanStatusSearchText(query);
}}
Expand Down Expand Up @@ -389,7 +387,6 @@ function Filters() {
</Combobox>
<Combobox
value={searchParams.get('malwareScanStatus')}
nullable
onQueryChange={(query) => {
setMalwareScanStatusSearchText(query);
}}
Expand Down Expand Up @@ -426,7 +423,6 @@ function Filters() {
</Combobox>
<Combobox
value={searchParams.get('complianceScanStatus')}
nullable
onQueryChange={(query) => {
setComplianceScanStatusSearchText(query);
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ function Filters() {
value={KUBERNETES_STATUSES.find((status) => {
return status.value === searchParams.get('kubernetesStatus');
})}
nullable
onQueryChange={(query) => {
setKubernetesStatusSearchText(query);
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,6 @@ const Filters = () => {
</Combobox>
<Combobox
value={searchParams.get('vulnerabilityScanStatus')}
nullable
onQueryChange={(query) => {
setVulnerabilityScanStatusSearchText(query);
}}
Expand Down
2 changes: 1 addition & 1 deletion deepfence_frontend/packages/ui-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"coverage": "vitest run --coverage"
},
"dependencies": {
"@headlessui/react": "^1.7.18",
"@headlessui/react": "^2.1.0",
"@radix-ui/react-accordion": "^1.1.2",
"@radix-ui/react-checkbox": "^1.0.4",
"@radix-ui/react-dialog": "^1.0.5",
Expand Down
Loading
Loading