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

Introduce config entity for managing GDPR settings. #7

Open
wants to merge 19 commits into
base: features/consent
Choose a base branch
from

Conversation

JeremySkinner
Copy link

Introduces a config entity for storing GDPR field settings with a separate form which resolves the issues with base fields not being editable.

image

Clicking the edit link next to the field on the GDPR field list page takes you to a separate page where the settings can be modified:

image

For editable fields, GDPR settings can still be edited through the field settings form, as before.

*/
public static function create(array $array) {
$field = new GdprField($array['bundle'], $array['name']);
$field->rtf = $array['rtf'];
Copy link
Contributor

Choose a reason for hiding this comment

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

Lets call $array $values instead, and use new static($values['bundle'] ... ) as we don't need to explicitly name the class in a static method.

Copy link
Author

Choose a reason for hiding this comment

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

Done

Copy link
Contributor

Choose a reason for hiding this comment

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

Did you push the branch? 😛

Copy link
Author

Choose a reason for hiding this comment

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

Yes, I pushed develop. I'll merge it to here too.

*/
public function setField($bundle, $field_name, $enabled, $rta, $rtf, $sanitizer, $notes) {
$this->bundles[$bundle][$field_name] = [
'bundle' => $bundle,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this could be more generic. rather than having to pass every field in as a separate parameter. $bundle and $field_name are still good to force as they are necessary for any update.

  public function setField($bundle, $field_name, $values) {

    $values['bundle'] = $bundle;
    $values['name'] = $field_name;

    foreach ($values as $key => $value) {
      $this->bundles[$bundle][$field_name][$key] = $value;
    }

This way we can pass anything in with values, either less than all fields or add more fields without having to change the function.

Copy link
Author

Choose a reason for hiding this comment

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

Done

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.

2 participants