Commit graph

38 commits

Author SHA1 Message Date
69d7d9dca9 Remove old FormatTagNamesCommand
This was a one-time command that is no longer needed, so it can be
removed.
2021-01-14 00:55:13 +00:00
43455d5ae1 Auto-configure event subscribers
References #347
2021-01-14 00:45:58 +00:00
53ab326415 Auto-configure services and repositories
Enable the auto-configuration of service and repository classes,
including support for classes in subdirectories by using
`getRelativePathname()` rather than `getFilename()` and making some
additional changes to the result.

References #347
2021-01-14 00:44:30 +00:00
5e9dc48896 Rename methods 2021-01-13 17:56:57 +00:00
7e06943be1 Rename event subscriber classes 2021-01-13 17:55:29 +00:00
661c26dcec Add query condition for status
References #344
2021-01-13 08:52:51 +00:00
dee6051cd9 Add route cache context to related posts block
References #3
2021-01-11 02:32:17 +00:00
a3e8f03cf1 Cache the block, not the render array
References #3
2021-01-11 02:20:17 +00:00
cca8ed1970 Re-order array by key [ci skip]
References #3
2021-01-11 01:59:31 +00:00
f404019a39 Add cache tag for the current post
References #3
2021-01-11 01:58:42 +00:00
52fa58733d Set cache max age on related posts block
Based on https://www.drupal.org/node/2451555, added a `max-age` value to
the related posts block.

References #3
2021-01-11 01:48:23 +00:00
105405e7f9 Display a list of related post titles
References #3
2021-01-11 01:48:21 +00:00
6436e3edb3 Generate a new block for related posts
References #3
2021-01-11 01:39:44 +00:00
3546ac427a Extract a method to contain the query logic
Group all of the query logic into one method, as this will make it more
readable and this logic is likely to grow.

References #3
2021-01-10 22:38:37 +00:00
ae0024f335 Return an empty Collection if there are no posts
Return an empty Collection if there are no related posts for the given
post.

References #3
2021-01-10 22:38:37 +00:00
b90ca42e87 Refactor to use an entity query
Refactor from using `loadByProperties` to using an entity query.

`loadByProperties` doesn't allow for passing multiple values for a
single property such as multiple tags to compare against, and also means
that removing the current node can be done in the query rather than
filtering it out of the Collection.

This might also be a more performant solution if we can do the grouping
and sorting of the results in the query rather than needing to perform
additional steps on the result.

References #3
2021-01-10 22:38:02 +00:00
d7f3d8c482 Return related posts for a specified blog post
Add the initial code for specifying a blog post and returning related
posts. This includes adding a repository for related posts, and adding
it as a service within the `opdavies_blog` module.

References #3
2021-01-10 22:38:00 +00:00
383c0d0fdf Push to IFTTT
References #328
2021-01-10 19:14:24 +00:00
790b221646 Save post as sent to social media
References #328
2021-01-10 19:13:00 +00:00
e617e9984d Return early if the post shouldn't be pushed
References #328
2021-01-10 19:06:37 +00:00
73271de39a Move logic for if a post should be pushed
References #328
2021-01-10 19:06:36 +00:00
baebc4fd25 Add queue worker
References #328
2021-01-10 19:04:30 +00:00
ec6ac1d798 Start refactoring to use a queue
References #328
2021-01-10 18:12:14 +00:00
ce7209ac74 Ensure that the translated text is rendered
Fixes #334
2021-01-04 22:01:42 +00:00
cb8afcd852 Update tweet text
References #332
2021-01-01 23:16:56 +00:00
87ee87f915 Fix blog tag re-ordering test
Add a NullPostPusher implementation and use it within the tag
re-ordering tests to stop an Exception being thrown because there's no
webhook URL.

References #332
2021-01-01 23:08:23 +00:00
d7459ff30f Extract a PostPusher service to push the post
Extract a `PostPusher` service with an IFTTT implementation. That means
if this needs to change to use a different service in the future, the
IFTTT implementation can remain unchanged and a new implementation can
be added with its own form params etc.

This also makes this functionality easier to test as we can add a
`NullPostPusher` implementation for testing.

References #332
2021-01-01 22:45:23 +00:00
f6ff21e04e Update form params to work with IFTTT
References #332
2021-01-01 22:34:59 +00:00
a6f378294c Extract a helper method to group checks [ci skip] 2021-01-01 21:50:35 +00:00
e2d7f08893 Rename variable to make it more generic 2021-01-01 21:46:12 +00:00
509d526661 Update the Collection namespace 2020-12-17 23:42:20 +00:00
a656280e7b Extract helper methods 2020-11-10 20:25:07 +00:00
06c3da1880 Add public constants for field names
Make it easier and safer when referencing field names by adding public
constants for them to the Talk and Post classes.
2020-11-10 19:34:15 +00:00
eb23d93fe0 Return early if should not be sent to social media
Return early and don't send the post to social media if the `Post to
social media` checkbox is not checked.

References #249
2020-10-07 23:11:22 +01:00
2d06f5e8d4 Add a method to check if send to social media
Add a method to check if a post should be sent automatically to social
media.

References #249
2020-10-07 22:57:40 +01:00
0f01551f26 Update Hook Event Dispatcher module
- Update the Hook Event Dispatcher module from `8.x-1.29` to `8.x-2.02`.
- Update custom modules after breaking changes from upgrading.

References #112
2020-09-06 12:15:59 +01:00
596ee4979d Fix PHPCS issues 2020-09-04 22:20:30 +01:00
cbe60209e6 Rename custom module directories
- Rename `opdavies_blog` to `blog`.
- Rename `opdavies_blog_test` to `blog_test`.
- Rename `opdavies_talks` to `talks`.
- Rename `opdavies_talks_test` to `talks_test`.

The files within the directories haven't changed, so there is no
breaking change caused by renaming the directories.

 Please enter the commit message for your changes. Lines starting
2020-09-04 21:25:36 +01:00