Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New filters for organizations module
- Loading branch information
1 parent
d046877
commit 746e18e
Showing
6 changed files
with
134 additions
and
6 deletions.
There are no files selected for viewing
68 changes: 68 additions & 0 deletions
68
frontend/src/modules/organization/organization-employees-field.js
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,68 @@ | ||
import IntegerRangeField from '@/shared/fields/integer-range-field' | ||
|
||
export default class OrganizationEmployeesField extends IntegerRangeField { | ||
constructor(name, label, config = {}) { | ||
super(name, label) | ||
|
||
this.placeholder = config.placeholder | ||
this.hint = config.hint | ||
this.required = config.required | ||
this.matches = config.matches | ||
this.filterable = config.filterable || false | ||
this.custom = config.custom || false | ||
} | ||
|
||
dropdownOptions() { | ||
return [ | ||
{ | ||
value: [1, 10], | ||
label: '1-10' | ||
}, | ||
{ | ||
value: [11, 50], | ||
label: '11-50' | ||
}, | ||
{ | ||
value: [51, 200], | ||
label: '51-200' | ||
}, | ||
{ | ||
value: [201, 500], | ||
label: '201-500' | ||
}, | ||
{ | ||
value: [501, 1000], | ||
label: '501-1000' | ||
}, | ||
{ | ||
value: [1001, 5000], | ||
label: '1001-5000' | ||
}, | ||
{ | ||
value: [5001, 10000], | ||
label: '5001-10000' | ||
}, | ||
{ | ||
value: [10001, null], | ||
label: '10001+' | ||
} | ||
] | ||
} | ||
|
||
forFilter() { | ||
return { | ||
name: this.name, | ||
label: this.label, | ||
custom: this.custom, | ||
props: { | ||
options: this.dropdownOptions(), | ||
multiple: true | ||
}, | ||
defaultValue: null, | ||
value: null, | ||
defaultOperator: 'between', | ||
operator: 'between', | ||
type: 'select' | ||
} | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
frontend/src/modules/organization/organization-member-count-field.js
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,28 @@ | ||
import IntegerRangeField from '@/shared/fields/integer-range-field' | ||
|
||
export default class OrganizationMemberCountField extends IntegerRangeField { | ||
constructor(name, label, config = {}) { | ||
super(name, label) | ||
|
||
this.placeholder = config.placeholder | ||
this.hint = config.hint | ||
this.required = config.required | ||
this.matches = config.matches | ||
this.filterable = config.filterable || false | ||
this.custom = config.custom || false | ||
} | ||
|
||
forFilter() { | ||
return { | ||
name: this.name, | ||
label: this.label, | ||
custom: this.custom, | ||
props: {}, | ||
defaultValue: [], | ||
value: [], | ||
defaultOperator: 'between', | ||
operator: 'between', | ||
type: 'number' | ||
} | ||
} | ||
} |
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