Commit Graph

33979 Commits

Author SHA1 Message Date
Fabien "egg" O'Carroll
104f84f252 Added eslint rule for file naming convention
As discussed with the product team we want to enforce kebab-case file names for
all files, with the exception of files which export a single class, in which
case they should be PascalCase and reflect the class which they export.

This will help find classes faster, and should push better naming for them too.

Some files and packages have been excluded from this linting, specifically when
a library or framework depends on the naming of a file for the functionality
e.g. Ember, knex-migrator, adapter-manager
2023-05-09 12:34:34 -04:00
Ronald Langeveld
8a08cf3628
Added signupCard feature flags (#16763)
no issue

This pull request adds a new experimental feature flag `signupCard` to
the Ghost admin app, which enables a signup card component in the
lexical editor that's currently being worked on. 
The feature flag can be toggled from the settings/labs
UI and is read from the server-side configuration.
2023-05-09 16:27:36 +02:00
renovate[bot]
35d02fd3ec Update dependency vite-plugin-css-injected-by-js to v3.1.1 2023-05-09 12:51:52 +02:00
Fabien 'egg' O'Carroll
0b8c3747c5
Supported inviting users using an Admin API Integration
Whilst Admin API Integrations had the permissions to create invites they were
blocked from doing so at the HTTP level. We've removed this restriction for
creating Invites as well as browsing Roles, because a Role ID is necessary to
create an invite. The code was also not setup to support Admin API Integrations
as it made assumptions about the existence of a User. That has been updated in
the permissions layer - so that the Invites are limited to Contributors,
Authors and Editors as well as at the email layer, which has has the copy and
from address updated to reflect the lack of a User creating the Invite.
2023-05-08 15:27:15 -04:00
Rishabh
e2fe1171be Released Portal v2.30.2 2023-05-08 22:32:21 +05:30
Sag
f560a334cc
Bumped Lexical packages (#16756)
no issue

- Bumped default config for koenig-lexical to ~0.2
2023-05-08 18:39:14 +02:00
Fabien "egg" O'Carroll
819571749b Released Portal v2.30.1 2023-05-08 11:13:37 -04:00
Fabien "egg" O'Carroll
45a70a3f4c 🐛 Fixed Member signup when signup terms are null
We only display the signup checkbox if both the checkbox is required AND we
have some terms to display alongside it. However we require the checkbox to be
checked, regardless of if it is displayed. This results in the Signup button
not working at all if your settings are in this state.
2023-05-08 11:11:39 -04:00
Rishabh Garg
c6a75cf015
Integrated image editor for staff and tag admin pages (#16755)
refs https://github.com/TryGhost/Team/issues/3145

- includes image editing for generic upload image components to extend
image editing capabilities to other areas in Admin
- allows image editing for tag images and staff user images
2023-05-08 15:22:25 +05:30
Daniel Lockyer
799561aaec
Reduced Sharp concurrency to test alleviating memory fragmentation
refs 9d104c8511

- we've seen recurring instances where Ghost will hog memory after image
  uploads
- we use `jemalloc` to try and help this, but it still seems to happen
- according to the sharp thread referenced in my commit above, memory
  fragmentation can also be helped by reducing the concurrency within
  sharp
- this is a bit of an experiment and we can revert if it causes issues
2023-05-08 10:51:56 +02:00
Elena Baidakova
9df8e89806 Revert "Removed p wrapper for koenig-lexical-input (#16754)"
This reverts commit 9051ea62aa.
2023-05-08 12:15:37 +04:00
Elena Baidakova
07e979698d Revert "Checked whether initialHtml in lexical input has a paragraph"
This reverts commit dd26448dcf.
2023-05-08 12:15:25 +04:00
Elena Baidakova
dd26448dcf Checked whether initialHtml in lexical input has a paragraph
refs TryGhost/Team#3147
2023-05-08 11:07:18 +04:00
Elena Baidakova
9051ea62aa
Removed p wrapper for koenig-lexical-input (#16754)
refs TryGhost/Team#3147

---

<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
<!--
copilot:summary
-->
### <samp>🤖 Generated by Copilot at 7dfd8bf</samp>

This file adds a function to clean and format the HTML of the
`koenig-lexical-editor-input` component and passes it to the
`HtmlOutputPlugin` component.
2023-05-08 10:04:14 +04:00
renovate[bot]
6518d2ccae Update dependency i18next-parser to v8 2023-05-08 07:01:20 +02:00
Chris Raible
810b789419 Increased Post Revisions limit to 25
no issue
2023-05-05 21:46:50 +00:00
Ghost CI
832cee3005 v5.47.0 2023-05-05 16:00:42 +01:00
renovate[bot]
6d78512a4b Update dependency vite to v4.3.5 2023-05-05 16:04:32 +02:00
Simon Backx
6566903df5
Cleaned up member attribution flag (#16745)
no issue

This commit removes the `memberAttribution` feature flag from the
codebase. Some CSS classes are not removed as removing them and updating
the associated CSS files have side effects sadly.
2023-05-05 15:04:14 +02:00
Daniel Lockyer
310ec7d58b
Bumped Portal to v2.30
fixes https://github.com/TryGhost/Ghost/issues/16641

- this updates Ghost to use the latest Portal, which contains updated
  translations and new locales since the last publish
2023-05-05 13:29:16 +02:00
Daniel Lockyer
6d9b4b395f
Released Portal v2.30.0 2023-05-05 13:27:20 +02:00
Daniel Lockyer
b0483d1ef3
Updated supported locales 2023-05-05 13:24:41 +02:00
Daniel Lockyer
443ff9079b
Auto-generated translations
- this fixes some issues detected by i18next
2023-05-05 13:23:23 +02:00
Eflarus
1e51815f33
Added Russian locale (#16719)
refs https://github.com/TryGhost/Team/issues/2795
2023-05-05 13:22:34 +02:00
Rishabh Garg
6c131de6eb
Added image editing feature for publication logo and cover (#16741)
refs https://github.com/TryGhost/Team/issues/3145

- adds image editing functionality(behind flag) using pintura
integration to publication logo and cover
2023-05-05 16:30:34 +05:30
Sodbileg Gansukh
e50bc87780 Added explicit rules to announcement bar styles
refs https://github.com/TryGhost/Team/issues/3143

- due to the reset, some default styles stopped working
- this adds those missing explicit styles
2023-05-05 18:22:30 +08:00
Daniel Lockyer
16ea824f71
Fixed building Admin in development mode for browser tests
- I switched over `build` to run in production mode because we now do
  `lerna run build` during the release process, but this was bundling
  development assets
- this adds `build:dev` and switches the browser test to use that, so
  they should use the development assets moving forwards
2023-05-05 12:13:11 +02:00
Elena Baidakova
4207c9d0d1
Added browser tests for announcement bar (#16742)
refs TryGhost/Team#3122

<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
<!--
copilot:summary
-->
### <samp>🤖 Generated by Copilot at 87727d9</samp>

Added `data-testid` attributes to various elements in the announcement
bar settings feature to enable Playwright testing. Fixed a potential bug
with the `visibilitySettings` getter in the `visibility.js` component.
Added Playwright tests for the announcement bar settings feature in
`announcement-bar-settings.spec.js`.
2023-05-05 14:11:26 +04:00
Sodbileg Gansukh
ffe6a472a9 Added a reset to the announcement bar styles
refs https://github.com/TryGhost/Team/issues/3143

- the reset was added to reduce the theme style conflict as much as possible
2023-05-05 17:58:37 +08:00
Simon Backx
05bba5135d
Cleaned up sourceAttribution flag (#16740)
no issue

This commit removes the `sourceAttribution` feature flag from the
codebase.
2023-05-05 10:57:26 +02:00
Daniel Lockyer
aede64acb9
Switched yarn build to run in production for Admin builds
- it's pretty rare we ever want to do a manual development build, so we
  can just let `yarn build` be for production
2023-05-05 10:53:19 +02:00
Daniel Lockyer
cf41c3ad54
Removed final declaration of oembed-parser
refs 27e4523aec

- we no longer use `oembed-parser`, so we can remove it from
  package.json
- also pins the `@extractus/oembed-extractor` package and adds it into
  `@tryghost/oembed-service` where it was missing
2023-05-05 10:48:16 +02:00
renovate[bot]
0cdf555758 Update dependency vitest to v0.31.0 2023-05-05 09:48:36 +02:00
Simon Backx
fbed93b866
🐛 Added missing history logs for post/page bulk actions (#16734)
no issue

The post/page bulk actions weren't logged in the history log / actions
table.

This change adds support for logging bulk actions.
- New `addActions` static method on models. It creates an action log in
the database for multiple models at once. If only one model was edited,
deleted or added, it will fallback to `addAction`
- `addAction` can also be called statically now
- `actionName` option is now supported when using `addActions`,
`addAction`, and as a result also in all bulk manipulation methods, and
CRUD methods. This allows you to replace the default '5 posts edited'
into something more specific like '5 posts featured'
- Fixed support for null resource_id in the parse-history-event helper
- Removed the default 'published' status requirement when using
Post.findOne for internal queries.
2023-05-05 09:45:36 +02:00
renovate[bot]
5d392bbe57 Update dependency lerna to v6.6.2 2023-05-05 07:36:31 +02:00
Chris Raible
27e4523aec
🐛 Improved error message for unauthorized YouTube embeds (#16374)
refs TryGhost/Ghost#16048

- When attempting to embed a Youtube video that has had embedding
disabled by its owner/author, Ghost displayed a generic error message
that didn't indicate the reason for the failed emebed.
- This change updated the error message when Youtube (or any provider)
returns 401: Unauthorized to indicate that the owner of the resource has
explicitly disabled embedding.
2023-05-04 16:04:58 -07:00
Simon Backx
848b2d82a1
Cleaned up suppressionList feature flag (#16736)
no issue

This pull request removes the `suppressionList` feature flag and all its
dependencies from the codebase. It makes the suppression list feature
the default and consistent behavior for all email events and
newsletters. It simplifies the UI, logic, and data related to email
events and newsletters. It affects several files in the
`ghost/admin/app`, `ghost/core/core`, and `ghost/members-api`
directories.
2023-05-04 14:47:04 +02:00
Simon Backx
17a6217cc7 🐛 Fixed members breadcrumbs when not coming from analytics
fixes https://github.com/TryGhost/Team/issues/2404

This change introduces a new 'post' query parameter to the members and member routes.

Previously, the members route would check if the previous route was the analytics page, and then show the breadcrumbs to go back to the analytics page. But when navigating to the members page from the menu, we don't want to show the breadcrumbs. To accomplish this, the routes that point to the members page from the analytics page now specifically pass on the post id in the query parameters. The query parameter is then passed on from the members page to the member page.

`directlyFromAnalytics` is still used in the member route, to know wheter we came from the members page or from the analytics page (changes the breadcrumbs). This doesn't need to go via a query parameter (figured that would make the url too long/complex).

The resetController method is now implemented and resets the filter and/or fromAnalytics post id if required (when going from members to member, we don't want to reset it because the we would lose the filter going back).
2023-05-04 11:20:33 +02:00
renovate[bot]
b407676b94 Update dependency vite to v4.3.4 2023-05-04 07:19:15 +02:00
Chris Raible
b62a642084
Added background save every 10 minutes to the lexical editor (#16732)
refs TryGhost/Team#3133

- the backend previously had logic to save a revision if more than 10
mins had elapsed since the last revision
- however, the frontend would autosave after 3 seconds of inactivity
(which doesn't trigger a revision), and never send another save request
at 10 minutes, so the backend logic to save a revision was never
triggered
- this change will save the current contents of the editor every 10
minutes, even if nothing has changed since the last save
2023-05-03 14:46:32 -07:00
Daniel Lockyer
53071dccd6
Updated lockfile 2023-05-03 21:40:28 +02:00
Fabien "egg" O'Carroll
ac2adfc964 Fixed browser tests on CI
We need to run `yarn build` in the top level to ensure that all packages are built
2023-05-03 14:38:26 -04:00
Fabien "egg" O'Carroll
b9565bc290 Migrated @tryghost/post-revisions to TypeScript!
This is an initial start to using TypeScript in our non-core Ghost packages.

- Adds a prepare script to build the project after installing deps
- Adds an initial tsconfig.json which is compatible with our node env
- Migrates all of the code to TypeScript, including tests
- Updates tests to use ts-node so that we don't need to compile the tests
- ts-node is installed at the top level because the env is weird with lerna and
  doesn't work otherwise
- Updates the yarn dev script to build the project with the --all and --revisions flag
2023-05-03 14:32:31 -04:00
Fabien "egg" O'Carroll
ed674981e6 Updated npm scripts to support packages with a build step
- Updates the prepare script in the top level to run prepare on packages, so
  that packages can be built when running `yarn`

- Updates the build script in ghost/core to run build on packages, so that
  packages are built before being monobundled

- Updates monobundle to be a dependency and use the new TryGhost repo, which
  includes some minor fixes and improvements, such as supporting devDeps

- Updates the GitHub workflows to run the build command in the top level
  directory rather than ghost/core so that other packages are built, too.
2023-05-03 14:32:31 -04:00
Sam Lord
cb30c9bbc9 Prevent posts_meta data from killing the data-generator process
no issue
2023-05-03 16:28:29 +01:00
Simon Backx
84c6c0397b 🐛 Fixed CMD/shift clicking to open the editor in a new tab/window
refs https://ghost.slack.com/archives/C025584CA/p1683105468216909

When holding cmd,ctrl or shift when clicking a post list item, it would try to select it. But that meant some user flows were broken where users would open multiple posts at the same time in a new tab.

This change allows you to cmd/ctrl/shift/right click on the edit button again.
2023-05-03 17:02:26 +02:00
Ghost CI
81c93c16f0 Merged v5.46.1 into main 2023-05-03 13:47:34 +01:00
Ghost CI
17025cd344 v5.46.1 2023-05-03 13:47:31 +01:00
Fabien "egg" O'Carroll
b3caf16005 🔒 Fixed filtering on private Author fields in Content API
refs https://github.com/TryGhost/Ghost/security/advisories/GHSA-r97q-ghch-82j9

Because our filtering layer is so coupled to the DB and we don't generally
apply restrictions, it was possible to fetch authors and filter by their
password or email field. Coupled with the "starts with" operator this can be
used to brute force the first character of these fields by trying random
combinations until an author is included in the filter. After which the next
character can be brute forced, and so on until the data has been leaked
completely.
2023-05-03 08:43:20 -04:00
Fabien "egg" O'Carroll
a22717a8e7 🔒 Fixed filtering on private Author fields in Content API
refs https://github.com/TryGhost/Ghost/security/advisories/GHSA-r97q-ghch-82j9

Because our filtering layer is so coupled to the DB and we don't generally
apply restrictions, it was possible to fetch authors and filter by their
password or email field. Coupled with the "starts with" operator this can be
used to brute force the first character of these fields by trying random
combinations until an author is included in the filter. After which the next
character can be brute forced, and so on until the data has been leaked
completely.
2023-05-03 08:25:27 -04:00