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

Explicitly unpack List config items from adminMeta #2892

Merged
merged 1 commit into from
May 6, 2020

Conversation

timleslie
Copy link
Contributor

No description provided.

@request-info
Copy link

request-info bot commented May 5, 2020

It looks like we could use some more details. Good titles and descriptions help us fix things faster. If you can provide more information please update this issue.

@changeset-bot
Copy link

changeset-bot bot commented May 5, 2020

🦋 Changeset is good to go

Latest commit: 22d49fd

We got this.

This PR includes changesets to release 1 package
Name Type
@keystonejs/app-admin-ui Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Member

@molomby molomby left a comment

Choose a reason for hiding this comment

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

I prefer this also

Comment on lines +65 to +75
Object.entries(lists || {}).forEach(
([key, { access, adminConfig, adminDoc, fields, gqlNames, label, path, plural, singular }]) => {
const list = new List(
{ access, adminConfig, adminDoc, fields, gqlNames, key, label, path, plural, singular },
adminMeta,
views[key]
);
listsByKey[key] = list;
listsByPath[list.path] = list;
}
);
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure I follow why this expansion. In this specific case I found it harder to reason about. ...not that I mind much.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The idea here is to make it explicit about what things we're taking out of the adminMeta object and where we're sending them. Once all of this is complete I want to know precisely how we're using the adminMeta object. The reason this is so important is that it's particularly wacky the way this thing gets passed across to the client via webpack, so it helps to have it all laid out what we're doing with it, rather than having the whole object being shipped off to other parts of the code base.

@timleslie timleslie force-pushed the explicit-list-args branch from d7bf325 to 22d49fd Compare May 5, 2020 23:54
@timleslie timleslie merged commit 3cd5f20 into master May 6, 2020
@timleslie timleslie deleted the explicit-list-args branch May 6, 2020 00:10
This was referenced May 6, 2020
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.

3 participants