Skip to content

feat(Forms): add Field.InstallmentDay and Value.InstallmentDay components - #8599

Open
langz wants to merge 17 commits into
mainfrom
feat/field-installment-date
Open

langz wants to merge 17 commits into
mainfrom
feat/field-installment-date

Conversation

@langz

@langz langz commented Jun 16, 2026 •

Copy link
Copy Markdown
Member

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:

image

image

Screenshots

This pull request adds new components, so there is no before. Chromium, ui theme, nb-NO, from this pull request (df5cb68). Compare with «How it looks today in DNB» above.

Opened, scrolled to the endWith a value, and Value.InstallmentDayrequired, with an error
Field.InstallmentDay with the label Avdragsdag, opened and scrolled to the end. The list shows the days 14 to 28 and «Siste dagen i måneden».Field.InstallmentDay shows «15. dagen i måneden». Below it, Value.InstallmentDay shows «15. dagen i måneden» and «Siste dagen i måneden».Field.InstallmentDay with the error «Du må velge en avdragsdag.»

@github-actions

github-actions Bot commented Jun 16, 2026 •

Copy link
Copy Markdown
Contributor

Branch Preview URL (stable):
https://pr-8599.eufemia-e25.pages.dev

https://pr-8599.eufemia-e25.pages.dev

Deployment URL (unique):
https://c93e00e7.eufemia-e25.pages.dev

https://c93e00e7.eufemia-e25.pages.dev

@pkg-pr-new

pkg-pr-new Bot commented Jun 16, 2026 •

Copy link
Copy Markdown

commit: ecd9cb4

@langz
langz force-pushed the feat/field-installment-date branch from 104fc5e to d4f4fb5 Compare June 16, 2026 11:23
@langz langz changed the title feat(Forms): add Field.InstallmentDate component feat(Forms): add Field.InstallmentDay component Jun 16, 2026
@langz langz changed the title feat(Forms): add Field.InstallmentDay component feat(Forms): add Field.InstallmentDay component [DRAFT] Jun 16, 2026
@langz
langz force-pushed the feat/field-installment-date branch 4 times, most recently from 0a33906 to 2012b3f Compare June 25, 2026 08:06
@langz
langz marked this pull request as ready for review June 25, 2026 08:07
@langz langz changed the title feat(Forms): add Field.InstallmentDay component [DRAFT] feat(Forms): add Field.InstallmentDay component Jun 25, 2026

@tujoworker tujoworker left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@langz
langz force-pushed the feat/field-installment-date branch from 2012b3f to 9834f8f Compare June 26, 2026 10:18
@langz

langz commented Jun 26, 2026

Copy link
Copy Markdown
Member Author

I'm quite pleased with this PR now 🚀
I would like to run this through UX some time after the summer vacation 🌞

@langz
langz force-pushed the feat/field-installment-date branch 3 times, most recently from 54cf258 to 56142e3 Compare July 2, 2026 09:16
@langz
langz force-pushed the feat/field-installment-date branch from 56142e3 to 9815aa2 Compare August 5, 2026 08:17
@langz
langz force-pushed the feat/field-installment-date branch 2 times, most recently from b2e9b90 to 30a3bb7 Compare August 20, 2026 11:57
@langz
langz force-pushed the feat/field-installment-date branch 2 times, most recently from 16c70b8 to a4a178a Compare September 15, 2026 10:38
@langz langz changed the title feat(Forms): add Field.InstallmentDay component feat(Forms): add Field.InstallmentDay and Value.InstallmentDay components Sep 15, 2026
@langz
langz force-pushed the feat/field-installment-date branch 2 times, most recently from 977f70a to cd77603 Compare September 16, 2026 12:27
@langz
langz force-pushed the feat/field-installment-date branch 2 times, most recently from b223fb8 to 79a086f Compare October 2, 2026 19:29
langz

This comment was marked as outdated.

@langz
langz force-pushed the feat/field-installment-date branch 2 times, most recently from d5c9dab to 2b662b5 Compare October 13, 2026 13:28
@langz

This comment has been minimized.

langz

This comment was marked as outdated.

langz

This comment was marked as outdated.

langz and others added 16 commits November 24, 2026 20:20
…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.
…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.

@langz langz left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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, which main added in #11014. I merged the old head with main at 541b379 and ran the test: it fails 1 of 3 and names both InstallmentDay/info.mdx files. That run is the control, because it proves the command catches the problem. The test passes 3 of 3 on 5216201 and on 3542345.
  • Resolved for now: the change log version. ## v11.20.0 is still right. The newest release is v11.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 fieldBlockProps from useFieldProps to the FieldBlock in InstallmentDay.tsx:219-229. #9887 still adds fieldBlockProps, and it does not touch InstallmentDay.
  • 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..5216201 shows 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) against main, apart from the blob ids.
    • A local merge of de682c5 with main gives exactly the tree of 9ddcefe.
    • No file changed on both sides since the old base.
  • The new commits change only the two info.mdx files.
    • 5216201 reorders the sections and adds the ## Available days heading. The sorted lines of each file differ only by that heading, so no text was lost.
    • 3542345 changes one line, from "By default it shows" to "By default, Field.InstallmentDay shows". The paragraph now names its subject, which it needs after the move. The sentence follows the link list.
  • The docs rules that main added since 77ae2b5 (#11013, #11014, #11019):
    • On 5216201, four portal tests pass (42 tests): page-sections, page-headings, page-ids and MdxSidebarNavigation.
    • On 3542345, page-sections and page-headings pass (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 ## Import and ## Relevant links". The sibling Field.DateOfBirth uses the same place for ## Validators.
  • The branch preview of 3542345 (6f9da22e, built with VITE_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.md copy has the same order and sentence.
    • I checked the Value page's section order (Description, Import, Relevant links) on the preview of 5216201 (e871f85c). 3542345 does not change that file.
  • Tests with Node 24.20, run on 5216201. 3542345 changes 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 to sv-SE, the translations override, and a string value.
    • Six related test files pass (345 tests): uniqueIds, FormsTranslations, both useTranslation files, useValueProps and supportsSpacingProps.
  • 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.

This branch was successfully deployed

2 active deployments
Package preview — 35423457 Deployed Nov 24, 2026 by github-actions[bot]
Portal preview — 35423457 Deployed Nov 24, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants