Commit Graph

15052 Commits

Author SHA1 Message Date
Simon Backx
3cb56bad94 Added confirmation step when sending feedback
fixes https://github.com/TryGhost/Team/issues/2161

Confirmation step is skipped when already signed in.
2022-10-26 14:18:07 +02:00
James Morris
f1565fe92a Updated the copy for the audience feedback in preview and email based on feedback
refs https://github.com/TryGhost/Team/issues/2171
2022-10-26 12:17:07 +01:00
James Morris
4c6a57c8f3 Updated the feedback copy for Portal modal based on recent feedback
refs https://github.com/TryGhost/Team/issues/2170
2022-10-26 11:59:57 +01:00
Aileen Nowak
b79006d7f3 Added Ghost Explore app
no issue

- bumps Ghost Explore integrated app  to GA from alpha
2022-10-26 10:05:50 +01:00
Naz
cdd65f25ac
Migrated members importer to use tiers
refs https://github.com/TryGhost/Team/issues/2077

- The "productRepository" methods have been deprecated in favor of "tiers" and "Tiers API".
- The changes migrated usages of  "productRepository.getDefaultProduct" to Tiers API's "readDefaultTier"
2022-10-26 14:26:21 +08:00
renovate[bot]
d034526fe6
Update dependency supertest to v6.3.1 2022-10-26 02:54:43 +00:00
Daniel Lockyer
857dacbf16 Fixed missing column values for default paid tiers
fixes https://github.com/TryGhost/Toolbox/issues/455
refs https://github.com/TryGhost/Ghost/blob/main/ghost/core/core/server/data/migrations/versions/5.19/2022-09-02-20-52-backfill-new-product-columns.js

- the referenced migration does not handle backfilling the
  currency/monthly_price/yearly_price for the default paid tiers where
  they do not originate from Stripe
- this is causing issues in Ghost because of the missing data
- this migration backfills the columns for products where they are paid
  but do not currently contain values due to the bug above with the
  values for the default tier we usually use
2022-10-26 08:49:10 +07:00
renovate[bot]
f8cf220762
Update dependency mailgun.js to v8.0.2 2022-10-25 20:20:41 +00:00
James Morris
176af30788 Added in clicks URLs for the members table under clicked tab
refs https://github.com/TryGhost/Team/issues/2149
2022-10-25 17:50:23 +01:00
James Morris
d4e336dc2a Further tweaks and refactoring to engagement bar
- Made a new function that checks if stubs are needed per tab
- Renamed the check for pagination to be a little more clear
- Made sure the pagination block is always to the right
- Made sure the pagination buttons don't show when there is no pagination

refs https://github.com/TryGhost/Team/issues/2149
2022-10-25 16:59:29 +01:00
James Morris
66e42c8b29 Moved the pagination to the right based on feedback
refs https://github.com/TryGhost/Team/issues/2149
2022-10-25 16:13:42 +01:00
Djordje Vlaisavljevic
3e206411f8 Updated attribution info design on member profile
refs https://github.com/TryGhost/Team/issues/1986
2022-10-25 16:55:19 +02:00
Simon Backx
e508baa540 Added breadcrumbs to members pages when coming from analytics
fixes https://github.com/TryGhost/Team/issues/2140
2022-10-25 16:21:10 +02:00
Simon Backx
fee493af45 Wired up source to conversions on analytics page
refs https://github.com/TryGhost/Team/issues/2157

- The source links to the referrer url if there is any
- A dash is used if no source is available
2022-10-25 14:30:40 +02:00
James Morris
bd091c65c7 Tidying up some aspects of the post analytics page and engagement bar
- Removed the dummy rows as they looked like loading states
- Improved the spacing of the pie chart
- Showing total number when pagination isn't required
- Tweaks across the page to look more consistent

refs https://github.com/TryGhost/Team/issues/2149
2022-10-25 12:55:03 +01:00
James Morris
c533af61a9 Removed the source attributiont table from Post Analytics page and added dummy metric to Conversions tab
refs https://github.com/TryGhost/Team/issues/2157
2022-10-25 11:05:44 +01:00
Peter Zimon
441ec742c0 Fixed icon style bug for Explore menu
no issue

- the circle component of the Explore icon was overriden with other style definitions
2022-10-25 11:27:23 +02:00
Naz
a7f5ee0ad5
Simplified members CSV importer constructor
refs https://github.com/TryGhost/Team/issues/2077

- Passing in the whole "getMembersApi" is just too much state to know about for the importer - it only uses a concept of default tier and members repository, the rest is distracting fluff making it hard to reason about what the importer **has to** know to function
- Passing in two functions breaking up the above state simplifies the constructor API.
- This is also a groundwork before substituting productsRepository for tiersRepository (refed issue objective)
2022-10-25 16:40:28 +08:00
Peter Zimon
f5a55092e5 Updated Explore menu
no issue

- Explore menu was before View site
- Explore menu colors were off in dark mode because it used old icon styles
2022-10-25 07:13:22 +02:00
renovate[bot]
0d3d85df64 Update dependency html-validate to v7.7.1 2022-10-25 10:40:33 +07:00
Fabien "egg" O'Carroll
25d8d694a0 Wired up the payment service to create stripe checkout sessions
refs https://github.com/TryGhost/Team/issues/2078
2022-10-25 09:03:04 +07:00
Fabien "egg" O'Carroll
31610f9b94 Wired up Tiers service to Tiers Content & Admin API
refs https://github.com/TryGhost/Team/issues/2078
2022-10-25 09:02:59 +07:00
Fabien "egg" O'Carroll
cc14ce2b20 Added initial tiers service to Ghost
refs https://github.com/TryGhost/Team/issues/2078

This allows us to start wiring up the new package to the Admin & Content API's
2022-10-25 09:02:56 +07:00
Fabien "egg" O'Carroll
df145797b3 Fixed toJSON method of Tier
This was returning an ObjectID object which is not a JSON primitive
2022-10-25 09:02:50 +07:00
Fabien "egg" O'Carroll
6e862b42e7 Wired up Payments service to new Tiers package
refs https://github.com/TryGhost/Team/issues/2078

This adds handling to the Tier events to create Stripe Products & Prices when
Tiers are created and have their pricing changed. We also update the Stripe
Product names when the Tier name is edited.

We also add a method to generate a payment URL which will replace our current
implementation of creating a Stripe Checkout Session
2022-10-25 09:02:41 +07:00
Fabien "egg" O'Carroll
253c30c37a Improved price data access and setting for Tier
refs https://github.com/TryGhost/Team/issues/2078

We want to be able to easily get the price for a Tier based on the cadence for
use when creating Stripe Prices. We also want to be able to set the pricing data
to `null` for free Tiers, rather than erroring.
2022-10-25 09:01:39 +07:00
renovate[bot]
68f1df545c
Update dependency express-jwt to v7.7.7 2022-10-24 21:21:25 +00:00
Hannah Wolfe
d260a7c78c
Updated webhook test snapshots
refs: 26d049911c
refs: 8c2f832573

