Commit Graph

6330 Commits

Author SHA1 Message Date
Peter Zimon
dff8c38547
AdminX UI fixes (#18110)
refs. https://github.com/TryGhost/Product/issues/3349

- fix tiers save & close bug
- show trial days on tier card
- removed 0's from monthly and yearly tier prices
- added color to learn more link in tier modal
- set background to white in newsletter preview
- fixed newsletter default sender data
- removed underline in "View in browser" link in newsletter preview
- updated copy in newsletters
- added Integrations' active indicator
- scrolling menu under searchbar to give search more prominance
- updated Portal modal buttons to be consistent with design settings
- fixed bug in AdminX loading Orb so that it actually starts auto-playing
2023-09-14 12:04:31 +02:00
Jono M
00e598b365
Updated AdminX features for different roles (#18131)
refs https://github.com/TryGhost/Product/issues/3832

---

This pull request introduces a new `MainContent` component that handles
the role-based access and rendering of the settings page and the
sidebar. It also refactors and improves the UI and logic of the
`UserDetailModal` and the `Users` components, and updates the footer
component to use the new settings page and profile modal for editors.
Additionally, it removes unused code and adds new helper functions for
checking the user's roles and permissions.
2023-09-14 07:48:07 +00:00
Sodbileg Gansukh
7a49183bc8
Custom theme settings improvements (#18101)
no issues

- removed (default) label from the custom theme settings
- the label was redundant especially when multiple select settings are next to each other
- instead, the default value should always be the first option in the select fields
- more consistent spacing between settings with/without description
- less spacing between boolean settings
2023-09-14 10:27:33 +08:00
Kevin Ansfield
f06f83c45b
Updated collection card post fetching to use Content API (#18121)
closes https://github.com/TryGhost/Product/issues/3874

- fetch Content API key if we don't already have it
- use the `frontend` service to fetch posts via the Content API
  - uses same ordering and published-only filtering as default front-end requests
2023-09-13 16:51:00 +00:00
Jono M
cb6a8ff6df
Removed redirect for editors accessing AdminX (#18111)
refs https://github.com/TryGhost/Product/issues/3832

Removed redundant code from `settings-x.js` since we now display the
settings page correctly for editors.
2023-09-13 14:04:58 +01:00
Michael Barrett
46897bdb3a
Ensure hidden settings return falsy when used with the @custom helper (#17920)
no refs

When a theme setting is hidden, it should return a falsy value when used
2023-09-13 08:38:31 +01:00
Peter Zimon
25e240357e
AdminX global loading Orb (#18076)
refs. https://github.com/TryGhost/Product/issues/3349

- we showed a "Loading..." text for people on super slow connection
instead of the animated Ghost Orb
2023-09-12 11:56:41 +02:00
Sodbileg Gansukh
1b1d871374 Fixed Koenig action bar icon color in dark mode
fixes https://github.com/TryGhost/Product/issues/3846

- when the lexical editor is turned off, some action bar icons appear as black in dark mode
- this fixes the icon and divider color for the mobiledoc editor
2023-09-12 16:35:59 +08:00
Jono M
acae53d9ed
Updated AdminX to be preloaded to improve perceived speed (#18059)
refs https://github.com/TryGhost/Product/issues/3832
2023-09-11 10:55:12 +01:00
Peter Zimon
7ebbf9d56e
AdminX dark mode (#18035)
refs. https://github.com/TryGhost/Product/issues/3349

- added basic support for dark mode
2023-09-08 20:53:41 +02:00
Kevin Ansfield
b48cc49e5a
🐛 Fixed broken "< Posts" and "Back to editor" links in beta editor (infinite save loop) (#18042)
refs https://github.com/TryGhost/Product/issues/3843

If you used relative URLs in the beta editor, when it came to leaving the editor you would get stuck due to an infinite save loop occurring in the background requiring a refresh to get back to a working state.

- when saving relative URLs the server will convert them to absolute for consistency and to ensure URLs work in other situations such as emails, RSS, 3rd party editors, etc
- although we get different data back from the server we don't overwrite the content in the editor with it as that would cause loss of changes since the save as well as loss of the cursor position
- when leaving the editor we compare content from the last save revision with the current editor content to see if we need to save a new revision but if the server data has been modified with relative->absolute URLs then we'd enter an infinite loop because the content would never match
- relative->absolute URLs should be the only thing to ever be modified in the underlying data when saving so we can work around the issue by replacing each instance of the site's URL before comparing revision data to current data
2023-09-08 14:24:05 +00:00
Jono M
9e45afddb8
Updated AdminX to load via ES Modules to enable code splitting (#17971)
refs https://github.com/TryGhost/Product/issues/3349
2023-09-07 06:38:20 +00:00
Kevin Ansfield
d00f437cf2
Revert "Added drop of intermediate post saves between current running and latest triggered" (#17978)
reverts TryGhost/Ghost#17912

- unfortunately dropping save tasks when one is already running has side-effects for code that is initiating the save tasks
- e.g. the slug or title update actions call `saveTask.perform()` and if that related save request fails they expect to get a standard request error so they can show a message and perform a model rollback. However with `keepLatest` the save task can be dropped and "fail" immediately with a `TaskCancelation` error which has unintended side-effects:
  1. error handling is no longer tied to the specific request meaning we could have slug-related failures being handled by non-slug-save code which is unexpected
  2. the internal `TaskCancelation` error is handled as if it was general error and we end up showing a useless error in the red error bar that makes it look like something failed when it didn't
  3. we initiate a model rollback when we do not have a failure situation that requires it meaning we can lose changes
2023-09-05 13:38:59 +00:00
Sag
d7504bdbf5
Added recommendation modal trigger on signup (#17925)
refs https://github.com/TryGhost/Product/issues/3771

- if recommendations are enabled, render the recommendation modal on
sign up, in Portal
- for free signups, the recommendations modal is rendered after clicking
on the magic link
- for paid signups, the recommendations modal is rendered after Stripe
Checkout
- the recommendations modal is not rendered on a free to paid upgrade
2023-09-04 14:35:56 +00:00
Kevin Ansfield
127cbfa62d
Improved save-waiting when leaving beta editor (#17929)
no issue

- adds explicit waits for the two save tasks when leaving the editor before any other checks or saves are triggered
- cleans up some errors around task cancellation that could be triggered when leaving the editor with an existing save running
2023-09-01 14:51:18 +00:00
Kevin Ansfield
d67a7bdc58
Fixed console error when leaving new post screen with beta editor (#17928)
no issue

- when a post is new it has no revisions but in the `willTransition` hook we were using `lastRevision.get` even though `lastRevision` was null
- adjusted the `hasChangedSinceLastRevision` conditional to always be `false` for new posts
2023-09-01 13:35:59 +00:00
Kevin Ansfield
a4f6a33fee
Fixed "new post" button showing 500 error when editor beta is enabled (#17926)
refs https://github.com/TryGhost/Ghost/pull/17876

- the redirect added for the beta editor was always redirecting to `lexical-editor.edit` even when accessing `editor.new` which resulted in an incorrect route params error and a 500 screen
- switched to redirecting to the correct new/edit route based on the route we're trying to access
2023-09-01 13:31:40 +00:00
Sanne de Vries
5ca082cd7c
Added CSS variable to adjust card width when sidebar is open (#17919)
Refs https://github.com/TryGhost/Product/issues/3713
2023-09-01 09:18:31 +00:00
Kevin Ansfield
ca6e7dfb88
Added drop of intermediate post saves between current running and latest triggered (#17912)
no issue

- every triggered save was being added to a queue resulting in an unnecessary number of requests in some circumstances because it means every triggered save would be run sequentially even though the intermediate saves could be safely thrown away if we're still waiting on a response to a previous one
- switched from a standard queue to ember-concurrency's `keepLatest` behaviour
  - drops intermediate saves if multiple saves are triggered whilst still waiting on a previous save
  - http://ember-concurrency.com/docs/task-concurrency#keepLatest
2023-08-31 15:18:02 +00:00
Kevin Ansfield
5f5ad4d5dd
Added automatic conversion of old content when opening in beta editor (#17876)
no issue

Previously the beta editor only worked for newly created posts/pages, any older content would open with the original editor. This change enables automatic conversion of old content to the new content format when a post/page is opened in the admin interface allowing new features like signup and advanced header cards to be used on existing content.

- removed `convertToLexical` feature flag
  - where necessary switched to using just the `lexicalEditor` feature flag in its place
- moved the "L"/"M" indicators on the posts list to a new `lexicalIndicators` feature flag to make debugging/development easier
- added a redirect to the original editor route so that any route to opening the editor (such as the `/edit` front-end shortcut, or other areas of Admin) will open in the beta editor
  - avoids confusing/inconsistent behavior
2023-08-30 16:54:03 +01:00
Sanne de Vries
c3a7e43286
Updated old Spirit class to stop overriding of Tailwind in editor (#17874)
No ref
2023-08-30 14:41:49 +00:00
Michael Barrett
492c26c6ac
🐛 Fixed member newsletter filter when multiple filters applied (#17857)
closes https://github.com/TryGhost/Product/issues/3735

The member newsletter filter was not working correctly when multiple
filters were applied due to the regex incorrectly extracting the
contents of a grouped filter. This commit splits the regex into two to
make it easier to reason about and fixes the underlying issue
2023-08-29 14:20:55 +01:00
Djordje Vlaisavljevic
8416278ea7
Added Recommendations settings placeholder under feature flag (#17855)
refs https://github.com/TryGhost/Product/issues/3787

- Added Recommendations feature flag
- Added an empty placeholder settings section for Recommendations under the feature flag
2023-08-29 12:36:50 +01:00
Djordje Vlaisavljevic
76adef7d9e
Fixed issue with list borders (#17792)
no refs

- Removed unnecessary `border-bottom` on list header and `border-top:
none` that was added to avoid double borders
2023-08-23 11:36:45 +01:00
Michael Barrett
0ea5f9228d
Added custom theme setting visibility (#17763)
refs https://github.com/TryGhost/Product/issues/3716
2023-08-21 11:26:51 +01:00
Jono M
f1266c6b9f
Wired up Zapier integration in AdminX (#17737)
refs https://github.com/TryGhost/Product/issues/3729
2023-08-16 18:59:31 +01:00
Simon Backx
13b732f905
Added Playwright tests for donations (#17699)
fixes https://github.com/TryGhost/Product/issues/3723

This also fixes usage of localhost instead of 127.0.0.1 as a test URL
for playwright. This caused issues for cookies because the member
impersonation navigated to 127.0.0.1 instead of localhost, meaning that
the next page.goto call would go to localhost and lose the cookies.
2023-08-15 15:20:18 +02:00
Ronald Langeveld
a7530720b4
🐛 Fixed Unsplash integration toggle in Koenig editor (#17725)
no issue

- since Unsplash can be toggled on / off in integrations, we need to
pass that to the Koenig-Lexical editor as well.
2023-08-15 14:59:26 +02:00
Ronald Langeveld
09bcc1f31a
Updated comment (#17718)
no issue

- added some more info to the comment
- found the actual issue that needed the admin p0 fix last night.
Updated the comment info block with a link to that 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 bcec294</samp>

Updated a comment in `members.js` to link to a possible NQL issue. This
helps explain the temporary fix for filtering members by labels with
parentheses.
2023-08-15 08:45:09 +00:00
Ronald Langeveld
e0ab167b94
🐛 Fixed newsletter filters not working in bulk operations (#17714)
refs https://ghost.slack.com/archives/CTH5NDJMS/p1692021848890629

- Addresses an NQL / API edge case where standalone filters with
parentheses doesn't get handled correctly within bulk operations such as
member labelling, member unsubscribe and member deletion.
- This is currently only affected by newsletter related filters.
- This adds a regex functions that checks when those filters are used
and removes the parentheses when required.
- Ideally we fix the NQL / API issue in the near future and remove this
regex hack altogether, but taking all things into consideration, this
should mitigate the risk of potential data-loss for Ghost users.
2023-08-15 06:35:51 +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
Peter Zimon
9bfbd5b3b9
History log in AdminX (#17666)
refs. https://github.com/TryGhost/Product/issues/3710

---------

Co-authored-by: Jono Mingard <reason.koan@gmail.com>
2023-08-14 12:11:53 +00:00
Sodbileg Gansukh
1b046426ae Adjusted scaling of the browser preview 2023-08-14 17:00:04 +08:00
Kevin Ansfield
ff3b936a0a
Added Sentry reporting for slow editor saves (#17698)
closes https://github.com/TryGhost/Product/issues/3719

- adds Sentry reporting for slow saves in the editor to help investigate reports of a similar nature
  - uses different messages for lexical vs mobiledoc and successful vs failed saves so we can compare frequency of each in the Sentry UI
  - includes `save_time` tag so we can see a breakdown of timings and adjust the threshold if necessary
  - includes `post_type` tag which will be useful as we introduce further differences between the features and rendering cycle of posts and pages
  - includes `newsletter` and `email_segment` tags to help indicate if slow saves are due to email sending
  - includes `save_revision` tag to help indicate if forced revision saves cause slow saves
  - includes `convert_to_lexical` tag to help indicate if mobiledoc/lexical conversion is causing slow saves
2023-08-11 15:00:26 +00:00
Djordje Vlaisavljevic
99761242da
Improved how Stripe connect buttons are shown (#17697)
refs https://github.com/TryGhost/Product/issues/3666

- Improves the way Connect with Stripe buttons are shown in Membership settings
2023-08-11 15:56:23 +01:00
Sag
37bf804cf5
Updated copy of error messages for Tips & Donations suggested amount (#17696)
refs https://github.com/TryGhost/Product/issues/3695
2023-08-11 14:11:04 +00:00
Sag
6c481b74a9
Added an upper limit to Tips & Donations suggested amount (#17695)
refs https://github.com/TryGhost/Product/issues/3695

- also updated the "minimumAmountPerCurrency" helper to return a
standard price (not in cents), to keep the code more readable
2023-08-11 13:09:42 +00:00
Aileen Nowak
c23480030f Convert getIframeUrl to a getter and inject as source into iframe component 2023-08-11 10:47:47 +01:00
Aileen Nowak
00db25e314 Revert back to use did-insert hook 2023-08-11 10:47:47 +01:00
Aileen Nowak
d2ab69aeb6 Fixed linting issues 2023-08-11 10:47:47 +01:00
Aileen Nowak
ec14f78ba3 Removed usage of did-insert hook and simplified openExploreWindow method
- We don't actually utilise the history handling for Explore, as it's not a full screen modal and therefore don't need passing in previous routes before opening the iframe
- Removed usage of `did-insert` livecycle hook and reverted to usage of `contructor` and `willDestroy` instead to add and remove message event listener
2023-08-11 10:47:47 +01:00
Aileen Nowak
a72dfdddb7 Prevented Explore iframe to be loading before needed
no issue

- We were loading the Explore iframe together with all assets in Admin
- This change will avoid that and only start loading and rendering Explore, once it's clicked
2023-08-11 10:47:47 +01:00
Djordje Vlaisavljevic
aeff42811c
Updated tips & donations settings and email notification design (#17679)
refs https://github.com/TryGhost/Product/issues/3693, https://github.com/TryGhost/Product/issues/3666

- Updated Tips&Donations email notification design to put focus onto the
amount
- Removed unnecessary gap between Free and Premium tiers in Membership
settings
- Improved the copy to better explain the feature
2023-08-10 18:35:42 +01:00
Michael Barrett
733135d3ff
🐛 Fixed incorrect newsletter subscriber count on dashboard (#17683)
fixes https://github.com/TryGhost/Product/issues/3714

The dashboard was showing the total number of subscribers, but not
taking into account members who have disabled emails. This commit fixes
that.
2023-08-10 18:18:12 +01:00
Kevin Ansfield
f983e93090
🐛 Fixed overly small file drop area in beta editor (#17682)
closes https://github.com/TryGhost/Product/issues/3449

- added drop handler to the whole editor pane area (to match previous editor) that uses the external API plugin to pass files through to the editor when dropped
- allows images/files to be dropped outside of the main editor canvas which is especially helpful when creating images in a new post
2023-08-10 16:36:06 +00:00
Steve Larson
8273671425
Updated bookmark card renderer (#17662)
refs https://github.com/TryGhost/Product/issues/3609
-reverted css changes
-reverted mobiledoc renderer
-made lexical renderer consistent with mobiledoc
-css classes were inverted for theme backwards compatibility
2023-08-10 13:41:59 +00:00
Sag
02f4f11e7c
Reverted Offer links to absolute URLs (#17675)
refs https://github.com/TryGhost/Product/issues/3687

- We're not sure that relative URLs for Offers will work in production,
even though they seem to work locally. Reverting for now.
2023-08-10 12:14:11 +00:00
Michael Barrett
8d0eed2dcd
🐛 Fixed member filter by single newsletter subscription (#17668)
fixes https://github.com/TryGhost/Product/issues/3708

When filtering members by the `Newsletter subscription` parameter, If
the site has a single newsletter, members with disabled emails were
being erroneously returned. This fixes that 👍
2023-08-10 12:59:14 +01:00
Sag
731773602c
Added relative URLs for Portal links in Button, Header, Email CTA url suggestions (#17669)
refs https://github.com/TryGhost/Product/issues/3687

- Today, in Button, Header, Email CTA cards, Portal links are used as
absolute URLs to the root, e.g. https://mysite.com/#/portal/signin. When
clicking on a Portal link, the reader is redirect to the homepage first,
loosing context of the post.
- With this change, the UX becomes smoother: clicking on a Portal link
keeps the reader in context, and open the Portal link on the same post
e.g., https://mysite.com/POST_URL/#/portal/signin
- Technically, this works by using relative URLs for Portal links.
Relative URLs work out of the box for web, but required changes on the
email side, cf. https://github.com/TryGhost/Ghost/pull/17630
2023-08-10 09:23:31 +00:00
Ronald Langeveld
04ce1154a1
Added new enhanced Header Card (#17654)
no issue

- Keep an eye on Ghost's changelog (https://ghost.org/changelog/) for
the full feature announcement. 🎉

---

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

This pull request removes the `headerUpgrade` feature flag and enables
the new header card by default in the editor. It also hides the old
header card from the editor menu unless the `labs.headerV1` setting is
enabled.
2023-08-10 10:40:10 +02:00