Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions ghost/admin/app/components/members/filter.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Component from '@glimmer/component';
import moment from 'moment-timezone';
import nql from '@tryghost/nql-lang';
import {AUDIENCE_FEEDBACK_FILTER, CREATED_AT_FILTER, EMAIL_CLICKED_FILTER, EMAIL_COUNT_FILTER, EMAIL_FILTER, EMAIL_OPENED_COUNT_FILTER, EMAIL_OPENED_FILTER, EMAIL_OPEN_RATE_FILTER, EMAIL_SENT_FILTER, LABEL_FILTER, LAST_SEEN_FILTER, NAME_FILTER, NEWSLETTERS_FILTERS, NEXT_BILLING_DATE_FILTER, OFFERS_FILTER, PLAN_INTERVAL_FILTER, SIGNUP_ATTRIBUTION_FILTER, STATUS_FILTER, SUBSCRIBED_FILTER, SUBSCRIPTION_ATTRIBUTION_FILTER, SUBSCRIPTION_START_DATE_FILTER, SUBSCRIPTION_STATUS_FILTER, TIER_FILTER} from './filters';
import {AUDIENCE_FEEDBACK_FILTER, CREATED_AT_FILTER, EMAIL_CLICKED_FILTER, EMAIL_COUNT_FILTER, EMAIL_FILTER, EMAIL_OPENED_COUNT_FILTER, EMAIL_OPENED_FILTER, EMAIL_OPEN_RATE_FILTER, EMAIL_SENT_FILTER, LABEL_FILTER, LAST_SEEN_FILTER, LOCATION_FILTER, NAME_FILTER, NEWSLETTERS_FILTERS, NEXT_BILLING_DATE_FILTER, OFFERS_FILTER, PLAN_INTERVAL_FILTER, SIGNUP_ATTRIBUTION_FILTER, STATUS_FILTER, SUBSCRIBED_FILTER, SUBSCRIPTION_ATTRIBUTION_FILTER, SUBSCRIPTION_START_DATE_FILTER, SUBSCRIPTION_STATUS_FILTER, TIER_FILTER} from './filters';
import {TrackedArray} from 'tracked-built-ins';
import {action} from '@ember/object';
import {didCancel, task} from 'ember-concurrency';
Expand All @@ -22,7 +22,8 @@ const FILTER_GROUPS = [
SUBSCRIBED_FILTER,
LAST_SEEN_FILTER,
CREATED_AT_FILTER,
SIGNUP_ATTRIBUTION_FILTER
SIGNUP_ATTRIBUTION_FILTER,
LOCATION_FILTER
]
},
{
Expand Down
1 change: 1 addition & 0 deletions ghost/admin/app/components/members/filters/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export * from './subscribed';
export * from './last-seen';
export * from './created-at';
export * from './signup-attribution';
export * from './location';
export * from './tier';
export * from './status';
export * from './plan-interval';
Expand Down
9 changes: 9 additions & 0 deletions ghost/admin/app/components/members/filters/location.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import {CONTAINS_ONLY_RELATION_OPTIONS} from './relation-options';

export const LOCATION_FILTER = {
label: 'Location',
name: 'geolocation',
valueType: 'string',
relationOptions: CONTAINS_ONLY_RELATION_OPTIONS
};

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export const CONTAINS_ONLY_RELATION_OPTIONS = [
{label: 'contains', name: 'contains'},
{label: 'does not contain', name: 'does-not-contain'},
{label: 'starts with', name: 'starts-with'},
{label: 'ends with', name: 'ends-with'}
];
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Near-duplicate relation options file instead of reusing existing

Low Severity

CONTAINS_ONLY_RELATION_OPTIONS is a near-duplicate of the existing CONTAINS_RELATION_OPTIONS, differing only in the absence of the is option. The PR description explicitly lists "is" (exact match) as a supported operator, and the analogous NAME_FILTER and EMAIL_FILTER (also valueType: 'string') both use CONTAINS_RELATION_OPTIONS. The LOCATION_FILTER could simply reuse CONTAINS_RELATION_OPTIONS instead of introducing a new nearly-identical constant and file.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 9fd396d. Configure here.


Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export * from './contains';
export * from './contains-only';
export * from './match';
export * from './date';
export * from './number';