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(1-3377): handle singular counts in project status lifecycle boxes #9317

Merged
merged 2 commits into from
Feb 17, 2025

Conversation

thomasheartman
Copy link
Contributor

@thomasheartman thomasheartman commented Feb 17, 2025

If the average number of days in a stage is 1, use 1 day instead of
1 days.

Likewise, if your total number of archived flags is 1, use 1 flag archived instead of 1 flags archived.

I grepped through the file, but couldn't find any other hardcoded instances of "flags" or "days", so I think this is everything.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
If the average number of days in a stage is 1, use `1 day` instead of
`1 days`.

Likewise, if your total number of archived flags is 1, use `1 flag
archived` instead of `1 flags archived`.
Copy link

vercel bot commented Feb 17, 2025

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

Name Status Preview Comments Updated (UTC)
unleash-monorepo-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 17, 2025 0:38am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Visit Preview Feb 17, 2025 0:38am

Copy link
Contributor

github-actions bot commented Feb 17, 2025

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Files

Comment on lines 170 to 173
const totalArchivedStat = () => {
const count = data?.lifecycleSummary.archived.last30Days ?? 0;
return `${count} ${count === 1 ? 'flag' : 'flags'} archived`;
};
Copy link
Member

Choose a reason for hiding this comment

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

this can be a variable, not a function

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It can be, but I'm not sure what you get from it. doing it as a function gives you scope to name variables and separate it from other stuff. I don't mind, though 🤷🏼

Copy link
Member

Choose a reason for hiding this comment

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

Scoping is a for of an abstraction - to me it makes this code less declarative, less "linear" to read if you need to understand everything that's going on, instead of trusting the function name

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@thomasheartman thomasheartman enabled auto-merge (squash) February 17, 2025 12:37
@thomasheartman thomasheartman merged commit b15502e into main Feb 17, 2025
11 checks passed
@thomasheartman thomasheartman deleted the fix(1-3377)/singular-plural-in-project-status branch February 17, 2025 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants