Repository navigation
Conversation
|
Branch Preview URL (stable): Deployment URL (unique): |
commit: |
104fc5e to
d4f4fb5
Compare
0a33906 to
2012b3f
Compare
tujoworker
left a comment
There was a problem hiding this comment.
Nice work 🫶
An entry in the change log would we good: https://feat-field-installment-date.eufemia-e25.pages.dev/uilib/extensions/forms/changelog
2012b3f to
9834f8f
Compare
|
I'm quite pleased with this PR now 🚀 |
54cf258 to
56142e3
Compare
56142e3 to
9815aa2
Compare
b2e9b90 to
30a3bb7
Compare
16c70b8 to
a4a178a
Compare
977f70a to
cd77603
Compare
b223fb8 to
79a086f
Compare
d5c9dab to
2b662b5
Compare
This comment has been minimized.
This comment has been minimized.
ecd9cb4 to
de682c5
Compare
…ents Add a dropdown-based Field.InstallmentDay for selecting which day of the month a recurring monthly payment is collected (e.g. loan instalments or standing orders), with a corresponding read-only Value.InstallmentDay. - Shows days 1-28 plus an optional "Last day of month" option (showLastDay); days 29-31 are excluded because they do not exist in every month. Use the days prop to constrain the selectable days. - The dropdown lists plain numbers, while the selected value is shown as a localized ordinal phrase (e.g. "3rd day of the month" in en-GB), derived from native Intl.PluralRules so intl-messageformat is not pulled into the bundle. - Robustly renders a value outside the available options: a numeric value not in days is injected in sorted order, and a 'last' value is shown even when showLastDay is false. - Value type is number | 'last'. width defaults to large (stretched) so the phrase is not truncated; size and the standard field props are supported. - Translations for nb-NO, en-GB (British "instalment" spelling), sv-SE and da-DK, using idiomatic ordinal forms per locale. - Includes documentation (info, demos, properties, events, a transformOut backend-format example), a v11.8.0 changelog entry, and tests.
Injecting an out-of-range value re-sorted the whole option list, so the option order depended on whether the current value happened to be in the given days. Insert the extra day in place instead, and cover it with tests. The change log entry targeted v11.8.0, which was released back in July; the next minor is v11.14.0. Also drop the unused `theme` frontmatter key, which nothing in the portal reads.
The English selected value read either "15th day of the month" or "Last day of month". The Norwegian, Danish and Swedish strings are all internally consistent, so align English on "Last day of the month" and follow the wording through the documentation. Document showLastDay by how to turn it off, since it is on by default, and note that the option still appears when the value is 'last'. Also pin the Form.Handler locale path for the ordinal phrase. The existing test sets the locale on Provider, which stays green even if Field.Provider stops forwarding the locale into the shared context.
Field.Selection needed the same guard in #9244, where recreating the normalized data on every render caused unnecessary DrawerList state updates during surrounding form rerenders. Field.InstallmentDay already holds that property but nothing protected it. The third case pins the reason the extra out-of-range day is tracked separately from the value: moving between days that are already in the list must not rebuild it. Depending on the value instead of that extra day leaves the first two cases green and only fails this one.
A handler given in htmlAttributes replaced the field's own onChange and onClose, which the spread-props/no-unmerged-own-props rule now reports.
The en-GB translation keeps instalment, and en-US now overrides it, as the spelling guideline asks.
FieldInstallmentDayProps removes layout and layoutOptions, so the General properties table no longer lists them. Boolean, Toggle, DateOfBirth, PhoneNumber and Indeterminate hide them the same way.
…og entry to v11.18.0
…nge log entry to v11.20.0 The sidebar now shows labels in sentence case with a matching breadcrumb, so "Installment day" replaces "Field.InstallmentDay" and "Value.InstallmentDay". v11.18.0 shipped without these components, and v11.19.0 is about to be released from main, so the entry now targets the next version. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Move the paragraph about the default days into its own section after Relevant links, as the documentation guideline asks.
de682c5 to
5216201
Compare
langz
left a comment
There was a problem hiding this comment.
Review of 3542345: Approve (posted as a comment, because GitHub does not let the PR author approve their own PR)
Since the last review (de682c5), the branch was rebased onto main at 541b379 with no conflicts. It also got two new commits. 5216201 ("Show the InstallmentDay description before the import") fixes the must-fix from the last review: both Info pages now start with ## Description, and page-sections.test.ts passes. 3542345 ("Name Field.InstallmentDay in the available days paragraph") changes one sentence in the new ## Available days section. The code is unchanged, and no must-fix remains. The new head already contains main at 541b379.
Earlier findings
- Resolved: the Info pages failed
vite/__tests__/page-sections.test.ts, whichmainadded in #11014. I merged the old head withmainat541b379and ran the test: it fails 1 of 3 and names bothInstallmentDay/info.mdxfiles. That run is the control, because it proves the command catches the problem. The test passes 3 of 3 on5216201and on3542345. - Resolved for now: the change log version.
## v11.20.0is still right. The newest release isv11.18.1, and #10980 ("release of v11.19.0") is still open. If this PR merges before #10980, move the entry to## v11.19.0. - Still open (needs a person): #9887 is still not merged. Whichever PR merges second must pass
fieldBlockPropsfromuseFieldPropsto theFieldBlockinInstallmentDay.tsx:219-229. #9887 still addsfieldBlockProps, and it does not touchInstallmentDay. - Still open (needs a person): there is still no record of the UX sign-off that tujoworker asked for before merge on 22 October.
What I checked
- The rebase:
git range-diff 77ae2b5..de682c5 541b379..5216201shows all 15 earlier commits as=, plus the one new commit.- The PR diff of the old head against its base is identical to the diff of
9ddcefe(the rebased old head) againstmain, apart from the blob ids. - A local merge of
de682c5withmaingives exactly the tree of9ddcefe. - No file changed on both sides since the old base.
- The new commits change only the two
info.mdxfiles.5216201reorders the sections and adds the## Available daysheading. The sorted lines of each file differ only by that heading, so no text was lost.3542345changes one line, from "By default it shows" to "By default,Field.InstallmentDayshows". The paragraph now names its subject, which it needs after the move. The sentence follows the link list.
- The docs rules that
mainadded since77ae2b5(#11013, #11014, #11019):- On
5216201, four portal tests pass (42 tests):page-sections,page-headings,page-idsandMdxSidebarNavigation. - On
3542345,page-sectionsandpage-headingspass (9 tests). - Neither page has an Accessibility section.
- The new layout follows the guideline, which says to give longer topics "a section of their own after
## Importand## Relevant links". The siblingField.DateOfBirthuses the same place for## Validators.
- On
- The branch preview of
3542345(6f9da22e, built withVITE_GITHUB_COMMIT_SHA=3542345), in Firefox with the DNB fonts loaded:- The Field page shows Description, Import, Relevant links, Available days, then Demos.
- The new section reads "By default, Field.InstallmentDay shows days 1–28 …".
- The generated
InstallmentDay.mdcopy has the same order and sentence. - I checked the Value page's section order (Description, Import, Relevant links) on the preview of
5216201(e871f85c).3542345does not change that file.
- Tests with Node 24.20, run on
5216201.3542345changes only one MDX line, so these results still apply:- The 4 InstallmentDay test files pass (61 tests).
- The 9 probe tests from the last review pass. They cover the label options, server rendering, the error inside
Field.Composition, the locale switch tosv-SE, thetranslationsoverride, and a string value. - Six related test files pass (345 tests):
uniqueIds,FormsTranslations, bothuseTranslationfiles,useValuePropsandsupportsSpacingProps.
- Prettier passes on both changed files at
3542345.
CI on 3542345794: all 23 checks passed. Rechecked just before posting: the head is still 3542345. The visual-regression job ran all 120 screenshot files, and they passed.
Motivation: https://dnb-it.slack.com/archives/CMXABCHEY/p1781514294343769 and #8579 (comment)
Deploy preview: https://feat-field-installment-date.eufemia-e25.pages.dev/uilib/extensions/forms/feature-fields/InstallmentDay/demos
How it looks today in DNB:
Screenshots
This pull request adds new components, so there is no before. Chromium,
uitheme,nb-NO, from this pull request (df5cb68). Compare with «How it looks today in DNB» above.required, with an error