Global Filters
The globalFilters
property is used to show, hide and configure global filters on the List screen. Currently, Workspaces supports three global filters: GroupName
, FormName
and DateCreated
.
note
globalFilters
is not mandatory, but if not set, all queries will have a dateCreated
range of one year from the current date.
Options
Date Created
The DateCreated
filter is used to show or hide the Date Created
input that allows Workspaces
to filter Txns by date created ranges.
Form Name
The FormName
filter is used to show or hide the Form Name
select component that allows Workspaces
users to filter Txns by form names.
FormName
relies on globalActions.FormName.options
in order to display the form list.
Example
The following example showcases how to configure a label, options and a value for different global filters.
import { ConfigCurrentSpace } from '@transact-open-ux/workspaces/dist/types';
export const processConfig = ({ date }: any): ConfigCurrentSpace => ({
...
globalFilters: {
GroupName: {
label: 'Queues',
options: [
{ label: 'Group One', value: ['Error Review', 'Fraud Review'] },
{ label: 'Group Two', value: ['Manual Review'] },
],
value: 'All',
},
FormName: {
label: 'Forms',
options: [
{
label: 'DAO Group 1',
value: [
'daofraudreview',
'daohelpdesk',
'daoreview',
],
},
{
label: 'DAO Group 2 ',
value: ['daofraudreview', 'usdao', 'daohelpdesk'],
},
],
value: ['daofraudreview', 'usdao', 'daohelpdesk'], // Shows DAO Group 2 option as default
},
DateCreated: {
label: 'Created Date',
value: [date('4 weeks ago'), date('now')],
},
},
...
});
export default processConfig;
Attributes
To review the list of supported attributes, see API Reference.