Commit Graph

11287 Commits

Author SHA1 Message Date
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
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
Ghost CI
45e84a60fe v5.46.0 2023-04-28 16:00:41 +01: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
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
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
renovate[bot]
235b39ab7a Update sentry-javascript monorepo to v7.49.0 2023-04-26 10:30:25 +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
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
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
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
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
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
Chris Raible
3aec11328f
Populated reason field in post-revisions when revision is created (#16700)
no issue
2023-04-21 14:36:35 +01:00
Elena Baidakova
4259867f4e Called onChange callback from announcement content
no issue
2023-04-21 17:20:56 +04: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
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
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
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
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
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
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
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
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
d36f3618c0 Added onBlur handler for announcement editor
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
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
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
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
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
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
Sanne de Vries
6e20d7704e Updated post settings menu
No ref
2023-04-19 13:07:51 +01: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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Simon Backx
352d7ee5e2 Updated copy when adding a single tag to posts
refs https://github.com/TryGhost/Team/issues/2677
2023-04-14 10:41:49 +02:00
Simon Backx
a36e89dfcc Filter email only posts
no issue

Adds a new filter to filter on email only posts in the admin UI.
2023-04-14 10:38:16 +02:00
Simon Backx
cce324724a Updated shift post selection to use first shift position
refs https://github.com/TryGhost/Team/issues/2677

- When shift clicking on the first item, it no longer will select from top to that item. It will now just select that item.
- Updates event listeners to use mousedown to prevent text selection glitch
2023-04-14 10:19:40 +02:00
Simon Backx
d0cd82cc6f Fixed cancel button clearing post selection
fixes https://github.com/TryGhost/Team/issues/3004
2023-04-14 10:05:48 +02:00
Sanne de Vries
7a6670a993 Removed featured/unfeatured toast and updated copy
Refs https://github.com/TryGhost/Team/issues/2923
2023-04-14 08:56:58 +01:00
Simon Backx
70316c6b15 Removed tpl dependency from admin
refs https://github.com/TryGhost/Team/issues/2677

The dependency caused errors in Safari, probably due to incompatible JS features that need to be polyfilled. Removed it for now and replaced it with a simple method instead.
2023-04-14 09:54:35 +02:00
Simon Backx
f8d0b56c2c Fixed CMD+TAB not firing keyup in post multi selection
refs https://github.com/TryGhost/Team/issues/2677

When doing CMD+TAB, then CMD+TAB+shift, the CMD key got released but both the keyup and blur events weren't called (also focus not).

To fix this, on the next click we'll check the meta, shift and ctrl keys so we can restore the situation.
2023-04-14 09:46:00 +02:00
Sanne de Vries
bf200561ff Updated post list bulk action modals
Refs https://github.com/TryGhost/Team/issues/2923
2023-04-13 17:05:07 +01:00
Simon Backx
c8d715167a Hid post access context menu action when members are disabled
refs https://github.com/TryGhost/Team/issues/2922
2023-04-13 17:54:01 +02:00
Simon Backx
0cf41171b8 Added error message when trying to add zero tags in bulk action
refs https://github.com/TryGhost/Team/issues/2922
2023-04-13 17:44:26 +02:00
Simon Backx
788aa34c8b Added support for creating new tags when bulk editing posts
refs https://github.com/TryGhost/Team/issues/2922
2023-04-13 17:05:42 +02:00
Simon Backx
76fae2a724 Fixed unpublishing sent posts was allowed
refs https://github.com/TryGhost/Team/issues/2677
2023-04-13 16:20:58 +02:00
Fabien 'egg' O'Carroll
82393fa99d
Added bulk tag addition to post context menu
refs https://github.com/TryGhost/Team/issues/2922

Add multiple tags to multiple posts at once.

---------

Co-authored-by: Simon Backx <simon@ghost.org>
2023-04-13 16:17:36 +02:00
Sanne de Vries
07785c8ed9 Updated featured status in post list
Refs https://github.com/TryGhost/Team/issues/2923
2023-04-13 14:59:59 +01:00
Simon Backx
0796dba3c1 Fixed linting issues context menu
no issue
2023-04-13 15:09:17 +02:00
Simon Backx
223e4af63c Fixed default context menu state
no issue

Still used removed variable.
2023-04-13 15:06:49 +02:00
Fabien 'egg' O'Carroll
27976381f8
Updated GhContextMenu to handle freezing the SelectionList (#16624)
refs https://github.com/TryGhost/Team/issues/2677

Fixed a bug that the current selection is deselected when clicking inside a modal when performing a context menu action.

Refactored the context menu component and its usage in the posts list to
improve the user experience and code quality. Introduced a `state`
property and a `setState` method to the `gh-context-menu` component to
handle different scenarios. Used the `gh-context-menu` component in the
`posts-list/context-menu` component to simplify the modal and loading
logic. Added a `#frozen` property and methods to the `selection-list`
utility to prevent the selection of posts from changing while the
context menu is active.

---------

Co-authored-by: Simon Backx <simon@ghost.org>
2023-04-13 15:04:06 +02:00
Simon Backx
ad65f6e242 Added toasts to bulk post actions
fixes https://github.com/TryGhost/Team/issues/2996

Toast messages added + the tpl dependency has been added to admin.
2023-04-13 14:49:52 +02:00
Kevin Ansfield
d7af4be7e5
Fixed invalid websocket address on https sites
no issue

- there was an errant space after the `wss:` protocol used when building the websockets URL for multiplayer that caused errors when trying to connect
2023-04-13 10:16:30 +01:00
Sag
1d19021606
Bumped Lexical packages (#16626)
no issue
2023-04-13 10:47:22 +02:00
Simon Backx
e3105bdde4 Improved shift selection when deselecting items
refs https://github.com/TryGhost/Team/issues/2677

When deselecting all items, and then using shift, it still tries to shift between the previous selection. This fixes that issue.
2023-04-13 10:22:09 +02:00
Kevin Ansfield
b286faf011
Initial setup for Lexical multiplayer websockets service (#16611)
no issue

Rough prototype only, current limitations:
- **No persistence**. Docs are in-memory only, YJS state will be lost on server restart although it could be re-populated by clients if they reconnect without closing their local doc (needs testing/investigation)
- **No tie-in with saved lexical state**. Lexical state is updated in the post model via normal API requests from Admin which can mean the multiplayer doc and the saved lexical state become out of sync but there's no detection/indication of that state at present. Will also trigger the "someone else is editing" errors because multiplayer doesn't yet override the default post update collision detection
- **New posts don't start in multiplayer**. New posts don't have an ID and so can't have a respective YJS doc, after initial save we don't transition to multiplayer because the React component in Ember doesn't re-render on prop changes yet
- **No tests**. Experimental code just to get something working and help answer questions for what's next

Changes:
- added `lexicalMultiplayer` labs flag
- updated `<KoenigLexicalEditor>` to pass through the required `<KoenigComposer>` props for multiplayer when enabled
- added `lexical-multiplayer` service
  - `init()` called during boot, used to set up the `enable()` and `disable()` methods so the flag can be toggled without restarts
  - when enabled it adds `upgrade` request handling to the base Ghost server
    - returns 404 if the URL doesn't match `/ghost/api/admin/posts/multiplayer/*`
    - returns 401 if a valid session cookie is not present
    - if everything is good, hands off to code in `y-websocket.js` that handles YJS doc creation, awareness, keepalive, etc
    - uses doc names in the format `${post.id}/${docId}` where `docId` is `main` for the primary document and a GUID for any sub-documents like captions and nested editors in cards
- updated `SettingsBREADService` to check if the `labs` setting is changed, and enables/disables the `lexical-multiplayer` service as needed so the websockets server can be started and shutdown when toggling without requiring a restart
2023-04-12 20:24:02 +01:00
Sanne de Vries
fadf90c61e Updated post list context menu
Refs https://github.com/TryGhost/Team/issues/2923
2023-04-12 17:18:01 +01:00
Jonathan Noack
dd5fd20cf9
Renamed Kiev to Kyiv in site timezone select (#16619)
closes https://github.com/TryGhost/Ghost/issues/16603

- Updates the timezone data used by Ghost to the latest version, which fixes the spelling of Kyiv in the timezone select.
2023-04-12 17:54:13 +02:00
Simon Backx
25d53f15b8 Improved default post access for bulk modal
refs https://github.com/TryGhost/Team/issues/2677

- Use post access level by default when doing single selection
- Use default access level from settings when selecting multiple posts
2023-04-12 16:38:53 +02:00
Simon Backx
8bdd23e1cc Improved bulk delete and unpublish modals copy
refs https://github.com/TryGhost/Team/issues/2677
2023-04-12 15:53:17 +02:00
Simon Backx
2df049b079 Improved feature/unfeature choice in post context menu
refs https://github.com/TryGhost/Team/issues/2677
2023-04-12 15:37:53 +02:00
Simon Backx
9eb886d26d Added unpublish bulk action to posts
fixes https://github.com/TryGhost/Team/issues/2994
2023-04-12 15:28:09 +02:00
Ghost CI
eafbb2856c v5.43.0 2023-04-12 11:38:08 +01:00
Simon Backx
fc05604d27 Added signup terms to Portal
fixes https://github.com/TryGhost/Team/issues/2680

Co-authored-by: Fabien 'egg' O'Carroll <fabien@allou.is>
Co-authored-by: Sanne de Vries <sannedv@protonmail.com>
2023-04-12 12:08:59 +02:00
Simon Backx
ab1ca90779
Implemented bulk editing post access (#16617)
fixes https://github.com/TryGhost/Team/issues/2924

This change adds a new bulk edit action for posts to update their
visibility. It also implements a modal to change the post access level
for multiple posts at once using this new API.

It also fixes a pattern that was used when modifying the Ember models in
memory. They previously were marked as dirty, this is fixed now. So when
going to the editor after modifying posts, you won't get a confirmation
dialog any longer.
2023-04-12 11:58:46 +02:00
Sanne de Vries
2325a359bb Fixed failing test due to CSS change
No ref
2023-04-12 08:45:56 +01:00
Sanne de Vries
bbcc7de31c Updated copy for portal signup notice
Refs https://github.com/TryGhost/Team/issues/2897
2023-04-12 08:28:02 +01:00
Ghost CI
e185ed8b68 v5.42.3 2023-04-12 04:38:23 +01:00
Simon Backx
c3c2427992 Fixed gh-count-down-html-characters helper to support null values
no issue

The default null value for the sigup terms caused an error. This fixes that issue.
2023-04-11 17:49:37 +02:00
Paul Davis
b149ed79ae Change self-service domain 2023-04-11 16:16:48 +01:00
Simon Backx
66b353ed97
Added bulk destroy posts api (#16587)
fixes https://github.com/TryGhost/Team/issues/2921

Adds the bulk destroy API for posts, and implemented it in the admin UI.
2023-04-11 16:37:42 +02:00
Simon Backx
1ce4e4c522 Updated post context menu to take permissions into account
fixes https://github.com/TryGhost/Team/issues/2938

- Multi selection is disabled for contributors and authors (no actions available)
- Delete action is only available for admins and owners
2023-04-11 16:33:39 +02:00
Elena Baidakova
100b4880ee Bump Koenig packages
no issue
2023-04-11 18:08:30 +04:00
Simon Backx
e938c2d5cc Fixed clearing posts selection when navigating
fixes https://github.com/TryGhost/Team/issues/2983

When navigating, the posts selection will get cleared. This also fixes a bug with CMD+a that had an old event listener that was not cleared correctly, breakign CMD+A after navigation.
2023-04-11 15:53:01 +02:00
Simon Backx
114a6eb953 Fixed CMD+F and multiple post selection
fixes https://github.com/TryGhost/Team/issues/2939

When using CMD+F, the multiple selection list still thinks CMD is pressed because the keyup event is not fired. This is fixed by clearing the pressed keys when the window is blurred.
2023-04-11 15:37:12 +02:00
renovate[bot]
88e1f2c50f Update dependency semver to v7.4.0 2023-04-11 11:01:01 +02:00
Sanne de Vries
79947d2f45 Updated signup terms input field in Portal settings
Refs https://github.com/TryGhost/Team/issues/2897
2023-04-11 10:38:45 +02:00
Fabien 'egg' O'Carroll
d4fe7217d6
Removed feature action from context menu for email-only posts (#16606)
These posts make no sense to be featured, so we are removing the option
from the context menu when there is only a single email-only post under
selection.

We still allow featuring these posts in the PSM and when they are
part of a larger selection, but fixing all places for this is out of
scope atm.
2023-04-11 13:25:49 +07:00
Sanne de Vries
9b1dd2a4ab Updated featured-post indicator and post selection styles
Refs https://github.com/TryGhost/Team/issues/2923
2023-04-10 13:53:04 +02:00
Simon Backx
bec71d7840 Added maximum signup terms count in HTML
refs https://github.com/TryGhost/Team/issues/2680

- Includes a new helper that is able to count HTML characters
- Prevent saving portal settings when maximum length is exceeded
2023-04-07 17:15:15 +02:00
Ghost CI
1c46e3d456 v5.42.2 2023-04-07 16:00:37 +01:00
renovate[bot]
07545541a8 Update @tryghost 2023-04-07 13:47:12 +02:00
renovate[bot]
9e888aeb15 Update dependency @babel/eslint-parser to v7.21.3 2023-04-07 13:43:07 +02:00
Sanne de Vries
c48ca09ff2 Moved signup terms above plan selection for non-free plans in Portal
Refs https://github.com/TryGhost/Team/issues/2878
- The free-only version of Portal will show the signup terms just above the signup button, whereas the non-free Portal version will show the signup terms above the plan selection
- The signup terms settings have been moved to the "Signup options" section
2023-04-07 11:53:59 +02:00
Simon Backx
f4d75388fd
Added post bulk edit api (#16576)
fixes https://github.com/TryGhost/Team/issues/2919

This pull request implements a new feature that allows bulk editing of
posts by a filter. It adds a new `bulkEdit` endpoint to the posts API
and new `PostsService` methods to handle the bulk actions.

The posts list component is duplicated, so we can keep working in a
copied version without affecting the old version without a flag. It
temporarily adds a star icon to indicate featured posts in the posts
list.
2023-04-07 11:48:14 +02:00
Simon Backx
ed1ae60bec
Fixed pasting links in koenig basic html input (#16584)
refs https://github.com/TryGhost/Team/issues/2680

When selecting a portion of text in KoenigBasicHtmlInput (caption input
for images, newsletter footer text input, new signup notice), and then
pasting a link, some funky things happen:
- Part of the text disappears
- The wrong part of the text is linked

The cause of this is that `KoenigBasicHtmlInput` deletes the selected
text range when pasting, even when pasting a link. so moving that part
below the code that detected a valid link, fixes the issue.

This also adds an option to not close an old style modal when pressing
the enter key (e.g. pressing enter when entering a link causes the modal
to close).
2023-04-07 11:19:37 +02:00
Ghost CI
7b6805580c Merged v5.42.1 into main 2023-04-07 08:51:06 +01:00
Ghost CI
89cf224a2a v5.42.1 2023-04-07 08:51:02 +01:00
Fabien "egg" O'Carroll
c99016fd2f Limited post export size to 1000 posts
refs https://github.com/TryGhost/Team/issues/2936

We want to make sure that downloads complete in a reasonable number of
time, and the simplest way to do that is to cap the size of the file.
2023-04-07 14:44:28 +07:00
Fabien "egg" O'Carroll
a890f0b707 Updated the posts export button to be a GhTaskButton
refs https://github.com/TryGhost/Team/issues/2935

This allows us to track the state with a loading spinner and a
success/error message on completion. This is expecially important for
larger sites where the download can take a long time, and users are
unsure if something is happening.
2023-04-07 14:44:28 +07:00
Fabien "egg" O'Carroll
3dac3cb4e2 Added fetchAndDownloadFile method to utils service
The existing approach didn't expose when the download was complete.

By fetching the file upfront and downloading from a blob we can better
estimate when the download is complete because we load the file in
memory, and then download from there.

The promise resolves after the file is in memory, so the delay between
the promise resolving and the file actually being downloaded is a lot
shorter, and based on the size of the file.
2023-04-07 14:44:28 +07:00
Sanne de Vries
bdaa992ced Updated signup notice setting in Portal settings
Refs https://github.com/TryGhost/Team/issues/2897
2023-04-06 10:57:13 +02:00
renovate[bot]
21516bfe11 Update sentry-javascript monorepo to v7.47.0 2023-04-05 18:23:06 +02:00
Simon Backx
8c046740f0 Added support for selecting posts
refs https://github.com/TryGhost/Team/issues/2906

Adds a way to select posts using CMD, shift and CMD+A. And adds a placeholder context menu.

Behind the making it rain feature flag.
2023-04-05 18:00:08 +02:00
Ghost CI
aa5272ffb9 v5.42.0 2023-04-05 16:49:46 +01:00
Simon Backx
ec40484983
Reverted " Added email design customization" (#16570) 2023-04-05 15:28:20 +02:00
renovate[bot]
3d5da1b091 Update dependency webpack to v5.77.0 2023-04-05 15:16:30 +02:00
renovate[bot]
83373e1751 Update Test & linting packages 2023-04-05 15:16:08 +02:00
Simon Backx
4639514a3b Added email design customization
fixes https://github.com/TryGhost/Team/issues/2671

Co-authored-by: Fabien 'egg' O'Carroll <fabien@allou.is>
Co-authored-by: Sanne de Vries <sannedv@protonmail.com>
2023-04-05 11:13:48 +02:00
renovate[bot]
c975e9af00 Update sentry-javascript monorepo to v7.46.0 2023-04-05 10:32:46 +02:00
Simon Backx
108ccd7fb6 Updated newsletter background preset color to lightgrey
no issue
2023-04-05 10:00:47 +02:00
Simon Backx
3885cab977 Reduced color picker delay 2023-04-04 18:05:16 +02:00
Sanne de Vries
cb8032911c Fixed spacing issue in email preview
No ref
2023-04-04 13:44:34 +02:00
Sanne de Vries
ae2622af6c Updated email preview in Newsletter settings
Closes https://github.com/TryGhost/Team/issues/2830
2023-04-04 13:40:06 +02:00
Simon Backx
7bc79ddb4e Added basic UI to update portal signup term settings
refs https://github.com/TryGhost/Team/issues/2897

Hidden behind a feature flag. UI probably needs to be improved, but this is a good start.
2023-04-04 10:10:06 +02:00
Simon Backx
e13f052af8
Added Portal signup terms settings and migration (#16545)
fixes https://github.com/TryGhost/Team/issues/2885 
fixes https://github.com/TryGhost/Team/issues/2896 
fixes https://github.com/TryGhost/Team/issues/2877

This change adds the new portal_signup_terms_html setting and
portal_signup_checkbox_required setting and the corresponding migration.
2023-04-04 10:04:12 +02:00
Chris Raible
6b8f5fe7aa
🐛 Fixed UI bug when selecting specific recipients by label (#16543)
closes TryGhost/Team#2859

- when removing all selected labels/newsletters, the UI would uncheck
the Specific People checkbox and hide the label/newsletter selection
- this change forces the Specific People checkbox to be checked even if
no labels/newsletters are selected
- test enhanced to cover this specific edge case
2023-04-03 14:45:58 -07:00
Simon Backx
a811d1173f Updated post export analytics copy
no issue
2023-04-03 15:50:26 +02:00
Simon Backx
136bf80168 Added post analytics export
fixes https://github.com/TryGhost/Team/issues/2678

- Includes a new filename for the export (post-analytics instead of posts)

Co-authored-by: Fabien 'egg' O'Carroll <fabien@allou.is>
Co-authored-by: Sanne de Vries <sannedv@protonmail.com>
2023-04-03 14:39:11 +02:00
Simon Backx
aee909b054 Improved newsletter color picker in admin
refs https://github.com/TryGhost/Team/issues/2830

- Colors stay in the same order
- Auto color changes faster because direct usage of preset colors and no longer uses ordered colors
2023-04-03 14:18:50 +02:00
Sag
3393d3910c
Upgraded Koenig packages
no issue
2023-04-03 11:33:43 +02:00
Simon Backx
33237c4df7 Added newsletter auto border color and dynamic color picker
fixes https://github.com/TryGhost/Team/issues/2879
fixes https://github.com/TryGhost/Team/issues/2880

- Replaced black border color with 'auto' based on background color.
- When a color is 'auto', the color that are visible in the UI (color pciker) will be dynamic based on the background color.
2023-04-03 11:27:57 +02:00
Sanne de Vries
b8a8b7fd19 Updated newsletter footer section headings to use titleColor
Refs https://github.com/TryGhost/Team/issues/2830
2023-04-03 10:17:51 +02:00
Fabien 'egg' O'Carroll
a978f9f6b9
Moved posts export to analytics settings page (#16539)
refs https://github.com/TryGhost/Team/issues/2869
2023-04-03 13:35:56 +07:00
pavel
301a21106c
🎨 Improved scrollbar appearance in dark mode (#16535)
fixes #16444
2023-04-02 11:00:38 -04:00
Ghost CI
8140a7b227 v5.41.0 2023-03-31 17:00:56 +01:00
Sanne de Vries
f21917697d Reverted UI changes to post metrics export button in post list
Refs https://github.com/TryGhost/Team/issues/2780
- This functionality is being moved to Settings > Analytics
2023-03-30 18:16:07 +02:00
Daniel Lockyer
a1815cd6d6 Updated copy for locale input 2023-03-30 18:15:57 +02:00
Daniel Lockyer
5cd67f83ea Added i18n labs flag
- this adds the labs flag and scaffolding to wire it into Ghost + Portal
2023-03-30 18:15:57 +02:00
Sanne de Vries
e5fc4bd6ba Updated email width in admin preview
Refs https://github.com/TryGhost/Team/issues/2846
2023-03-30 17:38:01 +02:00
Sanne de Vries
8eefaee591 Implemented newsletter customisation in admin preview
Refs https://github.com/TryGhost/Team/issues/2846
2023-03-30 17:34:01 +02:00
Paul Davis
86027fdb6f
Add Migrate app (#16458)
Adds the UI for self-serve migrations
2023-03-30 15:40:06 +01:00
Sanne de Vries
429840606d Added post analytics export UI to Settings > Analytics
Refs https://github.com/TryGhost/Team/issues/2780
2023-03-30 08:35:03 +02:00