Commit Graph

6395 Commits

Author SHA1 Message Date
Fabien "egg" O'Carroll
56f2832754 Explicitly set include for posts/pages in editor
We want to remove the post_revisions default include from the API but it's
required for the post history feature in the editor. Because the default include
is only applied when no include is sent, we have to set the entire string,
rather than just the missing post_revision related fields
2023-10-12 13:10:05 +02:00
Chris Raible
de16c13852
Removed 10 minute Post-Revision autosave (#18586)
fixes TryGhost/Product#3480

- Removed this feature because it provides a surface area for bugs and
issues, and isn't really needed
2023-10-11 15:15:00 -07:00
Kevin Ansfield
e213a5ca3a
Fixed Admin sending all post revisions along with each post save request (#18582)
no issue

- deleted `post_revisions` from the serialized JSON string for posts
2023-10-11 17:37:50 +00:00
Chris Raible
909c8b53a8
🐛 Fixed bug causing sites with many snippets to be rate limited (#18568)
refs TryGhost/Product#4022

- This block of code converts any snippets that are only in mobiledoc to lexical locally in the editor, then sends a PUT request for each snippet to update it on the server
- For sites with > 50 snippets, these PUT requests were triggering rate limits on Pro of 50 req/s
- This change is a temp fix to add a 100ms sleep between these requests to stay under the 50 req/s limit
- Longer term, we may introduce a migration that will convert all snippets, or modify the editor to somehow lazily convert the snippets when needed, but this temp fix should resolve the rate limiting issue for the time being
2023-10-11 12:06:03 +01:00
Peter Zimon
586efd1f60
Added "about" modal to AdminX
refs. https://github.com/TryGhost/Product/issues/3949

Added an about modal to the new admin x settings.
---------

Co-authored-by: Ronald Langeveld <hi@ronaldlangeveld.com>
2023-10-11 16:09:56 +07:00
Sanne de Vries
1a8ba0693c
Added shortcuts for highlighting and pasting without formatting (#18556)
No ref
2023-10-11 09:34:42 +02:00
Kevin Ansfield
0ffe4dd144 Swapped feature image caption input from mobiledoc to lexical
closes https://github.com/TryGhost/Product/issues/4015

Swapped `<KoenigBasicHtmlInput>` for `<KoenigLexicalEditorInput>`

- added support for passing `class` through to the container `<div>`
- updated caption handler to clean HTML and strip/add surrounding `<p>` as necessary
- added passthrough for `onFocus` prop
- updated styles to force font style inheritance within Koeing's `.kg-prose` class
2023-10-10 18:45:51 +01:00
Jono M
839b1e1b43
Fixed tiers resetting in Ember when created in AdminX (#18554)
refs https://github.com/TryGhost/Product/issues/3832

---

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

Reload members data when tiers settings change. This ensures that the UI
shows the correct counts and labels of the tiers after updating them in
the settings component.
2023-10-10 15:37:17 +01:00
Michael Barrett
9a18d43ea6
Refactored theme demo selector functionality (#18541)
refs https://github.com/TryGhost/Product/issues/3999

Refactored the theme demo functionality to remove the hard-coded
reference to the source theme and enable the functionality for any
theme.
2023-10-10 09:19:08 +01:00
Jono M
81d2fa09da
Redesigned Admin settings (#18545)
refs https://github.com/TryGhost/Product/issues/3832

Last piece of cleanup, removing the old feature flag. See
https://github.com/TryGhost/Ghost/pull/18360 for the commit that
actually switched over the routes.
2023-10-10 07:37:01 +01:00
Michael Barrett
bc3ad1a798
Refactored theme demo functionality (#18525)
refs https://github.com/TryGhost/Product/issues/3998

Refactored the theme demo functionality to remove the hard-coded
reference to the source theme and enable the functionality for any
theme. This also ensures the demo images are correctly referenced in
pro.
2023-10-09 09:05:43 +01:00
Peter Zimon
e68db848dc
AdminX: reroute settings-x to settings (#18360)
refs. https://github.com/TryGhost/Product/issues/3949

---------

Co-authored-by: Jono Mingard <reason.koan@gmail.com>
Co-authored-by: Daniel Lockyer <hi@daniellockyer.com>
2023-10-09 08:12:46 +01:00
Sanne de Vries
dc11270954
Fixed post preview icons in dark mode (#18517)
No ref
2023-10-06 11:03:58 +00:00
Jonathan Browne
e8840510fc
Fixed post items getting cut off on iOS (#17189)
- This PR is a fixed version of #16765. I took a different approach for this to work around some of the issues that were found after that one got merged. In that PR's description, I mentioned that there were multiple scroll areas for the post editor that were somehow displaying at different sizes. The reason appears to be that the CSS vh unit includes some areas that are obscured by Safari's toolbars, since those toolbars may disappear if the <body> element is scrolled. However, since Ghost's admin area uses <div> elements for all scrolling, those toolbars never disappear, and so the space becomes unused. We can work around this by changing to the CSS dvh unit, which always represents the current size of the viewport.
- Most pages have enough padding that the vh unit doesn't cause any problems. In this PR, I've changed it for two places that do break, the post editor and the post settings menu (which can get the "Delete" button cut off). I also included the sidebar width fix from the previous PR.
- Video of the fixed behavior (compare with the old behavior video linked in #16765): https://github.com/TryGhost/Ghost/assets/12983479/eceda43a-23c3-4cf6-9de2-8eda54a98100
2023-10-06 10:58:08 +02:00
Daniel Lockyer
3e42d4b1be Implemented cachebuster for Admin-X Settings and Koenig-Lexical files
fixes https://github.com/TryGhost/DevOps/issues/86

- this will now hash the files and append a cachebuster, so we never
  serve stale files again
2023-10-06 10:41:37 +02:00
Kevin Ansfield
d812781888
Prevented Escape from closing the image editor (#18505)
no issue

`Escape` can often be hit when attempting to cancel or undo an action
through muscle memory despite it not doing anything in Pintura except
closing the modal and losing all changes

- added `willClose` option to the Pintura modal settings which only
returns `true` when we've detected a click on the close button
2023-10-05 17:30:56 +01:00
Djordje Vlaisavljevic
1775591472 Fixed Stripe thumbnail src
no refs
2023-10-05 15:10:34 +01:00
Nick Moreton
8122f02f17
Added resize option to Pintura (#18504)
Got some code for us? Awesome 🎊!

Please include a description of your change & check your PR against this
list, thanks!

- [ ] There's a clear use-case for this code change, explained below
- [ ] Commit message has a short title & references relevant issues
- [ ] The build will pass (run `yarn test:all` and `yarn lint`)

We appreciate your contribution!

---

<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
copilot:summary
2023-10-05 13:08:23 +00:00
Nick Moreton
d454f18ad2
Removed sticker option from Pintura (#18497)
Removed the sticker feature from the image editor component in both the
new and the legacy admin apps. This simplifies the UI and the code of
the `usePinturaEditor.ts` and `koenig-image-editor.js` files.
2023-10-05 10:32:13 +01:00
Kevin Ansfield
1b5359dce1
Removed old/unused posts list item component (#18495)
no issue

- cleanup of unused files
2023-10-05 10:01:12 +01:00
Kevin Ansfield
08e4593093 Added pre-emptive fetch of editor module after logging in to Admin
no issue

Reduces likelihood of seeing the "Loading editor..." state when accessing the editor by fetching the editor module in the background after login.

- added `koenig` service
  - `.resource` getter for returning a React suspense resource object to reduce duplication across main editor and HTML input components
  - `.fetch()` method that fetches the Koenig module, avoids concurrent or repeated fetches by utilising an internal `._fetchTask` ember-concurrency task
- updated Koenig components to use the `koenig` service and associated resource for fetching the module
  - required setting up `editorResource` inside the component's class and passing it in as a prop to the suspense-aware components as we need access to Ember's dependency injection available in the class
- added `koenig.fetch()` call to our post-login code in the `session` service so the fetch is started before the editor is accessed
2023-10-04 17:45:42 +01:00
Kevin Ansfield
c56bfd51de Fixed posts list hrefs showing "mobiledoc-editor" and added "editor-beta" redirects
no issue

- switched posts list over to using the `lexical-editor.edit` route so it uses the `/editor/` href rather than `/mobiledoc-editor/`
- added redirect handling for the `/editor-beta/*` urls to our generic 404 route so anyone upgrading with the beta URLs still open in tabs or saved won't hit a 404
2023-10-04 14:37:12 +01:00
Kevin Ansfield
259321a1a9 Fixed focus sometimes being lost when clicking on cards at bottom of editor
refs https://github.com/TryGhost/Koenig/pull/964

- editor behaviour has changed to select cards on mousedown, this has the effect of the following click/mouseup event potentially occuring off of the editor canvas if a previously selected card collapses when leaving edit mode
- updated the focus-on-click-below behaviour to skip if the previous mousedown event occurred on a card to avoid unexpected re-focus and card deselection
2023-10-04 13:31:30 +01:00
Steve Larson
8bc653802d
Released new editor (#18422)
Promoted our beta editor to the default editor. Keep an eye on (or subscribe to) https://ghost.org/changelog/ for release announcements with full details.

- moved the beta editor (Lexical-based editor) to the default editor; all pages and posts will now use it
- all mobiledoc (previous editor) posts will remain mobiledoc until opened in the editor at which point will be converted to Lexical on the fly and open in the new editor
2023-10-04 12:22:54 +01:00
Daniel Lockyer
639be25f1d Updated Koenig-Lexical bundling
refs https://github.com/TryGhost/DevOps/issues/83

- this will now continue use the dev server assets if we tell it to,
  or copy the dependency package files to the built folder otherwise
- removes `editor` from config API because it's no longer needed
- removes dependency on `editor.url` in tests, as this no longer exists
- edits dev script to pass dev server URL as env var
- adds `@tryghost/koenig-lexical` dependency to Admin
2023-10-04 12:50:21 +02: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
Sanne de Vries
dd84a42b43
Updated styles for editor loading and error states (#18441)
No ref
2023-10-03 09:55:43 +00:00
Princi Vershwal
3442fdfee6
🐛 Show specific tier posts under 'Paid-member only' filter in admin panel (#17043)
fixes https://github.com/TryGhost/Ghost/issues/16988
2023-10-03 14:43:11 +05:30
Sanne de Vries
c95da6b2d9
Swapped control symbol for text on Windows (#18420)
Refs https://github.com/TryGhost/Product/issues/3973
2023-10-02 13:03:58 +00:00
Sanne de Vries
6acf93c0d2
Updated Twitter wording and logos (#18419)
No ref
2023-10-02 12:48:34 +00:00
Sanne de Vries
76c9f04013
Added keyboard shortcut section to post settings menu (#18409)
Refs https://github.com/TryGhost/Product/issues/3725

---------

Co-authored-by: Kevin Ansfield <kevin@lookingsideways.co.uk>
2023-10-02 14:24:54 +02:00
Sanne de Vries
f70dcd6861
Replaced Twitter with X in editor and tags (#18415)
No ref
2023-10-02 11:16:07 +00:00
Sodbileg Gansukh
01646580e4 Fixed post edit button URL
no issues

- the edit button in the post list wasn't doing anything with an empty link
- now it has same URL as the post list item and it directs to its edit screen
2023-10-02 17:50:06 +08:00
Daniel Lockyer
6e46e8b5ba
Refactored loading of Koenig-Lexical package (#18392)
refs https://ghost.slack.com/archives/C02G9E68C/p1695901801049219?thread_ts=1695035790.122589&cid=C02G9E68C

- DRY up all the fetching of Koenig-Lexical so we only do it from one place
- this will help when we switch to loading Koenig-Lexical from local assets

Co-authored-by: Jono Mingard <reason.koan@gmail.com>
2023-09-28 17:43:12 +02:00
Daniel Lockyer
35d7e50027 Deleted Lexical sandbox page
refs https://ghost.slack.com/archives/C02G9E68C/p1695900212734549?thread_ts=1695035790.122589&cid=C02G9E68C

- this is no longer needed as we have Storybook to demo the components
2023-09-28 14:13:07 +02:00
Sanne de Vries
5e85d2f58f
Fixed feature image caption dark mode (#18379)
No ref
2023-09-27 10:49:35 +00:00
Sag
8b62ebd40a
Fixed recommendation add/delete in AdminX (#18378)
no issue
2023-09-27 09:54:19 +00:00
Michael Barrett
497f3b40dd
🐛 Fixed issue with settings being marked as dirty when visibility is changed (#18370)
refs https://github.com/TryGhost/Product/issues/3924

Settings were being marked as dirty when visibility was changed causing
the confirm dialog to show when navigating away from the settings page.
This change manually computes the dirtiness of the setting to ensure the
visibility change is ignored
2023-09-27 08:18:21 +01:00
Ronald Langeveld
29f98104df
Fixed icon not updating on Ember from AdminX (#18374)
refs
https://www.notion.so/ghost/df5bdea8f7ea4aca9d25eceb6a1bf34c?v=be2f15b6b58b4c27a0e11374282bead0&p=bafc80a9ad644fb18fe338f89500ff36&pm=s

- we now reload ember's settings data when settings data updated, to
keep certain data synced, such as the icon in the sidebar.

---

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

Refactor settings component to use Ember Octane and reload settings
model after saving. This improves the UI and code quality of the
`admin-x` component.
2023-09-27 09:36:45 +07:00
Jono M
fb435cc115
Fixed minor issues with AdminX Ember sync (#18359)
refs https://github.com/TryGhost/Product/issues/3832
2023-09-26 12:23:52 +00:00
Jono M
ea64107f9d
Fixed syncing tiers status between Ember and AdminX (#18353)
refs https://github.com/TryGhost/Product/issues/3832

---

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

Added `membersUtils` service to `AdminXSettings` component to support
tiers feature. Reloaded service after saving settings with
`TiersResponseType`.
2023-09-26 12:13:09 +01:00
Jono M
1f2dbc95f9
Updated links to old settings to link to AdminX (#18352)
refs https://github.com/TryGhost/Product/issues/3832

---

<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
copilot:summary
2023-09-26 10:33:00 +00:00
Jono M
d51322c95b
Updated AdminX API error handling to report to Sentry (#18300)
refs https://github.com/TryGhost/Product/issues/3832

---

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

This pull request refactors the error handling logic in various
components of the admin-x-settings app to use a custom hook called
`useHandleError`. This hook wraps the Sentry integration and provides a
consistent and reliable way of reporting and logging errors. This
improves the code quality, readability, and maintainability of the app.
The pull request also improves the Sentry initialization by passing the
DSN and the environment to the `ServicesProvider` component.
2023-09-26 11:09:42 +01:00
Jono M
84ae5f58d2
Fixed site title syncing from AdminX to Ember (#18349)
refs https://github.com/TryGhost/Product/issues/3832
2023-09-26 10:51:43 +01:00
Ronald Langeveld
ac7abb9edd
Added custom theme type to emberdatatypemapping (#18348)
no issue

- added a missing emberDataTypeMapping needed for theme uploads to be
handled correctly

---

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

Added support for custom theme settings API in Ember Data. Updated
`settings.js` to map the new `CustomThemeSettingsResponseType` to the
store.
2023-09-26 08:55:45 +00:00
Jono M
328a785065
Updated AdminX to sync data changes to Ember (#18327)
refs https://github.com/TryGhost/Product/issues/3832

---

### <samp>🤖 Generated by Copilot at 7a91ba3</samp>

This pull request enables data synchronization between the Ember app and
the React app for the settings module. It passes `onUpdate` and
`onInvalidate` functions as props from the Ember app to the React app
through the `ReactApp` component and the `ServicesContext`. It also
removes unused code and adds some debugging logs in the `setting`
serializer and the `settings` service.
2023-09-25 17:29:09 +01:00
Peter Zimon
731f0c2a5e
AdminX settings GA design refinements (#18332)
refs. https://github.com/TryGhost/Product/issues/3949

- some minor copy had to be updated
- we had a little bug in the small version of dropdowns
- the crash page was just a plain text without any way out (e.g. allowing navigating to dashboard)
2023-09-25 17:49:12 +02:00
Steve Larson
498c375240
Added placeholder for beta editor (#18339)
closes TryGhost/Product#3906
- show placeholder 'post' for posts and 'page' for pages
2023-09-25 15:39:54 +00:00
Aileen Booker
907796d857 Fixed ForceUpgrade state not working with Explore
no issue

- When a user is in forced upgrade state, clicking on `Explore` would keep them trapped inside of the Explore frame rather than redirecting to Ghost(Pro)
2023-09-25 12:56:04 +01:00
Allan Stromfeldt Christensen
6757d984af
Add line-height for descenders getting cut off in Post settings Tag names (#17836) 2023-09-25 17:37:11 +08:00