mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-17 23:44:39 -05:00
Changed default member filter to "Name is"
refs https://github.com/TryGhost/Team/issues/1408 - "Name" is the first filter in the list and has a basic value type so it makes sense to make it the default compared to label
This commit is contained in:
parent
af08f050d3
commit
652fc883d7
1 changed files with 47 additions and 18 deletions
|
@ -141,7 +141,16 @@ export default class MembersFilter extends Component {
|
|||
@service settings;
|
||||
@service store;
|
||||
|
||||
@tracked filters = new TrackedArray([
|
||||
@tracked filters = this.feature.membersContainsFilters
|
||||
? new TrackedArray([
|
||||
new Filter({
|
||||
type: 'name',
|
||||
relation: 'is',
|
||||
value: '',
|
||||
relationOptions: FILTER_RELATIONS_OPTIONS.name
|
||||
})
|
||||
])
|
||||
: new TrackedArray([
|
||||
new Filter({
|
||||
type: 'label',
|
||||
relation: 'is',
|
||||
|
@ -195,12 +204,21 @@ export default class MembersFilter extends Component {
|
|||
|
||||
@action
|
||||
addFilter() {
|
||||
if (this.feature.membersContainsFilters) {
|
||||
this.filters.push(new Filter({
|
||||
type: 'name',
|
||||
relation: 'is',
|
||||
value: '',
|
||||
relationOptions: FILTER_RELATIONS_OPTIONS.name
|
||||
}));
|
||||
} else {
|
||||
this.filters.push(new Filter({
|
||||
type: 'label',
|
||||
relation: 'is',
|
||||
value: [],
|
||||
relationOptions: FILTER_RELATIONS_OPTIONS.label
|
||||
}));
|
||||
}
|
||||
this.applySoftFilter();
|
||||
}
|
||||
|
||||
|
@ -483,14 +501,25 @@ export default class MembersFilter extends Component {
|
|||
|
||||
@action
|
||||
resetFilter() {
|
||||
this.filters = new TrackedArray([
|
||||
new Filter({
|
||||
const filters = [];
|
||||
|
||||
if (this.feature.membersContainsFilters) {
|
||||
filters.push(new Filter({
|
||||
type: 'name',
|
||||
relation: 'is',
|
||||
value: '',
|
||||
relationOptions: FILTER_RELATIONS_OPTIONS.name
|
||||
}));
|
||||
} else {
|
||||
filters.push(new Filter({
|
||||
type: 'label',
|
||||
relation: 'is',
|
||||
value: [],
|
||||
relationOptions: FILTER_RELATIONS_OPTIONS.label
|
||||
})
|
||||
]);
|
||||
}));
|
||||
}
|
||||
|
||||
this.filters = new TrackedArray(filters);
|
||||
this.args.onResetFilter();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue