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 7eda74c</samp>
This pull request improves the validation, customization, and feedback
of various form components and modals in the admin-x-settings app. It
also adds new components for user detail modal sections and modifies the
user type to allow null values for social accounts. Additionally, it
adds `dirty` props to some integration modals and a `data-testid`
attribute to the exit settings button. It also deletes an unused file.
- 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
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 ebcfe42</samp>
This pull request adds acceptance tests for the recommendations feature
in the `admin-x-settings` app. It also updates the test utils module to
use the appropriate type and fixture for the recommendations API.
fixesTryGhost/Product#3970
- When saving a tier, it is impossible to change the capitalization of a
benefit
- The logic when saving a tier matches benefits by `name.toLowercase()`
and then overwrites the incoming change with the name from the previous
version of the benefit
- This changes the logic to match benefits the same way using
`name.toLowercase()`, but use the _incoming_ benefit's capitalization
rather than the old benefit's, to allow users to e.g. change 'TEst
benefit' to 'Test benefit'
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
refs https://ghost.slack.com/archives/C0568LN2CGJ/p1696495250115289
Adds a new helper function `toggleLabsFlag` that allows toggling of lab
flags within tests. This function can be used directly inside a test
case or within `beforeEach` or `beforeAll` hooks to set the initial
state before tests run.
Usage:
- To toggle a flag within a test: `toggleLabsFlag('recommendations',
false);`
- To set initial state in a hook:
```javascript
beforeEach(() => {
toggleLabsFlag('recommendations', true);
});
---
<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
<!--
copilot:summary
-->
### <samp>🤖 Generated by Copilot at e138d58</samp>
This change adds a utility module for acceptance testing of experimental
features in Ghost. It allows tests to mock and change the labs settings
using `defaultLabFlags` and `toggleLabsFlag`.
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
no issue
- During the one click subscribe flow, the outboundLinkTagging should
affect whether we send a history or not to the signup endpoint. But for
internal history this is the members_track_sources setting. This happens
in the backend normally.
- Do not send a (constructed) history to external sites (= one click
subscribe flow in recommendations) if outboundLinkTagging is false
- Do always send a history internally for local signups (backend handles
whether to store it based on the members_track_sources setting that is
currently not exposed in the frontend). The history is not built if this
setting is disabled, but we could have an old history entry if this
setting was enabled in the past.
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.
no issue
- we added a new plugin in Koenig which exposed a new onFocus plugin,
meaning we can get this directly from Koenig instead of hacking the html
dom.
- changed the HTML Editors onFocus function to use Koenig's / Lexical's
built in OnFocus plugin.
---
<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
<!--
copilot:summary
-->
### <samp>🤖 Generated by Copilot at 66d44ad</samp>
Fix editor toolbar disappearing bug in `HtmlEditor.tsx`. Use focus
plugin from `Koenig` package to handle editor focus.
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
refs https://github.com/TryGhost/Product/issues/3978
- added "GET /incoming_recommendations/" browse endpoint to the Admin
API - we store incoming recommendations as mentions in the database. The
new endpoint reuses the Mentions API underneath to fetch verified
mentions of type recommendation - recommendation-specific attributes are
returned by the new endpoint, including calculated fields such as the
"RecommendingBack" boolean
- show "Recommend back" option for sites recommending me, only if I
haven't recommended the site already
`generateOptionsData` was not taking into account the query params
`include`, `fields` and `format` could also be an array if included in
the request query like: `?fields[]=title&fields[]=slug` or
`?fields=title&fields=slug`
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
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