Skip to content

Commit

Permalink
fix: resource kind
Browse files Browse the repository at this point in the history
  • Loading branch information
topliceanurazvan committed May 25, 2022
1 parent f4cda6d commit cc13bb6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/molecules/ResourceFilter/ResourceFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const ResourceFilter = () => {
const [annotations, setAnnotations] = useState<Record<string, string | null>>({});
const [fileOrFolderContainedIn, setFileOrFolderContainedIn] = useState<string>();
const [labels, setLabels] = useState<Record<string, string | null>>({});
const [kinds, setKinds] = useState<string[]>([ALL_OPTIONS]);
const [kinds, setKinds] = useState<string[]>([]);
const [name, setName] = useState<string>();
const [namespace, setNamespace] = useState<string>();
const [wasLocalUpdate, setWasLocalUpdate] = useState<boolean>(false);
Expand Down Expand Up @@ -79,7 +79,7 @@ const ResourceFilter = () => {
const resetFilters = () => {
setWasLocalUpdate(true);
setName('');
setKinds([ALL_OPTIONS]);
setKinds([]);
setNamespace(ALL_OPTIONS);
setLabels({});
setAnnotations({});
Expand Down Expand Up @@ -163,7 +163,7 @@ const ResourceFilter = () => {
useEffect(() => {
if (!wasLocalUpdate) {
setName(filtersMap.name);
setKinds(filtersMap.kinds || [ALL_OPTIONS]);
setKinds(filtersMap.kinds || []);
setNamespace(filtersMap.namespace);
setLabels(filtersMap.labels);
setAnnotations(filtersMap.annotations);
Expand Down Expand Up @@ -221,6 +221,7 @@ const ResourceFilter = () => {
placeholder="Select one or multiple kinds"
showArrow
showSearch
mode="multiple"
style={{width: '100%'}}
value={kinds || []}
onChange={updateKinds}
Expand Down

0 comments on commit cc13bb6

Please sign in to comment.