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

Closed
wants to merge 7 commits into from

Conversation

TomPridham
Copy link
Contributor

@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 Dec 2, 2024 5:03pm

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
Contributor 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

@jtran
Copy link
Collaborator

jtran commented Dec 2, 2024

Merged in #4595.

@jtran jtran closed this Dec 2, 2024
@TomPridham TomPridham deleted the fix/directory-count branch December 3, 2024 15:32
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