Skip to content

Sidebar should only show parent resources#27

Merged
rambleraptor merged 5 commits intomainfrom
sidebar_only_parents
Aug 19, 2025
Merged

Sidebar should only show parent resources#27
rambleraptor merged 5 commits intomainfrom
sidebar_only_parents

Conversation

@rambleraptor
Copy link
Member

@rambleraptor rambleraptor commented Jan 20, 2025

Part of #26 #20

This PR adds the following:

  • Sidebar filters out resources that have parents
  • Does some reorganization
  • Creates a test for the resource sidebar list


parents(): string[] {
const resource = this.schema["x-aep-resource"]
if ('parents' in resource) {
Copy link
Member

Choose a reason for hiding this comment

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

could you just do resource.parents || []?

}

parentResources(): ResourceSchema[] {
return this.resources().filter((resource) => resource.parents().length == 0);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return this.resources().filter((resource) => resource.parents().length == 0);
return this.resources().filter((resource) => resource.parents().length != 0);

Shouldn't this be values of non-zero length?

Copy link
Member

Choose a reason for hiding this comment

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

ah ok, by "parent" are you referring to resources that have no parents? I'd argue that "root" resources are are a better way to describe that.

A parent is a specific relationship to other resources, it's a little confusing to use that in the context of "resources without a parent".

Copy link
Member

@toumorokoshi toumorokoshi left a comment

Choose a reason for hiding this comment

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

Thanks! I think the code itself is correct, but I worry about the usage of the term "parent' here. Please see my comments.

@toumorokoshi
Copy link
Member

Here's a PR on a proposal for defining the term "root resource" wdyt? aep-dev/aeps#273

@rambleraptor rambleraptor merged commit 3686aea into main Aug 19, 2025
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