-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change: Update all filter dialogs for new UI
Adjust the filter dialogs of all list pages.
- Loading branch information
1 parent
2cd26aa
commit de0c769
Showing
48 changed files
with
3,252 additions
and
1,959 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
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,73 @@ | ||
/* SPDX-FileCopyrightText: 2024 Greenbone AG | ||
* | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
*/ | ||
|
||
import PropTypes from 'web/utils/proptypes'; | ||
|
||
import DefaultFilterDialog from 'web/components/powerfilter/dialog'; | ||
import FilterDialog from 'web/components/powerfilter/filterdialog'; | ||
import useFilterDialog from 'web/components/powerfilter/useFilterDialog'; | ||
import useFilterDialogSave from 'web/components/powerfilter/useFilterDialogSave'; | ||
|
||
import useTranslation from 'web/hooks/useTranslation'; | ||
|
||
const CredentialsFilterDialog = ({ | ||
filter, | ||
onCloseClick, | ||
onClose = onCloseClick, | ||
onFilterChanged, | ||
onFilterCreated, | ||
...props | ||
}) => { | ||
const [_] = useTranslation(); | ||
const filterDialogProps = useFilterDialog(filter); | ||
const [handleSave] = useFilterDialogSave( | ||
'credential', | ||
{ | ||
onClose, | ||
onFilterChanged, | ||
onFilterCreated, | ||
}, | ||
filterDialogProps, | ||
); | ||
|
||
const SORT_FIELDS = [ | ||
{ | ||
name: 'name', | ||
displayName: _('Name'), | ||
}, | ||
{ | ||
name: 'type', | ||
displayName: _('Type'), | ||
}, | ||
{ | ||
name: 'allow_insecure', | ||
displayName: _('Allow insecure use'), | ||
}, | ||
{ | ||
name: 'login', | ||
displayName: _('Login'), | ||
}, | ||
]; | ||
|
||
return ( | ||
<FilterDialog onClose={onClose} onSave={handleSave}> | ||
<DefaultFilterDialog | ||
{...props} | ||
{...filterDialogProps} | ||
sortFields={SORT_FIELDS} | ||
/> | ||
</FilterDialog> | ||
); | ||
}; | ||
|
||
CredentialsFilterDialog.propTypes = { | ||
filter: PropTypes.filter, | ||
onClose: PropTypes.func, | ||
onCloseClick: PropTypes.func, // should be removed in future | ||
onFilterChanged: PropTypes.func, | ||
onFilterCreated: PropTypes.func, | ||
}; | ||
|
||
export default CredentialsFilterDialog; |
Oops, something went wrong.