Commit Graph

28900 Commits

Author SHA1 Message Date
Daniel Lockyer
fbcdacbd83 v5.2.1 2022-06-02 12:34:53 +01:00
Daniel Lockyer
e3223cd9a7 Updated Admin to v5.2.1 2022-06-02 12:34:53 +01:00
Simon Backx
bd1f11f147 Added test timeout hint to README 2022-06-02 13:20:05 +02:00
Simon Backx
549e8c526f Added newsletter slug generation to mirage 2022-06-02 13:19:52 +02:00
Naz
c9758112b3 🐛 Fixed an error when updating a user
closes https://github.com/TryGhost/Team/issues/1655
refs https://github.com/TryGhost/Ghost/commit/4bc14d2c4

- The API should always accept the input it returns. In this case it did not accept the input when it contained an unchanged roles property
- The problem here came from the referenced commit where we can now end up in the situation when the `roleToAssign` is just empty. It was an optimization to prevent a need to do ANY DB operation when none was needed.
2022-06-02 12:13:27 +01:00
Simon Backx
7c04c2c472 Added test to see if newsletter is saved 2022-06-02 12:58:10 +02:00
Simon Backx
d5887c6ac0 Added tests for newsletter limits
refs https://github.com/TryGhost/Team/issues/1477
2022-06-02 11:21:29 +02:00
Simon Backx
557e268445 Added newsletter archiving tests
refs https://github.com/TryGhost/Team/issues/1477
2022-06-02 10:39:17 +02:00
Simon Backx
fb1b9b5f1f Added test documentation to README
no issue
2022-06-02 10:38:51 +02:00
Renovate Bot
073d1f4deb Update dependency @tryghost/errors to v1.2.14 2022-06-02 01:49:26 +00:00
Sanne de Vries
1e76022a28 Fixed post bookmark shifting layout bug 2022-06-01 18:26:20 -04:00
Daniel Lockyer
264678e9be
Prevented certain GitHub Actions workflows from running on forks
fixes https://github.com/TryGhost/Toolbox/issues/285

- without this, some of the workflows that are only useful for the core
  team will run on forks
- this commit adds checks to ensure we're running on a repo maintained
  by the TryGhost organization for a handful of workflows
2022-06-01 17:54:26 -04:00
Sanne de Vries
5e7678b239 Fixed empty states spacing regression 2022-06-01 17:31:23 -04:00
Daniel Lockyer
a6efdbf1db v5.2.0 2022-06-01 16:28:51 +01:00
Daniel Lockyer
facf16becc v5.2.0 2022-06-01 16:28:51 +01:00
Daniel Lockyer
06868f81c6 Updated Admin to v5.2.0 2022-06-01 16:28:51 +01:00
Daniel Lockyer
47cca9b773 🎨 Updated Casper to v5.1.3 2022-06-01 16:28:50 +01:00
Matt Hanley
54d88cf689 Updated packages 2022-06-01 16:07:14 +01:00
Fabien 'egg' O'Carroll
6c455dc1f2
🐛 Fixed Stripe Checkout for Members w/ existing subscriptions (#14953)
refs https://github.com/TryGhost/Team/issues/1526

This adds a check for existing subscriptions for a member associated with the
email addressed used for Stripe Checkout, if any are found the Checkout Session
creation fails and responds with a 403.

We've also updated the error handling for the create-stripe-checkout-session
endpoint so that it follows the existing Ghost API patterns.
2022-06-01 15:53:05 +01:00
Simon Backx
c32b1baa9b
Added support for publishing email only posts by setting status to sent (#14950)
no issue

If you try to publish a draft email only post by setting the status to sent, you won't receive an error but the email won't get sent. This is because we don't support this behaviour. This is very counter-intuitive when writing the documentation, so I've patched this behaviour and added some more tests.
- When setting the status to `sent` for not email only posts, the post status will be set to `published` without warning
- Also published_by was not set correctly in the past. This is also fixed and has new tests.
2022-06-01 14:53:55 +02:00
Kevin Ansfield
e1dfe3edb0 🎨 Improved save/update button copy in editor (#2413)
no issue

- renamed "Update" to "Unpublish" or "Unschedule" to match the available actions
- renamed "Save" to "Update" and made it always visible but disabled when there are no unsaved changes
- switched <Editor::PublishManagement> to a provider component and extracted `<Editor::PublishButtons>`
  - allows for the management flow to wrap other UI elements and have the yielded actions passed down so the publish/update flow can be opened from more than just the publish/unschedule/unpublish buttons
- added link to "Sent" in editor status that opens the update flow for email-only posts

Co-authored-by: Peter Zimon <peter.zimon@gmail.com>
2022-06-01 13:48:33 +01:00
Naz
4bc14d2c4b 🐛 Fixed invalid user role assignment
closes https://github.com/TryGhost/Toolbox/issues/351

- When an invalid value was passed in `roles` parameter when editing a user it resulted in incorrect database state (all roles appeared to be unassigned from the user).
- The fix includes ability to set user role by an allowed name, one of:  'Administrator', 'Editor', 'Author', 'Contributor'.
- Also added a validation in case a non-ObjectID value is passed in roles to the users edit method.
2022-06-01 17:48:08 +08:00
Naz
29e5d08210 Refactored Admin API test agent to use async/await
no issue

- Improves readability of what's going on in the code.
2022-06-01 17:48:08 +08:00
Fabien "egg" O'Carroll
1256dea36e Published new versions
- @tryghost/members-api@8.1.3
2022-06-01 10:43:47 +01:00
Fabien 'egg' O'Carroll
8e2c600612 Fixed checkout session creation for existing members (#403)
refs https://github.com/TryGhost/Team/issues/1526

We weren't using the `req.body.customerEmail` to load a member and
check their existing tiers, this meant that existing members which
were signed out and attempted to create a stripe checkout session were
able to.
2022-06-01 10:40:52 +01:00
Hannah Wolfe
6271e2f5f3 Increased body parser limit to 50mb
refs: https://github.com/TryGhost/Ghost/issues/5998#issuecomment-928981043

- Starting to see more people using long form content and otherwise exceeding the 1mb internal limit
- Setting it to 50mb matches Ghost-CLI's max body for nginx
- It might be ideal at some point to make this configurable, but I think increasing the limit solves the problem very simply for the foreseeable future
2022-06-01 10:12:23 +01:00
Rishabh
c6c64c3aeb Updated single tier labels and subscription error messages
- bumps portal to refine single tier labels
- portal handles/shows custom error messages for failed checkout session creation
2022-06-01 13:44:08 +05:30
Kevin Ansfield
ed235b374d Increased publish flow acceptance tests
refs https://github.com/TryGhost/Team/issues/1586

- updated `?newsletter_id=id` handling in posts API mock to match the real `?newsletter=slug` behaviour
- added additional publish flow acceptance tests for single/multiple newsletter behaviour, scheduling, and sending
2022-05-31 22:59:20 +01:00
Renovate Bot
4feb5873b6
Update dependency express-jwt to v7.7.5 2022-05-31 21:02:21 +00:00
Peter Zimon
4d89ddf5bf Added 2 digit pad to fraction prices 2022-05-31 17:38:43 +02:00
Simon Backx
a30e42404b
Added getLazyRelation model helper method (#14943)
closes https://github.com/TryGhost/Team/issues/1626

- getLazyRelation is a safer shorthand for `model.related('relationName').fetch()`
- prevents doing a `fetch` operation on a relation that is already loaded, which can cause issues when `formatOnWrite` has a custom implementation
- uses the already loaded relation if it exists, or loads the relation
- doesn't reload if already loaded
- reload is forceable using the forceRefresh option
2022-05-31 13:21:53 +02:00
Sodbileg Gansukh
ce37e969ce Updated Casper screenshot 2022-05-31 16:47:30 +08:00
Daniel Lockyer
82a60ae155 Fixed detection of Windows environment when connecting to SQLite temp DB
fixes https://github.com/TryGhost/Toolbox/issues/284

- this section of code rewrites `/tmp` in the SQlite filename to the
  temp dir
- the fix was only intended for Windows environments, because they
  typically don't have a `/tmp` dir
- this commit adds a `process.platform` check for Windows
- it also moves the code into the DB connection file instead of the
  config lib
2022-05-30 17:42:34 -04:00
Kevin Ansfield
99f05e14b2 🐛 Fixed default publish type being "Publish and email" when default recipients set to "Usually nobody"
no issue

The default recipients setting "Usually nobody" was being respected with the email recipient list defaulting to no members selected. However the UI for that state was confusing because the default publish options ended up being "Publish and email" and "Not sent as a newsletter" but it was expected to be "Publish" with the newsletter option being disabled.

- updated the `PublishOptions` setup to reflect the desired outcome for "Usually nobody"
  - default publish type is set to "Publish"
  - default email recipients are set to match post visibility - this means there are fewer clicks required when switching from "Publish" to "Publish and send"
- updated mirage data setup so any members created are automatically assigned to any newsletter instance with `subscribeOnSignup` set
  - ensures we get proper member counts in the publish flow
2022-05-30 20:04:04 +01:00
Renovate Bot
4ddba47b00
Update dependency express-jwt to v7.7.3 2022-05-30 18:31:17 +00:00
Kevin Ansfield
3f0e46c7b0 Added initial tests for new publish flow
refs https://github.com/TryGhost/Team/issues/1586

- added test helper for enabling/disabling members and helpers for disabling mailgun and newsletters
- added `loginAsRole` helper that alleviates duplication of user+role creation and also handles log-out before log-in so it's easier to mix different role tests within a block that has a default role setup in `beforeEach()`
- cleaned up editor tests that were skipped due to using the old publish flow
- added `Publish flow` acceptance test suite with an initial batch of tests
2022-05-30 19:12:16 +01:00
Renovate Bot
367ad86e24
Update dependency knex-migrator to v4.2.11 2022-05-30 15:39:08 +00:00
Simon Backx
9d21a14b4b
Added integration test for MEGA.sendEmailJob (#14944)
closes https://github.com/TryGhost/Team/issues/1632
2022-05-30 15:41:02 +02:00
Kevin Ansfield
b123b297b6 Improved test settings fixtures
no issue

- the settings fixtures file was becoming hard to use because settings have been appended to it on an as-used basis which meant it was difficult to reason about the base-state in acceptance tests and was never really in sync with the default settings state for a Ghost site
- added a utility function to create a settings object with the `id` defined to avoid problems with manually updating the ids in the list
- updated to include all default settings with their default values if not already set to a specific testing value in the old fixtures
2022-05-30 14:09:29 +01:00
Simon Backx
da8cb5c078
Added possible fix for random test timeouts
no issue

Some tests timeout for an unknown reason. This commit adds some missing awaits for async test methods (that don't perform any async operation, but are marked as async).
2022-05-30 15:00:55 +02:00
Daniel Lockyer
438526641b v5.1.1 2022-05-30 13:54:29 +01:00
Daniel Lockyer
3d0e4c9380 v5.1.1 2022-05-30 13:54:28 +01:00
Daniel Lockyer
d9e5092ec5 Updated Admin to v5.1.1 2022-05-30 13:54:28 +01:00
Kevin Ansfield
e4b402c603 Sped up tests that use {{liquid-if}}
no issue

- some tests were unnecessarily slowed down by waiting repeatedly for animations to complete
- added override for `<LiquidContainer>` component that `<LiquidIf>` uses internally with the only change being to set the default growth animation duration to 5ms when running tests
2022-05-30 12:10:37 +01:00
Djordje Vlaisavljevic
ac52e01977 Put less emphasis on the "Send test email" button 2022-05-30 12:42:13 +02:00
Renovate Bot
8c601a411f
Update metascraper 2022-05-30 01:34:06 +00:00
Kevin Ansfield
09400a1ef8 🐛 Fixed broken file selectors in labs, general, and portal settings screens
refs 8fee5f155b

- the conversion from jQuery to native was incomplete in a few places and still used `.find()` in place of `.querySelector()`
2022-05-29 11:18:55 +01:00
Daniel Lockyer
302c257560 v5.1.0 2022-05-27 16:10:20 +01:00
Daniel Lockyer
f9736d2437 v5.1.0 2022-05-27 16:10:19 +01:00
Daniel Lockyer
b86756c36b Updated Admin to v5.1.0 2022-05-27 16:10:19 +01:00