Commit Graph

10793 Commits

Author SHA1 Message Date
Hannah Wolfe
213f0a4785 Moved ghost-locals mw into parent app
- Moved ghost-locals from shared to parent as it is not shared
- This file is only used in one place, this updates the code structure to reflect this
- This is one of many similar changes needed to make it easier to refactor to the existing setup
- This allows shared middleware to be unhooked from the parent app
2020-04-21 18:50:46 +01:00
Hannah Wolfe
295eac6ea1 Moved emit-events mw into parent app
- Moved emit-events from shared to parent as it is not shared
- This file is only used in one place, this updates the code structure to reflect this
- This is one of many similar changes needed to make it easier to refactor to the existing setup
2020-04-21 18:36:42 +01:00
Hannah Wolfe
e53baac13d Moved log-request mw into parent app
- Moved log-request from shared to parent as it is not shared
- This file is only used in one place, this updates the code structure to reflect this
- This is one of many similar changes needed to make it easier to refactor to the existing setup
2020-04-21 18:30:35 +01:00
Hannah Wolfe
8fe56852e0 Moved request-id mw into parent app
- Moved request-id from shared to parent as it is not shared
- This file is only used in one place, this updates the code structure to reflect this
- This is one of many similar changes needed to make it easier to refactor to the existing setup
2020-04-21 18:29:20 +01:00
Hannah Wolfe
becc239de1 Moved web/parent-app to web/parent/app
- Have a consistent structure so we can co-locate an app with its own middleware
- This is another small step in sorting out the giant mess that was web/shared/middleware
2020-04-21 18:08:29 +01:00
Hannah Wolfe
61633d48ee Moved serve-public-file mw into site app
- Moved serve-public-file from shared to site as it is not shared
- This file is only used in one place, this updates the code structure to reflect this
- This is one of many similar changes needed to make it easier to refactor to the existing setup
2020-04-21 17:23:07 +01:00
Hannah Wolfe
be71dfebe5 Removed unused requires
refs 406218489c

- I missed these due to using `grunt validate` instead of `yarn test` 🙈
2020-04-21 17:09:58 +01:00
Hannah Wolfe
0897b0ef3c Unhooked shared mw from members service 2020-04-21 17:04:20 +01:00
Hannah Wolfe
406218489c Remove additional mount of content/images
refs 717567995b

- We should not be using relative URLs inside the admin panel anymore
- Removes a usage of "shared" middleware which isn't truly shared
2020-04-21 17:02:16 +01:00
Hannah Wolfe
dbafaf7205 Moved handle-image-sizes mw into site app
- Moved handle-image-sizes from shared to site as it is not shared
- This file is only used in one place, this updates the code structure to reflect this
- This is one of many similar changes needed to make it easier to refactor to the existing setup
2020-04-21 15:50:01 +01:00
Hannah Wolfe
9fe741c9b9 Moved static-theme mw into site app
- Moved static-theme from shared to site as it is not shared
- This file is only used in one place, this updates the code structure to reflect this
- This is one of many similar changes needed to make it easier to refactor to the existing setup
2020-04-21 15:50:01 +01:00
Hannah Wolfe
40fa2053e3 Moved serve-favicon mw into site app
- Moved serve-favicon from shared to site as it is not shared
- This file is only used in one place, this updates the code structure to reflect this
- This is one of many similar changes needed to make it easier to refactor to the existing setup
2020-04-21 14:30:32 +01:00
Renovate Bot
c54e50bd11
Update dependency @tryghost/members-ssr to v0.7.6 2020-04-21 12:32:31 +00:00
Hannah Wolfe
c3f4b7a57c Moved admin-redirects mw into site app
- Moved admin-redirects from shared to site as it is not shared
- This file is only used in one place, this updates the code structure to reflect this
- This is one of many similar changes needed to make it easier to refactor to the existing setup
2020-04-21 12:18:19 +01:00
Renovate Bot
6fd4c65421
Update dependency @tryghost/members-api to v0.18.2 2020-04-21 10:05:23 +00:00
Renovate Bot
0e2147ba74 Update dependency knex to v0.21.0 2020-04-21 08:53:37 +01:00
Renovate Bot
f002e62fc4
Update dependency knex-migrator to v3.4.5 2020-04-21 06:40:00 +00:00
Renovate Bot
c15945ad23
Update dependency mock-knex to v0.4.8 2020-04-20 21:47:34 +00:00
Renovate Bot
e2e18b3448
Update dependency gscan to v3.5.2 2020-04-20 18:18:04 +00:00
Daniel Lockyer
ba36333a1f v3.13.4 2020-04-20 16:30:34 +01:00
Daniel Lockyer
5ab630cc81 Updated Ghost-Admin to v3.13.4 2020-04-20 16:30:34 +01:00
Kevin Ansfield
c5f7adf917 Fixed "view sent email" showing mailgun template variables
no issue

- the `email.{html,plaintext}` fields are only used to display what was sent in the email so it doesn't make sense to store the mailgun-specific content which can be confusing when viewing in the admin area
- store the raw serialized post content with a basic no-data replacement of replacement strings rather than the output of full data fetching and mailgun transformation
2020-04-20 15:35:33 +01:00
Kevin Ansfield
9981ea336c Changed {subscriber_firstname} replacement to {first_name}
no issue

- easier to remember and type
- removes need to remove the `subscriber_` prefix when accessing member properties
2020-04-20 14:25:58 +01:00
Kevin Ansfield
944ffa8668 Added acceptance test for email preview with email card and replacements
no issue

- the email previews API should return html and plaintext content that contains any email cards and where any valid replacement strings have been replaced with desired fallbacks
- unknown/invalid replacement strings should appear as entered by the user (no %% wrappers that are used internally)
2020-04-20 12:48:00 +01:00
Kevin Ansfield
a09a6caf5f Fixed in-browser email preview showing raw replacement strings
no issue

- fixed plaintext templates being word wrapped and breaking across replacement strings
- updated `postEmailSerializer.serialize` to return the email template plus a replacements array that can be used for creating Mailgun-like recipient variable objects or more straight forward replacement
- updated email-preview API to work with the replacements data to show fallback data when previewing
2020-04-20 12:24:05 +01:00
Renovate Bot
2ea504255c
Update dependency ajv to v6.12.2 2020-04-20 00:15:31 +00:00
Kevin Ansfield
5c12bf3858
Update dependency @tryghost/kg-mobiledoc-html-renderer to v2.0.1 (#11750)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2020-04-17 14:13:15 +01:00
Daniel Lockyer
7ac614030d 🐛 Fixed structured metadata for images
fixes #11746

- the original fix[1] inadvertently moved the logo object down one level
- this commit moves it back up, and fixes the tests to reflect the
  expected format

[1]: 3f5daa60c8
2020-04-17 13:51:55 +01:00
Renovate Bot
7104183c6f
Update dependency @tryghost/kg-default-cards to v1.1.1 2020-04-17 11:23:24 +00:00
Kevin Ansfield
e0e0a85a32 Updated test emails to fetch member data if email matches
no issue

- with the email replacements feature it's useful to have real member data when sending test emails from the PSM
- if the supplied email address matches a member then that member's data will be used for any replacements
2020-04-17 12:15:39 +01:00
Kevin Ansfield
d0393b6223 Fixed {subscriber_firstname} not picking up member's name in emails
no issue

- in our replacements the member properties are prefixed with `subscriber_` but this wasn't taken into account when requesting data from the member object
2020-04-17 12:15:39 +01:00
Daniel Lockyer
8853067830 Added custom json-string format to AJV validator
no issue

- the value of `mobiledoc` when submitting a page/post via the API must
  be JSON, but we don't validate this
- this results in url-utils throwing an error, which ends up being a 500
- this commit adds a custom format to AJV to validate it is valid JSON
- also updates tests with bad JSON - 'a'
2020-04-17 11:56:20 +01:00
Kevin Ansfield
374b43ceab Fixed linting error 2020-04-17 11:32:29 +01:00
Daniel Lockyer
88c11ffbb2 Updated eslint-plugin-ghost
no issue
2020-04-17 11:29:33 +01:00
Kevin Ansfield
a801352c7f Added email card and replacement handling to member emails
no issue

- adjusted mega's post serializer to get full email contents
  - fetch `mobiledoc` from the API rather than the pre-rendered `html` and `plaintext`
  - re-generate `html` using the mobiledoc renderer with an "email" target so that the email-only card content is included
  - re-generate `plaintext` from the newly generated email html

- added replacement handling to mega's `getEmailData` function
  - find all of our `%%{replacement "fallback"}%%` instances in the html template and push them into a replacements array with the respective property on the member instance and desired fallback
  - transform the replacement for Mailgun compatibility. Mailgun uses `%recipient.variable_name%` for its template variables so we need to replace our custom replacement string with the compatible version. Our replacements system allows for the same replacement (`{subscriber_name}`) to be used multiple times and have different fallbacks, Mailgun doesn't support fallbacks so for each replacement we also need an indexed `variable_name` part so that we can put our fallbacks in the correct place
  - perform the same Mailgun template transformation for the plaintext version except we re-use the replacements array to avoid bloating the API request to Mailgun with duplicate template variables for every recipient
  - swapped `reduce` for a plain loop for easier readability
2020-04-17 10:23:03 +01:00
Renovate Bot
cdaa1b5dbb
Update dependency express-session to v1.17.1 2020-04-17 05:14:11 +00:00
Renovate Bot
ccff9f095b
Update dependency @tryghost/members-ssr to v0.7.5 2020-04-17 03:25:45 +00:00
Renovate Bot
0dab0449c2
Update dependency @tryghost/members-api to v0.18.1 2020-04-17 02:11:58 +00:00
Renovate Bot
0d266bb3bb
Update dependency @tryghost/zip to v1.0.1 2020-04-17 00:18:23 +00:00
Renovate Bot
663400166a
Update dependency @tryghost/vhost-middleware to v1.0.3 2020-04-16 22:15:05 +00:00
Renovate Bot
4ee2be4b19
Update dependency @tryghost/session-service to v0.1.1 2020-04-16 20:15:01 +00:00
Renovate Bot
b69684e05e
Update dependency @tryghost/image-transform to v0.2.1 2020-04-16 18:17:13 +00:00
Renovate Bot
d68cd44c60
Update dependency @tryghost/mw-session-from-token to v0.1.1 2020-04-16 16:50:40 +00:00
Renovate Bot
9fce5d8ac0
Update dependency @tryghost/errors to v0.1.2 2020-04-16 15:26:26 +00:00
Renovate Bot
0d97a98eba
Update dependency @tryghost/adapter-manager to v0.1.3 2020-04-16 13:44:40 +00:00
Nazar Gargol
192cb107a5 Fixed regression test for tag edit redirects
refs bd92fcd282

- Referenced commit broke the regression test
2020-04-16 22:10:28 +12:00
Daniel Lockyer
425ba6143e Enabled FORCE_COLOR for CI tests
no issue
2020-04-16 11:01:27 +01:00
Daniel Lockyer
f8a22da490 Enabled Ghost-CLI testing on Renovate branches
no issue
2020-04-16 10:57:59 +01:00
Nazar Gargol
bd92fcd282 🐛 Fixed /edit route redirect for tag taxonomies
refs 183e22e0bf (diff-f3a289058604b2b069d07bb8e2cda60cL39)

- When using the `/edit` route in the end of tag taxonomy redirect was landing on 404 page in Ghost-Admin. For example redirect for `/tags/getting-started/edit/` would redirect to `/#/settings/tags/getting-started`, instead of `/#/tags/getting-started`
- Referenced commit is where the routing in Ghost-Admin was changed from `/settings/tags/:slug/` to `/tags/:slug`
2020-04-16 21:23:38 +12:00
Daniel Lockyer
5adbc4aa6a Moved Ghost-CLI tests to main testing workflow
no issue

- keeps all testing in one place and allows us to depend on a single
  workflow in the future
2020-04-16 07:42:31 +01:00