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

Refactor creation of aux lists in Content blocks #1674

Closed
MadeByMike opened this issue Sep 18, 2019 · 2 comments
Closed

Refactor creation of aux lists in Content blocks #1674

MadeByMike opened this issue Sep 18, 2019 · 2 comments

Comments

@MadeByMike
Copy link
Contributor

Pull request #1673 introduced an access control function repeated in all field implementations with AUX tables see: https://github.com/keystonejs/keystone-5/pull/1673/files#diff-17ecbca59700f2ff86be5edc3ee5f317R60

access: Object.entries(listConfig.listAccess).reduce(
  (acc, [schemaName, access]) => ({
    ...acc,
    [schemaName]: Object.entries(access).reduce(
      (acc, [op, rule]) => ({ ...acc, [op]: !!rule }), // Reduce the entries to truthy values
      {}
    )
  }),
  {}
);

This should be added to a utility function or one level higher with the way we create these Aux lists for blocks.

@timleslie is especially keen to make this improvement.

@timleslie
Copy link
Contributor

We should definitely factor out the Aux list creation, not just the access control portion, as there is a bunch of other duplicated stuff in there already.

@timleslie timleslie changed the title Refactor access functions for field implementations with AUX tables Refactor creation of aux lists in Content blocks Sep 18, 2019
@stale
Copy link

stale bot commented Nov 17, 2019

It looks like you haven't had a response in over 3 months. Sorry about that! We've flagged this issue for special attention. It wil be manually reviewed by maintainers, not automatically closed. If you have any additional information please leave us a comment. It really helps! Thank you for you contributions. :)

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

No branches or pull requests

2 participants