Commit Graph

17297 Commits

Author SHA1 Message Date
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
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
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
Simon Backx
514c8917c0 Readded matchMetadataSnapshot
refs bac2f4d4d4 (diff-473dc0c49e80df6c07569ed5730445ebdaaa8138fc819182548727db50eb55aa)
2023-05-03 14:14:10 +02:00
Simon Backx
fd69ab181d Removed duplicate matchHTMLSnapshot 2023-05-03 14:13:04 +02:00
Simon Backx
bac2f4d4d4 Fixed snapshot tests for MySQL only newsletter test
no issue

There was an error when generating the snapshot for this test. It never ran, so the snapshot was never committed. On top of that, the generated snapshot would change every time because the email verification token was not replaced with a static value.
2023-05-03 14:05:53 +02:00
Ronald Langeveld
6189040fc4
Added unpublished reason to post revisions (#16726)
closes https://github.com/TryGhost/Team/issues/3137

We have now included the ability to display an "Unpublished" tag for revisions that have been unpublished. The tag is only displayed when the revision's reason property is set to "unpublished". A new revision is triggered when a post is unpublished, regardless whether there's a change in the content.
2023-05-03 09:20:34 +02:00
Fabien "egg" O'Carroll
cef062452b Fixed typo when referring to revision author 2023-05-02 19:50:34 -04:00
Fabien 'egg' O'Carroll
d87da627d9
Added author image to revision history list (#16724)
refs https://github.com/TryGhost/Team/issues/3129

This has copied the same pattern from the gh-user-list-item component.

Co-authored-by: Sanne de Vries <sannedv@protonmail.com>
2023-05-02 19:38:31 -04:00
Ronald
ad3c5d1a0b Fixed linting
refs https://ghost.slack.com/archives/C02G9E68C/p1683036435533879

- Indentation errors was being ignored by eslint.
- Fixed it to bring it up to standard.
2023-05-02 19:55:51 +02:00
Sam Lord
f7188b4dcf Prevented an invalid order during deletion
no issue

Will allow the demo data script to run if offers exist and have been redeemed
2023-05-02 16:34:47 +01:00
Michael Barrett
b60761706b
Prevented post history from being viewed for emailed posts (#16704)
refs https://github.com/orgs/TryGhost/projects/88/views/2?pane=issue&itemId=26198422

Prevented post history from being viewed in the following scenarios:

- When a post is sent as and email only
- When a post is published and sent as an email
2023-05-02 15:58:56 +01:00
Simon Backx
6aa8fa2a8e Updated Portal back button translations
refs https://github.com/TryGhost/Ghost/issues/16628
2023-05-02 16:51:48 +02:00
Sanne de Vries
2342bfd06f Updated status badges in post revision list
Refs https://github.com/TryGhost/Team/issues/3123
2023-05-02 11:30:18 +02:00
Simon Backx
1b38361211 Updated @sentry/node to v7.50.0 and reenabled renovate again
fixes https://github.com/TryGhost/Team/issues/2385

The Sentry version has been locked to v7.11.1 for some time because Sentry still used a legacy Node feature, called domains. Due to a bug or change in in Noide 16+, those domains broke handling uncaught promise execptions. So Ghost crashed when a promise exception wasn't caught. But that shouldn't be the case because we have a global uncaught exception handler.

Luckily Sentry switched to AsyncLocalStorage in v7.48.0. This fixes the issue as demonstrated in c0cd62184c
2023-05-02 10:23:45 +02:00
Ronald
df1329f5e9 Added unpublished logic to revisionList.
refs https://github.com/TryGhost/Team/issues/3123

Refactor revisionList function to use a more concise logic for finding new published and unpublished revisions.
2023-05-02 09:11:56 +02:00
Peter Zimon
9dea2ef911 Contributor view post button color update
no refs.

- the hover color for the "View post" button was the same as the "Edit" which is a bit misleading
2023-05-02 06:46:24 +02:00
Peter Zimon
a55efec7be Contributor post list button fix
no refs.

- On the post list, an edit button was shown for contributors even if the post has been published. Clicking on this reloaded the post list
2023-05-02 06:40:51 +02:00
Fabien "egg" O'Carroll
a90cc2d7ab Fixed sodo-search build script 2023-05-01 13:00:37 -04:00
renovate[bot]
e7cef15bdf Update dependency jsdom to v21.1.2 2023-05-01 18:22:36 +02:00
Daniel Lockyer
83ee1f8860
🔥 Dropped support for Node 14
refs https://github.com/TryGhost/Toolbox/issues/570

- Node 14 is now EOL so we don't support it any further
2023-05-01 17:51:10 +02:00
Elena Baidakova
7ade895ce7
Hide preview select for design/announcement settings (#16721)
no issue
- Hide post preview select if there is no published posts yet.

---

<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
copilot:summary
2023-05-01 18:50:13 +04:00
Uvindu Rajapakshe
dc1ff890a0
Updated Sinhalese translations (#16639) 2023-05-01 16:49:04 +02:00
renovate[bot]
67abd6555b Update CSS preprocessors 2023-05-01 16:43:16 +02:00
Zabriskije
f81c7568fe Fixes for it localization 2023-05-01 15:19:16 +02:00
Andre Rafael
90adb7562b Added Portuguese locale for Portal 2023-05-01 15:18:36 +02:00
Daniel Lockyer
9bb2bc82bd Fixed erroneous timing in reported Mailgun metrics
- we have calls to the metrics library so we can measure the time it
  takes the Mailgun API to return a response
- however, there's a bug in the code whereby if the `batchHandler`
  takes a long time and then throws an error, this time will be reported
  to metrics
- this is misleading because it looks like Mailgun is taking a long time
  if the databases are slow
- this pulls the specific SDK call out into a function so it's easier to
  wrap with timing code
2023-05-01 15:05:59 +02:00
renovate[bot]
eff4662af3 Update dependency @types/sinon to v10.0.14 2023-05-01 15:01:17 +02:00
renovate[bot]
8ca3f301ae Update dependency date-fns to v2.30.0 2023-05-01 15:00:19 +02:00
Ronald
904a03f81a Sort revision list by createdAt.
refs https://ghost.slack.com/archives/C02G9E68C/p1682941387256079?thread_ts=1682507718.761429&cid=C02G9E68C https://github.com/TryGhost/Team/issues/3123

This commit modifies the revisionList method to sort the revisions array by createdAt property in descending order, instead of reversing the order of the array. This makes the code more intuitive and easier to follow for future developers.

Additionally, the published_latest key-value pair is renamed to initial_publish to better reflect its meaning. This key-value pair is added to the revision object at the index where the post status changed from 'draft' to 'published', indicating the initial publication of the post.
2023-05-01 14:13:05 +02:00
Ronald
d6794e6c43 Added "published_latest" key to revisionList
refs https://github.com/TryGhost/Team/issues/3123

This commit modifies the revisionList method to add a new key-value pair published_latest: true to the object if the current index matches with the index of the latest published revision with the reason 'published'. The change only affects the latest published revision and doesn't modify any existing data. This update improves the display of post revisions by highlighting the latest published revision in the list.
2023-05-01 10:30:02 +02:00
renovate[bot]
60d26c62e8 Update dependency vite to v4.3.3 2023-05-01 08:57:56 +02:00
renovate[bot]
f4cc04d235 Update dependency @playwright/test to v1.33.0 2023-05-01 08:57:43 +02:00
Ghost CI
45e84a60fe v5.46.0 2023-04-28 16:00:41 +01:00
Elena Baidakova
ef25e8dda7
Fixed tests (#16718)
no issue
2023-04-27 21:05:01 +04:00
Elena Baidakova
f9f5f72752 Added announcement bar setting
no issue

Allows publishers to set a banner at the top of their site
2023-04-27 17:51:24 +04:00
Elena Baidakova
62adec50f0 Bumped lexical package
no issue
2023-04-27 17:38:16 +04:00
Elena Baidakova
257e17c1ba Released Announcement-Bar v1.1.4 2023-04-27 17:23:37 +04:00
Simon Backx
51473b3f7d Added tests for pages bulk API
fixes https://github.com/TryGhost/Team/issues/2925
2023-04-27 15:06:19 +02:00
Simon Backx
9fc98417b5 Added bulk post unpublishing test
refs https://github.com/TryGhost/Team/issues/2925
2023-04-27 14:58:27 +02:00
Simon Backx
1ff71dc36c Removed unused bulkRemoveTags
no issue

This bulk action is not used at the moment.
2023-04-27 14:56:54 +02:00
Elena Baidakova
f5446bea46 Released Announcement-Bar v1.1.3 2023-04-27 16:45:55 +04:00
Elena Baidakova
0e9b8cc4ce Moved koenig-lexical from unpkg to jsdelivr cdn
no issue
2023-04-27 16:43:54 +04:00
Elena Baidakova
f69674ff9a
Fixed announcement bar preview (#16715)
refs TryGhost/Team#3122
- Fixed that preview takes data from user input before saving on
backend.

---

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

This pull request adds the ability to preview the announcement bar in
the Ghost admin panel and the theme settings. It also adds a
confirmation dialog to discard or save unsaved changes before leaving
the announcement bar settings. It refactors some components and methods
to remove unnecessary or redundant calls to save the settings. It
modifies the `ghost_head` helper, the `theme-management` service, and
the `announcement-bar/src` files to support the preview feature.
2023-04-27 16:40:11 +04:00
Naz
15eca6020d Migrated announcement bar script to use Members API
https://github.com/TryGhost/Team/issues/3121

- The announcement bar data is now exposed through Members API `/members/api/announcement` instead of Content API.
2023-04-27 14:01:36 +02:00
Naz
06c0a19718 Moved announcement bar settings to Frontend Members API
https://github.com/TryGhost/Team/issues/3121

- Because the announcement data has to be available with member's context, it's only possible to have it in cross-origin requests in the Members API.
- Exposed the announcement bar data through `GET /members/api/announcement` endpoint
2023-04-27 14:01:36 +02:00
Simon Backx
57557cb2f7 Added E2E tests for bulk post API
refs https://github.com/TryGhost/Team/issues/2925
2023-04-27 12:45:24 +02:00
Simon Backx
ec5ee76d0b
Added posts and pages bulk editing (#16634)
fixes https://github.com/TryGhost/Team/issues/2677


Co-authored-by: Sanne de Vries <sannedv@protonmail.com>
Co-authored-by: Fabien "egg" O'Carroll <fabien@allou.is>
2023-04-27 10:26:44 +02:00
Peter Zimon
792834e742 Dark mode input field background fix
no refs.

- The background color of the announcement bar input field and its container's background color was slightly off in dark mode
2023-04-26 22:38:48 +02:00
Peter Zimon
5f266a11db Fixed text selection for announcement bar
no issue.

- In dark mode the text and the text selection color in the announcement bar's input field were the same. This made the selected text unreadable
2023-04-26 22:33:13 +02:00
Peter Zimon
ca7ca53d5c Fixed minor UI bugs for announcement bar dark mode
refs. https://github.com/TryGhost/Team/issues/3112

- the font color in the announcement input field was not prepared for dark mode
- the first background swatch had an unwanted border setting
2023-04-26 21:31:37 +02:00
Sanne de Vries
fddb0fe965 Updated copy in post list "add tag" modal
No ref
2023-04-26 16:55:25 +02:00
Simon Backx
ad3fc7fce3 Fixed filter update after bulk action
no issue

After making a change to a post via the bulk action menu, the filter checks if the post should still be included on the page. If not, it is removed.

There were two bugs here:
- Expansions were not applied
- Relation checks were not working because the model was not serialized

Now  the posts correctly stay on the page if needed, or are removed if not.
2023-04-26 16:25:48 +02:00
Peter Zimon
a65dd11637 Minor UI refinements for announcement bar
refs. https://github.com/TryGhost/Team/issues/3112

- sidebar was a bit misaligned
2023-04-26 16:10:11 +02:00
Simon Backx
56b51999dc Added accent color for Koenig Lexical
refs https://github.com/TryGhost/Team/issues/3082
2023-04-26 16:06:37 +02:00
Naz
4cd2688c25
Fixed announcement bar filtering for disabled members
refs https://github.com/TryGhost/Team/issues/3112

- When members features are disabled on the site, there is no point to show member-specific filters for the announcement bar. The only option available should be to show or not to show the announcement.
2023-04-26 15:39:25 +02:00
Naz
e541ea8746
Extracted announcement visibility values to single place
refs https://github.com/TryGhost/Team/issues/3010

- Having all possible values in within single packages will make it easier to look for "source of truth" and is more maintainable rather than having values scattered all over the codebase
2023-04-26 14:42:33 +02:00
renovate[bot]
235b39ab7a Update sentry-javascript monorepo to v7.49.0 2023-04-26 10:30:25 +02:00
renovate[bot]
2a2c8efaea Update dependency vite to v4.3.2 2023-04-26 10:30:12 +02:00
renovate[bot]
bcc2e06063 Update dependency @vitejs/plugin-react to v4 2023-04-26 10:29:12 +02:00
renovate[bot]
52b7086d1d Update dependency semver to v7.5.0 2023-04-26 10:14:22 +02:00
renovate[bot]
48ebe66208 Update sentry-javascript monorepo to v7.48.0 2023-04-26 10:14:04 +02:00
renovate[bot]
95b4d48c39 Update dependency vite to v4.2.2 2023-04-26 10:13:40 +02:00
renovate[bot]
31ae31a13d Update dependency tailwindcss to v3.3.2 2023-04-26 06:36:40 +02:00
Ghost CI
cf0fdc3d86 v5.45.1 2023-04-25 16:32:08 +01:00
Kevin Ansfield
11cab899f0
🐛 Fixed images sometimes being stored as data: URLs when copy/pasting from other editors (#16707)
refs https://github.com/TryGhost/Team/issues/2887

Images could sometimes be pasted into the editor (noticed especially with Google Docs) with `data:` URLs rather than typical `https:` URLs. That causes problems because data URLs are large binary blobs that get stored in the `posts` table and passed through many areas of the system that doesn't expect large binary blobs, causing knock-on effects.

- added handling to our editor's image card to detect when the card is displayed in the editor with a `data:` URL and if it was then it converts it to a file and uploads it so the image can be stored and displayed the same way as any other image
 - handles uploads on both paste and opening a post in the editor that was previously saved with a `data:` URL
2023-04-25 15:58:07 +01:00
Sanne de Vries
1f643884af Fixed broken links in feature image caption in post history
No ref
2023-04-21 17:01:51 +01:00
Sanne de Vries
d26ba6ff4d Surfaced feature image caption in post history versions
No ref
2023-04-21 16:57:49 +01:00
Chris Raible
3d785e4d95 Fixed restoring post revision not creating a new revision
refs TryGhost/Team#3109
2023-04-21 16:37:49 +01:00
Naz
d2f4c097a0 Added Ukrainian locale for Portal
refs https://github.com/TryGhost/Team/issues/2795

- Ukrainian translation - used informal form
2023-04-21 17:26:51 +02:00
Ronald
47a327a4ba Added ESC handling to modal-post-history
no issue

- added esc key handling
2023-04-21 16:25:14 +01:00
Fabien "egg" O'Carroll
960faf7d93 Fixed column type for feature_image_caption on post revisions
MySQL needs to use the TEXT type for large columns like this.
2023-04-21 16:21:16 +01:00
Chris Raible
58efca6c04
Added background saves every 10 mins for post-revisions (#16703)
no issue
2023-04-21 16:04:54 +01:00
Fabien "egg" O'Carroll
f92def8dde Exposed feature image meta data to post revision modal template
This will allow Sanne to wire it up to the output
2023-04-21 16:02:02 +01:00
Ghost CI
050ff1b28a v5.45.0 2023-04-21 16:00:48 +01:00
Ghost CI
74e44aeaca 🎨 Updated Casper to v5.4.10 2023-04-21 16:00:48 +01:00
Sodbileg Gansukh
9f93c7b205 Refined the admin UI of the announcement bar
closes https://github.com/TryGhost/Team/issues/3098
2023-04-21 15:59:20 +01:00
Ronald
0751ff9e9d Added post status conditions in history modal
no issue
2023-04-21 15:58:45 +01:00
Rishabh Garg
a704071448
Added pintura config for lexical editor (#16698)
refs https://github.com/TryGhost/Team/issues/3034

- passes pintura editor config to Koenig lexical editor, allowing integrating it with lexical cards like image and product.
2023-04-21 20:18:28 +05:30
Naz
f9fbac8fa5
Added labs safeguard for announcementBar settings
refs https://github.com/TryGhost/Team/issues/3051

- An extra safeguard to prevent announcementBar feature variables from accidentally leaking through the Content API.
2023-04-21 16:40:49 +02:00
Sanne de Vries
22c45ee9b1 Updated copy for deleted staff users in post history
No ref
2023-04-21 15:27:40 +01:00
Fabien "egg" O'Carroll
5feedadc80 Wired up feature image alt and caption to DB and Admin
We no longer need a reference to the previous version, instead we can use the
latest revision, this makes it easier to compare "off table" data such as the
feature image caption stored in posts_meta.
2023-04-21 15:26:43 +01:00
Fabien "egg" O'Carroll
bbdbcd02ef Added columns to store feature image metadata for revision
We need this to correctly display the difference with feature images and to
restore them.
2023-04-21 15:25:11 +01:00
Ronald Langeveld
f68936900c
Added post status saving (#16702)
no issue 

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

This pull request adds support for storing and tracking the status of
posts in revisions. It introduces a new `post_status` column and
property in the `post` and `PostRevision` models, and updates the
`PostRevisions.formatInput` method to handle it.
2023-04-21 15:17:25 +01:00
Chris Raible
3aec11328f
Populated reason field in post-revisions when revision is created (#16700)
no issue
2023-04-21 14:36:35 +01:00
Naz
02f9ecb7c1
Fixed announcement showing to visitors when set to paid_members
refs https://github.com/TryGhost/Team/issues/3051

- The filter was not working properly when there was no logged in member, but the announcement filter was set to "paid_members" only
2023-04-21 15:27:18 +02:00
Elena Baidakova
4259867f4e Called onChange callback from announcement content
no issue
2023-04-21 17:20:56 +04:00
Naz
6928235c48
Refactored announcement bar settings tests
refs https://github.com/TryGhost/Team/issues/3051

- Made unit tests in the announcement bar settings package more concise
2023-04-21 15:19:33 +02:00
Sanne de Vries
d3a60c760b Updated feature image positioning in post history
No ref
2023-04-21 14:14:32 +01:00
Ronald
f37d7a3fc7 Wired up revision post status and reason to admin
no issue

We can now get post_status and reason in admin for each post_revision
object
2023-04-21 14:05:27 +01:00
Elena Baidakova
0adc81e192 Released Announcement-Bar v1.1.2 2023-04-21 17:00:47 +04:00
Elena Baidakova
bef618c975
Fixed announcement bar close button state (#16699)
refs TryGhost/Team#3095

We should show the announcement bar again in the following case:

- User closes the bar
- Publisher updates announcement content
- We show the bar again even if the user closed it previously in the
same session
2023-04-21 16:58:41 +04:00
Michael Barrett
1538b18d4e
Added post revision anonymous author label (#16697)
refs https://github.com/TryGhost/Team/issues/3104

When a post revision author has been deleted, or there is no author
associated with a post revision, the label "Anonymous" is used for the
revision author
2023-04-21 13:52:08 +01:00
Elena Baidakova
a46d837fbd Released Announcement-Bar v1.1.1 2023-04-21 16:49:13 +04:00
Chris Raible
857a5ad004
Fixed FIFO for post revisions (#16696)
no issue

- with this change, the oldest revision will be deleted and the new
revision will be added if the limit is reached
2023-04-21 13:34:12 +01:00
Fabien "egg" O'Carroll
9ab4579084 Added post history modal lint errors to todo file 2023-04-21 13:33:08 +01:00
Fabien "egg" O'Carroll
f33f9cc530 Added feature_image to the post history modal
This allows us to diff and review previous revisions feature images
2023-04-21 13:20:41 +01:00
Naz
cddf786424
Added filtering of announcement bar content
refs https://github.com/TryGhost/Team/issues/3051

-  We need to show the announcement_content to specific audiences based on the announcement_visibility filter
2023-04-21 13:46:37 +02:00
Ronald Langeveld
3cf6800e3e
Added post-status and reason col to post_revisions (#16693)
refs https://github.com/TryGhost/Team/issues/3099

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

This pull request adds a new column `post_status` to the
`post_revisions` table to store the status of the post revision. It also
updates the schema definition, the migration file, and the integrity
test to reflect the new column.
2023-04-21 12:32:35 +01:00
Elena Baidakova
b893ec13ab Fixed announcement bar insertion
no issue
- Checked if react root div was already inserted to avoid duplication.
2023-04-21 15:19:24 +04:00
Sodbileg Gansukh
b6320ca976 Updated the announcement bar subheading copy in the settings
refs https://github.com/TryGhost/Team/issues/3098
2023-04-21 12:18:53 +01:00
Fabien "egg" O'Carroll
bf37e6273a Fixed post_revisions title migration
This was incorrectly using the lenght of 24 rather than 2000
2023-04-21 12:03:11 +01:00
Fabien 'egg' O'Carroll
169a56d1bb
Added feature_image to post_revisions (#16695)
This will allow us to store historical data for feature images so we can
diff and restore them
2023-04-21 12:02:04 +01:00
Michael Barrett
a9ee30f8b0
Fixed issue with restoring post revision (#16694)
refs https://github.com/TryGhost/Team/issues/3102

Post revision restoration was failing due a few failing edge cases that
occurred during the refactor of the post history modal
2023-04-21 11:55:24 +01:00
Sodbileg Gansukh
0ecdd50d3b Refined the announcement bar frontend styles
refs https://github.com/TryGhost/Team/issues/3097
2023-04-21 11:50:08 +01:00
Ronald
6d4bee82f0 Add flag val to showDifferences in post history
no issue

- set the tracked value to showDifferences state in modal-post-history
2023-04-21 11:22:08 +01:00
Sanne de Vries
1d4a358fd5 Fixed feature image and content overlapping in post
No ref
2023-04-21 11:06:57 +01:00
Chris Raible
06262ecf33
Added logic for saving revisions on explicit saves (#16688)
refs @TryGhost/Team#3076

- added `save_revision` option to edit post endpoint
- this change covers the following cases:
1. we will not save a `post_revision` on every background autosave that
occurs after 3 seconds of inactivity in the editor
2. we will save a `post_revision` when the user hits `cmd+s` in the
editor to explicitly save
3. we will save a `post_revision` when the user navigates away from the
editor (e.g. by clicking the 'Posts' breadcrumb in the editor)
4. we will save a `post_revision` when the user publishes a post
5. we will save a `post_revision` when a user updates an already
published post
2023-04-21 10:04:05 +01:00
Elena Baidakova
8e897ffdd4
Wired announcement settings admin UI to API (#16692)
refs TryGhost/Team#3094
2023-04-21 12:49:29 +04:00
Ronald Langeveld
a13ac255f3
Refactored post history modal to Glimmer component (#16690)
closes https://github.com/TryGhost/Team/issues/3077

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

This pull request refactors the modal-post-history component from a
classic Ember component to a glimmer component, using the latest APIs
and syntax. This improves the code quality and aligns with the Octane
edition of Ember. The changes affect the
`ghost/admin/app/components/modal-post-history.js` and
`ghost/admin/app/components/modal-post-history.hbs` files.
2023-04-21 09:45:28 +01:00
Sanne de Vries
ae04987d6f Added UI for highlighting published post revision
No ref
2023-04-21 09:25:51 +01:00
Naz
c21f136834 Corrected announcement_visibility setting type
refs https://github.com/TryGhost/Ghost/pull/14264

- With a requirement change we need to transform `announcement_visibility` setting to be an "array" instead of a "string". Array structure will allow us to hold multiple filters at once giving more coverage to the audience targetting usecases.
- Example filter variations we'll support are:
[ ] Logged out visitors
[ ] Members
[ ] Free members
[ ] Paid members
2023-04-21 10:18:50 +02:00
Sanne de Vries
ffcba43aa9 Fixed post diffing not being hidden behind feature flag 2023-04-21 08:44:12 +01:00
Sodbileg Gansukh
e5066252bd Added a separate settings page for the announcement bar
refs https://github.com/TryGhost/Team/issues/3080
2023-04-20 22:21:22 +01:00
Sanne de Vries
44206fad38 Updated post history modal
No ref
- Moved diffing toggle
- Removed feature image buttons
- Fixed faded content when diffs is toggled off
2023-04-20 17:47:24 +01:00
Rishabh
bcd0ed539c Updated image editor settings
refs https://github.com/TryGhost/Team/issues/3034

- updates frame options for pintura image editor
- cleans up image editor loading state based on settings
2023-04-20 17:28:01 +01:00
Michael Barrett
49eac033a3
Added confirmation modal when restoring a post revision (#16689)
no issue

Added confirmation modal when restoring a post revision
2023-04-20 17:01:17 +01:00
Rishabh Garg
d3c6d8ad13
Added Pintura integration page in Admin (#16686)
refs https://github.com/TryGhost/Team/issues/3034

- adds new integration page for Pintura in Admin
- allows site owners to enable/disable the image editor integration
- allows self-hosters to upload the files for enabling Pintura image
editor

---------

Co-authored-by: Sodbileg Gansukh <sodbileg.gansukh@gmail.com>
2023-04-20 21:20:07 +05:30
Fabien "egg" O'Carroll
e3fbab9dad Refactored the card diffing into a separate method
This makes it easier to enable and disable the card diffing in dev
2023-04-20 15:23:08 +01:00
Rishabh Garg
bd127eae6d
Added new settings for pintura editor integration (#16682)
refs https://github.com/TryGhost/Team/issues/3034

- adds 3 new settings for managing pintura image editor integration in
admin
- `pintura` setting controls the enabling of the feature
- `pintura_css_url` is used to store path to pintura css file uploaded
on integration page
- `pintura_js_url` is used to store path to pintura js file uploaded on
integration page
2023-04-20 19:19:56 +05:30
Ronald
71052cb33e Added postdiffing feature flag
closes https://github.com/TryGhost/Team/issues/3078

- added post diffing feature flag to isolate it from post history.
2023-04-20 14:15:59 +01:00
Elena Baidakova
09ead74f21 Bumped announcement-bar package
no issue
2023-04-20 16:44:35 +04:00
Elena Baidakova
53b2050c89 Released Announcement-Bar v1.1.0 2023-04-20 16:40:28 +04:00
Elena Baidakova
a282857379
Added announcement close button state storage to sessionStorage (#16683)
refs TryGhost/Team#3071
2023-04-20 16:39:44 +04:00
Sodbileg Gansukh
f95febbcbf Reverted to the default pintura editor style 2023-04-20 12:32:39 +01:00
Michael Barrett
096a31cf7e
Added post revision restoration (#16680)
no issue

Added functionality to restore a post revision
2023-04-20 11:43:22 +01:00
Elena Baidakova
bf6f697be4 Fixed announcement-bar package version
no issue
2023-04-20 14:32:20 +04:00
Elena Baidakova
5d3eed1eac Released Announcement-Bar v1.0.0 2023-04-20 14:24:49 +04:00
Elena Baidakova
d36f3618c0 Added onBlur handler for announcement editor
refs TryGhost/Team#3009
2023-04-20 14:05:37 +04:00
Elena Baidakova
4c4e5a9c95 Hide announcement bar script if announcement_content is empty
refs TryGhost/Team#3009
2023-04-20 14:05:37 +04:00
Elena Baidakova
e39c79a811 Added debounce for announcement content editor
refs TryGhost/Team#3009
2023-04-20 14:05:37 +04:00
Sodbileg Gansukh
65ba464548 Show the announcement bar only when there is content 2023-04-20 14:05:37 +04:00
Sodbileg Gansukh
b1f60fd589 Update the light announcement bar background color 2023-04-20 14:05:37 +04:00
Naz
5421ab5ab0 Limited the keys pulled from Settings API
refs https://github.com/TryGhost/Team/issues/3009

- It's best to pull in as much data from the API as the app's state will ever use. Makes it explicit about what fields the app depends on instead of requesting a whole of "settings"
2023-04-20 14:05:37 +04:00
Naz
7270c17a1d Connected announcement bar to Settings API data
refs https://github.com/TryGhost/Team/issues/3009

- The change hooks up the announcement bar script to use "announcement" and "announcement_background" values coming from the Content Settings API
2023-04-20 14:05:37 +04:00
Sodbileg Gansukh
8e7a150237 Add closing logic 2023-04-20 14:05:37 +04:00
Sodbileg Gansukh
6e1cb2f8ad Add close button 2023-04-20 14:05:37 +04:00
Sodbileg Gansukh
af6b474e23 Add the default background color class 2023-04-20 14:05:37 +04:00
Sodbileg Gansukh
248d5833e4 Added basic styles 2023-04-20 14:05:37 +04:00
Elena Baidakova
725956bc8b Added script for announcement bar insertion
refs TryGhost/Team#3009
2023-04-20 14:05:37 +04:00
Sag
06610e150a Bumped lexical packages
no issue
2023-04-20 10:54:16 +01:00
Ronald
66e8d2a51e Added placeholder remover on post history
no issue

- removes the div containing the initial "Begin writing your post" from
  being part of the compared by the differ
2023-04-20 10:31:53 +01:00
Fabien "egg" O'Carroll
f9e3813b08 Updated diff generation to treat cards atomically
Rather than displaying changes inside cards, we want to show a complete
replacement of the card. The current html diffing library is not capable of
supporting this so we have to use the approach here. First we find all cards
with changes in them, and then pull out the changes into two duplicated version
of the card, once for removals and one for additions.
2023-04-20 10:23:23 +01:00
Elena Baidakova
9c59fbfb52 Bumped Lexical packages
no issue
2023-04-20 10:58:09 +04:00
Naz
5dc1c55a6b
Fixed crashing resource search in Admin UI
refs https://github.com/TryGhost/Team/issues/3041

- Added a 10k search limit in Admin reserouce search. The limit prevents the search component from crashing when there are way too many resources to fetch.
- The default ordering is preserved for the fetched resources.
2023-04-19 19:31:56 +02:00
Sanne de Vries
e6f9fce99a Updated diff toggle in post history modal 2023-04-19 17:56:06 +01:00
Fabien "egg" O'Carroll
ce3f2221a0 Removed bookshelf-relations config from PostRevision model
This was causing issues with saving posts when revisions did not have authors
and is not necessary for the functionality we desire.
2023-04-19 17:49:23 +01:00
Ronald
9b00411e3f Added diff toggling for post history
no issue

- adds diff toggling inside the post history modal
2023-04-19 17:40:06 +01:00
Elena Baidakova
ecb42a3680
Wired announcement api to admin ui (#16678)
refs TryGhost/Team#3052


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

This pull request adds new components and settings for the announcement
bar feature, which allows the user to customize the content, background,
and visibility of a banner that appears on the site.
2023-04-19 19:45:34 +04:00
Sanne de Vries
1c3523c2ad Hid restore button from post version when it's the latest
No ref
2023-04-19 16:34:53 +01:00
Sanne de Vries
adf796f26e Updated post history timestamp format
No ref
2023-04-19 16:25:46 +01:00
Naz
de41b07228
Exposed announcement settings in Content API
refs https://github.com/TryGhost/Team/issues/3011

- Allows to read following settings fields:
  - announcement - alias to announcement_content
  - announcement_background
2023-04-19 16:01:50 +02:00
Naz
388a625f37
Added announcement_* fields to Settings Admin API
refs https://github.com/TryGhost/Team/issues/3011

- Allows to edit and read following settings fields:
  - announcement_content
  - announcement_background
  - announcement_visibility
2023-04-19 16:01:50 +02:00
Sanne de Vries
a0dbdfad6b Added restore button to selected post version
No ref
2023-04-19 14:55:32 +01:00
Rishabh
9e268009da Fixed cors error for image editor
refs https://github.com/TryGhost/Team/issues/3034

- while fetching the image from source for editing in the image editor, it throws cors error when the image is returned from cache instead of ghost server
- the cached image response causes cors to trip over if admin url is different from frontend url for site as it doesn't has the right header
- adds a dynamic `v=...` query param while fetching image in editor to bypass cache and fetch image from server directly
2023-04-19 14:31:46 +01:00
Fabien "egg" O'Carroll
e00bb48f61 Ignored lint errors for the post history modal
This component is going to be rewritten using glimmer components anyway so
we'll fix the lint issues like this for now.
2023-04-19 14:30:15 +01:00
Fabien "egg" O'Carroll
5175987920 Fixed revisionList not updating selected values
Because we're using the old style components we need to make this a computed
property for changes to it to cause a rerender. We also add a latest property
to the first revision so that it can be rendered differently
2023-04-19 14:30:15 +01:00
Chris Raible
24b06e3a34 Wired up the author details to the post history modal
no issue

- added post-revision serializer to allow for embedded records in the post-revision ember model
2023-04-19 14:22:03 +01:00
Michael Barrett
78da6cf77d
Removed post revision author id on user deletion (#16670)
no issue

When a user is deleted any post revisions created by the user are set to
be owned by nobody (null) rather than deleting the post revisions
associated with the user
2023-04-19 14:00:45 +01:00
Fabien "egg" O'Carroll
a65f928932 Added support for viewing different revisions
The Lexical editor isn't passed the editor state it's passed the _initial_
editor state, which means that subsequent renders will not use an updated
state. To work around this we store a reference to the editor api and manually
set the state ourselves when the selected revision is changed.
2023-04-19 13:57:35 +01:00
naz
865df1e143
Added announcement fields to settings table (#16654)
refs https://github.com/TryGhost/Team/issues/3011

- This is a data structure needed to support Announcement Bar feature -
allows to create custom site-wide announcements tailored to the
audience.
- The `announcement_content` is meant to hold displayed HTML content of
the announcement and will be exposed through unauthenticated Content
Site API

- The `announcement_visibility` sets the target audience to display the
Announcement Bart to:
  - `public` - Everyone
  - `visitors` - Logged out visitors only
  - `members` - Members only
  - `paid` - Paid members only

- The `announcement_background` sets the CSS class that should be
applied to the Announcement Bar. and will be exposed through
unauthenticated Content Site API. Three styles are available:
  - `accent` - matches the color of the site accent
  - `dark` - dark style
  - `light` - light style
2023-04-19 14:25:25 +02:00
Sanne de Vries
6e20d7704e Updated post settings menu
No ref
2023-04-19 13:07:51 +01:00
Naz
7969399cdf
Added ability to pass 'flags' field into new settings
refs 3b90b1f335
refs https://github.com/TryGhost/Team/issues/3011

- The "flags" property was missing from the allowed parameters in addSettings migrations utility method. Passing in "flags" is needed to complete a refed issue where we add a new "announcement" group of settings and two of these settings have a "PUBLIC" flag
2023-04-19 14:02:03 +02:00
Sodbileg Gansukh
a9974742cc Centered the main stage of the pintura editor 2023-04-19 12:25:53 +01:00
Sodbileg Gansukh
09822dfcaf Updated the pintura toolbar styles 2023-04-19 12:14:52 +01:00
Chris Raible
f95012066a
Added author details to post_revisions in posts endpoint (#16674)
no issue

- added full author object to the post_revisions array on the /posts endpoint
- to be used in the post history modal to display who authored each revision
2023-04-19 12:05:55 +01:00
Sodbileg Gansukh
b227fda4cf Updated tab list style of the pintura editor 2023-04-19 12:01:11 +01:00
Rishabh Garg
48030c3050
Added basic image editing alpha feature (#16669)
refs https://github.com/TryGhost/Team/issues/3034

- adds new alpha feature flag for image editing in Admin
- allows new config for Pintura files that enable the image editing in
Admin
- adds new ember component for triggering image editing for post feature
images

---------

Co-authored-by: Sodbileg Gansukh <sodbileg.gansukh@gmail.com>
2023-04-19 16:27:26 +05:30
Fabien 'egg' O'Carroll
bd04eb3d21
Updated limit service to only request a single member (#16672)
When we request all members, what happens is that the amount of data is
so great that Ghost is completely overwhelmed - database connections
are hanging open, spanners are thrown in the works, half the team are
staying up half the night!
2023-04-19 01:20:34 +01:00
Sodbileg Gansukh
16e8d7d1f4 Increased the focus area of the announcement input placeholder
refs https://github.com/TryGhost/Team/issues/3026
2023-04-18 17:11:31 +01:00
Sodbileg Gansukh
79cef73f59 Increased the focus area of the announcement input
refs https://github.com/TryGhost/Team/issues/3026
2023-04-18 17:07:09 +01:00
Chris Raible
65cf3afe5b
Fixed maxlength for author_id in migration v5.45 (#16668)
no issue

- maxlength for author_id was errantly set to 2000 instead of 24
- migration was failing with:

ERROR Field length of `author_id` in `post_revisions` is too long!

Field length of `author_id` in `post_revisions` is too long!

"This usually happens if your database encoding is utf8mb4.\nAll unique
fields and indexes must be lower than 191 characters.\nPlease correct
your field length and reset your database with `yarn knex-migrator
reset`.\n" "Read more here:
https://github.com/TryGhost/knex-migrator/issues/51\n"
2023-04-18 16:46:46 +01:00
Kevin Ansfield
59c6f9d28a
Fixed member count for limit checks when publishing sometimes being incorrect (#16667)
no issue

- the members stats service was being used for the total member count
when checking member limits for publishing but the stats service is not
always correct which could result in publishing being blocked
unexpectedly
- switched to using the total count from a `/members/` query which
should always be correct/match other counts within the UI
2023-04-18 16:32:34 +01:00
Simon Backx
2738d25cc6 Added autocompletion to Lexical button urls
fixes https://github.com/TryGhost/Team/issues/3031

This implements the fetchAutocompleteLinks method, which is used by the button and email CTA cards to autocomplete urls.
2023-04-18 16:25:31 +01:00
Ronald
56b6fedb72 Sorted post revisions by timestamp
no issue

- reversed timestamps of post revisions
2023-04-18 16:17:06 +01:00
Ronald Langeveld
30535eb8f5
Added post revision sidebar list (#16666)
no issue

<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
copilot:summary
2023-04-18 16:10:41 +01:00
Aileen Nowak
540de8eafd Added oembed Admin API endpoint to allow list
no issue

- Some services require the `oembed` API endpoint to be reachable via Admin API
- Adding the endpoint to the allowed list resolves this
2023-04-18 15:38:36 +01:00
Chris Raible
0130c9f553
Renamed foreign key constraint in migration v5.45 (#16664)
- the autogenerated constraint name was too long for MySQL, yielding the
error below (although it seems to be fine for sqlite)
- this change adds an explicit, shorthand name for the constraint to
stay under the limit on MySQL8

Error: alter table `post_revisions` add constraint
`post_revisions_author_id_foreign` foreign key (`author_id`) references
`users` (`id`), algorithm=copy - Specified key was too long; max key
length is 3072 bytes
2023-04-18 15:02:13 +01:00
Fabien "egg" O'Carroll
0ef05d4bed Added initial version of post revision diffing
We want the diff to be based on what the editor looks like, so we render two
hidden koenig instances and diff the html output, as opposed to using lexical
to render the "frontend" HTML. We also have some weirdness with the last
revision being the same content as the current state of the post. We can look
to fix that at the storage or API level in future
2023-04-18 14:58:22 +01:00
Sanne de Vries
94dc4a8fc5 Updated post history sidebar
No ref
2023-04-18 14:28:59 +01:00
Steve Larson
01f86f1427 added type to embed request
no refs
2023-04-18 14:23:43 +01:00
Michael Barrett
9911e6be78
Persisted post revision author and title (#16653)
no issue

Persisted post revision author and title
2023-04-18 14:15:26 +01:00
Sodbileg Gansukh
7e349d0bf8 Added basic styles to the announcement editor
refs https://github.com/TryGhost/Team/issues/3026
2023-04-18 14:02:58 +01:00
Sag
932bfef27a
Bumped Lexical packages (#16661)
no issue
2023-04-18 13:42:05 +01:00
Chris Raible
e7f9f7c101 Fixed post revisions not loading in modal-post-history 2023-04-18 12:19:31 +01:00
Sanne de Vries
71524bf7da Updated post history modal to resemble editor
No ref
2023-04-18 12:10:51 +01:00
Chris Raible
37e13b9c90 Removed post_revisions from posts-public.js 2023-04-18 12:03:30 +01:00
Sodbileg Gansukh
0f86514ae1 Added a label to the announcement setting
refs https://github.com/TryGhost/Team/issues/3026
2023-04-18 11:56:06 +01:00
Michael Barrett
75e6ce261c
Added author & title to post revisions (#16649)
no issue

Added `created_by` and `title` columns to `post_revisions` table
2023-04-18 11:47:57 +01:00
Chris Raible
ba5fb35e36 Removed Post History from sidebar for mobiledoc posts 2023-04-18 11:28:52 +01:00
Sanne de Vries
f0f217a756 Updated post settings menu
No ref
2023-04-18 11:22:50 +01:00
Chris Raible
af367a2a18
Added post_revisions as a default include for posts (#16660)
no issue

- post_revisions will now be included in any request to the /posts
endpoint
- updated admin models to include post_revisions
- post revisions can now be accessed in the modal-portal-history via
this.post.post_revisions
2023-04-18 11:12:35 +01:00
Sanne de Vries
29e45f2658 Moved post history trigger to post settings menu
No ref
2023-04-18 10:57:41 +01:00
Elena Baidakova
b7f091f732 Updated lexical packages
no issue
2023-04-18 13:23:02 +04:00
Elena Baidakova
9380209670
Added announcementBar feature flag and announcement input demo (#16659)
refs TryGhost/Team#3008

---

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

This pull request adds a new experimental feature for displaying an
announcement bar at the top of the site. It introduces a new component
template and class for the announcement bar, a new feature flag and its
UI controls, and some CSS adjustments for the editor input and the
announcement bar.
2023-04-18 13:12:37 +04:00
Ronald Langeveld
b13677085d
Added html difference library (#16658)
no issue

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

This pull request adds a feature to show the HTML diff of the post
content changes in the post history modal. It uses the `node-htmldiff`
module to generate the diff and updates the `modal-post-history`
component and its template and style files.

---------

Co-authored-by: Fabien "egg" O'Carroll <fabien@allou.is>
2023-04-18 09:20:24 +01:00
Elena Baidakova
b3257cb7ea
Added minimal lexical editor input (#16657)
refs TryGhost/Team#3008

---

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

This change adds a new component `koenig-lexical-editor-input` that
renders a React component using the `@tryghost/koenig-lexical` package,
which provides a new editor for Ghost that supports rich text and
markdown editing. The component can be used to edit HTML content using
the Lexical editor, and syncs the HTML content with the `html` argument
and the `onChangeHtml` callback. The component also handles dynamic
import, loading, error, and dark mode scenarios.
2023-04-18 11:41:48 +04:00
Sanne de Vries
f8273b7f1f Removed ember component test
No ref
- This will be replaced by snapshot tests
2023-04-17 17:12:31 +01:00
Fabien "egg" O'Carroll
b41897a2b4 Fixed unit tests 2023-04-17 16:52:51 +01:00
Fabien "egg" O'Carroll
ff082c1934 Fixed revision creation for new posts
We had incorrectly ported the existing functionality and started adding 2
revisions for each new post. This fixes the logic to only add 1.
2023-04-17 16:49:17 +01:00
Sanne de Vries
c2f14ccd82 Added post history modal layout
No ref
2023-04-17 16:41:00 +01:00
Steve Larson
aec1455c56 fixed bookmark card requests
no refs
2023-04-17 16:31:42 +01:00
Steve Larson
8a563910d3 updated lexical packages
no refs
2023-04-17 16:24:36 +01:00
Fabien "egg" O'Carroll
a507072eb8 Updated PostRevisions to accept html string
- We also fix the name of the feature flag
- We also correctly await the result of revision generation
- We pass the HTML string so we can potentially do an easier word count diff
2023-04-17 16:16:08 +01:00
Chris Raible
79a95268b6
Added Post History modal to the editor behind postHistory flag (#16651)
no issue

- added modal-post-history component and wired it up to the
lexical-editor

### <samp>🤖 Generated by Copilot at b726dd5</samp>

> _`Post history` is the key to the past_
> _Unveil the changes in a modal so vast_
> _But beware of the doom that lurks in the edits_
> _The lexical-editor is a portal to the abyss_
2023-04-17 15:25:52 +01:00
Fabien "egg" O'Carroll
e151b55461 Fixed name of @tryghost/post-revisions 2023-04-17 14:59:13 +01:00
Fabien "egg" O'Carroll
454dc7a876 Added @tryghost/post-revisions to package.json
This is necessary for our build tool to pick up and bundle the package.
2023-04-17 14:56:12 +01:00
Fabien "egg" O'Carroll
7d7e19449a Used new PostRevisions service for revision generation
This is behind the postHistory flag so that we leave alone the very import
revision generation code. The new package attempts to replicate the existing
strategy but gives us room to easily change it in future
2023-04-17 14:47:27 +01:00
Fabien "egg" O'Carroll
a62fe42933 Implemented initial PostRevisions class
This aims to implement the current strategy of revision generation so that we
can switch to it and start tweaking it whilst the flag is enabled
2023-04-17 14:47:27 +01:00
Elena Baidakova
2236d2ef24
Wired lexical snippets to Ghost (#16647)
refs TryGhost/Team#2904

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

This pull request adds the lexical editor feature to the Ghost admin
app, which allows users to create and edit snippets in a natural
language format. It modifies the `snippet` model, adapter, and
controller, and the `lexical-editor` template and component to support
the new feature.
2023-04-17 17:39:04 +04:00
Sanne de Vries
deb613fcf9 Added trigger in editor for post history modal
No ref
2023-04-17 13:54:57 +01:00
Chris Raible
4c893e5a63
Added post_revisions to posts endpoint as an include option (#16648)
no issue

- with this change, you can access a post's lexical revisions via the
api (e.g. `/posts/:id/?include=post_revisions`)

> _We are the post revisions, we won't be erased_
> _We rise from the ashes of the mobiledoc waste_
> _We join the API response, we claim our rightful place_
> _We are the post revisions, we show the truth of your face_
2023-04-17 13:46:27 +01:00
Fabien "egg" O'Carroll
f3a572a9d1 Fixed unit test coverage
For some reason blank files would fail unit test coverage
2023-04-17 11:23:52 +01:00
Fabien "egg" O'Carroll
12d0c3bf64 Added post-revisions package
This package will be used to contain the logic for determining when a
revisions should be generated for a post. It will be used by the Post
model during saving and will not handle the storage of revisions
2023-04-17 11:14:57 +01:00
Michael Barrett
8dff121f73
Added postHistory feature flag (#16645)
no issue

Added flag to enable / disable post history from within the editor
2023-04-17 11:08:47 +01:00
Elena Baidakova
7f184d2451
Added support for filtering snippets to mobiledoc/lexical (#16636)
refs TryGhost/Team#2904


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

This pull request adds support for multiple formats of snippet content,
especially the `lexical` format, to the Ghost CMS. It modifies the
snippets API, model, and test files to handle the format conversion,
filtering, and serialization of snippets.
2023-04-17 10:54:08 +04:00
Ghost CI
5d43101f40 v5.44.0 2023-04-14 16:00:41 +01:00
Elena Baidakova
3235f22da6
Updated Ghost to handle Lexical snippets (#16630)
refs TryGhost/Team#2904
2023-04-14 16:08:48 +04:00
Sanne de Vries
b76f93ea5a Fixed copy for changing page access modal
Refs https://github.com/TryGhost/Team/issues/2677
2023-04-14 11:32:09 +01:00
Simon Backx
d98f29c6aa Added cache invalidation to posts and pages bulk apis
refs https://github.com/TryGhost/Team/issues/2677
2023-04-14 12:25:24 +02:00
Simon Backx
854f616f70
Added bulk edit pages API and admin UI (#16633)
refs https://github.com/TryGhost/Team/issues/2677

- This extends the bulk editing UI to pages.
- New endpoints for editing pages in bulk
- Support for type in bulk edit UI
- Fixed empty messages for lists
- Minor bugfixes (e.g. save button when adding tags became red because
task didn't return true)

---

This pull request adds support for bulk editing and deleting of pages in
the admin UI and the API. It refactors the context menu component and
the list templates to handle different types of content (posts or pages)
dynamically. It also updates the selection list utility and the no posts
box component to work with the new feature. It modifies the `posts.js`
and `pages.js` API files and the corresponding input and output
serializers and routes.
2023-04-14 12:16:15 +02:00
Elena Baidakova
eaf6e3c7e5
Added lexical column to snippets table (#16632)
refs TryGhost/Team#2904

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

This pull request adds a new `lexical` column to the `snippets` table to
store lexical information for snippets. It includes a migration script,
a schema update, and a schema hash update.
2023-04-14 13:18:41 +04:00