Commit Graph

17095 Commits

Author SHA1 Message Date
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
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
Daniel Lockyer
1403849efe
Fixed i18n tests in CI
- bit of a mess but we run `test:unit` in CI and this needed to run
  `yarn translate` so i18next-parser can fail if the translations need
  updating (ie. fail tests)
2023-04-14 08:39:51 +01:00
Daniel Lockyer
4a032e23b2
Fixed indentation on Slovenian translations
- we should be using 4 spaces over 2 spaces here
2023-04-14 08:27:57 +01:00
Daniel Lockyer
75553b6bef
Updated Sinhalese encoding
- some characters needed to be re-encoded
2023-04-14 08:16:03 +01:00
Daniel Lockyer
cebad9ae0c
Added support for new locales
- Danish and Chinese as per recent pull requests
2023-04-14 08:14:10 +01:00
martinverbic
d11801d0d4
Updated Slovenian locale (#16621)
refs https://github.com/TryGhost/Team/issues/2795
2023-04-14 08:05:48 +01:00
Christian Schou
1285e4480b
Added Danish translation (#16627)
refs https://github.com/TryGhost/Team/issues/2795
2023-04-14 08:02:02 +01:00
Kasun Chanuka Fernando
427337633b
Added Sinhalese locale (#16595)
refs https://github.com/TryGhost/Team/issues/2795
2023-04-14 07:47:10 +01:00
Alexandre "Lekler" Rodrigues
fd705ccee2
Updated pt-br translations (#16622)
refs https://github.com/TryGhost/Team/issues/2795
2023-04-14 07:44:19 +01:00
AreChen
ada0f34d81
Added Chinese locale (#16623)
refs https://github.com/TryGhost/Team/issues/2795
2023-04-14 07:42:01 +01: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
c4dd980421 Fixed transaction usage in bulk tag adding
refs https://github.com/TryGhost/Team/issues/2922
2023-04-13 17:47:00 +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
Simon Backx
2f2171c18b Released Portal v2.29.3 2023-04-13 13:42:09 +02:00
Sanne de Vries
d37f958f41 Updated signup terms positioning on Portal offer page
Refs https://github.com/TryGhost/Ghost/issues/16625
2023-04-13 11:06:55 +01: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
75a25d1f70 Added signup terms to offer page
refs https://github.com/TryGhost/Ghost/issues/16625

The signup terms were not visible when signing up via an offer. This adds the checkbox and validation to the offer page.
2023-04-13 10:32:34 +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
Daniel Lockyer
c6220aad67
Released Portal v2.29.2 2023-04-12 21:21:30 +01:00
Sanne de Vries
7dee5d215d Fixed signup terms displaying behind button in Portal free signup
Refs https://github.com/TryGhost/Team/issues/2878
2023-04-12 21:13:34 +01: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
Simon Backx
d4e9c23f84 Fixed select not happening inside transaction for bulk post actions
no issue

This potentially caused Knex timeout connection pool errors.
2023-04-12 12:48:17 +02:00
Ghost CI
eafbb2856c v5.43.0 2023-04-12 11:38:08 +01:00
Ghost CI
63c5a47c02 🎨 Updated Casper to v5.4.9 2023-04-12 11:38:08 +01:00
Simon Backx
0f2cf8e4c5 Released Portal v2.29.1 2023-04-12 12:11:42 +02: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
Simon Backx
a097f0e973 Fixed deleting email recipient failures before recipients
fixes https://github.com/TryGhost/Team/issues/2993

For the bulk destroy action of posts.
2023-04-12 11:55:18 +02:00
Simon Backx
ae863674ba
Added error message to Portal SignupPage below buttons (#16609)
fixes https://github.com/TryGhost/Team/issues/2980

This change adds an error message below the submit buttons on the signup page (if there are multiple tiers), when one or multiple fields have an error. That way, the error message is visible and not out of view.

---------

Co-authored-by: Sanne de Vries <sannedv@protonmail.com>
2023-04-12 11:12:14 +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
8571011e7d Merged v5.42.3 into main 2023-04-12 04:38:27 +01:00
Ghost CI
e185ed8b68 v5.42.3 2023-04-12 04:38:23 +01:00
Chris Raible
0b0e3f8e85
Added error handling for email analytics unsubscribe event (#16613)
refs TryGhost/Team#2974

- currently the unsubscribeFromNewsletters event is failing with 'member
not found' in elastic
- this change catches the error and logs it, which should allow the rest
of the event(s) to be processed
2023-04-11 13:13:34 -07:00
Simon Backx
24b4a50b24 Bumped Portal to v2.29
no issue

Start using the latest released version.
2023-04-11 17:54:09 +02:00
Simon Backx
b820853b52 Released Portal v2.29.0 2023-04-11 17:53:12 +02: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]
ee216038e9 Update dependency @tryghost/email-mock-receiver to v0.3.1 2023-04-11 11:47:08 +02:00
renovate[bot]
4b8f631563 Update dependency @playwright/test to v1.32.3 2023-04-11 11:14:38 +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
Chris Raible
7a800ec06e
Fixed flaky test: posts API export can export with order (#16605)
closes Tryghost/Team#2975

- The test was failing because the order of the posts was not guaranteed
- The posts receive a published_at timestamp = new Date() when they are
created, unless a published_at date is passed in
- ~1/3 times the tests would run, the ordering would change and this
test would fail
- This commit fixes the test by passing in a published_at date to ensure
the order is always the same
2023-04-10 18:40:03 -07:00
Thibault Malfoy
b9014a47f8
Updated French translations to reflect feedback (#16593)
refs https://github.com/TryGhost/Team/issues/2795
2023-04-10 16:47:32 +02:00
Daniel Lockyer
a97335f7f4
Removed translations for "Powered by Ghost"
refs https://github.com/TryGhost/Team/issues/2795
refs https://ghost.slack.com/archives/CFH10N79S/p1681131575137019?thread_ts=1680206445.643819&cid=CFH10N79S

- we want to keep this in English so this commit removes the
  translation wrapper and associated translations
2023-04-10 15:13:49 +02:00
Daniel Lockyer
7435b18c85
Added support for new locales
refs https://github.com/TryGhost/Team/issues/2795

- PRs for these locales were merged this morning so we need this to
  enable the languages
2023-04-10 14:05:33 +02:00
Daniel Lockyer
3a0768cfda
Reformatted locale files
- perhaps we need better config to enforce this from the get-go
2023-04-10 14:04:51 +02: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
martinverbic
d866993ce2
Added Slovenian locale (#16594)
refs https://github.com/TryGhost/Team/issues/2795
2023-04-10 13:52:43 +02:00
Ugurcan Yildirim
e446e31a9e
Added Turkish locale (#16596)
refs https://github.com/TryGhost/Team/issues/2795
2023-04-10 13:52:10 +02:00
Sag
ed28bba94d
Upgraded Lexical packages (#16600)
no issue
2023-04-10 10:39:15 +02:00
renovate[bot]
3b8eea2c01 Update dependency html-validate to v7.15.1 2023-04-10 10:25:09 +02:00
Jordan Ostreff
f5f58994f7
Added Bulgarian translations (#16590)
refs https://github.com/TryGhost/Team/issues/2795
2023-04-10 10:24:35 +02:00
Chris Raible
71aca468b3
Fixed flaky test: Can generate a mentions report (#16592)
refs TryGhost/Team#2844

- assertion was comparing a constant `now` with a `new Date()` that was
made on the next line — by passing now in as the end date to
`getMentionReport`, the end date should always equal the constant
- intent of the test is just to make sure a mentions report can
generate, so we can just use the variable now instead of creating new
Date() objects
2023-04-07 19:03:22 -07:00
Chris Raible
04e6b9763c
Added retries to a flaky batch sending test (#16591)
refs TryGhost/Team#2949
2023-04-07 17:44:11 -07: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
Naz
cdc8cb2d16 Added email snapshot test to member suite
refs https://github.com/TryGhost/Team/issues/2691
refs 53fd78cc86

- One more example using emailMockReceiver instead of outdated mockManager's assertions.
2023-04-07 16:12:51 +02:00
Naz
f77aa03e91
Added missing snapshots for version tests
refs 7552873072

- These snapshot were missing with original refed commit.
2023-04-07 15:31:18 +02:00
Naz
53fd78cc86
Added email snapshot tests to newsletter suites
https://github.com/TryGhost/Team/issues/2691

- This change is meant to serve as an example for testing outbound emails. It uses emailMockReceiver and it's html/test/metadata snapshotting features.
- The wider goal is to move away from using "mockManager.assert.sentEmail" that only tested some of the outgoing email contents to more wide range testing through "emailMockReceiver"
- For more on best practices using emailMockReceiver check out codex section on "email testing" - https://ghost.notion.site/End-to-end-Testing-6a2ef073b1754b18aff42e24a632a007#cf33c7f0-fba6-4951-bf50-09080374719c
2023-04-07 14:34:57 +02:00
Naz
f264c1d1f8
Removed unnecessary mockMail call
no issue

- This test has nothing to do with outgoing emails, so no need to mock mail
2023-04-07 14:34:57 +02:00
renovate[bot]
11aacc0e6b Update dependency copy-webpack-plugin to v11 2023-04-07 13:47:46 +02:00
renovate[bot]
07545541a8 Update @tryghost 2023-04-07 13:47:12 +02:00
Simon Backx
cf4e6f80c5 Released Portal v2.28.1 2023-04-07 13:44:25 +02:00
renovate[bot]
9e888aeb15 Update dependency @babel/eslint-parser to v7.21.3 2023-04-07 13:43:07 +02:00
Adam Hunter
ef264e2263
Fixed typo in variable name for GeolocationService (#16574) 2023-04-07 13:23:15 +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
Thibault Malfoy
726246b80e
Fixed a few typos in the French translation (#16546)
refs https://github.com/TryGhost/Team/issues/2795
2023-04-07 11:16:30 +02:00
Chris Raible
d49241dd29
Fixing error in browser test (#16583) 2023-04-07 01:11:37 -07:00
Ghost CI
7b6805580c Merged v5.42.1 into main 2023-04-07 08:51:06 +01:00