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

bug 1794928: Fix update label #4068

Merged
merged 1 commit into from Jan 29, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 1 addition & 5 deletions frontend/public/components/search.tsx
Expand Up @@ -45,7 +45,6 @@ const ResourceList = connectToModel(({ kindObj, mock, namespace, selector, nameF
const SearchPage_: React.FC<SearchProps> = (props) => {
const [selectedItems, setSelectedItems] = React.useState(new Set<string>([]));
const [collaspedState, setCollaspedState] = React.useState(new Set<string>([]));
const [selector, setSelector] = React.useState(selectorFromString(''));
const [nameFilter, setNameFilter] = React.useState([]);
const [labelFilter, setLabelFilter] = React.useState([]);

Expand All @@ -70,7 +69,6 @@ const SearchPage_: React.FC<SearchProps> = (props) => {
const nameTags = split(name || '');
const validTags = _.reject(tags, (tag) => requirementFromString(tag) === undefined);
const validNameTags = _.reject(nameTags, (tag) => requirementFromString(tag) === undefined);
setSelector(selectorFromString(validTags.join(',')));
setLabelFilter(validTags);
setNameFilter(validNameTags);
}, []);
Expand All @@ -94,7 +92,6 @@ const SearchPage_: React.FC<SearchProps> = (props) => {

const clearLabelFilter = () => {
setLabelFilter([]);
setSelector(selectorFromString(''));
setQueryArgument('q', '');
};

Expand Down Expand Up @@ -122,7 +119,6 @@ const SearchPage_: React.FC<SearchProps> = (props) => {
const updateLabelFilter = (value: string) => {
if (requirementFromString(value) !== undefined) {
setLabelFilter([...labelFilter, value]);
setSelector(selectorFromString([...labelFilter, value].join(',')));
setQueryArgument('q', [...labelFilter, value].join(','));
}
};
Expand Down Expand Up @@ -229,7 +225,7 @@ const SearchPage_: React.FC<SearchProps> = (props) => {
>
<ResourceList
kind={item}
selector={selector}
selector={selectorFromString(labelFilter.join(','))}
nameFilter={nameFilter.join(',')}
namespace={namespace}
mock={noProjectsAvailable}
Expand Down