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

fix: only count something as a directory if it has children #4556

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

TomPridham
Copy link

@TomPridham TomPridham commented Nov 23, 2024

closes #4515
Every entry was being counted as a directory on the ProjectCard when it should have only been counting entries with children
With this file tree:

dsf.kcl
fgk.kcl
folder
folder-1
main.kcl
project.toml

before:
Screenshot from 2024-11-23 12-01-30
after:
Screenshot from 2024-11-23 12-01-07

Copy link

qa-wolf bot commented Nov 23, 2024

QA Wolf here! As you write new code it's important that your test coverage is keeping up.
Click here to request test coverage for this PR!

Copy link

vercel bot commented Nov 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
modeling-app ✅ Ready (Inspect) Visit Preview Nov 27, 2024 10:11pm

Copy link
Collaborator

@jtran jtran left a comment

Choose a reason for hiding this comment

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

Looks good to me.

Comment on lines +311 to +313
if (entry.children !== null) {
count += 1
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I would have done if (!entry.children) continue; but this works too :P

@TomPridham
Copy link
Author

Are the test failures expected? They don't seem related to my changes, but I also can't run those failing tests locally.

@jtran
Copy link
Collaborator

jtran commented Nov 27, 2024

Our CI currently has problems with forks outside the org #4124. I cherry-picked your change on a new PR here: #4595

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.

[BUG]: The count of number of folders when displayed on the project page is incorrect.
4 participants