Commit Graph

12073 Commits

Author SHA1 Message Date
Daniel Lockyer
5417c9edd2
Fixed dependencies for settings-path-manager
- it was incorrectly referencing `tpl` as a dependency, which must have
  been accidentally included when the package was created
- this has been switched out for `@tryghost/tpl`
- also added the missing `@tryghost/errors` dependency
2022-07-27 08:51:44 +02:00
Daniel Lockyer
a9cffd9550
Pinned all dependencies
- we should pin all dependencies so we know what is getting shipped in
  the application
2022-07-27 08:44:50 +02:00
renovate[bot]
0270f7833f
Update dependency date-fns to v2.29.1 2022-07-27 03:32:41 +00:00
renovate[bot]
6d1e8181f8
Update dependency csso to v5.0.4 2022-07-27 01:19:54 +00:00
renovate[bot]
b33c07a5eb
Pin dependency terser to 5.14.2 2022-07-26 22:28:18 +00:00
renovate[bot]
d6bdef8437
Pin dependency csso to v 2022-07-26 17:57:48 +00:00
Naz
7adf3a5410 Added support for one off inline jobs
refs https://github.com/TryGhost/Toolbox/issues/359

- Inline one off jobs are needed in situations when we want to run a certain operation only once in the lifecycle of the Ghost instance. These operations should not be extremely long to execute though (not suited for backups or import types of tasks)
2022-07-26 18:14:25 +01:00
Naz
822549c9ef Added defensive code for non-persistent job manager
refs https://github.com/TryGhost/Toolbox/issues/359

- It's up to a user to decide initializing the job manager without a "jobModel". In these cases the regular recurring job scheduling should work as it did before
2022-07-26 18:14:25 +01:00
renovate[bot]
9973b5419c Update dependency @playwright/test to v1.24.1 2022-07-26 18:18:50 +02:00
Daniel Lockyer
4b5b3de11c
Moved test agents into subfolder
- these agent files are all very similar and should be grouped together
- moving them into a subfolder makes the `test/utils` folder a little
  bit easier to browse
