Commit Graph

332 Commits

Author SHA1 Message Date
Steve Larson
59b304dfca
🐛 Fixed editor 'are you sure?' modal displaying when no user changes occurred (#20370)
ref https://linear.app/tryghost/issue/ENG-661
- added a dirty check to ignore the `direction` field from the lexical
object; this is set dynamically and shouldn't be serialized, see
facebook/lexical/issues/4998
- fixed a bug where the modal wouldn't display on leaving the editor if
the post had no revisions (e.g. import); this could result in content
being saved over published content with no user action
- added Sentry logging for the modal

We would sometimes see the "Are you sure?" modal pop up when opening a
post in the editor and attempting to navigate away immediately, without
any changes to the post. This appears to be an issue with the serialized
Lexical data, which would change after loading into the editor,
resulting in the scratch and model's lexical values to differ, making
Admin think the user changed the content.

Ideally we'll see a fix upstream (or fix it ourselves). We may need to
revisit this if we experience other such situations. It's awfully
difficult to be able to set a flag saying 'the editor is done loading',
so this seems to be the best path for the moment.

Testing is difficult because we don't actually load the new Lexical editor into e2e/acceptance tests. I've added a unit test that can at least simulate the editor state changing on editor load.
2024-06-13 11:07:56 -05:00
Kevin Ansfield
9ca1f3ce24
Renamed subtitle to excerpt (#20334)
no issue

We've settled on using "excerpt" naming in place of "subtitle" to better reflect the underlying property name and tie in with themes and historical usage.

- added migration to rename the `show_subtitle` newsletter setting to `show_excerpt`
- renamed all places in the codebase that referenced subtitle
2024-06-05 17:59:30 +01:00
Kevin Ansfield
b447a26832
Added custom excerpt to post revisions (#20323)
closes https://linear.app/tryghost/issue/MOM-170

When the subtitle field is included in the editor it creates a disconnect with post revisions if the underlying custom excerpt data is not included so we'd like to both preview and restore the subtitle when the in-editor subtitle field is enabled.

- added `post_revisions.custom_excerpt` column to schema
- added migration to add `post_revisions.custom_excerpt` to existing databases
- added migration to populate `post_revisions.custom_excerpt` with the current `post.custom_excerpt` value from the associated record
  - ensures no data is inadvertently lost when restoring an old version
- using current data matches what would have happened previously where custom_excerpt was never overwritten when restoring an old version
- updated post revisions handling to accept the `custom_excerpt` field
- updated Admin's revision preview and restoration to display and set the `custom_excerpt` field
2024-06-05 14:47:33 +01:00
Kevin Ansfield
36ba47604f Added Admin acceptance test for post revision restoration
ref https://linear.app/tryghost/issue/ENG-1078

- adds required setup for acceptance testing post revisions
- adds happy-path test for listing, previewing, and restoring a post revision
2024-06-04 20:16:19 +01:00
Peter Zimon
5bb945e89b
What's new popup (#20112)
DES-192

We often hear that people are not aware of the new features we ship.
Ways in which people can find out are social media/changelog/dashboard –
all of these are easy to miss. We'd like to introduce a template for a
simple notification in the sidebar that can be used any time a new and noteworthy feature has
shipped. The purpose of this is simply to notify and will
disappear forever after it's been dismissed.
2024-05-21 12:36:28 +02:00
Peter Zimon
770f657ae9
Improve messaging and error handling (#20078)
ref DES-228

This PR updates messaging and error handling in order to make Ghost calmer and friendlier. High level summary of the changes:

- Removed all onBlur validation in Settings -> now it’s possible to just click around without being warned to fill mandatory fields
- Removed  lot of technical errors like `ValidationError: Validation (isEmpty) failed for locale`
- Completely removed the red background toast notifications, it was aggressive and raw esp. on the top
- Removed some unnecessary notifications (e.g. when removing a webhook, the removal already communicates the result)
- Now we show field errors on submitting forms, and in case of an error we show a “Retry” button in Settings too. This allowed to remove a lot of unnecessary error messages, like the big error message on the top, plus it’s consistent with the patterns outside Settings.
- Notification style is white now with filled color icons which makes everything much calmer and more refined.
- Removes redundant copy (e.g. "successful(ly)") from notifications

---------

Co-authored-by: Sodbileg Gansukh <sodbileg.gansukh@gmail.com>
2024-05-14 09:31:19 +02:00
Chris Raible
a10b13916a
🐛 Fixed admin error when deleting an unsaved or imported post (#20053)
ref
https://linear.app/tryghost/issue/ENG-845/error-attempted-to-set-lexical-on-the-deleted-record
ref
[https://linear.app/tryghost/issue/ENG-854/🐛-deleting-imported-posts-makes-ghost-unresponsive](https://linear.app/tryghost/issue/ENG-854/%F0%9F%90%9B-deleting-imported-posts-makes-ghost-unresponsive)

- When deleting a post in the editor's Post Settings Menu, if the post
has unsaved changes (indicated by the hasDirtyAttributes property in the
editor), Admin will crash because it tries to save a post revision
before leaving the editor, but the post has already been deleted so
saving fails.
- This can occur when editing a post and quickly deleting it from the
Post Settings Menu before saving is completed.
- It can also occur when attempting to delete an imported post, as the
editor will parse the lexical from the server and may make some minor,
invisible-to-the-user changes to the lexical string locally (e.g. JSON
formatting, or updating the JSON to use extended version of base lexical
nodes), which triggers the same error.
- This fix bypasses the attempt to save a post revision when leaving the
editor if the post is already deleted, which allows the transition back
to the Posts route to succeed.
2024-04-18 10:02:02 -07:00
Kevin Ansfield
d6e599dab3
Generalised Admin search for use in editor (#20011)
ref https://linear.app/tryghost/issue/MOM-1

- renamed `searchable` to `groupName` so it better matches usage and avoids leaking internal naming to external clients
- added `url` to the fetched data for each data type as the editor will want to use front-end URLs in content
- added acceptance tests to help avoid regressions as we further generalise/optimise the search behaviour
2024-04-11 14:01:39 +00:00
Sag
4ab9c24f12
Fixed sender email in the post preview for email (#19211)
Fixes GRO-74
2023-11-30 18:22:38 +00:00
Sag
3b7dc7555d
Fixed default sender address when email is managed (#19186)
fixes GRO-74

- uses the calculated setting "default_email_address" as first fallback, if there is no sender email for the newsletter
2023-11-29 19:24:16 +00:00
Jono M
e8e0d84d50
Deleted old Ember settings pages (#18740)
refs https://github.com/TryGhost/Product/issues/4055

---

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

Removed unused components related to announcement settings, custom theme
settings, and file upload. These components were part of a deprecated
feature or a legacy UI.
2023-11-06 06:46:31 +00:00
Kevin Ansfield
fa0b1c607b
Deleted all Admin code relating to the old editor (#18580)
no issue

- removed labs flag
- removed main editor component and all associated components
- switched usage of `<KoenigBasicHtmlInput>` and `<KoenigBasicHtmlTextarea>` over to use plain `textarea`, the only uses were in settings modals that have been replaced in AdminX
- cleaned up unused editor CSS
2023-10-12 13:17:39 +01:00
Chris Raible
80a6fe17d0 Added Source as the new default theme
refs TryGhost/Product#3510

- Added `TryGhost/Source` as a submodule in `ghost/core/content/themes` so `Source` will ship with Ghost (along with Casper)
- With this change, new installs will use `Source` as the default theme. Existing sites will have `Source` installed, but not activated, as this is a large change and we don't want to drastically change existing sites without warning. Users can upgrade to use `Source` simply by clicking 'Activate' in design settings.
- Updated protections to prevent users from uploading their own conflicting version of `Source`
2023-10-03 14:02:08 +02:00
Sag
a045e7e50b
Added a preview link in Admin for Tips & Donations (#17711)
closes https://github.com/TryGhost/Product/issues/3724
2023-08-14 13:33:38 +00:00
Daniel Lockyer
532a7cf6e3 Fixed loading assets from CDN URL
refs https://ghost.slack.com/archives/C027S85FS/p1690202522054729

- this is another set of places where we load assets slightly
  differently
- this should fix user profile images when using assets from a CDN
2023-07-24 16:12:29 +02:00
Michael Barrett
184c6ae951
Retain newsletter subscriptions on suppression (#17373)
refs https://github.com/TryGhost/Product/issues/2610
2023-07-24 10:47:57 +01:00
Ronald Langeveld
bd348dc297
🎨 Improved copy on page & post revisions (#17068)
no issue

Updates the labels of the post history components to reflect the type of
content (post or page).
It modifies the `restore-revision`, `gh-post-settings-menu`, and
`modal-post-history` components.
2023-06-20 14:52:51 +02:00
Ronald Langeveld
998708c81a
🐛 Fixed empty icon crashing signup embed preview (#17022)
closes https://github.com/TryGhost/Team/issues/3471

- after adding and removing an icon, icon settings passed an undefined
icon to the signup form's all-in-one style. The AIO conditions didn't
take that into account and caused the entire component to crash.

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

Fix signup form embed code generation when icon is not set. Add a check
for `this.settings.icon` in `signup-form-embed.js` before replacing
image path.
2023-06-14 15:13:49 +02:00
Simon Backx
ffa6c9c5f8 Added width:100% to minimal signup form CSS
no issue

Otherwise the auto margin would cause issues in a grid or flex container.
2023-06-09 11:08:14 +02:00
Simon Backx
12f7fd0153 Updated minimal signup form to be centered by default
no issue

Added `margin: 0 auto;` css by default.
2023-06-09 10:47:51 +02:00
Simon Backx
66ca072055 Moved maximum width and centering outside minimal signup form
refs https://ghost.slack.com/archives/C04TMVA1D7A/p1686299301740999

- Easier to customize: easy to choose between centering and left alignment
- Fixes issue with centering error message
2023-06-09 10:42:24 +02:00
Sanne de Vries
e74b38ac93
Updated color picker in signup form modal (#16971)
Refs https://github.com/TryGhost/Team/issues/3407

---------

Co-authored-by: Simon Backx <simon@ghost.org>
2023-06-09 08:55:35 +02:00
Sanne de Vries
1e7b332b7f Updated signup form embed settings copy
No ref
2023-06-09 08:26:21 +02:00
Simon Backx
c5fbd8bae6 Added Plausible events when copying the signup form embed code
fixes https://github.com/TryGhost/Team/issues/3389
2023-06-08 15:51:32 +02:00
Simon Backx
5658f4b627 Fixed admin failing tests
no issue

renderInPlace broke tests because expected dropdown changed place in the DOM
2023-06-08 13:38:13 +02:00
Simon Backx
a68ac4b688 Renamed data-logo to data-icon in signup embed attributes
fixes https://github.com/TryGhost/Team/issues/3401
2023-06-08 13:23:38 +02:00
Simon Backx
f0518bc76a Increased signup form embed icon resolution to 192px
no issue

Optimal resolution for @3x devices
2023-06-06 09:42:42 +02:00
Simon Backx
fc89ad22fc Prevented setting signup form embed locale when feature flag is disabled
fixes https://github.com/TryGhost/Team/issues/3385
2023-06-06 09:40:47 +02:00
Simon Backx
ab0c33346d Fixed signup form minimal width in preview
no issue
2023-06-05 18:10:19 +02:00
Simon Backx
1e7b658148 Updated sign up form to use resized version of icon
fixes https://github.com/TryGhost/Team/issues/3345

The icon is now served as a 128x128px version
2023-06-05 17:59:18 +02:00
Simon Backx
9aef897936 Increased virtual iframe width of minimal signup form preview
no issue

Because the signup form is responsive, it is displayed too small in the preview. To counteract this, the width of the iframe is increased to 200%, and clipped to make it larger.
2023-06-05 17:37:43 +02:00
Simon Backx
22f4d55f75 Added throttling and animation when updating signup form preview
fixes https://github.com/TryGhost/Team/issues/3378
2023-06-05 15:24:59 +02:00
Simon Backx
d4f82f8b88 Added copy on click to textarea in signup form embed modal
no issue
2023-06-02 16:31:30 +02:00
Simon Backx
fc5af7e7f8 Removed notification when copying signup form embed code 2023-06-02 16:21:20 +02:00
Simon Backx
ff28e1c94f Added fixed order in data attributes for signup form embed script
refs https://ghost.slack.com/archives/C04TMVA1D7A/p1685711310532969
2023-06-02 16:13:42 +02:00
Sanne de Vries
8833ec03de
Updated signup form modal (#16925)
Refs https://github.com/TryGhost/Team/issues/3340

---------

Co-authored-by: Simon Backx <simon@ghost.org>
2023-06-02 16:07:30 +02:00
Simon Backx
258dc2f8f2 Added locale data option to signup form script
refs https://github.com/TryGhost/Team/issues/3307
2023-06-02 14:36:17 +02:00
Simon Backx
c27b488f3d Added async attribute to signup form script tag 2023-06-02 13:59:49 +02:00
Simon Backx
806abf28e4 Added placeholder to member label input for signup form embed modal
refs https://github.com/TryGhost/Team/issues/3340
2023-06-02 12:28:58 +02:00
Simon Backx
9ff9906670 Added transparent background pattern to minimal signup form preview
refs https://github.com/TryGhost/Team/issues/3340
2023-06-02 09:48:25 +02:00
Simon Backx
5152e0e042 Moved signup form embed to a modal
refs https://github.com/TryGhost/Team/issues/3340
2023-06-02 09:31:38 +02:00
Michael Barrett
83847bf22c
Added emailCustomization flag and removed makeItRain flag (#16903)
refs https://github.com/TryGhost/Team/issues/3337

Moved current email customization functionality that is behind the
`makeItRain` to its own flag (`emailCustomization`) and removed the now
redundant `makeItRain` flag
2023-06-01 12:32:37 +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
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
Simon Backx
ec40484983
Reverted " Added email design customization" (#16570) 2023-04-05 15:28:20 +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
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
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
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