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
Display min/max limits with field description #15424
Conversation
Codecov ReportBase: 61.27% // Head: 61.28% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #15424 +/- ##
=======================================
Coverage 61.27% 61.28%
=======================================
Files 1355 1355
Lines 33499 33491 -8
Branches 6455 6449 -6
=======================================
- Hits 20528 20526 -2
+ Misses 11144 11142 -2
+ Partials 1827 1823 -4
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Your padding between the two lines & font weight on the character count don't look correct looking at the image you've shared. Would you be able to double check and revisit? At the moment it looks a bit lost. |
packages/core/admin/admin/src/content-manager/components/Inputs/utils/fieldDescription.js
Outdated
Show resolved
Hide resolved
feat(content-manager): construct min/max description separately from main description
Yeah I know what you mean. We had agreed as a first step to implement it like this (see CONTENT-863) but I agree it looks a bit strange. WDYT @gu-stav ? |
packages/core/admin/admin/src/content-manager/components/Inputs/index.js
Outdated
Show resolved
Hide resolved
Ah i didn't see that this was agreed on. In that case leave it if @maevalienard is happy. |
Well I'd rather see the min/max as semibold but it was easier as such :) |
packages/core/admin/admin/src/content-manager/components/Inputs/index.js
Outdated
Show resolved
Hide resolved
packages/core/helper-plugin/lib/src/hooks/useFieldHint/index.js
Outdated
Show resolved
Hide resolved
packages/core/helper-plugin/lib/src/hooks/useFieldHint/index.js
Outdated
Show resolved
Hide resolved
packages/core/helper-plugin/lib/src/hooks/useFieldHint/index.js
Outdated
Show resolved
Hide resolved
packages/core/helper-plugin/lib/src/hooks/useFieldHint/index.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some feedback on your hook, i'd want to avoid disabling eslint rules for hooks where possible, i'd double check my comments before just committing them, i didn't double check what i wrote!
packages/core/admin/admin/src/content-manager/components/Inputs/utils/getMinMax.js
Outdated
Show resolved
Hide resolved
packages/core/helper-plugin/lib/src/components/GenericInput/utils/fieldUnits.js
Outdated
Show resolved
Hide resolved
packages/core/helper-plugin/lib/src/hooks/useFieldHint/index.js
Outdated
Show resolved
Hide resolved
packages/core/helper-plugin/lib/src/hooks/useFieldHint/index.js
Outdated
Show resolved
Hide resolved
packages/core/helper-plugin/lib/src/hooks/useFieldHint/index.js
Outdated
Show resolved
Hide resolved
packages/core/helper-plugin/lib/src/hooks/useFieldHint/index.js
Outdated
Show resolved
Hide resolved
packages/core/helper-plugin/lib/src/hooks/useFieldHint/index.js
Outdated
Show resolved
Hide resolved
packages/core/helper-plugin/lib/src/hooks/useFieldHint/index.js
Outdated
Show resolved
Hide resolved
fix(helper-plugin): useFieldHint dependencies array
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM ⭐
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks much better - good work! 🚀 I think there is only one tricky question left about this can be translated by the community, but maybe I just don't see the whole idea yet :)
A few notes/ questions from a functional test:
- if I add the
min
(e.g. 10) validation to a field and leave the field empty while saving there is no validation error. This means the BE does not validate this constraint at the moment. Should we track this in a follow-up bug (max validation seems to work)? - there is no validation in case the "default value" entered in the CTB is longer than the allowed maximum, which might be a ux problem? Again: follow-up task?
- for richtext fields currently these constraints are not displayed. I guess this is intentional?
integer
/decimal
fields display constraints, while biginteger fields do not. I guess you haven't touched that - should we track this in a follow-up issue?
packages/core/admin/admin/src/content-manager/components/Inputs/utils/getMinMax.js
Outdated
Show resolved
Hide resolved
packages/core/helper-plugin/lib/src/components/GenericInput/utils/fieldUnits.js
Outdated
Show resolved
Hide resolved
packages/core/helper-plugin/lib/src/hooks/useFieldHint/index.js
Outdated
Show resolved
Hide resolved
packages/core/helper-plugin/lib/src/hooks/useFieldHint/tests/useFieldHint.test.js
Outdated
Show resolved
Hide resolved
test(helper-plugin): getFieldUnits feat(I18n): add en.json translations for min/max descriptions feat(content-manager): support min/max descriptions in Wysiwyg and BIGINT inputs test(content-manager): getMinMax
Thanks for the review @gu-stav 🙏🏻, I've addressed your comments in the latest commits. The only outstanding things are the validation issues you spotted. I agree these should be tracked in separate issues, I can make the JIRA tickets. |
packages/core/helper-plugin/lib/src/components/GenericInput/utils/getFieldUnits.js
Outdated
Show resolved
Hide resolved
packages/core/helper-plugin/lib/src/hooks/useFieldHint/index.js
Outdated
Show resolved
Hide resolved
refactor(helper-plugin) fix(helper-plugin):combine translation strings
packages/core/helper-plugin/lib/src/hooks/useFieldHint/index.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me now! 🚀 Thank you!
packages/core/helper-plugin/lib/src/hooks/useFieldHint/index.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's been a journey, but really great work 👍🏼
What does it do?
Adds the min and max constraints to field descriptions
How to test it?
packages/core/helper-plugin/lib/src/hooks/useFieldHint/tests/useFieldHint.test.js