Commit Graph

15710 Commits

Author SHA1 Message Date
Djordje Vlaisavljevic
3dc85b0397 Added static Mentions widget behind the flag
refs https://github.com/TryGhost/Team/issues/2481
2023-01-24 15:55:37 +00:00
Cathy Sarisky
9db27cfd50
remove hardcoded values from Portal (#15661)
Portal currently has a Globals.js file that spells out all the colors in use in Portal, which should make it easy to customize the portal colors to match the chosen theme. There are a bunch of hardcoded values and this PR deals with those. The final outcome of these changes is absolutely invisible.

Co-authored-by: Peter Zimon <zimo@ghost.org>
2023-01-24 13:23:11 +01:00
Fabien "egg" O'Carroll
48e9393159 Removed flaky test
This test is failing because the `sleep` isn't long enough. Removing this test
until we've refactored to use the jobs service, at which point we can remove the
sleep and wait for the job to be complete.
2023-01-24 18:50:04 +07:00
Fabien "egg" O'Carroll
169eb6046e Fixed RoutingService checks for resource existence
We were incorrectly handling a "no resource found" return value from the
ResourceService, instead of an object with `null` values, we were expecting a
`null` value - so we were considering all URL's to be pointing toward a
resource.
2023-01-24 18:00:52 +07:00
Rishabh Garg
88979c852b
Updated email sending to remove invalid recipient emails (#16171)
closes https://github.com/TryGhost/Team/issues/2388

We have seen examples of sites with member emails that have invalid characters that can cause an entire email send to fail, or just cause a failure to those addresses. The issue that allowed members with invalid email address to be saved was patched earlier, but its possible there are still sites that contain some of those invalid email addresses.

This change updates new sending service to filter out the recipients with invalid email address before passing them to mail provider, so these rogue addresses don't affect the whole batch in anyway. We also trim the recipient emails to clear out any spaces first, which is the most likely culprit.

- uses new email validator that detects invalid email addresses with special chars
2023-01-24 16:13:10 +05:30
Fabien "egg" O'Carroll
9df131ee5a Checked for existence of page via a network request
refs https://github.com/TryGhost/Team/issues/2466

Now that we're checking for resources at the URL and rejecting if
there isn't one found, we want to make sure that we can handle pages
which are not a resource.

The idea here is to make a HEAD request to determine whether or not
the page exists. We don't need the full response so HEAD saves us some
bandwidth and we allow both 2xx and 3xx status codes because Ghost has
redirects to add missing trailing slashes, which may not be present in
the URL we're passed.
2023-01-24 16:17:40 +07:00
Fabien "egg" O'Carroll
919d0a80c0 Checked for existence of a resource to determine page existence
refs https://github.com/TryGhost/Team/issues/2466

The existing implementation was a very basic check to get us to the
first milestone. By checking if the page points to a resource we can
know for sure the URL exists on the site.
2023-01-24 16:17:40 +07:00
Naz
a22799e133
Added last_seen to authors routing config exclude
refs https://github.com/TryGhost/Toolbox/issues/503

- The "last_seen" property is not used in routing calculations. Without it the routing service was triggering an expensive process on each user login.
2023-01-24 12:29:09 +08:00
Naz
62e3caba2c
Fixed route update error on attach/detach events
refs https://github.com/TryGhost/Toolbox/issues/503

- There was an error thrown due to empty "model._changed" field
- When attached or detached events (e.g. tag.attached) are sent through, their models do not contain any _changed properties. This was taken into account when checking for route related resource changes
2023-01-24 12:29:09 +08:00
Djordje Vlaisavljevic
d394ce6638 Added Mentions page empty state
refs https://github.com/TryGhost/Team/issues/2479
2023-01-23 21:42:55 +00:00
Djordje Vlaisavljevic
bbbdd26f3f Added conditionals for displaying mention info
refs https://github.com/TryGhost/Team/issues/2434
2023-01-23 21:42:55 +00:00
Sam Lord
24bdcf5e9d Added WebMentions to data generator
closes: https://github.com/TryGhost/Toolbox/issues/509
closes: https://github.com/TryGhost/Toolbox/issues/507
2023-01-23 17:39:00 +00:00
renovate[bot]
90ad60dd85 Update sentry-javascript monorepo to v7.32.0 2023-01-23 16:46:58 +01:00
renovate[bot]
d4cd6be9f7
Update metascraper to v5.33.5 2023-01-23 12:04:33 +00:00
renovate[bot]
929d32dddf Update dependency knex to v2.4.2 2023-01-23 13:00:53 +01:00
Fabien "egg" O'Carroll
182e0b831d Implemented and tested ResourceService as separate class
refs https://github.com/TryGhost/Team/issues/2465

This code is still in the Ghost package for now as it's essentially glue code.
2023-01-23 18:34:52 +07:00
Fabien "egg" O'Carroll
f746f223cd Implemented and tested RoutingService as separate class
refs https://github.com/TryGhost/Team/issues/2466

This code is still in the Ghost package for now as it's essentially glue code.
2023-01-23 18:34:52 +07:00
Sagar Gupta
bba4743739
Removed bluebird dependency from unit tests in core (#16096)
refs https://github.com/TryGhost/Ghost/issues/14882

- Replaced `new Promise.reject()` / `new Promise.resolve()` with the
static methods `Promise.reject` / `Promise/resolve` from native promises
- Replaced `Promise.delay()` with a promisified `setTimeout()`
2023-01-23 11:23:48 +00:00
Kevin Ansfield
42b30ac613 Fixed email preview input dropdown not closing when clicking on iframe
no issue

- clicks on the iframe never bubble out of the iframe so weren't captured by the dropdown-closing event listener
- added an event listener directly on the iframe's body element when we render the iframe's content that manually calls out to our generic dropdown closing method
2023-01-23 09:47:46 +00:00
Sanne de Vries
4b61f23bd0 Fixed minor email preview visual bugs
No ref
2023-01-23 10:46:30 +01:00
Naz
2a01dd0481
Added test coverage for sitemap base generator
refs https://github.com/TryGhost/Toolbox/issues/503

- The "updateURL" method was not covered during implementation. Covering the gap with basic tests for the "updateURL" method
2023-01-23 16:33:41 +08:00
Naz
4aacd50fee
Added coverage for URLResourceUpdatedEvent
refs https://github.com/TryGhost/Toolbox/issues/503

- The listener was not covered during quick and dirty implementation. While in the area did some cleanup to the sitemap manager test
- One of the problems I've stumbled upon when adding a test is having multiple instances of SiteManager in the test, which in turn created multiple "subscribe" events and repeat handle executions. Fixed it by having just one site manager instance (a singleton) as that's the pattern that used in main codebase
2023-01-23 16:33:41 +08:00
Naz
714a6f6900
Updated sitemaps to react to a partial resource update
refs https://github.com/TryGhost/Toolbox/issues/503

- The Dynamic URL service no longer generates "url.added" event when only a partial resource update happened - only non-url forming properties were modified. The sitemaps service still needs to know when to update the lastmod ("Last Modified") field associated with specific URL.
2023-01-23 16:33:41 +08:00
Naz
39ef1d20db
Excluded 'tiers' from fields that affect url generation for posts
refs https://github.com/TryGhost/Toolbox/issues/503

- Tier's are sometimes dynamically generated and are present in the "_changed" properties, causing full URL regeneration. They have no effect on post's URL, so should not trigger URL regeneration.
2023-01-23 16:33:41 +08:00
Naz
fbf9442e39
Added extra JSDocs
no issue
2023-01-23 16:33:41 +08:00
Naz
ccb485110b
Short-circuited resource URL regeneration when it's not necessary
refs https://github.com/TryGhost/Toolbox/issues/503

- Full URL regeneration process was happening even when only unrelated to URL generation fields were updated (e.g. 'plaintext' change in post does not affect the URL of the post). Stopping the  "resource updated" event processing early circumvents full url regeneration inside of DynamicRouting, which can be quite heavy depending on routing configuration
- The URLResourceUpdatedEvent is supposed to be emmited whenever there's an update to the resource already associated with the URL and no url-affecting fields were touched.
2023-01-23 16:33:41 +08:00
Naz
ec4045cb57
Added dynamic-routing-events package
refs https://github.com/TryGhost/Toolbox/issues/503

- Reusing existing events inside of dynamic routing would only contribute to general confusion that is already there. Having separate "DomainEvents" is the best practice used throughout the code which is substituting generic events.
- The URLResourceUpdatedEvent is supposed to be emmited whenever there's an updated to the resource already associated with the URL circumventing full url regeneration process inside of DynamicRouting
2023-01-23 16:33:41 +08:00
Ronald Langeveld
95b6a9d569
Added mentions email notification alpha flag (#16164)
refs https://github.com/TryGhost/Team/issues/2429

- Added an alpha feature flag toggle for webmentions' email notifications
2023-01-23 15:42:48 +08:00
renovate[bot]
e3b0152ae0
Update dependency ember-template-lint to v5.3.2 2023-01-23 02:01:35 +00:00
Simon Backx
3ac282598c Fixed Playwright tests for new email flow
no issue

Tests stopped working because the Mailgun mocker stopped working since we moved to the new email flow.

This also fixes a unit test that needed to get updated.
2023-01-20 19:00:13 +01:00
Simon Backx
693216c29e Improved failed email error messages
refs https://ghost.slack.com/archives/C02G9E68C/p1673570945616369?thread_ts=1672700158.659209&cid=C02G9E68C

Fixed a typo in the error messages and made the errors more clear. Also hide the email configuration part when there is no email configuration.
2023-01-20 18:37:43 +01:00
Daniel Lockyer
56b0e65583
Revert "Added email snapshots for API versioning tests (#16139)"
- this reverts commit 85051199e3
- the tests here rely on dynamic content (the Ghost version number)
2023-01-20 18:05:36 +01:00
Ghost CI
ff1039bcbe v5.31.0 2023-01-20 16:01:01 +00:00
Ghost CI
d3557c2879 🎨 Updated Casper to v5.4.5 2023-01-20 16:01:00 +00:00
Simon Backx
a269fbe15a Fixed mention card target link 2023-01-20 15:54:22 +01:00
Simon Backx
5287aeb320 Added noopener security to mention cards 2023-01-20 15:21:23 +01:00
Fabien 'egg' O'Carroll
33ebe971f8
Added BookshelfMentionRepository implementation (#16156)
fixes https://github.com/TryGhost/Team/issues/2418

This stores the received webmentions in the database.

Co-authored-by: Simon Backx <simon@ghost.org>
2023-01-20 14:32:50 +01:00
Rishabh Garg
c7230f1858
Improved email stability (#16159)
- bumps new email flows to GA improving overall email stability
2023-01-20 18:55:20 +05:30
Rishabh
0a65f3405e Added new urls to known referrers list for source attribution
- adds new urls for Google and LinkedIn as known referrers so they are grouped together on Admin
2023-01-20 18:13:05 +05:30
Simon Backx
e879406659
Added outbound link tagging setting (#16146)
fixes https://github.com/TryGhost/Team/issues/2432
    
Adds outbound_link_tagging setting (enabled by default and behind
feature flag). If the feature flag is enabled, and the setting is
disabled, we won't add ?ref to links in emails.
    
This includes new E2E tests for email click tracking, which were also
extended to check outbound link tagging (for both MEGA and the new email
stability flow).

Also fixes a test fixture for the comments_enabled setting.
2023-01-20 13:41:36 +01:00
Simon Backx
8a95c62ff1
🐛 Fixed post links being marked as edited when they were not (#16153)
fixes https://github.com/TryGhost/Team/issues/2461

- Ignores 'edited' links when there is only one second differences.
- Make sure we don't set updatedAt when linking a post to a redirect
2023-01-20 13:31:54 +01:00
Daniel Lockyer
34fe49b110
Added version information to log lines
refs https://github.com/TryGhost/Toolbox/issues/501

- this reverts commit 48dda23554
- also includes a resolution for `@elastic/elasticsearch` so we don't
  run a version that is potentially problematic - see referenced issue
  for context
2023-01-20 13:18:44 +01:00
Fabien "egg" O'Carroll
40c280f6ac Improved naming of output serializer url util 2023-01-20 18:49:26 +07:00
Fabien "egg" O'Carroll
68f469c78b Fixed mock instantiation
This mock will fail by default now, which stops us from adding bad data in prod.
2023-01-20 18:49:26 +07:00
Fabien "egg" O'Carroll
833182bc7f Implemented a basic RoutingService for Mentions
refs https://github.com/TryGhost/Team/issues/2466

This initial implementation just checks that we're on the right origin and
subdomain, but should be extended to check if the URL actually resolves to a
page hosted on the site!
2023-01-20 18:49:26 +07:00
Fabien "egg" O'Carroll
5b4bc01504 Added initial inline ResourceService implementation
refs https://github.com/TryGhost/Team/issues/2465

We've restricted this to Post resources for now until we update the Mention
entity to be able to handle multiple resource types.
2023-01-20 18:49:26 +07:00
Naz
d44386dae3
Refactored resource config as a DI in Resources
refs https://github.com/TryGhost/Toolbox/issues/503
refs https://github.com/TryGhost/Toolbox/issues/406

- In Ghost 5.x we dropped multi-versioned API, which means there's no need to track resource configs dynamically as there can only be one version
- Along with removed "initResourceConfig" refactored the "config" file itself to be injected into Resource's constructor - allows for easier testing.
2023-01-20 19:47:26 +08:00
Ronald Langeveld
3061fb2b3b
Added mentions database table (#16150)
closes https://github.com/TryGhost/Team/issues/2417

- added new `mentions` database table to be able to store incoming webmentions.
- updated schema and tests to match.
2023-01-20 19:08:07 +08:00
Simon Backx
8c9893e568 Improved MentionSendingService timeout
no issue

The current timeouts were unreliable.
2023-01-20 11:46:18 +01:00
Steve Larson
8895d22602
Added mention discovery service (#16154)
fixes https://github.com/TryGhost/Team/issues/2407

The MentionDiscoveryService fetches mentioned sites to return the webmention endpoint.
2023-01-20 11:45:48 +01:00