2022-07-26 18:00:37 +02:00
Rishabh Garg
47fa59ea72 Added flag for newsletter paywall feature (#2430)
refs https://github.com/TryGhost/Team/issues/1680
2022-07-26 21:30:21 +05:30
Daniel Lockyer
044b342de3
Fixed random test failure due to asynchronous directory creation
- we keep seeing random failures that complain about a directory already
  existing when trying to create it
- the error arises from the `fs.copySync` in this `prepareContentFolder`
  function, because it tries to create the folder if it doesn't exist
- it turns out we're using the asynchronous `fs.ensureDir` without an
  await just before, so it doesn't block on creating the folder
- there's a veeeery small window where the code within `copySync` thinks
  the folder doesn't exist, `ensureDir` creates the folder, and
  then `copySync` tries to create the folder => 💥
- it looks like we're already `await`-ing `prepareContentFolder`, so we
  can just switch all the calls to the Promise-based ones and await them
- the other `prepareContentFolder` uses the sync versions of the
  functions, but we can fix that in the future: 7b7767d483/ghost/core/test/utils/e2e-utils.js (L73-L79)
2022-07-26 17:28:16 +02:00
Daniel Lockyer
7b7767d483
Deleted .jshintrc file
refs bcf5a1bc34

- we no longer use jshint so this file is not needed
2022-07-26 16:47:31 +02:00
Daniel Lockyer
f61cd0b18e
Deleted .gitkeep file
- this was accidentally pulled in from the Utils package migration
2022-07-26 16:47:31 +02:00
Naz
2fe4f66ae3 Cleanedup job manager one off test structure
refs https://github.com/TryGhost/Toolbox/issues/359

- LIttle housekeeping was needed before introducing "inline" one-off jobs
2022-07-26 15:18:48 +01:00
Naz
013051a6c9 Made name parameter required for one off jobs
refs https://github.com/TryGhost/Toolbox/issues/359

- Without a "name" parameter it's impossible to identify a job in the storage. It was missed during the PoC inmplementation
2022-07-26 15:13:12 +01:00
Naz
8c3473e5e0 Moved exception handling for members migrations
refs https://github.com/TryGhost/Toolbox/issues/358

- Error handling should be done as close to the place that knows how to handle them. It's a catch-all block which doesn't add any logic, so does not really make sense to have that extra code in general "init" method which ideally should be just a whole bunch of calls with no extras.
2022-07-26 15:13:12 +01:00
renovate[bot]
679634342a
Pinned dependencies (#15100)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-07-26 16:06:00 +02:00
Daniel Lockyer
6a2afbd859
Changed import path for mw-session-from-token tests
- this has the nice side effect of increasing code coverage by checking
  the exports of the package
2022-07-26 15:53:29 +02:00
Rishabh Garg
9c616fe067
Added content paywall for newsletters (#15048)
refs TryGhost/Team#1680

- extends the public preview card so that the paywall is shown in newsletters for paid-only posts based on member's access
- adds CTA for paywalled content in newsletters
- the segmentation for paywall only considers free and non-free members, so post with specific `tiers` and `paid-only` access settings are sent to all paid members

Co-authored-by: Djordje Vlaisavljevic <dzvlais@gmail.com>
2022-07-26 19:16:08 +05:30
Kevin Ansfield
b5b88e7c5e Added mobiledoc change handling to react-editor experiment
no issue

- passed through the `onChange` event handler so that changes to the content are updated in Ember and autosave etc is triggered
2022-07-26 14:42:59 +01:00
Daniel Lockyer
a12047b224
Added cobertura reporter to members-events-service
- without this, we don't get coverage reports for the package
2022-07-26 15:37:33 +02:00
Daniel Lockyer
b72c4482dc
Added c8 to update-check-service
- this must have been missed off when the package was first created,
  but is now required so we can track code coverage
2022-07-26 15:36:07 +02:00
Kevin Ansfield
873a2ff8e3 Updated <ReactMobiledocEditor> to work with single-component export from koenig-react
no issue

- top-level export from `@tryghost/koenig-react` is a single component and the UMD module is loaded onto `window.koenigEditor`
2022-07-26 14:34:14 +01:00
Daniel Lockyer
3d1e53e8f9
Updated import for mw-update-user-last-seen tests
- this now requires the library as it would be used, which increases
  coverage
2022-07-26 15:31:14 +02:00
Daniel Lockyer
08abfcafd1
Remove linting as posttest step
- linting is handled separately (in CI and locally, as it's a git
  pre-push hook) so we shouldn't also be running it after tests
2022-07-26 15:26:21 +02:00
Daniel Lockyer
0a5f600dfe
Tidied up package README and LICENSE files
- we shouldn't need individual LICENSE files because these packages
  won't be published, so the top-level one applies
- also cleaned up README files to remove mentions of Lerna monorepos and
  install instructions
2022-07-26 15:22:10 +02:00
Daniel Lockyer
735608ea76
Renamed @tryghost/vhost-middleware to @tryghost/mw-vhost
refs https://github.com/TryGhost/Toolbox/issues/354

- this commit renames the vhost middleware to follow our naming pattern
  of `mw-X`
2022-07-26 15:12:32 +02:00
Daniel Lockyer
255eb0726b
Cleaned up package metadata
refs https://github.com/TryGhost/Toolbox/issues/354

- set packages to `private: true`
- removed repository link - these packages won't be published so this
  link won't be seen anywhere
- removed `publishConfig`
2022-07-26 15:08:05 +02:00
Daniel Lockyer
5fc7ba59d3
Reset package versions back to 0.0.0
refs https://github.com/TryGhost/Toolbox/issues/354

- these packages won't be published from now on, so setting the versions
  back to 0.0.0 keeps them clean
2022-07-26 14:57:43 +02:00
Daniel Lockyer
e0b947b59d
Deleted release-utils package
- this probably doesn't belong here but it was difficult to exclude when
  migrating the packages over
2022-07-26 14:47:43 +02:00
Daniel Lockyer
3526154377
Migrated packages from Utils
refs https://github.com/TryGhost/Toolbox/issues/354

- the Utils repo is being split up and we're bringing these packages
  into Ghost
- this commit merges the history of the relevant packages in the Utils
  directory into Ghost
2022-07-26 14:45:37 +02:00
Daniel Lockyer
7fa997c91d Deleted packages migrated to SDK
refs https://github.com/TryGhost/Toolbox/issues/354

- these packages were migrated to the SDK repository so
  they aren't needed here any more
2022-07-26 14:38:09 +02:00
Daniel Lockyer
48cc229b21 Deleted packages migrated to Framework
refs https://github.com/TryGhost/Toolbox/issues/354

- these packages were migrated to the Framework repository so they
  aren't needed here any more
2022-07-26 14:29:54 +02:00
Daniel Lockyer
1f9d9b1185 Fixed flaky test
- the test wants to assert that the output contains 0-9 a-z characters,
  but it actually asserts the output is a number followed by alphabet
  characters
- this commit updates the regex to allow any combination of letters and
  numbers
2022-07-26 12:51:37 +02:00
Daniel Lockyer
2acdde2535 Deleted moleculer-service-from-class package
refs https://github.com/TryGhost/Toolbox/issues/354

- this is no longer used as the original project it was developed for
  was done in a different way
2022-07-26 12:37:57 +02:00
renovate[bot]
fd41b48f41 Update dependency @tryghost/limit-service to v1.2.2 2022-07-26 11:56:19 +02:00
Daniel Lockyer
5f311946b5 v5.5.0 2022-07-26 08:23:55 +01:00
Daniel Lockyer
2df2106701 v5.5.0 2022-07-26 08:23:55 +01:00
Daniel Lockyer
8936d83cac 🎨 Updated Casper to v5.2.2 2022-07-26 08:23:54 +01:00
Daniel Lockyer
d08144e2bf
Updated @tryghost packages
- this commit bumps all `@tryghost` packages that only contain
  dependency updates
2022-07-25 22:28:24 +02:00
Rishabh
487b61eb81 Updated stylesheet url handling for frontend apps
refs https://github.com/TryGhost/Team/issues/1719

- updates search and comments app to use configurable stylesheet url instead of hardcoded value
2022-07-25 23:00:37 +05:30
Rishabh
eb75888b48 Updated frontend apps to use new config
refs https://github.com/TryGhost/Team/issues/1719

- creates scripts injected for portal/search/comments using new config format
- adds `data-styles` to search/comments script for adding external styles URL
2022-07-25 23:00:37 +05:30
Rishabh
a44460d226 ℹ️ Updated default config and CDN for frontend apps
refs https://github.com/TryGhost/Team/issues/1719

- switches default CDN from unpkg to jsDelivr for better reliability
- current config for frontend apps doesn't allow easy switching of CDN for frontend urls
- allows easy switch of base CDN for frontend apps via config
- fixes double use of version string in the config
- extends config to include url needed for loading styles for frontend app instead of hardcoded urs
2022-07-25 23:00:37 +05:30
Daniel Lockyer
c376587288
Moved yarn main functionality up to root yarn script
- since we've turned the repo into a monorepo, the `yarn main` scripts
  have lived in their original place under `ghost/core` package.json and
  Gruntfile.js
- for one, we want to remove grunt because it's terribly old and our use
  is hacked together
- secondly, `yarn main` applies to the monorepo + submodules as a whole,
  and not just the Ghost core folder
- this commit extracts the functionality into yarn scripts in the
  top-level and removes the dependency that was required
2022-07-25 18:30:21 +02:00
Simon Backx
5235d67fed
Added comment events to activity feed (#15064)
refs https://github.com/TryGhost/Team/issues/1709

- New event type `comment_event` (comments and replies of a member in the activity feed)
- Includes member, post and parent relation by default
- Added new output mapper for ActivityFeed events

**Changes to `Comment` model:**
* **Only limit comment fetched to root comments when not authenticated as a user:** 
`enforcedFilters` is applied to all queries, which is a problem because for the activity feed we also need to fetch comments which have a parent_id that is not null (`Member x replied to a comment`). The current filter in the model is specifically for the members API, not the admin API (so checking the user should fix that, not sure if that is a good pattern but couldn’t find a better alternative).
* **Only set default relations for comments when withRelated is empty or not set:**
`defaultRelations`: Right now, for every fetch it would force all these relations. But we don’t need all those relations for the activity feed; So I updated the pattern to only set the default relations when it is empty (which we also do on a couple of other places and seems like a good pattern). I also updated the comments-ui frontend to not send ?include
2022-07-25 17:48:23 +02:00
Simon Backx
31a4135fec
Added members.last_commented_at and last_seen_at update when commenting (#15088)
refs https://github.com/TryGhost/Team/issues/1717

- Updates last_commented_at and last_seen_at (only once a day)
- Used the LastSeenAtUpdater, so we can combine updating last_commented_at and last_seen_at in one query + used same pattern
- Updated comments service to await emails in order to make E2E tests more stable (as we don't have any method to await emails and test emails otherwise). This removed the email sending logic from the `onCreated` hook of the model.
2022-07-25 17:35:46 +02:00
Simon Backx
57a743e3aa
Fixed TXT content of report emails (#15090)
fixes https://github.com/TryGhost/Team/issues/1718

- Text content of report emails still had some placeholder text
- Converts HTML comments to TXT to include in the TXT version of the email
- Added support for Regexp matchers in the email mocker
- Added tests to check if the email content is in the new comment/report emails
2022-07-25 15:27:38 +01:00
Daniel Lockyer
308a28d31a
Tidied up package READMEs
refs https://github.com/TryGhost/Toolbox/issues/354

- these READMEs were migrated over from when each package was in a
  different repo
- they also assume you're going to be publishing the packages because it
  mentions install instructions
- only a few of them contain custom content
- this commit deletes the majority of these files because they're now
  not useful
- any that contained other instructions have been cut down
2022-07-25 15:17:12 +02:00
Naz
7c3ca9a26d Cleaned up stripe service init syntax
no issue

- It's super hard to read long lines and not that great tracking changes when an array is in a single line declaraion
2022-07-25 12:58:01 +01:00
renovate[bot]
396bc865a9
Update dependency knex-migrator to v5.0.2 2022-07-25 11:11:31 +00:00
Fabien 'egg' O'Carroll
b3471ab439
Improved comments API security (#15065)
refs https://github.com/TryGhost/Team/issues/1688

* Added missing/failing tests
* Refactored comments BREAD into service
* Ensured member_id is not writable, it should come from auth only
* Ensured one cannot reply to a reply
* Ensured the parent_id is not writable on edit
2022-07-25 10:41:33 +01:00
Peter Zimon
e5bcc52dfc Updated new site creation typography 2022-07-25 11:26:07 +02:00
Daniel Lockyer
ee5753a6b7
Fixed minor linting issue in member-count tests
- we don't need to return this value, and eslint complains about it if
  we do
2022-07-25 11:25:14 +02:00
Daniel Lockyer
61125d7605
Removed repository from component package.json files
refs https://github.com/TryGhost/Toolbox/issues/354

- these repository links made sense when they were in different repos
  and published to NPM but we don't publish these packages any more
- this commit deletes those keys from the files
2022-07-25 11:15:16 +02:00
Daniel Lockyer
d73d7da7ef
Deleted non-root LICENSE files
- these were copied over during the monorepo conversion but we're not
  going to be publishing these packages so the top-level LICENSE file
  covers all packages here
2022-07-25 08:35:59 +02:00
Daniel Lockyer
57d47a79f9
Added yarn setup to root scripts
- we had this working in the Ghost repo before switching to a monorepo
- this commit adds a `setup` script to the root package.json so we can
  maintain the functionality
2022-07-25 08:35:57 +02:00
Daniel Lockyer
184149492d
Lifted "fix repo" scripts up to root package.json
- these scripts are useful for just trying to fix your repo when
  node_modules is playing up
- as we now have a monorepo, they should be lifted up to the root and
  not hidden in the ghost package
2022-07-25 08:35:55 +02:00
Naz
5f2967cf27 Added support for offloaded oneoff jobs
refs https://github.com/TryGhost/Toolbox/issues/357

- Adds support for persisted one off offloaded (worker thread) jobs
- To try them out run Ghost instance in "testmode" and shoo a request like so: `curl http://localhost:2368/ghost/api/oneoff/graceful-job` - this starts a one time job from graceful-job script (can only ever be executed once on the Ghost instance)
- Job's progress and runtime details are persisted in `jobs` table
- To play more with one off jobs use `addOneOffJob` method available on jobsService
2022-07-22 18:19:07 +01:00
Naz
d5e38e6fc7 Published new versions
- @tryghost/adapter-manager@0.2.33
 - @tryghost/api-version-compatibility-service@0.4.4
 - @tryghost/bootstrap-socket@0.2.22
 - @tryghost/config-url-helpers@1.0.2
 - @tryghost/constants@1.0.7
 - @tryghost/database-info@0.3.8
 - @tryghost/email-content-generator@0.1.4
 - @tryghost/image-transform@1.2.1
 - @tryghost/job-manager@0.9.0
 - @tryghost/limit-service@1.2.2
 - @tryghost/minifier@0.1.17
 - @tryghost/moleculer-service-from-class@0.2.28
 - @tryghost/mw-api-version-mismatch@0.2.3
 - @tryghost/mw-error-handler@1.0.5
 - @tryghost/mw-session-from-token@0.1.34
 - @tryghost/mw-update-user-last-seen@0.1.8
 - @tryghost/package-json@1.0.23
 - @tryghost/pretty-cli@1.2.29
 - @tryghost/promise@0.1.20
 - @tryghost/release-utils@0.8.1
 - @tryghost/security@0.3.3
 - @tryghost/session-service@0.1.44
 - @tryghost/settings-path-manager@0.1.9
 - @tryghost/version-notifications-data-service@0.2.2
 - @tryghost/vhost-middleware@1.0.28
 - @tryghost/zip@1.1.27
2022-07-22 16:46:56 +01:00
Naz
df8a7f9b6b Fixed formatting 2022-07-22 16:44:28 +01:00
Naz
b0581c778e Added execution progress updates for one off jobs
refs https://github.com/TryGhost/Toolbox/issues/357

- Job persisted in the database need to track job's execution status such as completion, failure, execution start and end times. This changeset allows to hook into job/bree lifecycle to track job's progress.
- NOTE: only supports "offloaded" jobs at the moment. Support for "inline" jobs will be added once there's a clear usecase for it.
- The "started" status and "started_at" timestamp are assigned to a job at the moment when the worker thread is created inside of bree
- The "finished" status and "finished_at" timestamp are assigned to a job when a "done" event is passed from the job script (NOTE: using process.exit(0) will not trigger the "finished" state")
- The "failed" status is assigned when the job execution is interrupted with an error
2022-07-22 16:43:15 +01:00
renovate[bot]
c9ae36ea8c Update dependency date-fns to v2.29.1 2022-07-22 13:04:15 +00:00
Simon Backx
c9a3211032 Updated comment events to use parent instead of parent_id 2022-07-22 14:34:43 +02:00
renovate[bot]
e9132d7572
Update dependency sqlite3 to v5.0.10 2022-07-22 12:09:33 +00:00
Naz
c667620d8f 🏗 Added jobs table creation migration
refs https://github.com/TryGhost/Toolbox/issues/357

- One time jobs need a storage mechanism to be run only ever once.
- Field notes:

- `id`, `created_at`, `updated_at` - standard Ghost fields
- `name` - unique name of the job, could also be used with prefixing to identify certain type of job (e.g.: backup-bob-2022-10-16, backup-sam-2023-01-13 identifying backup jobs run by users)
- `status` - 'started' | 'finished' | 'failed' | 'queued'  (need to identify when the job is in progress, done, added to the execution queue, or errored)
- `started_at` - when the job started execution
- `finished_at` - when the job successfully finished execution
2022-07-22 23:32:58 +12:00
Simon Backx
30c4f11e27
Added report API for comments (#15043)
closes https://github.com/TryGhost/Team/issues/1684

**Migrations:**
- Added report permissions (fixtures + migrations)
- Dropped reason field in reports (no textarea in reports in V1)
- Dropped nullable from comment_likes.member_id (can't be null)
- Added SET NULL/CASCADE foreign keys for comments related tables(*)

(*):
fixes https://github.com/TryGhost/Team/issues/1687
refs https://ghost.slack.com/archives/C02G9E68C/p1658217288591369

This commit adds support for `SET NULL` foreign keys in schema and migration helpers + also fixes the foreign keys for the comment_reports, comment_likes and comments tables.

- When a member is deleted, we **do** want to keep their reports (SET NULL)
- When a member is deleted, we **do not** want to keep their likes (CASCADE)
- When a member is deleted, we **do** want to keep the comments (SET NULL)

**Changes:**
- Added report API: `POST /members/api/comments/{id}}/report/`
- Sends an email to the owner when a comment is reported
- Saves a report to the database (not used for now, but might be useful later)
2022-07-22 12:03:05 +02:00
Simon Backx
0963da7a2e Added support for comment activity feed events
refs https://github.com/TryGhost/Team/issues/1709

- Hides comment events if lab flag is disabled
- Hides comment events if comments are disabled
2022-07-22 11:52:11 +02:00
James Morris
b46a6fb83e Added in a new comments icon for the activity feed
refs https://github.com/TryGhost/Team/issues/1709
2022-07-22 10:08:00 +01:00
renovate[bot]
2339577dd3 Update dependency metascraper-logo-favicon to v5.30.0 2022-07-22 08:34:07 +00:00
renovate[bot]
33b3fab663 Update dependency @playwright/test to v1.24.0 2022-07-22 09:39:38 +02:00
Naz
5dae6d6acf Added support for one off jobs
refs https://github.com/TryGhost/Toolbox/issues/357

- This is a scaffolding for what will become a one off job scheduling mechanism. The aim is allowing to run jobs which can be only ever be run once in the lifetime of the instance - persisting through restarts.
2022-07-21 19:39:54 +01:00
renovate[bot]
c34edc9f26
Pin dependency pump to 3.0.0 2022-07-21 18:04:31 +00:00
Naz
13bfc0746b Revert "Transformed addJob to be an async method"
This reverts commit f8b1877253.
2022-07-21 18:56:35 +01:00
Naz
3e57e6fe10 Moved jobmanager initialization logic
refs https://github.com/TryGhost/Toolbox/issues/357

- In upcoming iteration job manager will need "models" fully initialized to be able to persiste one time jobs. This bit of code of in a bad place as it initialized (through require) the job manager without having models module initialized first.
- The change moves that code from a bad to less bad place (wasn't able to think of any better location for now). Checking for `server:testmode' config in job initialization has a little bit of a smell, but don't think it's super critical. Could be improved if a better structure appears in the future!
2022-07-21 17:00:45 +01:00
Daniel Lockyer
17bf358b47
Pinned internal packages
- we're going to be pinning all dependencies within the monorepo
- this shouldn't change anything anyway because we're using the same
  version across all packages
2022-07-21 16:35:19 +02:00
renovate[bot]
d228144c27 Pin dependencies 2022-07-21 16:27:57 +02:00
renovate[bot]
6ebe34fdf0 Update dependency @playwright/test to v1.23.4 2022-07-21 14:37:19 +02:00
Daniel Lockyer
3559c57dbe
Fixed package import
refs 2c59f5342b

- this was missed during the referenced commit
2022-07-21 12:41:54 +02:00
Daniel Lockyer
2c59f5342b
Switched away from using @nexes packages
- we renamed the scope to `@tryghost` a while back, and published new
  versions, but these packages seem to have been missed during the
  rename
2022-07-21 12:38:09 +02:00
Peter Zimon
05789e4466 Fixed typography glitches
- fixed letter spacing for titles using Inter font
2022-07-21 10:24:10 +02:00
Daniel Lockyer
48fd5ca8cb
Removed posttest linting step
- linting is done as a separate step in CI and it's a git hook upon
  pushing locally, so we don't need to run it after tests
2022-07-21 10:09:36 +02:00
Peter Zimon
b7a5f4f266 Switching default font to Inter (#2429)
This PR switches the default font for Inter to provide a much more reliable typography across various OS's and for better integration with the Ghost brand.
2022-07-21 09:58:22 +02:00
Daniel Lockyer
03cb00e7fb
Unified some package scripts
- reworked lint script to follow the format of others
- deleted posttest linting from members-ssr
2022-07-21 09:51:16 +02:00
Daniel Lockyer
6192ae4620
Increased E2E test timeout temporarily
- we keep seeing a lot of random failures from CI due to the Posts
  Content API
- I think it's because of the Ghost boot + number of fixtures we load,
  which sends us over our 10s threshold
- let's see if 15s resolves that
2022-07-21 09:40:09 +02:00
Daniel Lockyer
d5874e29a3
Removed members-api posttest linting step
- we don't need to run linting after testing, as this is done separately
  and upon a `git push` anyway
2022-07-21 09:30:07 +02:00
Daniel Lockyer
9ec83a6e21
Disabled publishing for Members packages
- we don't want to publish these anymore so this commit disables the
  ability to
- also fixes up a missing version that wasn't reset
2022-07-21 09:26:04 +02:00
Daniel Lockyer
ed7e17b2f9
Deleted commited lockfile
- this was leftover from the Members package import
2022-07-21 09:19:39 +02:00
Daniel Lockyer
376ee24600
Switched to unversioned Members packages
- these packages are split apart for local development, but will be
  bundled into Ghost when publishing
- therefore, these packages won't be published so we are resetting the
  versions to make them cleaner
2022-07-21 09:15:29 +02:00
Daniel Lockyer
67aebbc7bc
Migrated Members packages into Ghost monorepo
refs https://github.com/TryGhost/Toolbox/issues/354

- now the Ghost repo is a monorepo, we can migrate our packages in to
  make development easier
2022-07-21 09:04:30 +02:00
Naz
f8b1877253 Transformed addJob to be an async method
https://github.com/TryGhost/Toolbox/issues/357

- This is a groundwork before adding one-off (solo) jobs with persistance to the job manager
- Making the addJob method async also makes the whole interface consistent - removeJob and shutdown are also async
2022-07-20 20:41:02 +01:00
renovate[bot]
6a18b50b8a
Update dependency sanitize-html to v2.7.1 2022-07-20 19:40:39 +00:00
renovate[bot]
16d3045997 Update dependency @types/node to v16.11.45 2022-07-20 18:08:14 +02:00
renovate[bot]
206df11f27 Update dependency @types/node-jose to v1.1.10 2022-07-20 18:08:02 +02:00
Daniel Lockyer
273d53cf09
Updated testing & linting packages
- these weren't updated in core before the migration, so we ended up
  with two different versions in yarn.lock
2022-07-20 18:05:27 +02:00
Daniel Lockyer
08779bc977
Fixed version of email-analytics-service within email-analytics-provider-mailgun
- this was missed during the migration but needs to happen so the
  packages are linked and re-used
2022-07-20 18:00:17 +02:00
Daniel Lockyer
abdcd9a650
Switched to @tryghost/nql-lang
- we moved this from `@nexes` to the `@tryghost` organization a while
  back, and this was missed from the switchover
2022-07-20 17:54:13 +02:00
Daniel Lockyer
ed1bdac20c
Removed publicConfig from packages config
- this was leftover from the migration to the monorepo and won't be
  needed because we're not publishing the packages
2022-07-20 17:49:52 +02:00
Daniel Lockyer
d3930b50ef
Reworked imports for custom-theme-settings-service tests
- now they import from the package exports, we get a slight boost in
  coverage because `index.js` is now used
2022-07-20 17:47:23 +02:00
Daniel Lockyer
796961329a
Fixed yarn test from top-level repo
- we probably don't want it to be this long term but it allows us to
  enable tests on the new packages
2022-07-20 17:41:11 +02:00
Daniel Lockyer
9fa789159c
Reset Publishing packages version and visibility
refs https://github.com/TryGhost/Toolbox/issues/354

- these packages are here for development and will be bundled when
  published, so they don't need versioning nor publishing
2022-07-20 17:20:24 +02:00
Daniel Lockyer
685b270013
Deleted .gitkeep file
- this was leftover from the Publishing packages migration
2022-07-20 17:19:04 +02:00
Daniel Lockyer
75d8a29642
Migrated Publishing packages into Ghost repo
refs https://github.com/TryGhost/Toolbox/issues/354

- now we've turned the Ghost repo into a monorepo, we can migrate
  packages back in to make development easier
2022-07-20 17:18:08 +02:00
Daniel Lockyer
3d989eba23 Converted Ghost repo into a monorepo
refs https://github.com/TryGhost/Toolbox/issues/354

- this commit turns the Ghost repo into a monorepo so we can bring our
  internal packages back in, which makes life easier when working on
  Ghost
2022-07-20 16:41:05 +02:00
renovate[bot]
0fdbba9dbd Update Test & linting packages 2022-07-19 20:05:27 +00:00
renovate[bot]
bc4aebf163 Update Test & linting packages 2022-07-19 18:55:22 +00:00
renovate[bot]
11d0ab9605 Update dependency c8 to v7.12.0 2022-07-19 18:33:27 +00:00
Djordje Vlaisavljevic
29b47d9556 Added z-index for post settings panes 2022-07-19 17:19:41 +02:00
Daniel Lockyer
69cc21992d Merged v5.4.1 into main
v5.4.1
2022-07-19 16:00:35 +02:00
Daniel Lockyer
2d405513b3 v5.4.1 2022-07-19 14:57:42 +01:00
Kevin Ansfield
f00bdbf43c Changed url for react editor module to use Ghost/config-provided url (#2428)
reqs https://github.com/TryGhost/Ghost/pull/15045

- accesses the Ember registry via the `GhostAdmin` global to grab the editor component url that Admin fetches from the config endpoint
- `ember-auto-import` does not allow dynamic imports unless it can see it's an absolute URL, to work around that we strip the `https://` part of the provided URL and manually include it in the template string so it's detectable as an absolute URL when building
- added redirect to posts screen if no editor url is provided in config
2022-07-19 14:24:07 +01:00
Kevin Ansfield
896cd4888f Switched to dynamically loaded external react-mobiledoc-editor package
no issue

- dropped the bundled `react-mobiledoc-editor` package
- updated `<ReactMobiledocEditor>` component to pull in editor components dynamically
  - added a resource function to dynamically import the external module
  - added `Container` and `Editor` components that read from the resource function and wrap components of the same name from the external module
  - added `<Suspense>` around the `Container` and `Editor` components so that React will show a loading state whilst the external components are still being fetched
  - added `<ErrorHandler>` so we can show an error state if loading fails
2022-07-19 12:48:53 +01:00
Kevin Ansfield
d991da399c Added support for building/rendering react components
no issue

- updated ember-cli-build and eslint config to support jsx
- added `react` and `react-dom` libraries
  - included them in the build so the `React` and `ReactDom` globals are available for use by third party components
  - added vendor shims so we can do things like `import * from 'react'` where the imports are referenced directly to the already imported modules
- added `<ReactComponent>` component
  - designed to be extended from in specific react component classes
  - renders a div and calls `renderComponent()` action once inserted - this should be replaced in any extended classes in order to render a react component
  - handles react rendering and teardown
- added `<ReactMobiledocEditor>` react component that renders an editor composed of components provided by the `react-mobiledoc-editor` package
- added `<KoenigReactEditor>` ember component that renders `<ReactMobiledocEditor>` and handles pass-through of Ember arguments and handling of actions
- updated `<GhKoenigEditorReact>` to render `<KoenigReactEditor>` in place of `<KoenigEditor>`
2022-07-19 12:48:53 +01:00
renovate[bot]
d6d6be1327 Update dependency knex to v2.2.0 2022-07-19 00:27:50 +00:00
Kevin Ansfield
81f3718867 Duplicated <GhKoenigEditor> to <GhKoenigEditorReact>
no issue

- the component wraps the title and editor canvas components, we only want to replace the canvas component with a react experiment so we need a duplicate for use in the `react-editor` experiment templates
2022-07-18 11:11:19 +01:00
Kevin Ansfield
a76132bda3 Re-generated .lint-todo file
refs https://github.com/TryGhost/Ghost/issues/14101

- compacted file and reset warning/error times
2022-07-18 10:54:10 +01:00
Kevin Ansfield
8d65303268 Fixed linter error for use of {{action}} in editor-loading controller
refs https://github.com/TryGhost/Ghost/issues/14101

- `{{action}}` is deprecated and should be replaced with `{{on}}` and `{{fn}}` with direct use of methods
- switched to calling `ui.setMainClass` action directly
2022-07-18 10:50:03 +01:00
Kevin Ansfield
a77388159c Duplicated editor screens to react-editor
no issue

- initial set up ready for testing use of react components (specifically an editor component for this experiment) inside of Admin
- added `react-editor` route
- duplicated all editor screen files and updated route references where necessary
2022-07-18 10:43:29 +01:00
Daniel Lockyer
40240d6b7a v5.4.0 2022-07-15 16:00:33 +01:00
Djordje Vlaisavljevic
067ebeab7b Made it easier to tell primary and other authors apart in post settings 2022-07-15 15:28:03 +02:00
Simon Backx
05d82b35c7 Published new versions
- @tryghost/image-transform@1.2.0
 - @tryghost/mw-error-handler@1.0.4
 - @tryghost/vhost-middleware@1.0.27
2022-07-15 15:16:47 +02:00
Simon Backx
6cc92fac9a Added support for transforming AVIF files
no issue

- This adds the possibility to format AVIF files in Ghost if requested.
- This format is supported in Sharp
- Provides smaller file sizes than webp
2022-07-15 15:12:56 +02:00
Simon Backx
9e7727752c Updated support email address confirmation flow (#2426)
refs https://github.com/TryGhost/Team/issues/584

- No longer uses a API URL + redirect inside verification emails. This is replaced by a new route (`/settings/members/?verifyEmail=token`) that does the API request and shows a modal.
- Removed update button when changing support email address in the Portal settings
- Added `_meta` attribute to settings (uses same pattern as newsletters model)
- When updating the `membersSupportAddress` setting (via the normal edit endpoint), the `sent_email_verification` meta property will get set by the API. When this new property is present, we'll show a warning that the support address requires verification.
2022-07-15 14:44:26 +02:00
Fabien "egg" O'Carroll
0ff47d4b51 Published new versions
- @tryghost/magic-link@1.1.0
 - @tryghost/members-api@8.3.0
 - @tryghost/members-stripe-service@0.10.6
2022-07-15 11:03:57 +01:00
Fabien 'egg' O'Carroll
f3130d9538 Passed request referrer to magic link service (#408)
refs https://github.com/TryGhost/Team/issues/1174

This paves the way for Ghost to be able to redirect to the referrer
page when dealign with signup magic links. We pass the referrer for
all types of magic links however, to allow extension of this
functionality in the future.

We've also removed the concept of `requestSrc` which has been unused
for a while now.
2022-07-15 11:02:58 +01:00
Djordje Vlaisavljevic
5d827ad1a9 Made it easier to tell internal and public tags apart in post settings 2022-07-15 11:19:40 +02:00
Daniel Lockyer
1d6fee8aa0 Fixed date zero-padding in table views
- when you have a date column in a table, dates with 2 digits vs 1
  digit cause the vertical alignment to be all over the place
- this commit fixes the date formatting for those entries to be zero-padded
2022-07-15 09:45:42 +01:00
renovate[bot]
5fc7a90bf9 Lock file maintenance 2022-07-14 20:04:41 +00:00
Kevin Ansfield
242106d596 Migrated code card to Octane syntax
refs https://github.com/TryGhost/Ghost/issues/14101

- applying boyscout rule and upgrading/cleaning up when touching files
- nothing out of the ordinary to report with this migration
2022-07-14 17:32:44 +01:00
Kevin Ansfield
aab02f0f4c 🐛 Fixed code card not correctly saving language when changing
closes https://github.com/TryGhost/Team/issues/1662

- the on-blur action for the language input was modifying the language property in the payload object directly which meant that the mobiledoc `save` call was missing and all the associated editor behaviour for serializing and saving the update was lost
- switched to modern action syntax and a proper action on the backing component so we're saving the change correctly
2022-07-14 17:30:05 +01:00
James Morris
587ae505f0 Added in hover states for the members list so it matches other lists
no issue
2022-07-14 16:29:02 +01:00
Naz
ef1c4764d3 Published new versions
- @tryghost/members-api@8.2.1
2022-07-14 16:15:02 +01:00
Naz
08b49a3475 Updated method signatures and added JSDocs
refs https://github.com/TryGhost/Team/issues/1674

- While preparing the changes had a look around and made small refactors to understand the codebase a little better. In general it's best to keep the method parameters as small and precise as possible instead of passing around a "bag-of-all-the-things" like "data" around
2022-07-15 03:12:35 +12:00
James Morris
db0929d07a Improved the strange resizing issues for the main chart on new Dashboard 2022-07-14 16:00:17 +01:00
Sanne de Vries
8aeb5c181e Updated .lint-todo 2022-07-14 15:32:21 +01:00
Sanne de Vries
a4d5d14ba6 Updated internal tag style in user deletion modal 2022-07-14 15:11:43 +01:00
Sanne de Vries
09794a7c05 Updated theme upload modal in Casper error state
No ref

- Updated modal default state to make it look more clickable
- Updated the Casper upload error state design
- Changed the 'try again' button to directly open the finder rather than only resetting the modal
2022-07-14 15:07:08 +01:00
jp
214ad1d57c 🎨 Added link to GitHub release for current version (#2349) 2022-07-14 15:07:24 +02:00
Naz
05105e1173 Updated method signatures and added JSDocs
refs https://github.com/TryGhost/Team/issues/1674

- While preparing the changes had a look around and made small refactors to understand the codebase a little better. In general it's best to keep the method parameters as small and precise as possible instead of passing around a "bag-of-all-the-things" like "data" around
2022-07-14 12:54:58 +01:00
Naz
2a7166ffc3 Fixed typo 2022-07-14 12:10:18 +01:00
James Morris
415dfa97b3 Refactored and cleared out some unneeded Dashboard CSS
no issue
2022-07-14 10:37:10 +01:00
James Morris
551db84966 Small fix for email newsletter setting arrow placement
no issue
2022-07-14 09:52:26 +01:00
Djordje Vlaisavljevic
048b0470da Updated lint-todo 2022-07-13 18:25:54 +02:00
Djordje Vlaisavljevic
5ad99f79a9 Added unique aria-labels to form elements 2022-07-13 18:25:46 +02:00
Djordje Vlaisavljevic
a710dd3c06 Removed option to close the modal by clicking behind it 2022-07-13 17:28:29 +02:00
Djordje Vlaisavljevic
82808d69f5 Made the "back" buttons have unique aria-label attributes 2022-07-13 17:27:24 +02:00
Djordje Vlaisavljevic
6e0bd66063 Updated lint-todo 2022-07-13 17:26:35 +02:00
Kevin Ansfield
cb6e1679e9 Fixed modalOptions.ignoreBackdropClick not always being picked up
no issue

- the modal instance on `this.top` inside the background click handler is not always a direct instance so we need to check both `.options` and `._options` when looking for the desired click ignore behaviour
2022-07-13 16:02:34 +01:00
Djordje Vlaisavljevic
1158555084 Set canonical post placeholder value to post URL 2022-07-13 16:59:28 +02:00
Daniel Lockyer
a644cc14c1 Merged v5.3.1 into main
v5.3.1
2022-07-13 12:56:50 +01:00
Daniel Lockyer
3f380e266d v5.3.1 2022-07-13 12:55:34 +01:00
Simon Backx
5f63060f78 🐛 Excluded plan changes from paid subscribers graph in dashboard
refs https://github.com/TryGhost/Team/issues/1673

When a user switches plan, the paid subscribers delta chart on the dashboard displays the change as a cancellation plus a new subscription. This display is misleading and confusing - instead, plan changes should be excluded from the paid subscribers delta chart.
2022-07-13 13:46:45 +02:00
Daniel Lockyer
3c63a01eec v5.3.0 2022-07-12 16:24:01 +01:00
Sanne de Vries
be2744c27f Updated activity feed empty state icon 2022-07-12 14:03:40 +01:00
Sanne de Vries
18102f309b Fixed empty state icons in dark mode 2022-07-12 13:49:24 +01:00
Sanne de Vries
be0fb41636 Updated webhook actions to dotdotdot menu 2022-07-12 13:38:51 +01:00
Naz
c7de8d3358 Updated copy for user deletion modal
refs https://github.com/TryGhost/Ghost/issues/15008

- When the user is removed the new flow adds a special tag and reassignes all the user-owned posts to the owner user. Updated copy to inform about this behavior clearly
2022-07-13 00:26:13 +12:00
Sanne de Vries
abc11a8028 Fixed broken activity filter empty state 2022-07-12 12:47:48 +01:00
Sanne de Vries
ea2bbef4c1 Fixed broken icon for activity empty state 2022-07-12 12:28:57 +01:00
Sanne de Vries
ea92f89c1d Removed unused contributors code and images 2022-07-12 11:38:08 +01:00
Rishabh
0ec3e2274f Removed sodo search alpha feature flag
refs https://github.com/TryGhost/Team/issues/1665

- removes feature flag for sodo search as its now bumped to GA
2022-07-12 13:22:26 +05:30
renovate[bot]
9cde5db860 Lock file maintenance 2022-07-11 00:04:38 +00:00
Kevin Ansfield
c06692a2fb 🐛 Fixed "Published" date for recent posts in dashboard always showing current time
no issue

- switched to the actual published at property name
- wrapped date in `{{moment-site-tz}}` so the site-local time is shown
2022-07-08 12:34:58 +02:00
Naz
04d27fac5f Stopped downloading site backup when deleting a user
refs https://github.com/TryGhost/Ghost/issues/15008

- Backup process had a slim benefit to keep around. Without it the removal process is much smoother.
- The backup still happens on the server side if it's absolutely needed at some point in the future
2022-07-08 20:56:52 +12:00
Simon Backx
3ecff41a11 Published new versions
- @tryghost/members-api@8.2.0
2022-07-07 14:15:06 +02:00
Simon Backx
011c7cb0a2 Added support for updating member enable_comment_notifications
refs https://github.com/TryGhost/Team/issues/1664

This makes it possible for members to update their comment notification preferences
2022-07-07 14:14:02 +02:00
Kevin Ansfield
87eafc1ae4 Wired up user comment notifications toggle 2022-07-06 18:32:13 +02:00
Peter Zimon
27212475f3 Added basic email notification for comment in staff 2022-07-06 17:55:44 +02:00
Peter Zimon
385000d4ce Fixed lint error 2022-07-06 11:09:25 +02:00
Peter Zimon
ff7bb48b7e Added Comment access dropdown to membership settings 2022-07-06 11:01:57 +02:00
Kevin Ansfield
79f0c04828 Added commentsEnabled setting
refs https://github.com/TryGhost/Team/issues/1664

- used to change native comments system availability
2022-07-06 09:53:21 +02:00
Kevin Ansfield
b98b6aa805 🐛 Fixed dashboard member activity feed always showing current time for timestamp
no issue

- `event.timestamp` was used instead of `parsedEvent.timestamp` meaning it was undefined and `{{moment-format}}` created a new date object instead of using the real event date
2022-07-06 09:22:05 +02:00
Daniel Lockyer
a7c34b7a7e Merged v5.2.4 into main
v5.2.4
2022-07-05 10:52:15 +02:00
Daniel Lockyer
862ace7945 v5.2.4 2022-07-05 09:50:40 +01:00
Kevin Ansfield
fa92a62cd3 🐛 Fixed scheduled post datepicker sometimes picking day before selected date
no issue

- in sites with a timezone that is negatively offset from UTC at certain times of day when the equivalent UTC date would be the next day, selecting a date when scheduling a post would select a day before the selected date
- fixed the date adjustment when applying the selected date to properly take timezones into account
2022-07-05 10:44:38 +02:00
Kevin Ansfield
a1457a0b8c 🐛 Fixed schedule post date picker sometimes not allowing "today" to be selected
no issue

- with large site timezone UTC offsets it could happen that "today" in the site timezone is not selectable in the date picker when scheduling posts
- the problem occurred because we were passing a minimum date to the date picker in UTC which was then converted to a local date using just the "YYYY-MM-DD" data but that would not always be correct because the UTC date could be "tomorrow" compared to the site timezone. Passing in the minimum date in the site timezone rather than UTC ensures the minimum date always matches "today" in the site timezone
2022-07-05 10:44:30 +02:00
Kevin Ansfield
8ff94df1c8 Added comments toggle to labs feature list
no issue
2022-07-04 14:15:53 +02:00
Naz
2857e46d7c Added sodoSearch flag to Admin Labs
refs 911ce4f29e
2022-07-04 18:10:42 +08:00
renovate[bot]
035ef523f4 Update dependency supertest to v6.2.4 2022-07-04 01:28:27 +00:00
renovate[bot]
a70ffd32d7 Lock file maintenance 2022-07-01 14:32:42 +00:00
renovate[bot]
a99f836b83 Update dependency miragejs to v0.1.45 (#2379)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-07-01 13:00:39 +01:00
Kevin Ansfield
f03041929f 🐛 Fixed schedule post date picker sometimes not allowing "today" to be selected
no issue

- with large site timezone UTC offsets it could happen that "today" in the site timezone is not selectable in the date picker when scheduling posts
- the problem occurred because we were passing a minimum date to the date picker in UTC which was then converted to a local date using just the "YYYY-MM-DD" data but that would not always be correct because the UTC date could be "tomorrow" compared to the site timezone. Passing in the minimum date in the site timezone rather than UTC ensures the minimum date always matches "today" in the site timezone
2022-07-01 11:20:26 +01:00
Kevin Ansfield
100dea6d98 🐛 Fixed scheduled post datepicker sometimes picking day before selected date
no issue

- in sites with a timezone that is negatively offset from UTC at certain times of day when the equivalent UTC date would be the next day, selecting a date when scheduling a post would select a day before the selected date
- fixed the date adjustment when applying the selected date to properly take timezones into account
2022-07-01 11:20:26 +01:00
renovate[bot]
79b0e7a3a2 Update dependency nock to v13.2.8 2022-06-30 21:37:04 +00:00
renovate[bot]
a0294c65b2 Update dependency nock to v13.2.8 2022-06-30 19:55:09 +00:00
Renovate Bot
fd118f1fe2 Update dependency nock to v13.2.7 2022-06-15 03:55:13 +00:00
Renovate Bot
c9e60ac690 Update dependency nock to v13.2.7 2022-06-15 03:52:01 +00:00
Daniel Lockyer
cc570d23b0 v5.2.3 2022-06-15 03:59:46 +01:00
Renovate Bot
47e3a3253f Update Test & linting packages 2022-06-03 23:36:05 +00:00
Renovate Bot
f1118ead35 Update dependency nock to v13.2.6 2022-06-03 18:48:31 +00:00
Daniel Lockyer
9551e57a00 v5.2.2 2022-06-03 17:50:37 +01:00
Daniel Lockyer
802cf2457f 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
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