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 empty token group creation #3245

Merged
merged 8 commits into from
Jan 14, 2025
Merged

Conversation

akshay-gupta7
Copy link
Contributor

Why does this PR exist?

Fixes #2171

What does this pull request do?

Currently, users can name token like abc...... (probably sometimes by mistake), which results in the creation of empty nested groups, thereby mangling with the tokens json. This PR will now not allow for such names to be entered

Testing this change

  • Try to create a token with a name like abc......
  • User will be displayed a message "Token names cannot contain empty groups"

Additional Notes (if any)

Screenshot 2025-01-09 at 11 41 06 PM

@akshay-gupta7 akshay-gupta7 self-assigned this Jan 9, 2025
Copy link

changeset-bot bot commented Jan 9, 2025

🦋 Changeset detected

Latest commit: c4b66e6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@tokens-studio/figma-plugin 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
Contributor

github-actions bot commented Jan 9, 2025

⤵️ 📦 ✨ The artifact was successfully created! Want to test it? Download it here 👀 🎁

@akshay-gupta7 akshay-gupta7 requested a review from six7 January 9, 2025 18:15
Copy link
Contributor

github-actions bot commented Jan 9, 2025

Commit SHA:d7a942903c41ff91605071bb0b1aedd91502fcb6

Test coverage results 🧪

Code coverage diff between base branch:main and head branch: fix-empty-token-group-creation 
Status File % Stmts % Branch % Funcs % Lines
🟢 total 67.09 (0) 58.08 (0.03) 63.87 (0.01) 67.47 (0.01)
🟢 packages/tokens-studio-for-figma/src/app/components/EditTokenForm.tsx 50 (0.99) 34.23 (2.16) 40.81 (1.23) 51.72 (0.96)

Copy link
Collaborator

@six7 six7 left a comment

Choose a reason for hiding this comment

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

Nice!

@keeganedwin
Copy link
Collaborator

Successfully reproduced the fix for this issue:
CleanShot 2025-01-15 at 00 06 34@2x

@akshay-gupta7 akshay-gupta7 merged commit c83b514 into main Jan 14, 2025
10 checks passed
@akshay-gupta7 akshay-gupta7 deleted the fix-empty-token-group-creation branch January 14, 2025 18:45
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.

Creating tokens without token or group name
3 participants