Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.8.x Refactor #338

Merged
merged 47 commits into from
Oct 15, 2024
Merged

1.8.x Refactor #338

merged 47 commits into from
Oct 15, 2024

Conversation

andybroomfield
Copy link
Contributor

@andybroomfield andybroomfield commented Jun 25, 2024

Current blockers

Propose we handle in patch release as needs more discussion

Don't know

millnut and others added 11 commits June 17, 2024 19:16
…-type-fixes

fix: additional strict type fixes
Fix #323

Refactor the alert banner entitiy to use a more standard approach to revisions,
using \Drupal\Core\Entity\Routing\RevisionHtmlRouteProvider
instead of custom routes, and using standard revsion routes instead of custom
versions in routing.yml.

This also groups all the none view crud permissions into the manage alert
banner permission in alertBannerEntityAccessControlHandler.
Normally not required as the view is in place, but sometimes needed if the
view is disabled.
Note: this may still get removed later in the refactor, but for now restore
route admin/structure/alert-banner-types
Ref #334

Flaged as deprecated because of the {% spaceless %} tag, which should have
been removed with the move to Drupal 9?
However this template is simply not used, so removing.
Ref #334

Remove view default_argument_skip_url config key which is being removed.
See https://www.drupal.org/node/3382316
Fix #261

Use a new AlertBannerManager service and move the getCurentBanners method from the
block to the manager service.

Adds an $options array for setting the type and future options.
Small refactor to use loadMultiple.
…ctor

Initial refactor of revision provider and access
…anager

Move getCurrentBanners to a service
@andybroomfield andybroomfield marked this pull request as draft June 25, 2024 12:25
stephen-cox and others added 12 commits June 25, 2024 13:30
…fault-argument

Remove default_argument_skip_url from group manage alert banners view
Fix #229

Implements hook_gin_content_form_routes for both the alert banner creation
and edit form. This makes editing the alert banner like nodes.

Renames the publishing options group meta to auto pick up gin theming.
Moves the revision log and new revision into the meta group
Add a flag if this is the Gin theme, if it is add the extra class to meta
so it is themed like nodes.
Fix #342

Use the standard drupal paths (entity_type/manage) for the alert banner
entity type routes, and add a local task for the edit link.
This restores expected behaviour with edit, fields, manage form,
manage display,  permissions.

Remove unneed entity type route provider and remove todo comment
from entity type list builder.
…theme

Opt into the Gin content form routes (edit theme)
…entity-type

Fix alert banner entity type paths and local tasks
…ermissions-test

Fix routes to localgov_alert_banner_types in permissions test
Fix #271

Small refactor to remove the js-cookie dependancy by using native javascript
cookie read and write methods.
@andybroomfield
Copy link
Contributor Author

Suggest re rename this branch becuase having a 1.8.x branch seems to be the root of the test failures.
See localgovdrupal/localgov_shared_workflows#3

@andybroomfield
Copy link
Contributor Author

andybroomfield commented Jul 10, 2024

and yet renaming this branch causes this one to pass?

andybroomfield and others added 4 commits July 11, 2024 10:48
andybroomfield and others added 6 commits September 3, 2024 13:24
…ository) (#369)

* Deprecate old constructor signiture of alert banner block

This may not be totally nescerry, but to be on the safe side in case the block has been
extended, this deprecates the old signiture with current_user and entity.repository
and marks alert banner manager as required.

* Add the deprecatedProperttTrait to the alert banner block

Allows block extensions to still have a currentUser and entityRepository
Fix #247

This provides the details in the readme, will open a new issue for the config
option.
See #327.

Extends visibility test by providing actual pages for the banner to display on.
This also provides an extra banner to test the correct banner is visible per page.
…ble-check

Move the visible check to alert banner manager
@andybroomfield andybroomfield marked this pull request as ready for review September 16, 2024 20:57
@andybroomfield andybroomfield changed the title 1.8.x 1.8.x Refactor Sep 16, 2024
@andybroomfield
Copy link
Contributor Author

andybroomfield commented Sep 16, 2024

List of PRs that make up the refactor.

@andybroomfield
Copy link
Contributor Author

What does this change?

Refactors the Alert banner entity, alert banner block and adds an alert banner manager service.
Adds Drupal 11 support and drops Drupal 9 support.

How to test

  • Check no more Drupal 11 deprecations
  • Check installable on Drupal 11.
  • Check alert banners can be created, viewed, dismissed.

How can we measure success?

Alert banner should function as before, now with Drupal 11 support and the deperacation warnings should be gone.
This release does not contan functional changes.

Have we considered potential risks?

Check that refactor does not have any side effects.

Images

n/a

Accessibility

n/a (follow up PRs to be added in 1.8.1)

@finnlewis finnlewis self-requested a review September 17, 2024 11:21
millnut and others added 3 commits September 23, 2024 21:18
…s-from-drupal-coder-update

fix: coding standards introduced by latest drupal coder rules
@finnlewis finnlewis requested a review from markconroy October 1, 2024 11:55
markconroy and others added 2 commits October 1, 2024 12:57
This fixes issue where alert banner cookie shows again even though it was hidden
@finnlewis
Copy link
Member

@andybroomfield I've tested this on Drupal 10 / localgov 3.x and all functionality seems to work as smoothly as ever.

Now trying to test on Drupal 11, although we're not explicitly testing again Drupal 11 yet and I imagine it will be a while until many people are using Drupal 11.

@finnlewis
Copy link
Member

How are you installing localgov Drupal 11 @andybroomfield ?

I'm trying this :

composer create-project localgovdrupal/localgov-project:^4.x-dev MY_PROJECT --no-install

But then getting composer issues.

    - localgovdrupal/localgov[3.0.0-alpha1, ..., 3.x-dev] require drupal/core ^10.0 -> satisfiable by drupal/core[10.0.0-alpha1, ..., 10.4.x-dev].
    

@millnut
Copy link
Member

millnut commented Oct 8, 2024

Hey @finnlewis yeah profile blocks the install currently from that branch as it's very experimental. I've been installing the 3.x branch and upgrading to D11 and testing

@finnlewis
Copy link
Member

Hey @finnlewis yeah profile blocks the install currently from that branch as it's very experimental. I've been installing the 3.x branch and upgrading to D11 and testing

Thanks @millnut - can you point me in the right direction with some quick steps to upgrade to D11?

@finnlewis
Copy link
Member

Meanwhile, @andybroomfield , tested on a vanilla Drupal 11 install, and it installs and functions well.

The only thing I notice is that

  1. I need to place the block manually in a region.
  2. Placing it in the header region does not render a full width banner, it gets bunched up next to the branding.

image

I guess for now we are targeting people who are installing this as part of LocalGov Drupal, so perhaps that's something for the future?

@andybroomfield
Copy link
Contributor Author

@finnlewis Yes, I've been thinking of providing an olivero block, and then the localgov theme blocks could use the method @rupertj is / has created.
I use the hero region on Olivero.

@andybroomfield
Copy link
Contributor Author

Just a note, I've added @markconroy PR on removing polyfills to this PR also. Apolgies if that means you need to restart testing.

Copy link
Member

@markconroy markconroy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Tested on existing install, all fine.
  • Tested on clean install of LGD, all fine.

@finnlewis finnlewis merged commit f927fce into 1.x Oct 15, 2024
16 checks passed
@finnlewis finnlewis deleted the 1.8.x branch October 15, 2024 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants