Commit Graph

6726 Commits

Author SHA1 Message Date
Hannah Wolfe
0720bc2bdb
Updated multi-tenant param name for stats charts
ref https://linear.app/tryghost/issue/ANAL-27/setup-tinybird-project-and-cicd

- We've settled on a name for the param of site_uuid
- Need to update the chart code that was added prior to this final decision
2024-08-30 11:23:27 +01:00
Sodbileg Gansukh
d30164df97
Improved publishing flow (#20878)
ref DES-706

* After a user publishes or schedules a post, they are directed to the post list
* If a post is sent as an email, they are directed to the Analytics page
* In both cases, a confirmation modal is shown
* If a post is published, they can share it directly from the confirmation modal
* Added a "Share" button and some additional functions (view, edit, and delete post) to
published posts in post analytics
* Added a manual "Refresh" button to post analytics so that there is
no need to reload the whole app to update the data

---------

Co-authored-by: Sag <guptazy@gmail.com>
2024-08-29 21:17:16 +02:00
Hannah Wolfe
9d121d8e9a
Added initial Stats page to Ghost Admin (#20877)
closes
https://linear.app/tryghost/issue/ANAL-10/stats-page-in-ghost-admin

- Adds all the structure, logic and permissions tests for the Stats page
to check we're loading the right thing at the right time
- Adds @tinybirdco/charts as a dependency, and has a single example of a
chart setup using the right config
2024-08-29 12:56:39 +01:00
Daniël van der Winden
42009eb9ed
Updated subtitle logic (#20876)
It was previously not displaying the correct text for when a post is
published + emailed. That's solved now.
2024-08-29 10:41:02 +00:00
Daniël van der Winden
d92f8bcf0a
Updated button colours and hover states (#20873) 2024-08-29 10:05:52 +00:00
Ronald Langeveld
8e1a730731
Fixed hanging dash when no attribution is present (#20869)
ref PLG-198

- Fixed trailing dash when no attribution is present
2024-08-29 15:22:31 +09:00
Sodbileg Gansukh
7be7112e68
Fixed non-email analytics error when refreshed (#20868)
ref DES-756, DES-757

- made the email property to make the refresh work properly for published-only posts
- included sentiment in the query to update the feedback percentage when refreshed
2024-08-29 04:49:06 +00:00
Sodbileg Gansukh
3b38ba3a29
Make split number helper handle empty value (#20848)
no issues
2024-08-28 10:47:03 +00:00
Daniël van der Winden
5cc3d943f2
Made the post preview card a link (#20846)
The modal in the new publish flow has a post preview card, which did not
link to the post itself. It does now (except when it's an email).
2024-08-28 10:08:25 +00:00
Sodbileg Gansukh
1afe96ae34
Added animation to the analytics numbers when refreshed (#20842)
ref DES-709

- when refresh button is clicked, the numbers in the analytics will be animated if changed
- for the animation to be performant, added a new dependency "animejs"
- to minimize the flash and layout shift, the analytics data is kept as it is while loading
- once finished loading, it will be replaced with the new data
2024-08-28 17:25:37 +08:00
Daniël van der Winden
1d17600f5d
Publishing flow: Social buttons update (#20841)
Updated the hover colour of the social buttons in the new publishing
flow's modal.
2024-08-28 08:42:56 +00:00
Daniël van der Winden
af0338b504
Rewrote the publish modal logic and layout (#20832)
Removed unnecessary code, rewrote it in places where we were repeating
ourselves, and followed the new layout for posts + emails.
2024-08-27 15:22:11 +00:00
Daniël van der Winden
344f440de9
Updated the buttons in the publish flow modals (#20831)
Buttons were previously part of the bookmark card, but that's no longer
the case. This makes it easier to scale between different types of
posts/emails.
2024-08-27 13:06:19 +00:00
Sodbileg Gansukh
2a212bfff4
Publish flow improvements and bug fixes (#20824)
ref DES-731

- improved mobile styles for the social buttons in the modal
- fixed the flow for publishing/scheduling pages
- redirect to post list only when a post doesn't involve any email
2024-08-26 17:02:00 +08:00
Steve Larson
827518c98b
🐛 Fixed shift selection in the posts list (#20818)
ref https://linear.app/tryghost/issue/ENG-1489/

The changes to improve posts loading in admin broke the shift selection
functionality. This restores that, as we need to be able to crawl across
the (now) three models when present.
2024-08-22 13:15:06 -05:00
Daniël van der Winden
7c992825ed
Publish modal updates (#20817)
The new modal for the updated publishing flow has an entirely new
layout, based on feedback previously received. In addition, this PR
includes a few tweaks to the underlying logic.
2024-08-22 14:49:29 +00:00
Steve Larson
cd7c27d3ad
🐛 Fixed fetching labels and offers in the editor (#20815)
ref https://linear.app/tryghost/issue/ONC-263/
- labels dropdown in sign up card was not successfully fetching labels
- offers dropdown suffered the same fate

When introducing the second editor instance, it appears we ran into some
race conditions with the Ember tasks used to fetch the resources. The
init instance was beating the other to the punch, and so the state was
never successfully updated, as it is only fetched once on mounting the
card.
2024-08-22 08:55:33 -05:00
Ronald Langeveld
f2206fb232
Added one-time payments under "payments" for filtering (#20807)
ref PLG-153

- Scoped one-time payments (`donation_event`) under the "payments"
category in the member activity feed filter.
- Updated `toggleEventType` logic to ensure that toggling "payments"
also toggles one-time payments when the `tipsAndDonations` feature is
enabled.
- Refactored event type handling into utility functions for easier
testing.
- Added unit tests for the new utility functions to ensure correct
behaviour.
- Added acceptance testing.
2024-08-22 10:26:46 +00:00
Chris Raible
6d46dc26c7
🔒 Fixed admin forms defaulting to GET method (#20810)
ref
https://linear.app/tryghost/issue/ENG-1497/admin-signin-signup-and-setup-forms-default-to-get

- If method is not specified, the form will default to GET, which is
incorrect
- This commit sets the method to POST and action to javascript:void(0)
to prevent the form from submitting via GET if JavaScript is disabled or
not fully loaded yet
2024-08-21 15:49:52 -07:00
Ronald Langeveld
3645fd8a5c
🐛 Fixed editor performance issues in Safari for posts with HTML or Markdown cards (#20806)
ref https://linear.app/tryghost/issue/ONC-261

- Previous method of hiding the second Lexical instance using `width:
0`, `height: 0`, and `overflow: hidden` caused CPU usage to spike,
likely due to CodeMirror continuously processing the element.
2024-08-21 09:42:22 +00:00
Sodbileg Gansukh
6413a30c35
Fixed missing stats on the analytics screen (#20797)
ref DES-716
2024-08-20 12:58:36 +00:00
Sodbileg Gansukh
9b41307a76
Replaced refresh button with a GhTaskButton (#20796)
ref DES-705
2024-08-20 20:06:12 +08:00
Sodbileg Gansukh
a8dc689823
Improved publish flow transition (#20794)
ref DES-697

- used client side navigation on the flow instead of hard refresh
- reduced layout shift on the analytics screen
- made the modal transition a bit smoother
2024-08-20 20:04:44 +08:00
Sodbileg Gansukh
5cce46e851
Share button improvements on publish flow modal (#20791)
ref DES-684

- switched social links from buttons to regular links 
- added post title to share links
2024-08-20 17:33:40 +08:00
Kevin Ansfield
9dfbd3e293 Fixed excerpt blur saving non-draft posts
ref https://linear.app/tryghost/issue/PLG-174

- forcing autosave on excerpt blur caused posts to revert to `draft` and save immediately even when they were published/scheduled
- updated the save-on-excerpt-blur to only autosave drafts
- added acceptance tests for title and excerpt change+blur on published posts
2024-08-19 21:04:15 +01:00
Kevin Ansfield
887f4d3ac2
🐛 Fixed editor unsaved changes modal showing too often (#20787)
ref [ENG-661](https://linear.app/tryghost/issue/ENG-661/) 
ref [ONC-253](https://linear.app/tryghost/issue/ONC-253/)
ref [PLG-174](https://linear.app/tryghost/issue/PLG-174/)

- restored the original but reverted fix for unsaved changes modal from https://github.com/TryGhost/Ghost/pull/20687
- updated code to remove some incorrect early-falsy-return logic in `editorController.hasDirtyAttributes` that prevented save of unsaved changes on the underlying model (e.g. excerpt)
- updated unit tests so they are testing real post model instances and therefore are testing what we expect them to test
- added acceptance tests to ensure autosave is working for title and excerpt fields

---------

Co-authored-by: Ronald Langeveld <hi@ronaldlangeveld.com>
2024-08-19 18:03:13 +00:00
Kevin Ansfield
21aa1b4378
🐛 Fixed autosave not triggering when in-editor excerpt is changed (#20785)
ref https://linear.app/tryghost/issue/PLG-174

- added `blur` handler to excerpt field so it acts the same as the title field and triggers a save when it loses focus
2024-08-19 14:38:00 +00:00
Daniël van der Winden
1e3edc0b5a
Adds blur behind 'Share' modal (#20782)
fixes https://linear.app/tryghost/issue/DES-683/add-blur-behind-modal

Adds a blur behind the modal in the new Publish flow.
2024-08-19 14:01:01 +00:00
Daniël van der Winden
f864bde459
Publish flow Close button improvements (#20779)
fixes
https://linear.app/tryghost/issue/DES-682/close-button-improvements

Small updates to the modal in the new Publish flow. Improved margins and
opacity for legibility.
2024-08-19 12:59:10 +00:00
Ronald Langeveld
6ebcd10288
Revert "Fixed draft posts not autosaving without title (#20774)" (#20776)
This reverts commit aad438ba0b.

- reverts the commit so that we can merge it together with PLG-174
2024-08-19 10:19:53 +00:00
Ronald Langeveld
aad438ba0b
Fixed draft posts not autosaving without title (#20774)
ref [ENG-661](https://linear.app/tryghost/issue/ENG-661/) ONC-253

- Reverts the revert of
93cbb94b90
of the intial bug fix.
- Updated hasDirtyAttributes logic to ensure the dirty state changes
when typing a draft, despite not title.
- Updated tests and added tests missing from the hasDirtyAttributes
logic
2024-08-19 12:21:35 +07:00
Chris Raible
77b18916f4
🐛 Fixed a bug causing new drafts to only save if the title is populated (#20769)
ref
https://linear.app/tryghost/issue/ONC-253/drafts-only-save-if-the-title-is-populated

- A
[commit](c8ba9e8027)
in `v5.89.1` introduced a bug that caused new drafts to only save if the
post title was populated, causing potential data loss if a user is
working on a new draft without setting the title.
- This commit reverts the one that introduced this bug to prevent data
loss.

This reverts commit c8ba9e8027.
2024-08-16 12:09:11 -07:00
Sanne de Vries
ae628d7520
🎨 Added “Copy post link” to posts list context menu (#20760)
REF DES-321
- Added a "Copy post link" button to the context menu to copy the post URL for published posts, and a "Copy preview link" for draft and scheduled posts.

---------

Co-authored-by: Kevin Ansfield <kevin@lookingsideways.co.uk>
2024-08-15 16:09:48 +02:00
Peter Zimon
46f93ad555
Refined details for new publish flow (#20761)
DES-686

Typography for the new modal was a bit off, needed refinement.
2024-08-15 14:54:50 +02:00
Sodbileg Gansukh
5ee67892dc
Improved publishing flow end screen (#20701)
ref DES-594

- this update introduces some improvements to the publishing flow end screen
- everything's behind a feature flag — publishFlowEndScreen
2024-08-15 18:22:32 +08:00
Ronald Langeveld
37fd9eaad5
🐛 Fixed additional white space appearing at bottom of editor (#20757)
ref ENG-1490

- Regression from the secondary lexical instance.
- Replaced the visibility and positioning styles with width, height, and
overflow to prevent layout space issues.
- Ensured the element takes up no space and is not visible, while
allowing proper initialisation.
2024-08-15 16:37:04 +07:00
Sag
e6254bbb93
🎨 Removed member bulk deletion safeguard from safe queries (#20747)
fixes https://linear.app/tryghost/issue/ENG-1484

- in Ghost release
[v5.89.0](https://github.com/TryGhost/Ghost/releases/tag/v5.89.0), we
have added a safeguard around bulk member deletion, due to a limitation
in NQL for member filters (commit: 2484a77)
- with this change, we limit the safeguard to only the cases we know are
problematic, and remove it for other useful and safe queries
- more precisely, the safeguard is in place only when:
    - Multiple newsletters exist, and the filter contains 2 or more
newsletter filters
    - If any of the following stripe filters are used even once:
        - Billing period
        - Stripe subscription status
        - Paid start date
        - Next billing date
        - Subscription started on post/page
        - Offers
2024-08-14 15:48:54 +00:00
Ronald Langeveld
e920888832
Wired up stripeEnabled to Koenig config (#20750)
ref PLG-109

- Added a boolean config property `stripeEnabled` to the configuration.
- This property is now passed down to the Koenig Editor to manage
features based on Stripe connectivity.
2024-08-14 14:32:18 +07:00
Kevin Ansfield
a86f9dbdda Cleaned up internalLinking labs flag
closes https://linear.app/tryghost/issue/PLG-15

- removed `internalLinking` GA labs flag
- renamed search providers to `flex` and `basic`
  - keeps old search provider around as it can handle non-English languages unlike the faster flex provider
- updated `search` service to switch from `flex` to `basic` when the site's locale is not english
- bumped Koenig packages to switch from a feature flag for toggling internal linking features to the presence of the `searchLinks` function in card config
- updated tests to correctly switch between flex and basic providers in respective suites
2024-08-12 13:08:29 +01:00
Daniël van der Winden
0412decaec
Excerpt form error fix (#20730)
fixes
https://linear.app/tryghost/issue/DES-435/excerpt-in-post-settings-has-an-inconsistent-error-state

The excerpt form field seemed to not be properly handling errors.
However, it was a case of the error styling being overruled by the
regular styling, causing the red border to only show upon `:focus` when
there is an error in the excerpt.

I've rewritten the logic to be slightly less obfuscated and added some
CSS to circumvent the issue.
2024-08-12 09:35:21 +00:00
Daniël van der Winden
e0a07c6813
Hide overflow on member list container (#20729)
Fixes
https://linear.app/tryghost/issue/DES-561/horizontal-scroll-on-members-index-shows-on-both-sides-of-table

On resolutions where the members list needed horizontal scrollbars, the
table was overflowing on the left side of the list. This hides that
overflow and fixes the issue.
2024-08-08 14:48:54 +02:00
Daniel Lockyer
b2284383bf Fixed matching ignored errors
refs https://ghost-foundation.sentry.io/issues/4907452370/

- we want to ignore these errors but the caret is stopping us from doing
  so because the errors usually start with AbortError
- we can remove the caret to do so and clean up Sentry
2024-08-07 12:39:57 +02:00
Ronald Langeveld
c8ba9e8027
🐛 Fixed unsaved changes confirmation on Lexical schema change (#20687)
refs ENG-661

Fixes a long-standing issue where an outdated Lexical schema in the
database triggered the unsaved changes confirmation dialog incorrectly.
Implemented a secondary hidden Lexical instance that loads the state
from the database, renders it, and uses this updated state to compare
with the live editor's scratch.
This ensures the unsaved changes prompt appears only when there are real
changes from the user.
2024-08-05 12:58:58 +00:00
Steve Larson
c61c42ce1d
Improved performance loading posts & pages in admin (#20646)
ref 8ea1dfb
ref https://linear.app/tryghost/issue/ONC-111

* undid the reversion for the performance improvements
* built upon new tests for the posts list functionality in admin,
including right click actions
* added tests for pages view in Admin

This was reverted because it broke the Pages list view in Admin, which
is a thin extension of the Posts functionality in admin (route &
controller). That has been fixed and tests added.

This was originally reverted because the changes to improve loading
response times broke right click (bulk) actions in the posts list. This
was not caught because it turned out we had near-zero test coverage of
that part of the codebase. Test coverage has been expanded for the posts
list, and while not comprehensive, is a much better place for us to be
in.
2024-07-29 16:19:28 +00:00
Sag
f64820b1be
🐛 Disabled bulk deletion when multiple member filters are applied (#20681)
fixes https://linear.app/tryghost/issue/ONC-206
ref https://app.incident.io/ghost/incidents/90

- when multiple member filters are used in combination, NQL sometimes
hit a limitation that results in the wrong members being returned
- while we work on the NQL limitation, we are temporarily disabling bulk
member deletion when more than one member filter has been applied
2024-07-29 17:33:23 +02:00
Daniel Lockyer
0193ad90bb Protected against quick escapes when loading post
fix https://linear.app/tryghost/issue/SLO-180/typeerror-cannot-read-properties-of-null-reading-displayname

- in the event you click on a post and then press Back really quickly,
  `this.post` will be null because the post is not loaded
- the code here fails because it tries to read a property from `null`
- we can protect against that by using optional chaining on the property
2024-07-29 09:40:54 +02:00
Sanne de Vries
14cabf97df
Updated tips and donations copy in editor button card (#20662)
REF MOM-313
2024-07-29 09:25:09 +02:00
Chris Raible
71d830e1c9
Removed cache buster from client extensions script (#20668)
ref
https://linear.app/tryghost/issue/PA-71/remove-cache-bust-from-projs-in-admin
ref
15ed2eb245

- This cache buster was added in March to mitigate a client side error in pro.js,
to effectively force browsers to redownload the fixed version of the file.
- It's not needed anymore, as the error has been fixed for a few months
now, so we can safely remove it.
2024-07-25 15:40:12 -07:00
Sag
54449ac98e
Fixed members list when scrolled down too quickly (#20654)
ref https://linear.app/tryghost/issue/SLO-160

- in the Members list, we were using VerticalCollection with
`@bufferSize` set to 20, which means that 20 additional items before and
after the visible items in the viewport were pre-loaded
- however, scrolling down too quickly (e.g. dragging the scrollbar thumb
to the bottom) breaks the list
- with this fix, we adjust `@estimateHeight` parameter to the correct
item size, and reduce the `@bufferSize`
2024-07-24 15:09:53 +02:00
Ronald Langeveld
4dc503e9e5
🐛 Fixed broken link to subscription settings (#20651)
no issue

- Fixed a broken link when navigating from Members list to subscription
access settings.
2024-07-24 09:28:32 +00:00