Skip to content

Commit

Permalink
Merge pull request #1458 from newrelic/ru/anything-to-all
Browse files Browse the repository at this point in the history
chore: replace anything with all
  • Loading branch information
John P Vajda authored Jul 2, 2021
2 parents f0ee98e + 72e7544 commit d31fc3d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/pages/observability-packs.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { useDebounce } from 'react-use';

const sortOptionValues = ['Alphabetical', 'Reverse', 'Popularity'];
const packContentsFilterGroups = [
'Anything',
'All',
'Dashboards',
'Alerts',
'Visualizations',
Expand All @@ -37,9 +37,7 @@ const ObservabilityPacksPage = ({ data, location }) => {
} = data;

const [filteredPacks, setFilteredPacks] = useState(o11yPacks);
const [containingFilterState, setContainingFilterState] = useState(
'Anything'
);
const [containingFilterState, setContainingFilterState] = useState('All');
const [sortState, setSortState] = useState('Alphabetical');
const [searchTerm, setSearchTerm] = useState('');
const [view, setView] = useState(VIEWS.GRID);
Expand Down Expand Up @@ -103,7 +101,7 @@ const ObservabilityPacksPage = ({ data, location }) => {
pack.description.toLowerCase().includes(searchTerm)
);

if (containingFilterState !== 'Anything') {
if (containingFilterState !== 'All') {
tempFilteredPacks = tempFilteredPacks.filter(
(pack) => pack[containingFilterState.toLowerCase()]?.length > 0
);
Expand Down Expand Up @@ -142,7 +140,7 @@ const ObservabilityPacksPage = ({ data, location }) => {

const packContentsFilterValues = packContentsFilterGroups.map(
(filterName) => {
if (filterName === 'Anything') {
if (filterName === 'All') {
const filterCount = o11yPacks.length;
return { filterName, filterCount };
}
Expand Down

0 comments on commit d31fc3d

Please sign in to comment.