- snapshots fell behind between the two referenced commits, and needed updating
2022-10-24 19:44:46 +01:00
James Morris
9f7a8a6f2f Renamed the member links to be something simpler on Post Analytics page
refs https://github.com/TryGhost/Team/issues/2147
2022-10-24 16:52:59 +01:00
Kritika Sharma
26d049911c
Added e2e tests for post.published.edited webhook (#15642)
refs: https://github.com/TryGhost/Ghost/issues/15537

- snapshot test created to add confidence to webhook stability and increase overall test coverage.

Co-authored-by: Kritika Sharma <kritikasharma@Kritikas-MacBook-Pro-2.local>
2022-10-24 14:55:25 +01:00
Dominik Picheta
8c2f832573
Added e2e tests for post.unscheduled webhook (#15675)
refs: https://github.com/TryGhost/Ghost/issues/15537

- snapshot test created to add confidence to webhook stability and increase overall test coverage.
2022-10-24 14:12:49 +01:00
Simon Backx
1f138893ff Fixed snapshot tests
refs 30ecaef329
2022-10-24 14:27:52 +02:00
James Morris
30ecaef329 Update the portal version number
no issue
2022-10-24 12:47:00 +01:00
James Morris
7b0bf8191d Released Portal v2.18.0 2022-10-24 12:36:57 +01:00
James Morris
4f934ac94f Released Portal v2.17.0 2022-10-24 12:36:04 +01:00
James Morris
627b35aee4 Improved the error modals for audience feedback and newsletter unsubscribe
- Main goal to improve modal when audience feedback fails
- Felt right to also improve the newsletter unsubscribe issue, too
- Makes this more pleasing to read and look at, nothing fancy

refs https://github.com/TryGhost/Team/issues/2081
2022-10-24 12:11:30 +01:00
Naz
59209a07a5
Cleaned up leftover "product" variable naming
refs https://github.com/TryGhost/Team/issues/1076

- "product" in the context of members has been deprecated since introduction of "tiers"
2022-10-24 18:06:02 +08:00
Naz
840deaf8d7
Restricted members importer to ignore "products" column
refs https://github.com/TryGhost/Team/issues/1076
refs 70229e4fd3 (diff-b67ecda91b5bd79c598e5c5a9ec2ccf28dbfab6a924b21352273865e07cd7ceaR57)

- The "products" column has not been doing any logic anything since at least 5.20.0 (see refed commit). The concept of columns in the export file was mostly there for analytical/data filtering reasons - so the user could analyze their exports. CSV was never a good suite for relational data that "products" (or now tiers) represent
- The "tiers" column will still be present in the exported CSV file, but there is not going to be any logic attached to it.
- The only columns that can effect the "tiers" state of the member are: "complimentary_plan" (assign default tier to the member) and "stripe_customer_id" (pulls in subscription/tier data from Stripe)
2022-10-24 18:06:02 +08:00
James Morris
53e20f30ae Rearranged the markup so the empty state shows ok without pie chart
refs https://github.com/orgs/TryGhost/projects/60
2022-10-24 11:03:54 +01:00
James Morris
fda12d103a Added dark mode styles to the post analytics table
no issue
2022-10-24 10:35:29 +01:00
Simon Backx
fd91f7eebb
Added email sent events (#15682)
fixes https://github.com/TryGhost/Team/issues/2137

For the analytics page, we need the sent events to show up immediately
after sending an email. Otherwise we need to wait for emails to be
marked as received (which takes too long) before being able to show them
on the analytics page.

This adds the email_sent_event, which is hidden by default everywhere
and used on the analytics page.
2022-10-24 11:11:44 +02:00
Simon Backx
a650ae2138
Fixed default feedback enabled when flag is disabled (#15660)
fixes https://github.com/TryGhost/Team/issues/2114
fixes https://github.com/TryGhost/Team/issues/2115

When a new newsletter is created, the frontend will send feedback_enabled to true. We'll catch this in the backend and don't allow setting feedback_enabled to true when audience_feedback flag is disabled. This is also handled for editing newsletters.

To fix this in existing sites, I added a migration that disables feedback for all sites (since this is an alpha feature). Once we'll release the feature later, it will be disabled for existing newsletters, just like expected.
2022-10-24 10:14:58 +02:00
Fabien "egg" O'Carroll
0f03b5eddb Released Portal v2.16.0 2022-10-24 15:12:02 +07:00
renovate[bot]
bbd6c47d01 Update dependency html-validate to v7.7.0 2022-10-24 11:36:30 +07:00
renovate[bot]
603c78755d
Updated @tryghost dependencies (#15631)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-10-24 10:30:40 +07:00
renovate[bot]
5f08c1b713 Update dependency ember-svg-jar to v2.4.2 2022-10-24 10:28:20 +07:00
renovate[bot]
9b2e4eb73c Update dependency @babel/plugin-proposal-decorators to v7.19.6 2022-10-24 10:25:41 +07:00
renovate[bot]
44f54fa4cc Update dependency inquirer to v8.2.5 2022-10-24 10:22:16 +07:00
renovate[bot]
66f92e6eaf Update dependency ember-auto-import to v2.4.3 2022-10-24 10:20:44 +07:00
renovate[bot]
3021a7dc50 Update dependency eslint to v8.26.0 2022-10-24 10:19:56 +07:00
Hakim Razalan
48b033f1e1
🐛 Fixed missing unsaved changes modal for member newsletters (#15564)
closes: https://github.com/TryGhost/Ghost/issues/15507

- manually handle relationship changes detection labels and newsletters
- add `dirtyAttributes` controller property - return newsletters and labels dirty attributes status
2022-10-21 21:05:14 +01:00
Hakim Razalan
b88a54fb71
🐛 Fixed redirect to signin modal not shown when logged out (#15522)
fixes:  https://github.com/TryGhost/Ghost/issues/15291

- An attempt to improve re-authenticate modal toggle - show re-authenticate modal every time user save (ctrl/cmd + s)
- An attempt to fix redirection when user re-login on different tab. Prevent redirection to sign-in page since the user already logged in on another tab.
- Re-enable `editor` test on `authentication-test.js`
2022-10-21 21:03:12 +01:00
Halldor Thorhallsson
dbad621b91
Removed bluebird from fixture-utils.js (#15626)
refs: https://github.com/TryGhost/Ghost/issues/14882

- Opted to use the in-house `sequence` function when refactoring Bluebird's `Promise.each` to avoid deadlock issues (see 734ef66e6c). 
-It's hard to know without tonnes of context if any `Promise.each` are safe to refactor to `Promise.all`.
2022-10-21 20:56:21 +01:00
Elena Baidakova
9720459f55
Added pie chart for activity feed (#15673)
closes TryGhost/Team#2088
- Added pie chart to feedback event
- Added `negative_feedback` field to response from BE
2022-10-21 21:34:05 +04:00
Halldor Thorhallsson
39e246aaf8
Removed bluebird from fixture-manager.js (#15629)
refs: https://github.com/TryGhost/Ghost/issues/14882

- Removing bluebird specific methods in favour of the Ghost sequence method so we can remove the bluebird dependency

Co-authored-by: Hannah Wolfe <github.erisds@gmail.com>
2022-10-21 18:08:44 +01:00
James Morris
a79c48e547 Add in dummy rows and empty states to the engagement bar
refs https://github.com/TryGhost/Team/issues/2130
2022-10-21 17:33:44 +01:00
Simon Backx
5ef0753611 Improved post activity feed table
no issue

- Fixed counter at the bottom
- Fixed forward > backward not working
2022-10-21 17:19:34 +02:00
Simon Backx
7c824556c2
Added new members filters and refactored filters (#15667)
fixes https://github.com/TryGhost/Team/issues/2112

- Removed a bit of duplicate code across templates and components that was used to handle filters
- Updated filter objects to contain information about the filter
- Added resource filters that are able to select a single resource, which can be used in columns
- Filters can now define columns by themselves. Not all columns already make use of this functionality, but we can move those over later (cleanup: https://github.com/TryGhost/Team/issues/2133)
- The filter definitions became quite long. We should move them to separate files in the future: https://github.com/TryGhost/Team/issues/2134
- Filters can now have custom NQL parsing
- Improved support for parsing recursive or grouped NQL queries
- Added support for filtering members by feedback
2022-10-21 17:18:00 +02:00
James Morris
7d6cfc905e Making avatar initials smaller in the engagement bar
refs https://github.com/TryGhost/Team/issues/2139
2022-10-21 16:12:45 +01:00
James Morris
c2e43a0805 Changing the metric to positive feedback rather than more like this
refs https://github.com/TryGhost/Team/issues/2138
2022-10-21 16:06:27 +01:00
Ghost CI
67c742606d v5.20.0 2022-10-21 16:00:38 +01:00
Rishabh Garg
05330316e3
Allowed fixing newsletter links (#15672)
refs https://github.com/TryGhost/Team/issues/2116

- allows site owners to edit a link in a post that has already been sent out, fixing any typos or other mistakes
- resets click counter for the edited link back to 0 so site owners can see the clicks on new link, doesn't change the overall click count
2022-10-21 19:38:57 +05:30
James Morris
b4a178b45c Moved the newsletter settings option for audience feedback based on feedback
refs https://github.com/TryGhost/Team/issues/2124
2022-10-21 15:07:48 +01:00
illiteratewriter
a701f2114d
Added importer for custom theme settings (#15596)
closes: https://github.com/TryGhost/Ghost/issues/15542

- custom theme settings were not reinstated on import
- importing custom theme settings for the current active theme requires the theme be re-activated
2022-10-21 15:02:32 +01:00
James Morris
11bea8d9f0 Better matching the pagination styles across modules for post analytics
- Careful of flags, having different paginations depending on those
- Little stylistic adjustment to how pagination is shown on engagement bar
- Quite a few feature flag checks to make sure the right style is showing

refs https://github.com/TryGhost/Team/issues/2136
2022-10-21 14:53:09 +01:00
Hannah Wolfe
3ab1c418bc
Updated webhook test snapshots
refs: 717a27c85c
refs: 6380b82793

- The snapshots just needed updating
2022-10-21 14:36:20 +01:00
Halldor Thorhallsson
717a27c85c
Added e2e tests for page.unpublished webhook (#15613)
refs: https://github.com/TryGhost/Ghost/issues/15537

- snapshot test created to add confidence to webhook stability and increase overall test coverage.
2022-10-21 14:16:13 +01:00
James Morris
8d13aa003f Quick tweak to max height when there are columns side-by-side
refs https://github.com/TryGhost/Team/issues/2118
2022-10-21 14:01:40 +01:00
Rishabh
3d355ea41d Fixed test snapshots
refs 5b283930f0
2022-10-21 18:14:57 +05:30
Samprit JC
f7738dc1a2
Added e2e test for post.unpublished webhook (#15628)
refs: https://github.com/TryGhost/Ghost/issues/15537

- snapshot test created to add confidence to webhook stability and increase overall test coverage.
2022-10-21 13:08:54 +01:00
Djordje Vlaisavljevic
3d697fb67b Updated explainer text design
refs https://github.com/TryGhost/Team/issues/2127
2022-10-21 13:50:03 +02:00
Shashank Gupta
092fb7813d
Added e2e tests for page.edited webhook (#15627)
refs: https://github.com/TryGhost/Ghost/issues/15537

- snapshot test created to add confidence to webhook stability and increase overall test coverage.
2022-10-21 12:45:38 +01:00
illiteratewriter
4ba254b339
Added e2e tests for member.edited webhook (#15620)
refs: https://github.com/TryGhost/Ghost/issues/15537

- snapshot test created to add confidence to webhook stability and increase overall test coverage.
2022-10-21 12:43:30 +01:00
Shubhadeep Das
5b283930f0
Added e2e tests for post.edited webhook (#15625)
refs: https://github.com/TryGhost/Ghost/issues/15537

- snapshot test created to add confidence to webhook stability and increase overall test coverage.
2022-10-21 12:39:24 +01:00
Rishabh
25f76642b3 Refined link edit cancellation on analytics page
refs https://github.com/TryGhost/Team/issues/2116

- ignores blur events when link is edited via keypress
2022-10-21 17:05:48 +05:30
Rishabh
86a9695ccb Fixed date format for link bulk edit
refs https://github.com/TryGhost/Team/issues/2104

- updates date format for `updated_at` to use the right DB date format
2022-10-21 17:02:37 +05:30
Naz
b552727b69
Changed members export to contain tiers
refs https://github.com/TryGhost/Team/issues/1076

- The "products" is a legacy term for what is now "tiers" since multiple tiers feature introduction in https://github.com/TryGhost/Ghost/releases/tag/v4.39.0
- Note, the "tiers" is a field meant for informational purposes and cannot be imported back into Ghost site.
2022-10-21 18:58:59 +08:00
Naz
850eb611c3
Added 100% unit test coverage to unparse
refs https://github.com/TryGhost/Team/issues/1076

- 100% is the golden standard. Easy to keep it this way once there
2022-10-21 18:58:59 +08:00
Naz
77e8fdfccb
Removed test "utils" folder
refs https://github.com/TryGhost/Team/issues/1076

- The members-csv package does not use "should" for assertions anymore, so the accompanying "utils" lib can go away now
2022-10-21 18:58:59 +08:00
Naz
0d1479158c
Migrated unparse test suite to assert
refs https://github.com/TryGhost/Team/issues/1076

- The 'should' assertion library is deprecated. Native 'assert' is the recommended lib to use
- Migrating this bit of code allows to remove the should's "utils" folder. Less code, yey!
2022-10-21 18:58:59 +08:00
Naz
6c2d057e25
Improved readability of unparse test
refs https://github.com/TryGhost/Team/issues/1076

- The column parameter has default behavior attached to it, so it is best to have it mentioned and used in an explicit way.
2022-10-21 18:58:59 +08:00
Aileen Booker
6c9f8ec32d
Improved URL syncing between Admin and Explore (#15640)
no issue

Improve the route communication between Ghost Admin and Ghost Explore to
reflect route changes in the URL and correctly navigate to Explore sub
routes
2022-10-21 11:48:18 +01:00
Rishabh
50c92142d4 Fixed lint 2022-10-21 16:08:26 +05:30
Rishabh
ba6fe63250 Fixed cached redirects for edited newsletter links
refs https://github.com/TryGhost/Team/issues/2135

The email link redirects on Pro are cached as 302 redirects in Varnish, so we're missing further clicks after the first one for each member, until the cache is invalidated. This change invalidates cache on link edits to ensure that we correctly redirect members to updated link everytime
2022-10-21 16:07:34 +05:30
Rishabh
25cbbff81c Refined link edit flow on Admin
refs https://github.com/TryGhost/Team/issues/2116
2022-10-21 15:57:32 +05:30
Djordje Vlaisavljevic
06365b1d00 Changed explainer text color and icon to deemphasize it
refs https://github.com/TryGhost/Team/issues/2127
2022-10-21 11:46:33 +02:00
Djordje Vlaisavljevic
1d4e6328cb Fixed row hover effects in dark mode
refs https://github.com/TryGhost/Team/issues/2127
2022-10-21 11:08:11 +02:00
Rishabh
910d13fbab Updated save button handling for links
refs https://github.com/TryGhost/Team/issues/2116
2022-10-21 14:36:33 +05:30
Djordje Vlaisavljevic
9e3e3d7131 Removed unnecessary padding
refs https://github.com/TryGhost/Team/issues/2127
2022-10-21 11:04:27 +02:00
Djordje Vlaisavljevic
1e1a155b7d Updated edited state font weight for better contrast
refs https://github.com/TryGhost/Team/issues/2127
2022-10-21 10:37:31 +02:00
Elena Baidakova
bbf6b95cbf
Added filtered events tables to the analytics page (#15669)
closes TryGhost/Team#2087
2022-10-21 12:31:25 +04:00
Rishabh
dcd607ad94 Fixed jumping of links on edit in analytics
refs https://github.com/TryGhost/Team/issues/2116

- editing a link caused it to jump in the list as its count is reset to 0
- this forces the order of links same after edit, the new order is only visible on refresh or navigating away and coming back
2022-10-21 13:34:15 +05:30
Djordje Vlaisavljevic
3203714b3d Added retry button in error state
refs https://github.com/TryGhost/Team/issues/2127
2022-10-20 22:10:37 +02:00
Djordje Vlaisavljevic
1435f0eabf Fixed explanation text not showing when there's no pagination
refs https://github.com/TryGhost/Team/issues/2127
2022-10-20 22:04:29 +02:00
Djordje Vlaisavljevic
dafdfc7a7c Vertically aligned icons
refs https://github.com/TryGhost/Team/issues/2127
2022-10-20 21:58:33 +02:00
Djordje Vlaisavljevic
e84e58f9b3 Fixed unrelated elements sharing the same CSS class
refs https://github.com/TryGhost/Team/issues/2127
2022-10-20 21:49:14 +02:00
Djordje Vlaisavljevic
2325969f77 Fixed missing padding in post analytics header
refs https://github.com/TryGhost/Team/issues/2127
2022-10-20 21:43:12 +02:00
Djordje Vlaisavljevic
bb182674df Deemphasized edited state
refs https://github.com/TryGhost/Team/issues/2127
2022-10-20 21:39:48 +02:00
Djordje Vlaisavljevic
a0b5267f0f Improved responsiveness
refs https://github.com/TryGhost/Team/issues/2067
2022-10-20 16:26:39 +02:00
Rishabh
ec126f0980 Added missing dependencies for link tracking 2022-10-20 19:49:04 +05:30
Djordje Vlaisavljevic
b4d16a7d3e Fixed first and last child padding in edit mode
refs https://github.com/TryGhost/Team/issues/2067
2022-10-20 16:11:44 +02:00
Rishabh
71999a26b9 Updated success state for link update on Admin
refs https://github.com/TryGhost/Team/issues/2116

- removes extra redundant success state handling
2022-10-20 18:25:46 +05:30
Rishabh
d7b3721036 Added edited property to links api
refs https://github.com/TryGhost/Team/issues/2104

- adds a boolean `edited` property to links api that denotes if the link has been edited
2022-10-20 18:17:44 +05:30
Rishabh
ee145ed5b3 Wired link update api on Admin
refs https://github.com/TryGhost/Team/issues/2116

- wires link update API on post analytics UI page to save edited links for a newsletter
- all links matching the edited link are updated by the API in the backend
2022-10-20 17:55:02 +05:30
Rishabh
6312b064f5 Added reset for link click count on edit
refs https://github.com/TryGhost/Team/issues/2104

When a newsletter link is edited, we reset its click count to 0 to show only the clicks on newly edited links. This is done by only counting the member click events for a link which are greater than its last updated at, so that all previous click events are not counted for the link, but are included in the total count of all links on the page.
2022-10-20 17:50:02 +05:30
Rishabh
d8bacf12d1 Added endpoint for fixing newsletter links
refs https://github.com/TryGhost/Team/issues/2104

- adds new bulk edit endpoint for links, updates all matching link with the current redirect url and update to new url
2022-10-20 17:50:02 +05:30
James Morris
40b8a838ae Moving the post analytics layout closer to new design
- Newsletter clicks module has new header and box
- Source attribution module has new header and box
- Resources have new headers inside the box
- New split layout if there are two modules side-by-side

refs https://github.com/TryGhost/Team/issues/2119
2022-10-20 13:17:25 +01:00
Simon Backx
adf10f0e76
Added support for filtering email events by post_id (#15666)
refs https://github.com/TryGhost/Team/issues/2093
2022-10-20 13:29:00 +02:00
Djordje Vlaisavljevic
0172fd3ef2 Made default and editing states the same height
refs https://github.com/TryGhost/Team/issues/2067
2022-10-20 12:43:41 +02:00
Fabien "egg" O'Carroll
b14b74315f Exported Tier events from tiers package
These are required to be exported so that external code can subscribe to the
events.
2022-10-20 17:40:37 +07:00
Fabien "egg" O'Carroll
5f928794c3 Added support for Tier events
refs https://github.com/TryGhost/Team/issues/2078

These events are all required for other parts of the Ghost system to stay in
sync. The events on each Tier object will be dispatched by the TierRepository
once they've been persisted.

TierCreatedEvent - generate Stripe Products & Prices
TierNameChangeEvent - update Stripe Products
TierPriceChangeEvent - update Stripe Products & Prices
TierArchivedEvent - update the Portal settings for visible tiers
                  - disable Stripe Products & Prices
TierActivatedEvent - enable Stripe Products & Prices
2022-10-20 17:31:33 +07:00
Djordje Vlaisavljevic
d1d3c1401f Added button for saving changes made to the link
refs https://github.com/TryGhost/Team/issues/2125
2022-10-20 12:18:56 +02:00
Naz
0e094b371b
Reused getDefaultProduct where possible
refs 82ed10473b
refs https://github.com/TryGhost/Team/issues/1869

- getDefaultProduct has unified logic across different places (see refed commit). It is recommended to use instead of writing custom queries prone to mistakes.
- Also added more readable name to the possible error message thrown by setComplimentarySubscription
2022-10-20 17:23:59 +08:00
Naz
5d5b77d32f
Fixed comped tier assignment
closes https://github.com/TryGhost/Team/issues/1869

- When there were "archived" tiers in the system the importer incorrectly fetched them instead of only taking "active" ones into account. The "getDefaultProduct" on product repository does exactly that.
- Additionally, reusing the "getDefaultProduct" makes testing the importer slightly less complex.
2022-10-20 17:19:52 +08:00
Naz
82ed10473b
Added 'getDefaultProduct' convenience method to product repo
refs https://github.com/TryGhost/Team/issues/1869

- There are multiple places in the codebase fetching "default product". The code is slightly divergent in each one of them and has been a source of bugs (like the one referenced). Having the logic captured in one place will allow reducing the code duplication, making code less bug prone, and making testing the modules dependent on the "setDefaultProduct" method easier
2022-10-20 17:19:52 +08:00
James Morris
02698b4559 Moved the resources to the new style
refs https://github.com/TryGhost/Team/issues/2117
2022-10-20 10:01:30 +01:00
Naz
03e0962889
Removed garbage test
no issue

- This test does nothing but occupy the disc space
2022-10-20 14:34:23 +08:00
Fabien "egg" O'Carroll
6614aa9070 Fixed add method for TiersAPI
refs https://github.com/TryGhost/Team/issues/2078

The check for creating free Tiers needs to be explicit, rather than implicit
because the type is optional, we only want to error if it is explicitly passed
as "free", not if it is missing as "paid".
2022-10-20 11:56:46 +07:00
Fabien "egg" O'Carroll
9e7b009236 Fixed edit method to accept a string
refs https://github.com/TryGhost/Team/issues/2078

This fixes a bug with the edit method where we passed a raw string
rather than ObjectID
2022-10-20 11:55:21 +07:00
Fabien "egg" O'Carroll
93e392fac1 Added error messages for monthly & yearly price validation
refs https://github.com/TryGhost/Team/issues/2078

These were missing, and will be refactored into the correct
tpl(messages.prop) format
2022-10-20 11:55:09 +07:00
Fabien "egg" O'Carroll
dfa88360ea Fixed trialDays validation to default to 0
refs https://github.com/TryGhost/Team/issues/2078

This retains current functionality
2022-10-20 11:55:01 +07:00
Fabien "egg" O'Carroll
581164ed60 Updated Tier welcomePageURL to be a string rather than URL
refs https://github.com/TryGhost/Team/issues/2078

We allow passing in relative URLs for the welcome page, so we need to accept a
string for this property.
2022-10-20 11:54:49 +07:00
Fabien "egg" O'Carroll
b607bee27f Updated Tier to use camelCase property names
refs https://github.com/TryGhost/Team/issues/2078

Having to map between snake_case and camelCase was becoming confusing, so this
updates the Tier object to exclusively use camelCase, and the snake_case for the
API can be handled by the serializer/mapper or at the controller level.
2022-10-20 11:54:18 +07:00
Fabien "egg" O'Carroll
3811169d20 Fixed visibility property on Tiers
refs https://github.com/TryGhost/Team/issues/2078

This property should be settable to either 'public' or 'none'
2022-10-20 11:54:12 +07:00
Fabien "egg" O'Carroll
0978a808d6 Refactored TiersAPI to use core slug generation
refs https://github.com/TryGhost/Team/issues/2078

This removes the burden from the Tier object, and allows us to reuse
the existing slug generation implementation we have in our bookshelf
models.
2022-10-20 11:54:03 +07:00
Daniel Lockyer
02c8690e87 Added ghost_subscription_id column to members_stripe_customers_subscriptions
refs https://github.com/TryGhost/Team/issues/2034

- this table will be used to link Stripe subscriptions to Ghost
  subscriptions via a foreign key that we add at a later point
- this also includes `constraintName` as the auto-generated one would be
  too long for MySQL 8
2022-10-20 10:59:36 +07:00
Rishabh Garg
318a5a809c
Added permissions for link edit endpoints (#15664)
refs https://github.com/TryGhost/Team/issues/2104

- adds edit permissions for links endpoints to fixtures
- new `bulkEdit` endpoint will use the permissions and allow fixing newsletter links via Admin
2022-10-20 09:11:26 +05:30
renovate[bot]
eaf6c5d1b7 Update dependency ember-svg-jar to v2.4.1 2022-10-20 10:14:41 +07:00
Rishabh Garg
60b10ad69a
Fixed permissions for links endpoint (#15656)
refs 5fcf5098a8

- links browse endpoint had permissions switched off unintentionally and was also missing the necessary permissions in fixtures.
- enables permissions for browse endpoint and adds migration insert permissions in DB
2022-10-20 08:18:29 +05:30
renovate[bot]
93e999ec1c
Update dependency mocha to v10.1.0 2022-10-19 17:53:57 +00:00
James Morris
79142c0a4c Fixed up the more like this event icons as they were too large
refs https://github.com/TryGhost/Team/issues/2106
2022-10-19 17:49:17 +01:00
Rishabh
88bda6e1b3 Handled no empty sources for attribution table
- fixes an edge case where if a site has no unavailable sources in a particular period, it broke the table view as the `Others` data doesn't get fetched
2022-10-19 20:31:48 +05:30
Rishabh
ca28ba8bae Added edited state for newsletter links
refs https://github.com/TryGhost/Team/issues/2111

- shows edited in UI next to edited newsletter links in post analytics
2022-10-19 20:25:58 +05:30
Djordje Vlaisavljevic
e6bde038ba Fixed period filter not appearing on smaller screens on dashboard
no ref
2022-10-19 16:55:33 +02:00
Simon Backx
6380b82793
Added sentiment ordering and include for posts (#15657)
fixes https://github.com/TryGhost/Team/issues/2090

- This changes how sentiment is exposed in the API. Now it is exposed as a `sentiment` relation, directly on the model (no longer in counts). Internally we still use `count.sentiment`.
- Content API users (and themes) can include the 'sentiment' relation and order by sentiment.
- Updated Admin to use sentiment instead of count.sentiment
2022-10-19 16:50:58 +02:00
Rishabh
3db8fb5a1c Wired newsletter link success/error states
refs https://github.com/TryGhost/Team/issues/2116

- wires handling of success and error messages on editing a newsletter link
- has the update api commented out temporarily to mock the changes
2022-10-19 19:23:15 +05:30
Djordje Vlaisavljevic
b310b3a97a
Added design for edited state of newsletter links
refs https://github.com/TryGhost/Team/issues/2111

- Added indicator that the link in a newsletter has been edited after sending
2022-10-19 15:33:37 +02:00
Sam Lord
68955aa704 Remove Grunt from yarn setup in Ghost core
no issue
2022-10-19 12:58:10 +01:00
Elena Baidakova
17cfdcd3a9
Updated feedback buttons url (#15655)
closes TryGhost/Team#2080
- If the post was published and emailed the link leads the user to the
post.
- If the post was just emailed the link leads the user to the home page.
2022-10-19 15:21:43 +04:00
Elena Baidakova
c65b980ada
Added tabs component (#15652)
closes TryGhost/Team#2086
2022-10-19 15:20:15 +04:00
Naz
b589a66cd4
Fixed broken CSV importer tests
refs 90768e9985

- With introduction of strict field mapping the regression test testing for "imports of not mapped fields" failed.
2022-10-19 18:33:47 +08:00
Naz
90768e9985
Added strict field mapping to member CSV importer
closes https://github.com/TryGhost/Toolbox/issues/430

- The members importer used to  import all fields present in the uploaded CSV if the headers match, even if they're not mapped in the UI. This behavior has lead to have misleading consequences and "hidden" features. For example, if the field was present but intentionally left as "Not imported" in the UI the field would still get imported.
- Having a strict list of supported import fields also allows for manageable long-term maintenance of the CSV Import API and detect/communicate changes when they happen.
- The list of the current default field mapping is:

    email: 'email',
    name: 'name',
    note: 'note',
    subscribed_to_emails: 'subscribed',
    created_at: 'created_at',
    complimentary_plan: 'complimentary_plan',
    stripe_customer_id: 'stripe_customer_id',
    labels: 'labels',
    products: 'products'
2022-10-19 18:10:40 +08:00
Naz
748ef87954
Made running the import outside of job on test env
- Allows to write tests for the importer easier when there is a "subscription" or a "product" present
2022-10-19 18:10:40 +08:00
Naz
9389064ae2
Removed unused error message
no issue

- The job-related code was ripped out form the importer and this message was just an overlooked leftover
2022-10-19 18:10:40 +08:00
Naz
1317500058
Migrated CSV parser tests to 'assert'
no issue

- Using native 'assert' module in unit tests is a preferred practice. Should is outdated and is phased out of codebase.
2022-10-19 18:10:40 +08:00
Naz
c0a415e0e1
Added strict header mapping parsing
refs https://github.com/TryGhost/Toolbox/issues/430

- Previously the CSV parser had "map whatever you can and pass on unknown properties further" approach to CSV parsing. This logic has led to unwanted fields leaking through CSV imports - messy, dangerous.
- The strict mapping rules act as a "validator" to the user input, only passing through the fields we expect explicitly - safer clean cut solution with no unintended side-effects.
2022-10-19 18:10:40 +08:00
Naz
eca4b142d2
Cleaned up csv parse test suite
refs https://github.com/TryGhost/Toolbox/issues/430

- Removed unnecessary "readCSV" leftover code.
2022-10-19 18:10:40 +08:00
Naz
f1e45f4632
Cleaned up test case names 2022-10-19 18:10:40 +08:00
Naz
f0b68846cc
Moved header mapping configuration to importer
refs https://github.com/TryGhost/Toolbox/issues/430

- To be able to introduce strict mapping rules (exclude unknown fields) we need to control the CSV header mapping on the importer level. This change moves the configuration up from CSV parser to the importer
- Also adds tests covering correct inserts for specially treated "subscribed_to_emails" field
2022-10-19 18:10:40 +08:00
Naz
c08d4f8ad1
Added basic test coverage for perform method
refs https://github.com/TryGhost/Toolbox/issues/430

- "perform()" is what gets executed by the import job for both immediate import and "inline job" import. Testing it on granular level will allow to change it with more confidence when introducing strict field mapping rules
2022-10-19 18:10:40 +08:00
Naz
8dc630b3a0
Removed cleaned up use of "Job" object
refs https://github.com/TryGhost/Toolbox/issues/430

- Importer code was filled with an unnecessarily complex "job" object that was passed around. It had an "id" property, which confusingly was a path to a file at all times.
- Simplified the logic significantly by keeping and passing around the path to a "prepared" members CSV.
2022-10-19 18:10:40 +08:00
Naz
812973d962
Removed unused concept of "status" in importer job
refs https://github.com/TryGhost/Toolbox/issues/430

- The job "status" is never anything different than "pending" and never leaves the module itself. It's an outdated concept that only takes up lines of code!
2022-10-19 18:10:40 +08:00
Naz
2175d64095
Added future investigation note
refs https://github.com/TryGhost/Toolbox/issues/430

- This is a strange hardcoded value that seems like some legacy leftover concept we could do without or improve
2022-10-19 18:10:40 +08:00
Naz
d165a0017c
Extracted MembersCSVImporter to a builder method
refs https://github.com/TryGhost/Toolbox/issues/430
refs https://github.com/TryGhost/Ghost/issues/14882

- The MembersCSVImporter constructor is way to complex and needs refactoring. This complexity makes initialization in tests too bulky and makes tests hard to read.
- Having a builder method is a stopgap solution to avoid going into MembersCSVImporter refactoring too deep.
2022-10-19 18:10:40 +08:00
Naz
4300f14d79
Removed hidden row mapping in csv parser
refs https://github.com/TryGhost/Toolbox/issues/430
refs https://github.com/TryGhost/Ghost/issues/14882

- Having an explicit mappings passed into the members CSV parser makes it easier to control and understand the transforms for package clients
- Eventually the parser will receive a strict map with the fields it should parse - skipping all unknown & unmapped fields
2022-10-19 18:10:40 +08:00
Naz
971a562b46
Added JSDoc to members csv parser
refs https://github.com/TryGhost/Toolbox/issues/430

- Typings make developer's life nicer
2022-10-19 18:10:40 +08:00
Naz
1c746c0ca0
Added test coverage for 'subscribed' transform
refs https://github.com/TryGhost/Toolbox/issues/430

- Not having any extra logic in the mapper will allow to have a generalized "mapping" concept for CSV input serialization
- This is groundwork for stricter header value filtering on the parsing stage
2022-10-19 18:10:40 +08:00
Naz
bc70835890
Increased test coverage
refs https://github.com/TryGhost/Toolbox/issues/430

- The bonus of using the module exports file is that it also gets included in the test coverage statistics ^_^
2022-10-19 18:10:40 +08:00
Naz
f38950c022
Fixed typo 2022-10-19 18:10:40 +08:00
Naz
6c9cfe8f24
Fixed typo 2022-10-19 18:10:29 +08:00
Naz
7a1389954b
Updated JSDoc and fixed typos 2022-10-19 18:10:29 +08:00
Djordje Vlaisavljevic
d14dd3e3ae Fixed overflow for newsletter links
refs https://github.com/TryGhost/Team/issues/2067
2022-10-19 12:59:54 +05:30
Djordje Vlaisavljevic
e3c03bb754 Added newsletter links editing explanation text
refs https://github.com/TryGhost/Team/issues/2067
2022-10-19 12:59:54 +05:30
Djordje Vlaisavljevic
6b46f3f295 Made edit link button always visible
refs https://github.com/TryGhost/Team/issues/2067
2022-10-19 12:59:54 +05:30
Fabien "egg" O'Carroll
4f54cbc37a Supported payment URL in Portal
refs https://github.com/TryGhost/Team/issues/2078

As part of decoupling Stripe from the members feature, we are going to be using
payment URLs rather than Stripe sepcific session ids and publick keys.

This prepares Portal to work with the new system, whilst retainign the existing
functionality
2022-10-19 11:06:10 +07:00
Fabien "egg" O'Carroll
fbc23a624e Refactored Tiers logic into separate package
refs https://github.com/TryGhost/Team/issues/2078

This pulls the current Tiers logic into its own package, the persistence part of
the work has not been done yet, that will be handled in core, so all bookshelf
model specific stuff is kept together.
2022-10-19 11:05:09 +07:00
renovate[bot]
6eaeaad5f2
Update dependency ember-template-lint to v4.16.1 2022-10-18 23:25:57 +00:00
Daniel Lockyer
9b8c33484d
Merged v5.19.3 into main
v5.19.3
2022-10-19 06:22:38 +07:00
Ghost CI
e1e5a7b35e v5.19.3 2022-10-18 16:18:29 +01:00
Simon Backx
a822c5a8c5 Added test to check if feedback buttons are hidden if alpha flag is disabled 2022-10-18 16:47:06 +02:00
Simon Backx
8ecf0a5858 🐛 Fixed alpha feature visible in new newsletters
no issue
2022-10-18 16:38:59 +02:00
Simon Backx
a01fb5f1aa
Added post_id filter and total to activity feed API (#15650)
fixes https://github.com/TryGhost/Team/issues/2091
fixes https://github.com/TryGhost/Team/issues/2089

- Added new fixtures to make testing easier for the activity feed
- Improved E2E test coverage of activity feed with separate test file
- Added data.post_id filter to enable filtering by events related to a
given post
- Fixed return types in JSDoc of test agents (TypeScript interprets
these as `typeof Agent` if we don't add `InstanceType<Agent>`)
- Added total pagination metadata to activity feed API (to allow a basic
type of pagination using filters)
2022-10-18 15:52:04 +02:00
renovate[bot]
2f43e71f7f
Update dependency ember-template-lint to v4.16.0 2022-10-18 10:21:09 +00:00
Kevin Ansfield
95cfb48c2d Fixed broken ember-svg-jar asset viewer
no issue

- downgraded to `2.3.4` because `2.4.0` is missing the asset viewer assets, see https://github.com/voltidev/ember-svg-jar/issues/233
2022-10-18 11:18:20 +01:00
Daniel Lockyer
2dcc4139b1
Merged v5.19.2 into main
v5.19.2
2022-10-18 17:04:23 +07:00
Djordje Vlaisavljevic
a014b5838a
Added design for success and error states for editing newsletter links
refs https://github.com/TryGhost/Team/issues/2095
refs https://github.com/TryGhost/Team/issues/2098

- Added success state design for editing links in newsletters
- Added error state for invalid URL when editing links in newsletters
2022-10-18 10:53:34 +02:00
Ghost CI
14a259b828 v5.19.2 2022-10-18 09:51:41 +01:00
Simon Backx
d1e6870740
🐛 Fixed large mailgun recipient data (#15638)
fixes https://github.com/TryGhost/Team/issues/2096

When generating the recipient data for emails, the email clicks
implementation is resulting in a recipient variable being added called
replacement_xxx once for each link containing the same UUID.

This generates a lot of unnecessary data overhead for emails, and it
turns out that mailgun has a 25MB message limit. We wouldn't have come
close if we only included the uuid once.
2022-10-18 10:32:50 +02:00
Daniel Lockyer
18c52f2a2a
Improved jsdoc for permission migration utils
- this helps with readability and editor autocomplete
2022-10-18 14:38:58 +07:00
Daniel Lockyer
3858f255b9 Dropped nullable status on subscriptions.tier_id
fixes https://github.com/TryGhost/Team/issues/2102

- this column was added with `nullable: true` but it should never be
  nullable, so we should drop the nullable status whilst it's easy to
2022-10-18 14:16:30 +07:00
Daniel Lockyer
2d324ea315
Fixed various code nits with schema command utils
- de-duped the exports at the bottom if they export the same name as the
  function
- added types to all functions, or fixed existing ones
- renamed `table` to `tableBuilder` to represent it better
- these should help with code readability and autocomplete in editors
2022-10-18 11:07:12 +07:00
Daniel Lockyer
c9d43b8fe1
Allowed constraintName in schema column spec
refs 0ba3d6df49

- this is used to indicate the name of the foreign key constraint and so
  we should let it through the schema checks
2022-10-18 10:29:55 +07:00
Daniel Lockyer
0ba3d6df49 Added support for supplying the foreign key constraint name
- this allows us to choose the foreign key constraint name when the
  auto-generated one would be too long
2022-10-18 10:25:14 +07:00
Simon Backx
0bb7538cd1
Added feedback events to activity feed (#15639)
fixes https://github.com/TryGhost/Team/issues/2051
fixes https://github.com/TryGhost/Team/issues/2052
2022-10-17 15:44:18 +02:00
Kevin Ansfield
f78f264982
Fixed PromiseObject related errors thrown from members activity list (#15641)
no issue

- the `memberRecord` getter on the members activity controller was
returning the direct result of `store.findRecord()` which in reality is
a `PromiseObject` that is a type of proxy. Although templates handle
this OK, any JS code using the object needs to know that it's not a
typical type of object and has to use `.get()` for all property access
to avoid errors
- switched `memberRecord` from a getter to a resource so we have more
control over the returned object and loading lifecycle
- added a `MemberFetcher` resource class that awaits the result of the
store find and only then sets the value meaning we always have a fully
resolved model object
- being a resource the fetch will only occur when the `member` id
property changes, unlike the getter which performed the fetch every time
it was accessed
2022-10-17 15:28:34 +02:00
Simon Backx
22fe1c01de
Added conversions count and separate analytics page (#15637)
fixes https://github.com/TryGhost/Team/issues/2084

- When audience feedback is enabled, we use a single 'conversions' count instead of having separate ones for signups and paid conversions.
- The analytics component is separated so we can change it without breaking the existing page.
2022-10-17 13:02:39 +02:00
Daniel Lockyer
b6d2d97af2
Merged v5.19.1 into main
v5.19.1
2022-10-17 17:48:02 +07:00
Ghost CI
9a2fcba68a v5.19.1 2022-10-17 11:45:59 +01:00
Naz
66c2d3748a
🐛 Fixed 404 collection links for new tags
closes https://github.com/TryGhost/Ghost/issues/15608
closes https://github.com/TryGhost/Toolbox/issues/437
refs https://github.com/bookshelf/bookshelf/issues/2111
refs https://github.com/knex/knex/issues/1641

- When new tag was attached to the post the tag collection link returned 404 - instead of a collection with one post
- The root cause of the issue and it's flaky behavior (sometimes the collection link was returning correctly) was a race condition between event propagation in routing for "tag.attached" event and the post+tag+relations transaction completion
- The race condition was happening as the bookshelf-transaction-events plugin was emitting the 'committed' event BEFORE the transaction was committed!
2022-10-17 18:21:10 +08:00
renovate[bot]
e9587e02d0
Update dependency mocha to v10.1.0 2022-10-17 08:41:28 +00:00
renovate[bot]
f63fef11ed Update dependency util to v0.12.5 2022-10-17 15:37:56 +07:00
Ronald Langeveld
7a0c6de2d7
Added imageUpload function to Lexical Editor (#15634)
no issue

- A basic image upload function for testing the image card of the new Lexical Koenig Editor.
2022-10-17 15:31:55 +07:00
Peter Zimon
378a6f9326 Fixed loading animation for Safari
no refs.

- the size of the loading animation in Safari wasn't set correctly and didn't always start automatically
2022-10-17 10:11:07 +02:00
Daniel Lockyer
eb30e464d3
Added handling for unsuccessful comments API requests
refs https://github.com/TryGhost/Team/issues/2082

- in the event the API doesn't return a 200 OK, we shouldn't be
  processing the response from it, as we can end up doing weird things
  if, for example, an error object is returned
2022-10-17 12:07:18 +07:00
Daniel Lockyer
1dab16c9c1 Added handling for unsuccessful comments API requests
refs https://github.com/TryGhost/Team/issues/2082

- in the event the API doesn't return a 200 OK, we shouldn't be
  processing the response from it, as we can end up doing weird things
  if, for example, an error object is returned
2022-10-17 11:59:32 +07:00
Daniel Lockyer
7ac0fdb23d
Fixed unnecessary requests with loading comment counts
refs https://github.com/TryGhost/Team/issues/2082

- if a site has comments enabled but doesn't use the `comments_count`
  helper, the comments-count.min.js will still be loaded and it'll send
  a POST request to Ghost with an empty array of post IDs to fetch
- this is unnecessary and we should avoid this extra request for pages
  that don't need to show comment counts
- this commit prevents the comment-counts JS from sending the request if
  there are no post IDs to fetch
2022-10-17 11:51:14 +07:00
Daniel Lockyer
fd9401503b Fixed unnecessary requests with loading comment counts
refs https://github.com/TryGhost/Team/issues/2082

- if a site has comments enabled but doesn't use the `comments_count`
  helper, the comments-count.min.js will still be loaded and it'll send
  a POST request to Ghost with an empty array of post IDs to fetch
- this is unnecessary and we should avoid this extra request for pages
  that don't need to show comment counts
- this commit prevents the comment-counts JS from sending the request if
  there are no post IDs to fetch
2022-10-17 11:07:16 +07:00
Ronald Langeveld
6b7088ba20 Bumped kg-lexical-html-renderer version
no issue

- Bumped from 0.0.8 to 0.0.9
2022-10-17 08:44:30 +07:00
Daniel Lockyer
54c143a1b4
Fixed optional syntax style for jsdoc
refs https://jsdoc.app/tags-param.html#optional-parameters-and-default-values

- using an equals sign in the type definition is part of the Google
  Closure syntax but we use the JSDoc syntax in all other places, and
  tsc detects the different syntax
- this commit standardizes the syntax ahead of enforcing a certain style
  down the line
2022-10-16 14:48:05 +07:00
Rishabh
fdff8814b1 Bumped portal package.json to latest version
refs d381ff87b8

- portal was bumped to 2.15 but the version in package json didn't get auto-updated
2022-10-14 22:15:02 +05:30
Elena Baidakova
46141efe05
Updated test snapshot after bumping Portal (#15623) 2022-10-14 20:29:46 +04:00
Elena Baidakova
d381ff87b8
Added ability to handle feedback links from emails (#15622) 2022-10-14 20:11:44 +04:00
Djordje Vlaisavljevic
097b232524
Fix newsletter links (#15621)
Added a button for editing links in newsletters after sending to the
Post analytics page

Co-authored-by: Rishabh <zrishabhgarg@gmail.com>
2022-10-14 18:09:42 +02:00
Ghost CI
4e3afadfef v5.19.0 2022-10-14 16:00:45 +01:00
Elena Baidakova
e831be6bc2
Added the feedback buttons in the emails (#15619)
closes TryGhost/Team#2046
closes TryGhost/Team#2045
- Added feedback buttons markup.
- Added feedback links generation.
2022-10-14 18:12:17 +04:00
James Morris
e074676e12 Updated engagement bar metrics so when no link it doesn't hover
no issue
2022-10-14 12:19:29 +01:00
James Morris
60ce10be9f Fixed up more like this and newsletter clicks table at narrower viewports
no issue
2022-10-14 11:18:56 +01:00
Fabien "egg" O'Carroll
370ded5c77 Stored price and currency data on Tiers when creating & editing
refs https://github.com/TryGhost/Team/issues/2029

This will allow us to start decoupling the Stripe side of things once we've got
the core data stored. We've also add some integrity checks on the incoming
monthly_price and yearly_price to ensure they are the same currency.
2022-10-14 16:31:26 +07:00
Fabien 'egg' O'Carroll
8afc6777c0
🐛 Removed redirects from search engine indexing (#15617)
refs https://github.com/TryGhost/Team/issues/2072

Google is indexing our redirects and storign the redirected content
against the redirect URL in search results. This seems to be caused by
us using a 302 redirect rather than 301. We don't want to switch to a
301 however, so that we can support the ability to update redirects in
the future.
2022-10-14 15:51:43 +07:00
Fabien 'egg' O'Carroll
bd0f4b4b8c
Added Tier price and currency data to products table (#15366)
refs https://github.com/TryGhost/Team/issues/1765

In order to better handle deleted objects in Stripe we want to decouple
Members from Stripe.

These changes allow us to have the Tier concept completely independent
of the Stripe tables, such that the Stripe data can be generated as/when
it's needed - which will help to protect against missing data.
2022-10-14 06:40:17 +01:00
Barno
5c361670ce
Replaced Promise.each() with .all() in models/base/bookshelf (#15509)
refs: https://github.com/TryGhost/Ghost/issues/14882

- Removing bluebird specific methods in favour of native promises so we can remove the bluebird dependency.

Co-authored-by: Carol-Barno <cbarno@innovexsolutions.co.ke>
Co-authored-by: Hannah Wolfe <github.erisds@gmail.com>
2022-10-13 15:24:05 +01:00
renovate[bot]
63f90c2305
Pinned dependencies (#15612)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-10-13 18:48:09 +07:00
jbenezech
75811f35bc
🐛 Fixed embedded cards for non-utf8 content (#15578)
closes: https://github.com/TryGhost/Ghost/issues/14973

- When fetching content using a non-standard charset, characters were notproperly decoded to utf-8 resulting in mangled text in the editor -> Detect charset and use iconv to decode the page text

- When requesting a non bookmark card, if no oembed data could be foundand we fallback to bookmark, a second network request to fetch the content was issued. This seemed unnecessary -> refactored to avoid that
2022-10-13 12:19:47 +01:00
Kritika Sharma
76e906d498
Added e2e tests for post.tag.detached webhoo (#15610)
refs: https://github.com/TryGhost/Ghost/issues/15537

- snapshot test created to add confidence to webhook stability and increase overall test coverage.

Co-authored-by: Kritika Sharma <kritikasharma@Kritikas-MacBook-Pro-2.local>
2022-10-13 11:53:18 +01:00
Prathamesh Gawas
3424222597
🐛 Fixed redirects with special characters (#15533)
closes: https://github.com/TryGhost/Ghost/issues/15267

- This was because the URLs were not being encoded and matched correctly - it is solved by encoding the URL before adding to the router.
2022-10-13 11:41:20 +01:00
Shubhadeep Das
e2124314ed
Added e2e tests for page.scheduled webhook (#15609)
refs: https://github.com/TryGhost/Ghost/issues/15537

- snapshot test created to add confidence to webhook stability and increase overall test coverage.
2022-10-13 11:20:42 +01:00
Halldor Thorhallsson
74f7b7b3ee
Added e2e test for site.changed webhook event (#15595)
refs: https://github.com/TryGhost/Ghost/issues/15537

- snapshot test created to add confidence to webhook stability and increase overall test coverage.
2022-10-13 11:05:31 +01:00
Rishabh Garg
e05889cd53
🐛 Fixed missing accent color for default content cta (#15611)
refs https://github.com/TryGhost/Casper/issues/901

- the site accent color property on default cta for upgrade link had a typo and was using wrong property
2022-10-13 13:42:21 +05:30
Elena Baidakova
2c7ade78d7
🐛 Fixed color of member alert email links (#15582)
closes TryGhost/Team#2015
- Gmail wraps emails in link and added them custom styles. Was added fix
to reset Gmail styles.
2022-10-13 10:42:04 +04:00
Elena Baidakova
67b65538cf
Added toggle to enable/disable audience feedback in admin (#15601)
closes TryGhost/Team#2043
- Added ability to enable like/dislike buttons for each newsletter.
- Buttons color calculated from accent color.
2022-10-13 10:24:46 +04:00
Daniel Lockyer
bd3add9747
Switched to US spelling of cancelled in schema validation
refs https://github.com/TryGhost/Team/issues/2030

- we tend to use US spellings in the code and this was merged with the
  British spelling
- nothing has been added to this table yet so it's safe to switch
2022-10-13 11:53:07 +07:00
Naz
4db0be603f Added subscriptions table
refs https://github.com/TryGhost/Team/issues/2030

- adds `subscriptions` table to the DB schema
- this new table is aimed to support a native "subscription" primitive in Ghost
  that most resembles previously used `members_stripe_customers_subscriptions` table
2022-10-13 11:19:13 +07:00
Daniel Lockyer
74e1d52d6a Fixed incorrect maximum length definition in schema
refs https://github.com/TryGhost/Toolbox/issues/441

- whilst reviewing another PR, I noticed we were incorrectly using
  `maxLength` instead of `maxlength` in the schema column definition
- it turns out we've already been doing this wrong for a while with
  other columns
- this key is not acted upon, so the maximum column length was not applied
- fixing up the DB to the correct maximum length is something to fix in the
  future but right now, the schema does not reflect the size of the
  column that actually got created
- the fallback when `maxlength` is not provided is currently 191 [0], so
  this commit switches the schema and migrations to using the correct
  key name and column length that they are using when applied

[0]: 24670aa555/ghost/core/core/server/data/schema/commands.js (L27)
2022-10-13 09:58:19 +07:00
Daniel Lockyer
143ae857c9 Removed bool type from schema
refs https://github.com/TryGhost/Toolbox/issues/441

- we tend to have a mix of `bool` and `boolean` in the schema and
  migrations, which has become a real nit for me at this point
- we don't do any special handling between `bool` and `boolean`, it's
  just something we pass to Knex
- `bool` is an alias for `boolean` but `boolean` is actually documented - https://knexjs.org/guide/schema-builder.html#boolean
- this commit switches Ghost to only using `boolean` in the schema and
  migrations, and removes `bool` from the allowlist in tests to prevent
  us from adding it again in the future
- this should make absolutely no difference to the DB because both
  resulted in the same column
2022-10-13 09:37:38 +07:00
renovate[bot]
3917a058a4 Update dependency ember-classic-decorator to v3.0.1 2022-10-13 09:07:30 +07:00
Naz
5b8b18ded1
Moved csv parser utility method
refs https://github.com/TryGhost/Toolbox/issues/430

- The 'readCSV' method was only exposed to be used in the unit tests. To keep the module code to the minimum moved readCSV to the unit test itself - the only place where it's used and belongs to.
2022-10-13 09:53:16 +08:00
Naz
9e20544927
Fixed typo 2022-10-13 09:53:16 +08:00
Naz
71bed4f926
Fixed jsdoc to only mention used parameters
refs https://github.com/TryGhost/Toolbox/issues/430

- It's a minor cleanup while exploring the referenced bug surface area. Fixes distracting "missing parameters" warnings
2022-10-13 09:53:16 +08:00
Daniel Lockyer
24670aa555
Fixed validating numbers as booleans in schema validator
refs https://github.com/TryGhost/Toolbox/issues/441

- I'm currently working on cleaning up our uses of `bool` and `boolean`
  in favor of `boolean`, and I've noticed we only handle converting
  numbers into booleans when the type is `bool`, so validation would
  otherwise fail
- given these can be used interchangeably, we should also support
  converting the numbers into booleans when the type is `boolean`
- this is going to get cleaned up again when I remove `bool` but this
  fixes the validation bug for now
2022-10-13 08:20:31 +07:00
renovate[bot]
f5774fad0c Update dependency postcss to v8.4.18 2022-10-13 08:08:05 +07:00
renovate[bot]
fd2b068e3f
Update dependency cron-validate to v1.4.4 2022-10-12 21:11:14 +00:00
Kritika Sharma
2cb4282fa8
Added e2e tests for post.tag.attached webhook (#15576)
refs: https://github.com/TryGhost/Ghost/issues/15537

- snapshot test created to add confidence to webhook stability and increase overall test coverage.

Co-authored-by: Kritika Sharma <kritikasharma@Kritikas-MacBook-Pro-2.local>
2022-10-12 21:53:02 +01:00
jennyxchang
0bc31ded1b
Added e2e tests for post.scheduled event (#15561)
refs https://github.com/TryGhost/Ghost/issues/15537

- Added e2e test for post.scheduled event to increase webhook test coverage
2022-10-12 21:18:08 +01:00
Christa
87d21662bc
🐛 fixed error message code for HB translate helper (#15529)
closes: https://github.com/TryGhost/Ghost/issues/15500

- Per the issue, Ghost has a policy to never throw 500 Internal Server errors for theme issues. This change adds a check inside of `ghost\core\core\frontend\helpers\t.js` if `text` or `options` is undefined, to throw an `IncorrectUsageError` error within the function.
- Messaging was borrowed from `ghost\core\core\frontend\web\middleware\error-handler.js`.
2022-10-12 21:14:53 +01:00
Shubhadeep Das
8374c73e52
Added e2e tests for tag.edited webhook (#15555)
refs: https://github.com/TryGhost/Ghost/issues/15537

- this adds an e2e test and test snapshot for the `tag.edited` webhook so we can prevent regressions and bugs in the future

Co-authored-by: Hannah Wolfe <github.erisds@gmail.com>
2022-10-12 20:00:04 +01:00
Sam Lord
0c18060f61 Added metric for sending transactional email with mailgun
refs: https://github.com/TryGhost/Toolbox/issues/439

This case completes the monitoring of mailgun.js usage within Ghost.
2022-10-12 16:52:51 +01:00
Hannah Wolfe
168fa64395
Updated webhook snapshot for member.deleted
refs: 3ae1e48917
refs: 1221ba5d1d

- We added a new field between the PR being raised and merged, so the snapshot went out-of-date
2022-10-12 16:04:57 +01:00
illiteratewriter
3ae1e48917
Added e2e tests for member.deleted webhook (#15570)
refs: https://github.com/TryGhost/Ghost/issues/15537

- snapshot test created to add confidence to webhook stability and increase overall test coverage.
2022-10-12 14:35:24 +01:00
Kritika Sharma
2ce0727794
Added e2e tests for post.deleted webhook (#15572)
refs: https://github.com/TryGhost/Ghost/issues/15537

- Added  missing e2e tests for post.deleted webhook to increase coverage 

Co-authored-by: Kritika Sharma <kritikasharma@Kritikas-MacBook-Pro-2.local>
2022-10-12 14:32:01 +01:00
jbenezech
3d44e37cbd
🐛 Fixed sitemaps with no content (#15571)
closes: https://github.com/TryGhost/Ghost/issues/14981

- Taxonomy-specific sitemaps were invalid xml when there was no data
- These invalid empty sitemaps were referenced in the index sitemap causing SEO tools to report errors
2022-10-12 14:11:19 +01:00
jbenezech
b9dd9f066d
🐛 Fixed settings overriden when updated from multiple tabs (#15536)
closes: https://github.com/TryGhost/Ghost/issues/15470

- When multiple browser tabs are open, each manipulate a different copy of ember data model, changes to the model in one tab are not reflected in the model of the other tab.
- When updating some settings, all current settings were sent to the API.
- As a result, when updating two different categories of settings (navigation/code inspection) in different tabs, the second update was overriding the first one.
- From a user perspective, this is not a natural behaviour. Only settings visible on-screen when clicking save should be modified.

Co-authored-by: Kevin Ansfield <kevin@lookingsideways.co.uk>
2022-10-12 14:03:54 +01:00
Daniel Lockyer
845f8d965e
Added test to validate schema structure
refs https://github.com/TryGhost/Toolbox/issues/441

- this is only v1 of the test I would like but it validates the keys on
  a column definition are part of an allowlist
- this has already uncovered a bug with `maxLength` (vs `maxlength`)
2022-10-12 19:19:33 +07:00
renovate[bot]
178df69ae2 Update dependency @playwright/test to v1.27.1 2022-10-12 17:55:29 +07:00
Daniel Lockyer
5aeaa977fd
Pinned moment dependency
- this shouldn't make any difference because `moment` has a resolution but we take
  the approach of pinning all our dependencies in this repository
2022-10-12 15:42:46 +07:00
Daniel Lockyer
e2ba19b0df
Fixed import of bson-objectid in accordance to the typings
- there's a few different ways we can import it but I've chosen to
  append `.default` as we have done in several other places in the code
2022-10-12 14:54:35 +07:00
Daniel Lockyer
2422f4a95c
Fixed minor jsdoc typing issue regarding arrays
- `[string]` indicates an array with exactly one item but we actually
  want the type to be `string[]` to indicate an array of strings
2022-10-12 14:52:59 +07:00
Daniel Lockyer
b3ee6a4c9e
Promoted sourceAttribution flag to private beta
refs https://www.notion.so/ghost/Source-attribution-7ad2f4f75b4a458f8d8090ad75d9359e

- this allows us to enable the feature for private testing before we
  continue with GA'ing it
2022-10-12 13:46:35 +07:00
Rishabh
6b7f4dd1c7 Fixed cursor for attribution table header
refs https://github.com/TryGhost/Team/issues/1986
2022-10-12 10:51:13 +05:30
Daniel Lockyer
727187df32
Added missing jsdoc imports for PaymentsService
- this helps with populating types in editors
2022-10-12 11:08:49 +07:00
renovate[bot]
ab598dd7ea Update dependency minimist to v1.2.7 2022-10-12 10:16:31 +07:00