[OpenNMS/opennms] d9c761: NMS-20280: Time support for OnmsDatePicker, and Ti...

Scott Theleman via opennms-cvs <[email protected]>
Newsgroups gmane.network.opennms.cvs
Message-ID <OpenNMS/opennms/push/refs/heads/jira/NMS-20280-onms-timepicker/[email protected]>
  Branch: refs/heads/jira/NMS-20280-onms-timepicker
  Home:   https://github.com/OpenNMS/opennms
  Commit: d9c761da2f121d29f454b602b38a3c520e53ea37
      https://github.com/OpenNMS/opennms/commit/d9c761da2f121d29f454b602b38a3c520e53ea37
  Author: Scott Theleman <[email protected]>
  Date:   2026-09-01 (Tue, 01 Sep 2026)

  Changed paths:
    M ui/packages/onms-ui/README.md
    M ui/packages/onms-ui/src/components/OnmsDatePicker.vue
    M ui/packages/onms-ui/src/index.ts
    M ui/packages/onms-ui/src/types.ts
    M ui/src/components/AdhocGraphs/AdhocChartToolbar.vue
    M ui/src/components/AdhocGraphs/AdhocGraphBuilder.vue
    M ui/src/components/AdhocGraphs/utils/adhocUrlState.ts
    A ui/src/components/Common/TimeControls.vue
    A ui/src/components/Common/utils/timeRangeOptions.ts
    M ui/src/components/Resources/Graphs.vue
    R ui/src/components/Resources/TimeControls.vue
    R ui/src/components/Resources/utils/timeRangeOptions.ts
    A ui/tests/components/Common/TimeControls.test.ts
    A ui/tests/components/Common/timeRangeOptions.test.ts
    R ui/tests/components/Resources/timeRangeOptions.test.ts
    M ui/tests/onms-ui/OnmsDatePicker.test.ts

  Log Message:
  -----------
  NMS-20280: Time support for OnmsDatePicker, and TimeControls fixes

OnmsDatePicker (seam layer):
- Declare the time props showTime / timeOnly / hourFormat / showSeconds and
  stepHour / stepMinute / stepSecond, plus placeholder / minDate / maxDate.
  PrimeVue supports seconds natively (showSeconds, stepSecond), so no
  fallback is needed, and timeOnly hides the calendar on its own -- hence no
  separate OnmsTimePicker. Every default matches installed [email protected]'s
  own, so no existing consumer's rendering changes. Passing these by
  attribute fallthrough happens to reach PrimeVue, but seam rule 2 classes
  that as unsupported.
- hourFormat is typed as a new owned OnmsHourFormat ('12' | '24') rather than
  PrimeVue's HintedString, per seam rule 4.
- minDate/maxDate accept Date | null and collapse null to undefined, which
  PrimeVue requires; consumers keep their bounds in nullable refs.
- Emit show / hide so a consumer can observe overlay visibility without
  reaching into PrimeVue internals.

TimeControls:
- Moved to components/Common, together with utils/timeRangeOptions.ts (which
  AdhocGraphs already imported out of Resources). Consumers updated.
- Replace the date-picker-plus-hour-select pair with one showTime picker per
  range end. This also fixes a bug: the hour select defaulted to 1 PM and was
  ADDED to the picked date, so a custom range was silently shifted 13 hours
  unless both selects were touched. Ranges are now minute-precise. The dead
  HOUR_OPTIONS and its test go away.
- A click on the preset list while a picker overlay is open now only dismisses
  that picker, keeping its selection and leaving the popover open, instead of
  selecting a preset. PrimeVue dismisses the overlay from a document-level
  mousedown listener, so the state is latched on mousedown over the list -- a
  check at click time always reads "closed".
- Cross-wire minDate/maxDate between the two pickers so a range cannot invert.
- New optional `label` prop renders a bold label beside the trigger button and
  names it with aria-labelledby. AdhocChartToolbar drops its local span and
  CSS for it; the Resource Graphs page gains the label it was missing. Doing
  this in the component is what the AdhocChartToolbar comment asked for: the
  attribute applied from outside lands on a plain root div and is inert.
- Drop .wrapper's fixed 70px height (a 70px box around a 35px button) so the
  label and button text share a baseline; apply is now variant="ghost", with
  1em between the Start, End and Apply blocks.

Tests: OnmsDatePicker contract tests for every new prop and emit, and a new
TimeControls suite covering the custom-range arithmetic, the mousedown-latched
preset suppression, the range bounds and the label wiring.



To unsubscribe from these emails, change your notification settings at https://github.com/OpenNMS/opennms/settings/notifications


_______________________________________________
Please read the OpenNMS Mailing List FAQ:
http://www.opennms.org/wiki/index.php?page=MailingListFaq
opennms-cvs mailing list

To *unsubscribe* or change your subscription options, see the bottom of this page:
https://lists.sourceforge.net/lists/listinfo/opennms-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.