Commit Graph

39226 Commits

Author SHA1 Message Date
Kevin Ansfield
3744caa950 Fixed lint warnings from Admin feature-test
no issue

- converted use of promises to async/await
- removed return from async test functions to clear lint warnings
2024-09-03 10:59:08 +01:00
Kevin Ansfield
fd926193ce 🐛 Fixed unsaved changes modal showing when title has leading/trailing whitespace
closes https://linear.app/tryghost/issue/PLG-205

The server trims whitespace from the title when saving but our unsaved changes detection was comparing the raw title input field value meaning there would be a mismatch after publishing if the title field contained leading/trailing whitespace.

- updated title comparison to compare trimmed values
- moved and improved unsaved changes modal tests from publish-flow to unsaved-changes acceptance test file
  - added util for pasting content into the editor to test for content changes
2024-09-03 10:53:53 +01:00
Sodbileg Gansukh
1cee402339 Fixed publish flow related admin tests 2024-09-03 10:46:25 +01:00
Kevin Ansfield
cc72d368de Fixed Admin tests
no issue

- fixed eslint config so tests are correctly linted
- removed `.only` on stats tests preventing other tests from running
- removed unneccessary `return` from async setup functions
2024-09-03 10:46:25 +01:00
Daniel Lockyer
f96313e9c2 Enabled treeshaking for validator in AdminX design system
ref https://linear.app/tryghost/issue/DEV-20/faster-builds

- we can save 75KB by using a tree-shaking import for validator
- import string comes from validator docs
- also adds validator import, which was missing for this package
2024-09-03 10:44:14 +02:00
Daniel Lockyer
7db1cb4f14 Fixed treeshaking for lodash in AdminX apps
refs https://dev.to/pffigueiredo/making-lodash-tree-shakable-3h27
ref https://linear.app/tryghost/issue/DEV-20/faster-builds

- by importing `lodash`, we import a huge 500KB file into all AdminX
  apps
- we only use one function from this, so we can switch to `lodash-es`
  and Vite will treeshake the rest out of the final compiled JS
