Commit Graph

17095 Commits

Author SHA1 Message Date
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
Simon Backx
062a716fbc Added clear selection when right clicking non selected item
refs https://github.com/TryGhost/Team/issues/2677
2023-04-14 11:12:30 +02:00
Simon Backx
20d2722f04 Updated context menu to swap position if outside window
refs https://github.com/TryGhost/Team/issues/2677

When opening a context menu close to the border of the window, the menu went outside the window. This PR updates the position mirror horizontally or vertically if the menu would go outside the window.
2023-04-14 11:04:11 +02:00