0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00

Merged v5.57.1 into main

This commit is contained in:
Ghost CI 2023-08-01 19:57:00 +00:00
commit f839c2289c
6 changed files with 71 additions and 65 deletions

View file

@ -643,61 +643,8 @@ jobs:
if: needs.job_get_metadata.outputs.changed_core == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true
- uses: actions/setup-node@v3
env:
FORCE_COLOR: 0
with:
node-version: '16.14.0'
- name: Install Ghost-CLI
run: npm install -g ghost-cli@latest
- name: Restore caches
uses: ./.github/actions/restore-cache
env:
DEPENDENCY_CACHE_KEY: ${{ needs.job_install_deps.outputs.dependency_cache_key }}
- run: npm --no-git-tag-version version minor # We need to artificially bump the minor version to get migrations to run
working-directory: ghost/core
- run: npm pack
working-directory: ghost/core
- run: mv ghost-*.tgz ghost.tgz
working-directory: ghost/core
- name: Clean Install
run: |
DIR=$(mktemp -d)
ghost install local -d $DIR --archive $(pwd)/ghost/core/ghost.tgz
- name: Latest Release
run: |
DIR=$(mktemp -d)
ghost install local -d $DIR
ghost update -d $DIR --archive $(pwd)/ghost/core/ghost.tgz
- name: Update from latest v4
run: |
DIR=$(mktemp -d)
ghost install v4 --local -d $DIR
ghost update -f -d $DIR --archive $(pwd)/ghost/core/ghost.tgz
- name: Print debug logs
if: failure()
run: |
[ -f ~/.ghost/logs/*.log ] && cat ~/.ghost/logs/*.log
- uses: tryghost/actions/actions/slack-build@main
if: failure() && github.event_name == 'push' && github.ref == 'refs/heads/main'
with:
status: ${{ job.status }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
- name: noop
run: echo "noop"
job_coverage:
name: Coverage

View file

@ -6,7 +6,6 @@ import UnpublishPostsModal from './modals/unpublish-posts';
import nql from '@tryghost/nql';
import {action} from '@ember/object';
import {capitalizeFirstLetter} from 'ghost-admin/helpers/capitalize-first-letter';
import {posts as postExpansions} from '@tryghost/nql-filter-expansions';
import {inject as service} from '@ember/service';
import {task} from 'ember-concurrency';
@ -258,7 +257,29 @@ export default class PostsContextMenu extends Component {
const updatedModels = this.selectionList.availableModels;
const filter = this.selectionList.allFilter;
const filterNql = nql(filter, {
expansions: postExpansions
expansions: [
{
key: 'primary_tag',
replacement: 'tags.slug',
expansion: 'posts_tags.sort_order:0+tags.visibility:public'
}, {
key: 'primary_author',
replacement: 'authors.slug',
expansion: 'posts_authors.sort_order:0+authors.visibility:public'
}, {
key: 'authors',
replacement: 'authors.slug'
}, {
key: 'author',
replacement: 'authors.slug'
}, {
key: 'tag',
replacement: 'tags.slug'
}, {
key: 'tags',
replacement: 'tags.slug'
}
]
});
const remainingModels = this.selectionList.infinityModel.content.filter((model) => {

View file

@ -1,6 +1,6 @@
{
"name": "ghost-admin",
"version": "5.57.0",
"version": "5.57.1",
"description": "Ember.js admin client for Ghost",
"author": "Ghost Foundation",
"homepage": "http://ghost.org",
@ -52,7 +52,6 @@
"@tryghost/members-csv": "0.0.0",
"@tryghost/mobiledoc-kit": "0.12.5-ghost.2",
"@tryghost/nql": "0.11.0",
"@tryghost/nql-filter-expansions": "0.0.0",
"@tryghost/nql-lang": "0.5.0",
"@tryghost/string": "0.2.4",
"@tryghost/timezone-data": "0.3.0",

View file

@ -7,7 +7,6 @@ const tpl = require('@tryghost/tpl');
const errors = require('@tryghost/errors');
const nql = require('@tryghost/nql');
const htmlToPlaintext = require('@tryghost/html-to-plaintext');
const {posts: postExpansions} = require('@tryghost/nql-filter-expansions');
const ghostBookshelf = require('./base');
const config = require('../../shared/config');
const settingsCache = require('../../shared/settings-cache');
@ -291,6 +290,28 @@ Post = ghostBookshelf.Model.extend({
filterExpansions: function filterExpansions() {
const postsMetaKeys = _.without(ghostBookshelf.model('PostsMeta').prototype.orderAttributes(), 'posts_meta.id', 'posts_meta.post_id');
const expansions = [{
key: 'primary_tag',
replacement: 'tags.slug',
expansion: 'posts_tags.sort_order:0+tags.visibility:public'
}, {
key: 'primary_author',
replacement: 'authors.slug',
expansion: 'posts_authors.sort_order:0+authors.visibility:public'
}, {
key: 'authors',
replacement: 'authors.slug'
}, {
key: 'author',
replacement: 'authors.slug'
}, {
key: 'tag',
replacement: 'tags.slug'
}, {
key: 'tags',
replacement: 'tags.slug'
}];
const postMetaKeyExpansions = postsMetaKeys.map((pmk) => {
return {
key: pmk.split('.')[1],
@ -298,7 +319,7 @@ Post = ghostBookshelf.Model.extend({
};
});
return postExpansions.concat(postMetaKeyExpansions);
return expansions.concat(postMetaKeyExpansions);
},
filterRelations: function filterRelations() {

View file

@ -3,7 +3,26 @@ const nql = require('@tryghost/nql');
const debug = require('@tryghost/debug')('services:url:generator');
const localUtils = require('../../../shared/url-utils');
const {posts: postExpansions} = require('@tryghost/nql-filter-expansions');
// @TODO: merge with filter plugin
const EXPANSIONS = [{
key: 'author',
replacement: 'authors.slug'
}, {
key: 'tags',
replacement: 'tags.slug'
}, {
key: 'tag',
replacement: 'tags.slug'
}, {
key: 'authors',
replacement: 'authors.slug'
}, {
key: 'primary_tag',
replacement: 'primary_tag.slug'
}, {
key: 'primary_author',
replacement: 'primary_author.slug'
}];
/**
* The UrlGenerator class is responsible to generate urls based on a router's conditions.
@ -38,7 +57,7 @@ class UrlGenerator {
if (filter) {
this.filter = filter;
this.nql = nql(this.filter, {
expansions: postExpansions,
expansions: EXPANSIONS,
transformer: nql.utils.mapKeyValues({
key: {
from: 'page',

View file

@ -1,6 +1,6 @@
{
"name": "ghost",
"version": "5.57.0",
"version": "5.57.1",
"description": "The professional publishing platform",
"author": "Ghost Foundation",
"homepage": "https://ghost.org",
@ -136,7 +136,6 @@
"@tryghost/mw-vhost": "0.0.0",
"@tryghost/nodemailer": "0.3.35",
"@tryghost/nql": "0.11.0",
"@tryghost/nql-filter-expansions": "0.0.0",
"@tryghost/oembed-service": "0.0.0",
"@tryghost/package-json": "0.0.0",
"@tryghost/post-revisions": "0.0.0",