Removed usage of yg when using NQL (#19287)

refs https://github.com/TryGhost/NQL/pull/73

The referenced PR removes `yg` from the parsed NQL output, so we also
need to remove any usage of it in Ghost
This commit is contained in:
Michael Barrett 2024-01-15 14:40:01 +00:00 committed by GitHub
parent b6cf09130f
commit ed0762fb51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 38 additions and 20 deletions

View File

@ -40,7 +40,7 @@
"@codemirror/lang-html": "^6.4.5",
"@tryghost/color-utils": "0.2.0",
"@tryghost/limit-service": "^1.2.10",
"@tryghost/nql": "0.12.0",
"@tryghost/nql": "0.12.1",
"@tryghost/timezone-data": "0.4.1",
"react": "18.2.0",
"react-dom": "18.2.0",

View File

@ -342,9 +342,6 @@ export default class MembersFilter extends Component {
if (filter.$and) {
parsedFilters.push(...this.parseNqlFilters(filter.$and));
} else if (filter.yg) {
// Single filter grouped in backets
parsedFilters.push(...this.parseNqlFilter(filter.yg));
} else {
const filterKeys = Object.keys(filter);
const validKeys = this.filterProperties.map(prop => prop.name);

View File

@ -39,7 +39,7 @@ export const SUBSCRIBED_FILTER = ({newsletters, feature, group}) => {
const comparator = flt.$and || flt.$or; // $or for legacy filter backwards compatibility
if (!comparator || comparator.length !== 2) {
const filter = flt.yg || flt;
const filter = flt;
if (filter && filter.email_disabled !== undefined) {
if (filter.email_disabled) {
return {

View File

@ -49,8 +49,8 @@
"@tryghost/koenig-lexical": "1.0.9",
"@tryghost/limit-service": "1.2.12",
"@tryghost/members-csv": "0.0.0",
"@tryghost/nql": "0.12.0",
"@tryghost/nql-lang": "0.6.0",
"@tryghost/nql": "0.12.1",
"@tryghost/nql-lang": "0.6.1",
"@tryghost/string": "0.2.10",
"@tryghost/timezone-data": "0.4.1",
"autoprefixer": "9.8.6",

View File

@ -23,10 +23,10 @@
"c8": "7.14.0",
"mocha": "10.2.0",
"sinon": "15.2.0",
"@tryghost/nql": "0.12.0"
"@tryghost/nql": "0.12.1"
},
"dependencies": {
"@tryghost/mongo-utils": "0.6.0",
"@tryghost/mongo-utils": "0.6.1",
"knex": "2.4.2"
}
}

View File

@ -30,7 +30,7 @@
"@tryghost/errors": "1.2.26",
"@tryghost/in-memory-repository": "0.0.0",
"@tryghost/logging": "2.4.8",
"@tryghost/nql": "0.12.0",
"@tryghost/nql": "0.12.1",
"@tryghost/nql-filter-expansions": "0.0.0",
"@tryghost/post-events": "0.0.0",
"@tryghost/tpl": "0.1.26",

View File

@ -135,7 +135,7 @@
"@tryghost/mw-version-match": "0.0.0",
"@tryghost/mw-vhost": "0.0.0",
"@tryghost/nodemailer": "0.3.37",
"@tryghost/nql": "0.12.0",
"@tryghost/nql": "0.12.1",
"@tryghost/oembed-service": "0.0.0",
"@tryghost/package-json": "0.0.0",
"@tryghost/post-revisions": "0.0.0",

View File

@ -18,7 +18,7 @@
"lib"
],
"devDependencies": {
"@tryghost/nql-lang": "0.6.0",
"@tryghost/nql-lang": "0.6.1",
"c8": "8.0.1",
"mocha": "10.2.0",
"should": "13.2.3",
@ -27,7 +27,7 @@
"dependencies": {
"@tryghost/debug": "0.1.26",
"@tryghost/errors": "1.2.26",
"@tryghost/nql": "0.12.0",
"@tryghost/nql": "0.12.1",
"@tryghost/tpl": "0.1.26",
"lodash": "4.17.21"
}

View File

@ -26,7 +26,7 @@
"dependencies": {
"@tryghost/errors": "1.2.26",
"@tryghost/link-redirects": "0.0.0",
"@tryghost/nql": "0.12.0",
"@tryghost/nql": "0.12.1",
"@tryghost/tpl": "0.1.26",
"bson-objectid": "2.0.4",
"lodash": "4.17.21",

View File

@ -36,7 +36,7 @@
"@tryghost/magic-link": "0.0.0",
"@tryghost/member-events": "0.0.0",
"@tryghost/members-payments": "0.0.0",
"@tryghost/nql": "0.12.0",
"@tryghost/nql": "0.12.1",
"@tryghost/tpl": "0.1.26",
"@tryghost/validator": "0.2.6",
"@types/jsonwebtoken": "9.0.5",

View File

@ -226,9 +226,6 @@ class PostsExporter {
for (const subfilter of filter.$or) {
strings.push(...this.filterToString(subfilter, allLabels, allTiers));
}
} else if (filter.yg) {
// Single filter grouped in brackets
strings.push(...this.filterToString(filter.yg, allLabels, allTiers));
} else {
for (const key of Object.keys(filter)) {
if (key === 'label') {

View File

@ -24,7 +24,7 @@
},
"dependencies": {
"@tryghost/errors": "1.2.26",
"@tryghost/nql": "0.12.0",
"@tryghost/nql": "0.12.1",
"@tryghost/post-events": "0.0.0",
"@tryghost/tpl": "0.1.26",
"bson-objectid": "2.0.4"

View File

@ -8096,6 +8096,13 @@
dependencies:
lodash "^4.17.11"
"@tryghost/mongo-utils@0.6.1", "@tryghost/mongo-utils@^0.6.1":
version "0.6.1"
resolved "https://registry.yarnpkg.com/@tryghost/mongo-utils/-/mongo-utils-0.6.1.tgz#ef5e815ca923d7e3bf450c7a30843f763f68ae74"
integrity sha512-4v1rv5BxqImz8IYcw3Ao4EK2Ym5XY0DB/iGOURV1hkH8cECTbe515xWuR3JSXnB/o4BVZ8I1Wih4h5B0go+whA==
dependencies:
lodash "^4.17.11"
"@tryghost/nodemailer@0.3.37":
version "0.3.37"
resolved "https://registry.yarnpkg.com/@tryghost/nodemailer/-/nodemailer-0.3.37.tgz#f8766fdc176fec1e5fcfad1ed3c137702f247c83"
@ -8108,7 +8115,14 @@
nodemailer-mailgun-transport "^2.1.5"
nodemailer-stub-transport "^1.1.0"
"@tryghost/nql-lang@0.6.0", "@tryghost/nql-lang@^0.6.0":
"@tryghost/nql-lang@0.6.1", "@tryghost/nql-lang@^0.6.1":
version "0.6.1"
resolved "https://registry.yarnpkg.com/@tryghost/nql-lang/-/nql-lang-0.6.1.tgz#830847d71f0b04107f7d20e3ebc91530fa11df16"
integrity sha512-0fYuzWuHXYN0qk3EnqBPv7IQykn6IaFFp1XcY3CtB3nfYZqsJzVGylQFNpxx6dhRLN8ZxdycZ00HkRChd0tvjQ==
dependencies:
date-fns "^2.28.0"
"@tryghost/nql-lang@^0.6.0":
version "0.6.0"
resolved "https://registry.yarnpkg.com/@tryghost/nql-lang/-/nql-lang-0.6.0.tgz#ea9a0ba5e7a141fb7279e94442bf995bb70936da"
integrity sha512-8VAUhyA80nTlF/IrinCxw6E3q1Hd2jdpLCE/QqeKa0Q8ISoQ993eOfL9gNAbLc7rmc8GWN2QBYjAW6Xljmjkkw==
@ -8125,6 +8139,16 @@
"@tryghost/nql-lang" "^0.6.0"
mingo "^2.2.2"
"@tryghost/nql@0.12.1":
version "0.12.1"
resolved "https://registry.yarnpkg.com/@tryghost/nql/-/nql-0.12.1.tgz#da0deb03b9111ac34d70fb07e5db0c4028251ed2"
integrity sha512-UW3+lhyGW3AuGUAsOGsUr0hpkh1KQ2DlcdtZkN0DzU8Bznd7kR0/afOaOqnOdI257pkYmaP7PgGLXcvwTf27+w==
dependencies:
"@tryghost/mongo-knex" "^0.9.0"
"@tryghost/mongo-utils" "^0.6.1"
"@tryghost/nql-lang" "^0.6.1"
mingo "^2.2.2"
"@tryghost/pretty-cli@1.2.38", "@tryghost/pretty-cli@^1.2.38":
version "1.2.38"
resolved "https://registry.yarnpkg.com/@tryghost/pretty-cli/-/pretty-cli-1.2.38.tgz#a2844f504dfd841f9f0552769ec3f62239433eca"