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

Internal: Add Configuration to influence the order of branding features #3874

Merged
merged 1 commit into from
Apr 23, 2024

Conversation

ronaldtebrake
Copy link
Contributor

Problem

Right now we don't have an easy way to influence the bottom bar features, while we do promise that.
This was done by implementing a patch, per environment which uses

function hook_social_branding_preferred_features(): array {
  return [
    new PreferredFeature('home', 0),
    new PreferredFeature('events', 1),
    new PreferredFeature('groups', 2),
    new PreferredFeature('search', 3),
    new PreferredFeature('topics', 5),
  ];
}

But than changing that per environment.

Solution

We now provide a new admin form, currently no permissions are set, as it's for now Admin only (until we know every business requirement we need to provide it for SM, e.g. which preferred features are available, mandatory, how many etc)

So this form gives admins a way to deal with the bottom bar features for the App.

Right now we use the existing hook as input for the ConfigForm which preferred features are available.
We add a draggable table to the form, which shows all available features.
And we change the place where the hook is invoked, for GraphQl, to the configuration from the form submitted.

Notes

  • We don't provide default configuration, this ensures we don't break existing platforms, by default still the ones provided by the hook hook_social_branding_preferred_features() are available and used
  • Once the Form is saved however, that will take presedence, this to ensure we don't have duplicate weights from the Hook and the Form
  • The hook_social_branding_preferred_features_alter is still leading, this allows people to always add or remove preferred features.

Issue tracker

https://getopensocial.atlassian.net/browse/PROD-28762
https://www.drupal.org/project/social/issues/3442499

How to test

  • Enable social_branding, see that it works (unit tests also provide this proof)
  • As a sitemanager see you can't reach the page
  • As admin go to admin/config/opensocial/branding-features
  • When saving I expect the Form to have the order you saved it in
  • Querying the API clearly shows the new order

Screenshots

Screenshot 2024-04-22 at 11 44 30

Release notes

We have added an Admin form for the Branding features which are used through GraphQL.

@ronaldtebrake ronaldtebrake added type: feature Adds a new feature to Open Social status: needs review This pull request is waiting for a requested review prio: high team: guardians labels Apr 22, 2024
@ronaldtebrake ronaldtebrake added this to the 12.4.0 milestone Apr 22, 2024
Copy link

mergeable bot commented Apr 22, 2024

Thanks for contributing towards Open Social! A maintainer from the @goalgorilla/maintainers group might not review all changes from all teams/contributors. Please don't be discouraged if it takes a while. In the meantime, we have some automated checks running and it might be that you will see our comments with some tips or requests to speed up the review process. 😊

@ronaldtebrake ronaldtebrake force-pushed the issue/PROD-28762-bottom-bar-features-app branch from 32273d7 to 93ff72e Compare April 22, 2024 10:14
Copy link
Contributor

@vcsvinicius vcsvinicius left a comment

Choose a reason for hiding this comment

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

I approve

@BiaInacio
Copy link
Contributor

Test done, the order was kept on page save!
image

This gives admins a way to deal with the bottom bar features for the App.
This is just a proof of concept, later on we can add SM features when those details are clear.
Right now we use the existing hook as input for the ConfigForm which preferred features are available.
We add a draggable table to the form, which shows all available features.
And we change the place where the hook is invoked, for GraphQl, to the configuration from the form submitted.
@ronaldtebrake ronaldtebrake force-pushed the issue/PROD-28762-bottom-bar-features-app branch from 93ff72e to a18c1b5 Compare April 23, 2024 07:34
@ronaldtebrake ronaldtebrake merged commit 1cecfd8 into main Apr 23, 2024
189 checks passed
@ronaldtebrake ronaldtebrake deleted the issue/PROD-28762-bottom-bar-features-app branch April 23, 2024 09:08
@ronaldtebrake
Copy link
Contributor Author

Cherry picked to 12.4.x

@ronaldtebrake ronaldtebrake added backport: verified This pull request has been back ported to an older minor version and removed status: needs review This pull request is waiting for a requested review labels Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport: verified This pull request has been back ported to an older minor version prio: high team: guardians type: feature Adds a new feature to Open Social
3 participants