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

Feature: Group integration #250

Merged
merged 14 commits into from
Sep 29, 2023
Merged

Feature: Group integration #250

merged 14 commits into from
Sep 29, 2023

Conversation

Adnan-cds
Copy link
Contributor

Provides:

  • A Group plugin for Alert banners.
  • A View for listing Alert banners belonging to Groups.
  • User permissions to go along with the localgov_microsites_group module.

Provides:
- A Group plugin for Alert banners.
- A View for listing Alert banners belonging to groups.
- User permissions to go along with the localgov_microsites_group module.
@Adnan-cds Adnan-cds self-assigned this May 17, 2023
- Fixed Alert banner's entity *type* name during config dependency calculation.
- Added group relation type cached clear during Alert banner bundle creation.
  This is needed for config import to work.
Automated test for banner allocation to a test group bundle.
The suggested dependencies (e.g. group) from composer.json are required to run
some of the tests.
Fix for composer command in test runner to grab suggested packages.
@Adnan-cds Adnan-cds marked this pull request as ready for review June 9, 2023 15:39
@Adnan-cds
Copy link
Contributor Author

Mostly lifted from the gnode submodule of the group module.

Comment on lines +1 to +3
access localgov_alert_banner overview:
title: 'Access Alert banner listing page'
description: 'Access the Alert banner listing and management page, regardless of banner type.'
Copy link
Contributor

Choose a reason for hiding this comment

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

This sounds like the kind of general permission we should have in the main module, how are we access controlling it at the moment? Why do we need the seperate permission?

Copy link
Contributor

Choose a reason for hiding this comment

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

So I think I'm understanding that this is for the seperate group view, which is different from the main admin view. And we only want to grand group insiders the group admin view and not the main one?
(This is me trying to understand localgov microsites permissions)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And we only want to grant group insiders the group admin view and not the main one?

That's right.

@andybroomfield
Copy link
Contributor

As this is for microsites I'm happy to leave the review to those using it.
Be good to be able to have banners per group.
Raises a couple of questions on permissions, see comment above, though that might just be I don't have experince with group permissions.

If you are using this module alongside the [localgov_microsites_group](https://github.com/localgovdrupal/localgov_microsites_group) module, then user permissions will be automatically setup during module installation.

Otherwise enable at least the following permissions for **Groups**:
- "Entity: View any alert banner entities" for both anonymous and authenticated users.
Copy link
Contributor

Choose a reason for hiding this comment

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

May have an issue with #219 and #256 if we remove this permission.

@andybroomfield
Copy link
Contributor

andybroomfield commented Jun 9, 2023

My very quick run through within the localgov microsites distrubtion shows that this works well, thanks @Adnan-cds.
I think there are a few oddities, which could be a combination of microsites oddities, issues with domains, and understanding the group permissions vs global permissions.

Permissions are something we need to look at, just to make sure we're not granting a bit more than we should.
And we should redirect users after putting an alert banner live to the group version of the alert banner admin view.

I'm also noticing that when I click set live when creating a new alert banner, I'm taken to the view alert page, not the confirm form.

@finnlewis finnlewis self-assigned this Jun 12, 2023
@finnlewis finnlewis requested a review from ekes July 3, 2023 13:25
Copy link
Member

@stephen-cox stephen-cox left a comment

Choose a reason for hiding this comment

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

This largely works fine. A couple of minor issues:

  • As Andy points out, when adding alert the set live option doesn't work.
  • When viewing the list of alert banners to the banner type is empty; maybe this isn't needed.

Just to note, that this branch is rather out of data and alert banners weren't displaying until I merged the latest changes in the 1.x branch.

If the add alert banner form redirects to the site live form when the set live field is selected then I think this is fine to merge.

When a new banner is set to go live, we should end up in the "Put banner live"
tab of the new banner after the banner form is submitted.  At the moment we are
ending up in the banner's "View" tab.

Also, group banners should only appear in group pages and not all over the site.
@Adnan-cds Adnan-cds marked this pull request as draft September 4, 2023 13:21
Decide the active group either based on the current path or the current domain.
This is useful where we are using the domain_group module to associate a domain
with a group.
Once a group banner is published, redirect to the group banner listing page
instead of to the site-wide banner listing page.
@Adnan-cds
Copy link
Contributor Author

And we should redirect users after putting an alert banner live to the group version of the alert banner admin view.

This is done now.

when I click set live when creating a new alert banner, I'm taken to the view alert page, not the confirm form.

This is fixed as well.

The test runs are resulting in an unrelated test failure. Is this a known issue?

@Adnan-cds Adnan-cds marked this pull request as ready for review September 4, 2023 15:01
@finnlewis
Copy link
Member

@Adnan-cds would like @andybroomfield to review before merging.

@andybroomfield would like @stephen-cox to review before merging! 😄

@finnlewis
Copy link
Member

finnlewis commented Sep 28, 2023

@stephen-cox - might you have time to review this one?
@ekes - might you have time to review this one?

@finnlewis can you test again?

and @millnut - if you get bored? 😄

@stephen-cox stephen-cox self-requested a review September 28, 2023 15:48
Copy link
Member

@stephen-cox stephen-cox left a comment

Choose a reason for hiding this comment

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

Working well for me. Happy to approve.

One things to note is to get alert banners to display I had to add the alert banner block to the themes header region. I suggest adding optional block config for this to the Microsites Base theme as we have for other blocks: https://github.com/localgovdrupal/localgov_microsites_base/tree/2.x/config/install

@Adnan-cds
Copy link
Contributor Author

I suggest adding optional block config for this to the Microsites Base theme as we have for other blocks

That's a good point that I missed. I remember having to manually add this block in our microsite instance. How about adding it here in the group_alert_banner submodule as an optional block config?

@stephen-cox
Copy link
Member

How about adding it here in the group_alert_banner submodule as an optional block config?

That would do the trick

Optional Alert banner block configuration for the localgov_microsites_base
theme.  Automates setup of the Alert banner block for LocalGov Drupal Microsites
distribution users.
@Adnan-cds
Copy link
Contributor Author

I have added an optional config file to add the Alert banner block in the localgov_microsites_base theme. I have also explained the block placement issue in the README. Please let me know if this will do.

@stephen-cox
Copy link
Member

Looks fine to me 👍

@Adnan-cds
Copy link
Contributor Author

Great :) Merging then...

@Adnan-cds Adnan-cds merged commit 2524857 into 1.x Sep 29, 2023
8 checks passed
@Adnan-cds Adnan-cds deleted the feature/group-integration branch September 29, 2023 15:52
@andybroomfield andybroomfield mentioned this pull request Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants