Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge #1

Merged
merged 186 commits into from Oct 24, 2022
Merged

Merge #1

merged 186 commits into from Oct 24, 2022

Conversation

CarolBarno
Copy link
Owner

Got some code for us? Awesome 🎊!

Please include a description of your change & check your PR against this list, thanks!

  • There's a clear use-case for this code change, explained below
  • Commit message has a short title & references relevant issues
  • The build will pass (run yarn test:all and yarn lint)

We appreciate your contribution!

Also, if you'd be interested in writing code like this for us more regularly, we're hiring:
https://careers.ghost.org

allouis and others added 30 commits October 14, 2022 06:40
refs TryGhost/Product#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.
refs TryGhost/Product#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.
refs TryGhost/Product#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.
closes TryGhost/Team#2046
closes TryGhost/Team#2045
- Added feedback buttons markup.
- Added feedback links generation.
Added a button for editing links in newsletters after sending to the
Post analytics page

Co-authored-by: Rishabh <zrishabhgarg@gmail.com>
refs d381ff8

- portal was bumped to 2.15 but the version in package json didn't get auto-updated
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
no issue

- Bumped from 0.0.8 to 0.0.9
refs TryGhost/Product#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
refs TryGhost/Product#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
refs TryGhost/Product#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
refs TryGhost/Product#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
no refs.

- the size of the loading animation in Safari wasn't set correctly and didn't always start automatically
no issue

- A basic image upload function for testing the image card of the new Lexical Koenig Editor.
closes #15608
closes TryGhost/Toolbox#437
refs bookshelf/bookshelf#2111
refs knex/knex#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!
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.
…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
- this allows us to choose the foreign key constraint name when the
  auto-generated one would be too long
refs 0ba3d6d

- this is used to indicate the name of the foreign key constraint and so
  we should let it through the schema checks
- 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
h2akim and others added 27 commits October 21, 2022 21:03
fixes:  #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`
closes: #15507

- manually handle relationship changes detection labels and newsletters
- add `dirtyAttributes` controller property - return newsletters and labels dirty attributes status
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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.
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.
refs TryGhost/Product#1076
refs 70229e4#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)
refs TryGhost/Product#1076

- "product" in the context of members has been deprecated since introduction of "tiers"
…cribe

- 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
refs: #15537

- snapshot test created to add confidence to webhook stability and increase overall test coverage.
refs: #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>
refs: 26d0499
refs: 8c2f832

- snapshots fell behind between the two referenced commits, and needed updating
@CarolBarno CarolBarno merged commit 7f228ed into CarolBarno:main Oct 24, 2022
CarolBarno added a commit that referenced this pull request Oct 24, 2022
This reverts commit 7f228ed.
@CarolBarno CarolBarno mentioned this pull request Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet