- Issue created by @penyaskito
- Assigned to friera
- 🇪🇸Spain fjgarlin
This might be a normal "feature request" for "core" at the moment. Making available a block with this information shouldn't be too complex.
See also the related issues here 📌 Mark Announcements Feed as stable Fixed , as I believe there is overlap with this one.
- 🇪🇸Spain friera
To do not include external dependencies in the dashboard module. I have created a submodule called dashboard_blocks that could be used to add new needed blocks to be included in dashboard module.
Attached I provide the patch, it includes a functional test to check that the inclusion in the dashboard is working as expected.
- Status changed to Needs work
over 1 year ago 8:28pm 24 July 2023 - 🇪🇸Spain penyaskito Seville 💃, Spain 🇪🇸, UTC+2 🇪🇺
-
+++ b/modules/dashboard_blocks/src/Plugin/Block/DrupalAnnouncementsBlock.php @@ -0,0 +1,82 @@ + public function __construct(array $configuration, $plugin_id, $plugin_definition, private AnnounceFetcher $announceFetcher, private string $feedLink) {
Nice use of the constructor properties promotion! Those should be protected instead of private though.
-
+++ b/modules/dashboard_blocks/tests/src/Functional/DashboardBlocksSelectionTest.php @@ -0,0 +1,85 @@ + $this->getSession() + ->getPage() + ->find('xpath', '//*[@id="layout-builder"]/div[@class="layout-builder__add-section"]/a') + ->click();
Can we use
$page->pressButton('Add section');
here?
-
+++ b/modules/dashboard_blocks/tests/src/Functional/DashboardBlocksSelectionTest.php @@ -0,0 +1,85 @@ + $this->assertSession()->pageTextContains('Drupal Announcements Block');
If we add a Javascript test we could also assert some content inside the block.
Thanks for working on this!
-
- Status changed to Needs review
about 1 year ago 12:22pm 18 October 2023 - Status changed to Needs work
about 1 year ago 10:26am 20 October 2023 - 🇪🇸Spain fjgarlin
If we can change from a patch to a Merge request it will help with the code review. For now, I see a lot of duplication in the method
public function build()
, which means that maybe we could change something upstream so it can be reused in both the announcements module and the dashboard module.Actually, the block creation and the tests look good, so maybe it should all go against the "announcements" module. You can create a fork and MR with the changes here 📌 Convert announcements feed from toolbar to dashboard Postponed as making the announcements content available as a block is a really good idea.
- 🇪🇸Spain fjgarlin
Part of this code here https://git.drupalcode.org/project/drupal/-/blob/11.x/core/modules/annou... could be made a bit more generic so it's reusable.
If you have time to work on it that'd be great otherwise I could try to give it a go next week.
- 🇪🇸Spain plopesc Valladolid
Thanks for the suggestion @fjgarlin!
Created MR to test the block approach in 📌 Convert announcements feed from toolbar to dashboard Postponed
- Status changed to RTBC
about 1 year ago 8:10am 23 October 2023 - 🇪🇸Spain fjgarlin
I'm not sure how the issues for this sandbox are handled, but for me, given that there is a core issue already which does exactly that, would mean that this issue no longer "needs work". I'm reviewing and testing the core one.
I'm marking this as RTBC because I no longer think there is anything else to do "here".
- Issue was unassigned.
- 🇪🇸Spain plopesc Valladolid
Thank you for your review @fjgarlin!
Adding reference to the core issue to keep track of it.
- Status changed to Fixed
about 1 year ago 11:59am 27 October 2023 - 🇪🇸Spain plopesc Valladolid
Marking as fixed once 📌 Convert announcements feed from toolbar to dashboard Postponed has been committed.
Thank you all for your help here!
Automatically closed - issue fixed for 2 weeks with no activity.
- Status changed to Fixed
12 months ago 11:34am 10 January 2024