Skip to content

Conversation

@amandasiriwardane
Copy link

@amandasiriwardane amandasiriwardane commented Oct 19, 2025

Purpose

This PR updates the DatePicker component in the form module to use the Oxygen UI wrapper instead of importing directly from MUI, ensuring consistency with the design system.

Related Issues

Related PRs

Checklist

  • e2e cypress tests locally verified. (for internal contributers)
  • Manual test round performed and verified.
  • UX/UI review done on the final implementation.
  • Documentation provided. (Add links if there are any)
  • Relevant backend changes deployed and verified
  • Unit tests provided. (Add links if there are any)
  • Integration tests provided. (Add links if there are any)

Security checks

Developer Checklist (Mandatory)

  • Complete the Developer Checklist in the related product-is issue to track any behavioral change or migration impact.

Additional Context

Technical Details:
The Oxygen UI DatePicker (v2.4.6) is a wrapper around MUI's DatePicker component that provides consistent theming and styling across the Identity Server applications. The original implementation imported directly from MUI, bypassing the design system.

Type Handling:
Type assertions were necessary because the Oxygen UI DatePicker uses a generic type parameter TEnableAccessibleFieldDOMStructure which defaults to true. To maintain compatibility with the existing moment.Moment date handling, type assertions were applied to the rest props.

Build Verification:

  • All 13 projects in the monorepo build successfully (13m build time)
  • No TypeScript compilation errors
  • No runtime errors expected as the Oxygen UI DatePicker is a direct wrapper of the MUI component
    -Webpack dev server runs without errors

Impact:

  • No behavioral changes - the DatePicker functionality remains identical
  • No migration impact - this is an internal implementation change
  • No configuration changes required

Note: As an external contributor without the full Identity Server backend setup, manual UI testing was not performed. However, since the Oxygen UI DatePicker is a direct wrapper of the MUI DatePicker with identical props and behavior, functionality remains unchanged. Build validation confirms the code is correct.
Screenshot 2025-10-19 141910
Screenshot 2025-10-19 145214

@CLAassistant
Copy link

CLAassistant commented Oct 19, 2025

CLA assistant check
All committers have signed the CLA.

@pavinduLakshan
Copy link
Member

Note: As an external contributor without the full Identity Server backend setup, manual UI testing was not performed. However, since the Oxygen UI DatePicker is a direct wrapper of the MUI DatePicker with identical props and behavior, functionality remains unchanged. Build validation confirms the code is correct.

Hi @amandasiriwardane, even though the props are identical between two components, there can be differences in UX/runtime errors when replacing MUI components with the oxgen UI components. Therefore, it's strongly recommended to run the console in development mode and add a screencast of the changes done, especially for first time contributors. I'm afraid we wouldn't be able to accept this contribution without that kind of thorough testing. Thanks for your understanding!

@codecov
Copy link

codecov bot commented Oct 20, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 48.75%. Comparing base (203057a) to head (0d0ef27).
⚠️ Report is 137 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #9367   +/-   ##
=======================================
  Coverage   48.75%   48.75%           
=======================================
  Files          42       42           
  Lines        1003     1003           
  Branches      227      250   +23     
=======================================
  Hits          489      489           
+ Misses        514      499   -15     
- Partials        0       15   +15     
Flag Coverage Δ
@wso2is/core 48.75% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pavinduLakshan pavinduLakshan changed the title Issue #25669 add date picker to oxygen UI Replace usage of MUI date picker with Oxygen UI date picker Oct 21, 2025
@amandasiriwardane
Copy link
Author

Note: As an external contributor without the full Identity Server backend setup, manual UI testing was not performed. However, since the Oxygen UI DatePicker is a direct wrapper of the MUI DatePicker with identical props and behavior, functionality remains unchanged. Build validation confirms the code is correct.

Hi @amandasiriwardane, even though the props are identical between two components, there can be differences in UX/runtime errors when replacing MUI components with the oxgen UI components. Therefore, it's strongly recommended to run the console in development mode and add a screencast of the changes done, especially for first time contributors. I'm afraid we wouldn't be able to accept this contribution without that kind of thorough testing. Thanks for your understanding!

Okay will do that

Fixes #25669

- Updated DatePicker import to use @oxygen-ui/react/DatePicker
- Added type assertions to handle Oxygen UI DatePicker generic types
- Improved type safety with moment.isMoment() check in onChange handler
@amandasiriwardane amandasiriwardane force-pushed the issue-#25669-add-date-picker-to-oxygen-ui branch from 0d0ef27 to 5471bb8 Compare October 28, 2025 07:17
@@ -17,8 +17,8 @@
*/

import { AdapterMoment } from "@mui/x-date-pickers/AdapterMoment";
Copy link
Contributor

Choose a reason for hiding this comment

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

Along with the date picker, the AdapterMoment adapter also needs to be wrapped via oxygen-ui and used in identity-apps. Shall we look into that as well?

@@ -115,14 +115,14 @@ const DatePickerFieldAdapter: FunctionComponent<DatePickerFieldAdapterPropsInter
label={ label }
{ ...input }
value={ formattedValue.isValid() ? formattedValue : null }
onChange={ (date: moment.Moment | null) => {
if (date && date.isValid()) {
onChange={ (date: any) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Avoid using any type. Try to define proper types.

@JayaShakthi97
Copy link
Contributor

JayaShakthi97 commented Oct 28, 2025

Once finalized, add changesets as well. You can refer: https://github.com/wso2/identity-apps#releases

@pavinduLakshan
Copy link
Member

Hey @amandasiriwardane, any updates on the progress?

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.

Fix/Add Date picker related components to the oxygen-ui

5 participants