Commit Graph

31551 Commits

Author SHA1 Message Date
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