Commit Graph

36869 Commits

Author SHA1 Message Date
Jono M
fb7bf6d01e
Improved AdminX test coverage based on old admin tests (#18502)
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.
2023-10-06 10:06:05 +01:00
renovate[bot]
caf104dbb4 Update dependency @types/validator to v13.11.2 2023-10-06 11:01:24 +02:00
Shaun Roselt
3f5a2370c2
Updated Afrikaans Translations (#18399) 2023-10-06 10:58:35 +02: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
renovate[bot]
5b46f246ef Update dependency @ebay/nice-modal-react to v1.2.13 2023-10-06 08:56:57 +00:00
renovate[bot]
7aef7b7db1 Update dependency rimraf to v5.0.5 2023-10-06 10:52:34 +02:00
renovate[bot]
d07161a077 Update dependency tracked-built-ins to v3.3.0 2023-10-06 10:42:18 +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
Ugurcan Yildirim
bf9bf9f210
Fixed typo in Turkish translations (#18485) 2023-10-06 10:39:40 +02:00
renovate[bot]
d6c944c8b8 Update peter-evans/create-or-update-comment digest to e3645dd 2023-10-06 10:36:02 +02:00
Alexandre "Lekler" Rodrigues
cab29e1604
Updated Brazilian Portuguese translations (#18510)
refs https://github.com/TryGhost/Team/issues/2795
2023-10-06 10:35:10 +02:00
renovate[bot]
b2cebdc9b0 Update dependency vite to v4.4.11 2023-10-06 07:55:29 +02:00
renovate[bot]
ba6830453a Update dependency jwks-rsa to v3.1.0 2023-10-06 07:54:57 +02:00
Ronald Langeveld
d0cd7f040d
Added Recommendations Acceptance tests - Admin X (#18513)
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.
2023-10-06 10:52:18 +07:00
Chris Raible
70304d92d4
🐛 Fixed bug preventing changes to tier benefit capitalization (#18406)
fixes TryGhost/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'
2023-10-05 19:04:11 -07: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
Ronald Langeveld
e82f845d5c
Added flags helper for Acceptance Tests in AdminX (#18500)
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`.
2023-10-05 20:12:54 +07: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
Sam Lord
45f704ce86 Add a metric when shutting down in-flight requests takes more than 15 seconds
refs: https://github.com/TryGhost/DevOps/issues/64
2023-10-05 12:31:02 +01:00
Simon Backx
7b3a0c6863
🐛 Fixed outboundLinkTagging setting affected whether member sources are tracked (#18498)
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.
2023-10-05 12:25:21 +02:00
Daniel Lockyer
85098e07d4 Configured all unit tests to use dot reporter
refs https://ghost.slack.com/archives/C02G9E68C/p1696490748701419

- this configures mocha to use the dot reporter because the default is
  way too verbose in CI
2023-10-05 12:24:24 +02:00
Simon Backx
1882b7048d
Added click tracking for recommendations helper (#18496)
fixes https://github.com/TryGhost/Product/issues/4001
2023-10-05 11:37:02 +02: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
Ronald Langeveld
929d05a33b
Fixed sidebar order of Newsletters section - X (#18493)
refs https://ghost.slack.com/archives/C0568LN2CGJ/p1696490815762949

- Fixed a tiny issue where the Sidebar Navigation doesn't align with the
newsletter options.
- Got rid of some unused commented out code that's not needed.
2023-10-05 15:20:18 +07:00
Ronald Langeveld
d1b92a04a3
Changed HTML Editor to use Koenig's onFocus (#18492)
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.
2023-10-05 12:47:29 +07:00
Sag
0c8218b8f6
Removed wrapper in the Recommendation helper template (#18488)
no issue
2023-10-04 22:11:25 +00:00
Sag
380f3b5ca2
Added missing unit tests to the Recommendations package (#18489)
refs https://github.com/TryGhost/Product/issues/3954
2023-10-04 21:52:22 +00:00
Sag
2391ccc3db
Added more options to "order", in the Recommendations API (#18487)
closes https://github.com/TryGhost/Product/issues/4000
2023-10-04 19:32:03 +00:00
Djordje Vlaisavljevic
27cec8b909
Improved "Copy link" design (#18486)
refs https://github.com/TryGhost/Product/issues/3974
2023-10-04 19:16:08 +01:00
Djordje Vlaisavljevic
cbd43d38a8 Added a tooltip to the "Copy link" button
refs https://github.com/TryGhost/Product/issues/3974
2023-10-04 18:21:32 +01:00
Djordje Vlaisavljevic
1e5b52b368 Added label showing if you're already recommending back a site recommending you
refs https://github.com/TryGhost/Product/issues/3978
2023-10-04 18:21:32 +01:00
Djordje Vlaisavljevic
9a45b0b785 Made recommendation modals footer sticky
no refs
2023-10-04 18:21:32 +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
renovate[bot]
60aa1d9cb7 Update dependency @uiw/react-codemirror to v4.21.19 2023-10-04 15:35:24 +00:00
Sag
15adb254f0
Added an option to recommend back in Admin Settings (#18478)
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
2023-10-04 15:22:04 +00:00
Michael Barrett
e06a5825dc
🐛 Fixed cache key generation not taking into account array value (#18476)
`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`
2023-10-04 15:54:59 +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
Steve Larson
4bdd8366ea
Removed beta editor flag from admin x settings (#18473)
no refs
2023-10-04 13:35:34 +00:00
Simon Backx
bed3e05eee Added full unit test coverage to recommendations package
fixes https://github.com/TryGhost/Product/issues/3954
2023-10-04 15:31:59 +02:00
Simon Backx
9f9f028e82 Added 100% test coverage for Recommendation class
refs https://github.com/TryGhost/Product/issues/3954
2023-10-04 15:31:59 +02:00
renovate[bot]
76a5b9861a Update dependency jose to v4.15.2 2023-10-04 12:46:19 +00:00
Peter Zimon
09af419db0
Update "Saved" button state in AdminX (#18469)
refs. https://github.com/TryGhost/Product/issues/3949

- "Saved" state of buttons in modals were not distinct enough to see
that there's been a successful save
2023-10-04 14:34:41 +02: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
Sag
506488df11
Fixed typo in the {{recommendations}} helper (#18468)
refs https://github.com/TryGhost/Product/issues/3940
2023-10-04 12:25:27 +00:00
Kevin Ansfield
89a3774983 Fixed e2e-browser publishing tests
refs https://github.com/TryGhost/Ghost/pull/18422

- now that we're using the externally-loaded editor we need to wait for it to load and be ready before moving focus to it and starting to type
2023-10-04 13:20:05 +01:00
Peter Zimon
223a1d7767
Adding CMD/CTRL+S to AdminX (#18466)
refs. https://github.com/TryGhost/Product/issues/3949

- it wasn't possible to save setting values in AdminX with CMD/CTR+S
2023-10-04 13:36:06 +02: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
Ronald Langeveld
70a805463a
Added Portal acceptance tests in Admin X (#18465)
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 7ab405d</samp>

This change adds a new file `portal.test.ts` that contains acceptance
tests for the Portal Settings feature in the admin-x-settings app. The
tests use Playwright to verify that the portal settings can be
customized and saved correctly. The change aims to improve the test
coverage and confidence for the new feature.
2023-10-04 11:06:59 +00:00