forked from giranm/pd-live-react
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #443 from PagerDuty/improve-filters
- Loading branch information
Showing
18 changed files
with
181 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# MUST match .node-version | ||
nodejs 20.5.1 | ||
yarn 1.22.19 | ||
nodejs 20.14.0 | ||
yarn 1.22.22 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
src/components/QuerySettings/subcomponents/ColumnFilterIndicatorComponent.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import React, { | ||
useMemo, | ||
} from 'react'; | ||
|
||
import { | ||
useSelector, | ||
useDispatch, | ||
} from 'react-redux'; | ||
|
||
import { | ||
useTranslation, | ||
} from 'react-i18next'; | ||
|
||
import { | ||
Flex, | ||
Button, | ||
Tag, | ||
} from '@chakra-ui/react'; | ||
|
||
import { | ||
clearIncidentTableFilters as clearIncidentTableFiltersConnected, | ||
} from 'src/redux/incident_table/actions'; | ||
|
||
const ColumnFilterIndicatorComponent = () => { | ||
const { | ||
t, | ||
} = useTranslation(); | ||
const { | ||
filters, | ||
} = useSelector((state) => state.incidentTable.incidentTableState); | ||
|
||
const dispatch = useDispatch(); | ||
const clearIncidentTableFilters = () => { | ||
dispatch(clearIncidentTableFiltersConnected()); | ||
}; | ||
|
||
const filterCount = useMemo(() => { | ||
if (filters instanceof Array) { | ||
return filters.length; | ||
} | ||
return 0; | ||
}, [filters]); | ||
|
||
return ( | ||
<Flex> | ||
<Tag colorScheme="blue"> | ||
{filterCount} | ||
</Tag> | ||
<Button | ||
id="clear-filters-button" | ||
size="xs" | ||
ml={1} | ||
colorScheme="red" | ||
aria-label="clear" | ||
onClick={clearIncidentTableFilters} | ||
> | ||
{t('Clear')} | ||
</Button> | ||
</Flex> | ||
); | ||
}; | ||
|
||
export default ColumnFilterIndicatorComponent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.