- this saves 500KB in each AdminX app and improves compile times
2024-09-03 10:18:04 +02:00
renovate[bot]
84b45581b6 Update dependency lint-staged to v15.2.10 2024-09-03 09:30:56 +02:00
Djordje Vlaisavljevic
3696d4305c Added static design for Replies
ref https://linear.app/tryghost/issue/AP-374/add-design-for-replies
2024-09-02 21:38:32 +01:00
Peter Zimon
397342a910
Added technical details to stats (#20898)
[ANAL-1](https://linear.app/tryghost/issue/ANAL-32/add-stats-kpis-charts)

The technical details section in Stats contains only the browser breakdown ATM. This PR adds the rest (devices, operating systems) and fixes a couple of minor UI details on the rest of the charts
2024-09-02 16:05:09 +02:00
Daniel Lockyer
47d1a3c451 Switched build and build:ts scripts
ref https://linear.app/tryghost/issue/DEV-20/faster-builds

- `build` should be the overall script to build the package
- `build:ts` should only build TypeScript
- by having them switched around, `build:ts` would call `yarn build`,
  and `yarn` adds several hundreds of milliseconds of time to each build
2024-09-02 15:20:03 +02:00
Daniël van der Winden
e369ca6489
Updated date notation (#20899)
fixes https://linear.app/tryghost/issue/DES-762/improve-date-notation-when-scheduling-posts

If a post goes out *today*, it will no longer show the full date. Also
formatted the subtitle in the modal to be a bit more legible.
2024-09-02 15:08:42 +02:00
Hannah Wolfe
4c5704bfa6 Added audience handling to stats
closes https://linear.app/tryghost/issue/ANAL-23/filtering-by-logged-out-logged-in-traffic

- Updated all of our tinybird datasources and pipes to handle member status
- Added member_status as an array query param to the API endpoints
- Added a really dodgy power select multiple to the stats page to demonstrate it works (needs styling)
- Added all of the wiring so each chart updates
- This was done pretty fast, and may not be 100% right yet
2024-09-02 12:56:37 +01:00
Kevin Ansfield
73d75413a0
🎨 Convert portal links to relative to avoid homepage flash on click (#20896)
closes https://linear.app/tryghost/issue/PLG-190

- often when adding portal links to your own site pages the URLs are added as absolute on the site's homepage due to copy+paste from displayed URLs in Admin
- when clicking absolute portal URLs the homepage is first loaded before the Portal popup is shown resulting in a slower and flashier experience
- added a transform for all local portal URLs on the page when Portal is initialized so links open the Portal popup immediately on the current page
2024-09-02 11:23:12 +00:00
Peter Zimon
ad9312451d
Stats tab charts (#20895)
[ANAL-1](https://linear.app/tryghost/issue/ANAL-1/v1-chart-list)

Creating first version of charts on Stats tab which includes KPIs, Content, Sources, Locations and technical data.
2024-09-02 13:22:39 +02:00
Kevin Ansfield
9467ffadb5 Removed sqlite skip in recommendation email test
no issue

- test runs OK locally in SQLite
- enabling it to run eliminates a potential tripping point when generating updated snapshots locally
2024-09-02 11:16:02 +01:00
Daniel Lockyer
33dd6b6b49 Removed concurrently from building apps
ref https://linear.app/tryghost/issue/DEV-20/faster-builds

- we added concurrently because, in theory, it should make builds faster
  by utilizing more cores
- however, when combined with Nx, it seems that we are trying to exceed
  the number of cores, which actually makes individual builds slower
- I've removed concurrently from the apps, which should improve the
  build time significantly
2024-09-02 12:06:27 +02:00
Djordje Vlaisavljevic
a3e498106d Added icons to Activity items to make it easier to scan the page
ref https://linear.app/tryghost/issue/AP-283/handle-incoming-likes
2024-09-02 10:43:38 +01:00
Djordje Vlaisavljevic
c260ed5202 Added support for badges to APAvatar
ref https://linear.app/tryghost/issue/AP-283/handle-incoming-likes
2024-09-02 10:43:38 +01:00
Daniël van der Winden
16d2987c0c
Updated URL encoding (#20891)
Fixes
https://linear.app/tryghost/issue/DES-760/make-a-line-break-between-the-post-title-and-url-when-sharing-to

When a post is shared to Twitter from the 'Share' modal (or in the
publishing flow), the URL now sits on the second line.

<img width="653" alt="Screenshot 2024-09-02 at 11 20 53"
src="https://github.com/user-attachments/assets/178066cc-01da-41b6-bf1d-d00943881209">
2024-09-02 09:27:32 +00:00
Ronald Langeveld
b62baa8b0b
Added sentry to support error on Portal (#20890)
ref PLG-204

- Added a sentry capture so we know when and if the support error
component gets triggered.
2024-09-02 16:58:22 +09:00
Daniel Lockyer
0f8fd441c7 Renamed ghost:build to ghost:build:assets
ref https://linear.app/tryghost/issue/DEV-20/faster-builds

- this was previously causing duplicate builds of the TS projects
  because Nx was building all projects with `build` targets, and we were
  also calling `build:ts`
- this cuts 12 compilation jobs from the archive process, which should
  help with container build times
2024-09-02 09:08:47 +02:00
Hannah Wolfe
c1798620bb
Added basic date-handling to stats page (#20887)
ref https://linear.app/tryghost/issue/ANAL-21/filtering-the-dashboard

- Added the very basic date filter back from the dashboard
- Without this, it's very hard to see that the basic concept is working
- This method can be reused for creating any filter
2024-09-01 16:33:31 +01:00
Chris Raible
03c388db91
Updated yarn.lock (#20885)
no issue

- Running `yarn` on `main` was making changes to the `yarn.lock` file
without any code/dependency changes — committing those changes to fix
this.
2024-08-30 11:23:17 -07:00
Ghost CI
bf4e6600a9 v5.91.0 2024-08-30 15:05:40 +00:00
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
Hannah Wolfe
08bf49eaec
Added full suite of tinybird datasources and pipes (#20882)
ref
https://linear.app/tryghost/issue/ANAL-27/setup-tinybird-project-and-cicd
ref
https://github.com/tinybirdco/web-analytics-starter-kit/blob/main/tinybird/pipes/analytics_sessions.pipe

- These datasources and pipes work together to define the main endpoints
we need for our stats dashboard
- They are based on the web analytics starter kit from tinybird
- We've updated them to handle site_uuid
- There's more to do to pipe the member-related and post-related data
through the system yet
2024-08-29 22:03:31 +01:00
Hannah Wolfe
f79f5471b4
Added stats tracker script to ghost head (#20881)
closes
https://linear.app/tryghost/issue/ANAL-9/initial-tracker-in-ghost-head

- Given that all of the correct config is in place, output a tracking
script
- This allows us to send pageview events into tinybird
- All of the details (location of the script, destination etc) are kept
in config so that it's easy to change for different environments
2024-08-29 21:40:41 +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
Steve Larson
c2ae91e4db
Added config flag to disable recommendations service (#20879)
no ref

This service can get rather noisy when doing local development with our
data generator, as we do not use real urls, and therefore generate a lot
of not found errors in the console.
2024-08-29 17:51:23 +00:00
Hannah Wolfe
79f4b523ac
Added analytics_events tinybird datasource
ref https://linear.app/tryghost/issue/ANAL-27/setup-tinybird-project-and-cicd
ref https://www.tinybird.co/docs/concepts/data-sources

- This is our main datasource, where we'll store events that come in as people browse around Ghost
- It's defined using tinybird's format, and then deployed out to tinybird using `tb deploy`
2024-08-29 17:20:16 +01:00
Sanne de Vries
b79534387d Updated notification email mobile styles
ref https://linear.app/tryghost/issue/PLG-200
2024-08-29 17:15:45 +01:00
Kevin Ansfield
0647172ca8 Added style inlining to staff service emails
no issue

- uses same `juice` version that we use in our newsletter emails
2024-08-29 17:15:45 +01:00
Hannah Wolfe
e41984d0a5
Initial tinybird setup
ref https://linear.app/tryghost/issue/ANAL-27/setup-tinybird-project-and-cicd

- Tinybird has a system for managing it's configuration as code, with full ci/cd support
- The tinybird CLI tool uses python, so we'll run that using docker, via `yarn tb`
- Some of the files tinybird adds should not be in source control, so we've added those to git ignore
- Everything in /ghost/tinybird is tinybird's init config
2024-08-29 16:56:51 +01: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
Hannah Wolfe
3e25370ebe
Added initial stats config to API (#20875)
closes https://linear.app/tryghost/issue/ANAL-8/flag-and-config

- This checks if tinybird:stats is set, and if so passes through the
config that is set via the config API
- This is used by Ghost admin to configure where to pull charts from
2024-08-29 11:37:28 +01:00
Daniel Lockyer
0a6cd75993 Gated NestJS framework behind environment variable
- we added NestJS to Ghost as a way forwards for a new framework within
  Ghost but we haven't added much to it
- requiring all the NestJS code adds about 6-9% to our boot time, so if
  we're not using it, it's just time we're burning for no benefit
- for now, I've gated this behind an env var to prevent it from loading
- we can't use labs flags in the boot process, so I've gone for an env
  var
2024-08-29 12:18:42 +02:00
Daniël van der Winden
d92f8bcf0a
Updated button colours and hover states (#20873) 2024-08-29 10:05:52 +00:00
Sanne de Vries
2b90ca9082
Updated member link styling in donation email (#20872)
REF PLG-202
- Removed underline from member link
- Changed &rarr; to &bull;
2024-08-29 09:58:40 +00:00
Daniel Lockyer
77df6186f0 Removed auto-labeller for PRs
- this was an early attempt to group PRs together by labels, so we can
  triage PRs easier, but it's not finished and actually producing more
  noise than signal
- we might want to re-add this in the future, but for now, silence 🧘
2024-08-29 11:06:00 +02:00
Fabien O'Carroll
2d00d5ca0e Fixed welcome email being sent for Admin API creates
ref https://linear.app/tryghost/issue/ONC-274

This fix is done at the endpoint layer, which isn't ideal, but has the smallest
surface area for the change. I think we may want to move it up a layer though,
despite the extra complications. If we move the check _into_ the MembersAPI
class however, we start to run into issues with circular dependncies due to the
mess that is our dependency injection approach with the Members service
2024-08-29 16:05:27 +07:00
Fabien O'Carroll
3adc0c0441 Added breaking test for sending welcome emails
ref https://linear.app/tryghost/issue/ONC-274

This test checks that a welcome email is not sent when adding a member via the
Admin API if the site is in need of email verification, regardless of whether
or not the flag to send an email is set.

It is currently failing to demonstrate the whole in our logic.
2024-08-29 16:05:27 +07:00
Fabien O'Carroll
b012da023d Cleaned up settings cache after test
All tests after this one were in a non-sending email state, which luckily
doesn't affect these tests, but it will affect future ones! This just cleans up
the settings so that they're back to a standard default.
2024-08-29 16:05:27 +07:00
Hannah Wolfe
2720791434
Updated CI workflow to run on PR label/unlabel
- We have browser tests which only run if the browser tests flag is added to the PR
- The label has to be present on PR creation, which is hard to remember/doesn't fit with various workflows
- The default type of action for the pull_request trigger are opened, synchronize, reopened
- This PR adds labeled and unlabeled to those, which I think will help us to run the tests as expected
- The expectation is that adding the browser test label will now trigger the tests to run
2024-08-29 09:24:37 +01: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
Chris Raible
dd714ef543
Added test-results directories to .gitignore (#20867)
no issue

- These directories are made when running browser tests locally — added
to `.gitignore` so we don't accidentally commit our local test results
to version control
2024-08-28 16:04:19 -07:00
Kevin Ansfield
0d091992f2 Shipped new Portal version 2024-08-28 17:54:58 +01:00
Sanne de Vries
0532e4063f
Fixed potential orphaned words in notification email titles (#20860)
REF PLG-150
2024-08-28 16:03:37 +00:00
Sanne de Vries
8ddbf471dd
Updated donation success modal styles (#20859)
REF PLG-152
2024-08-28 15:48:57 +00:00