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

Fork number-field and text-field templates #2495

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft

Conversation

mollykreis
Copy link
Contributor

Pull Request

🀨 Rationale

Fork the FAST templates for the number-field and the text-field in preparation for adding a required-visible icon to the label (see #2100)

πŸ‘©β€πŸ’» Implementation

Forked the FAST templates for the number-field and the text-field with no functional changes.

πŸ§ͺ Testing

Verified tests still pass and no visual changes were introduced to those components.

βœ… Checklist

  • I have updated the project documentation to reflect my changes or determined no changes are needed.

Comment on lines 22 to 28
if (props) {
// eslint-disable-next-line guard-for-in
for (const key in props) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-explicit-any
(element as any)[key] = (props as any)[key].toString();
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note: This function broke quite a few lint rules we have in place for nimble. I chose to mostly disable those rules and keep the original code rather than completely re-write this function. Let me know if you think it would be better to find a different way to write this code.

Copy link
Contributor

Choose a reason for hiding this comment

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

If you have ideas on another way to write it without disabling the lint rules, it's probably worth doing so (I think we try to fix 'small' lint issues rather than suppress, when we bring FAST tests over).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I fixed one of the lint rules, but the collection of issues around assigning an arbitrary property from props to element seems much more challenging to fix (at least without jumping through a bunch of typing hoops).

@mollykreis mollykreis requested a review from msmithNI December 12, 2024 17:12
@mollykreis
Copy link
Contributor Author

@msmithNI, will you buddy this PR for me?

@mollykreis mollykreis changed the title Fork templates Fork number-field and text-field templates Dec 12, 2024
Comment on lines 22 to 28
if (props) {
// eslint-disable-next-line guard-for-in
for (const key in props) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-explicit-any
(element as any)[key] = (props as any)[key].toString();
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

If you have ideas on another way to write it without disabling the lint rules, it's probably worth doing so (I think we try to fix 'small' lint issues rather than suppress, when we bring FAST tests over).

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