Skip to content

Conversation

@brionmario
Copy link
Member

@brionmario brionmario commented Jul 2, 2025

Purpose

This pull request introduces several updates to the Asgardeo JavaScript SDK, including enhancements to organization management, API improvements, and updates to theming functionality. The most notable changes include the addition of new methods for handling organizations, updates to the API response structure, and the introduction of a comprehensive theme creation utility with support for custom configurations and dark mode.

Enhancements to organization management:

  • Updated switchOrganization and getOrganizations methods in AsgardeoJavaScriptClient to include support for session IDs and return more detailed responses, such as TokenResponse or AllOrganizationsApiResponse. ([[1]](https://github.com/asgardeo/javascript/pull/87/files#diff-1de99ccf9a6555feff096d35ba4d4626b4d42ce6da23d9b9ed996bb3f65e1bcbL33-R43), [[2]](https://github.com/asgardeo/javascript/pull/87/files#diff-47d1628f385e7a95ba078012412f6b43a3af85373b276c74b1a7f620f89d8581L40-R52), [[3]](https://github.com/asgardeo/javascript/pull/87/files#diff-47d1628f385e7a95ba078012412f6b43a3af85373b276c74b1a7f620f89d8581L58-R66))
  • Added new interface AllOrganizationsApiResponse for paginated organization responses, replacing the previous PaginatedOrganizationsResponse. ([[1]](https://github.com/asgardeo/javascript/pull/87/files#diff-4856bf64c07f5f9176749dbf7f720719abaefc7d70d3c316656f391270ee6035R26-R35), [[2]](https://github.com/asgardeo/javascript/pull/87/files#diff-79296621b96b8d639da909543b1fd217ad3c2f31d53e2c7582e86ba5253f6e0fL19-L31), [[3]](https://github.com/asgardeo/javascript/pull/87/files#diff-79296621b96b8d639da909543b1fd217ad3c2f31d53e2c7582e86ba5253f6e0fL123-R113))

API improvements:

  • Refactored getScim2Me to process user usernames before returning the response using a newly introduced utility function processUsername. ([[1]](https://github.com/asgardeo/javascript/pull/87/files#diff-0d8b77f6e2a7070081091b5c3864480dbdbd9f7bdaf30cbb59412912378922d9R21), [[2]](https://github.com/asgardeo/javascript/pull/87/files#diff-0d8b77f6e2a7070081091b5c3864480dbdbd9f7bdaf30cbb59412912378922d9L133-R136))
  • Fixed URL resolution in getBrandingPreference and getScim2Me APIs to ensure proper endpoint paths. ([[1]](https://github.com/asgardeo/javascript/pull/87/files#diff-daae96c0966c861401953667db84adeca004b669cff391291ad418b2314e2415L137-R137), [[2]](https://github.com/asgardeo/javascript/pull/87/files#diff-0d8b77f6e2a7070081091b5c3864480dbdbd9f7bdaf30cbb59412912378922d9L106-R107))

Theming functionality:

  • Introduced a new createTheme utility with support for custom configurations, dark mode, and CSS variable prefixes. Comprehensive test coverage added for this utility. ([packages/javascript/src/theme/createTheme.test.tsR1-R98](https://github.com/asgardeo/javascript/pull/87/files#diff-a292551729f130c438c1741dce3d78efe0847571f883abe0869a9e07e1685264R1-R98))
  • Expanded ThemeTypography and ThemeColors interfaces to include detailed typography and action-related color properties. ([packages/javascript/src/theme/types.tsR19-R56](https://github.com/asgardeo/javascript/pull/87/files#diff-a1f5614ca9519ec291c8191c45b409f396ab60acdfedc76a3a78387afdd5952cR19-R56))

Internationalization updates:

  • Added new translations for organization-related UI elements, such as "Switch", "Refresh", and "Load More Organizations". ([[1]](https://github.com/asgardeo/javascript/pull/87/files#diff-2c22f979243dfaf9d2031311426ff5516e255f5f9c2b8984770dbf9e779178a7L91-R102), [[2]](https://github.com/asgardeo/javascript/pull/87/files#diff-e5f67c806e5be95de3b966cbc9cd589a7ebcb89afe790c612b66c0c91361142cR91-R100))

Miscellaneous improvements:

  • Updated exports in index.ts to include new models and utilities, such as processUsername and transformBrandingPreferenceToTheme. ([[1]](https://github.com/asgardeo/javascript/pull/87/files#diff-c91ab2a4227a3b32483db0f1a9f4268f2d6dd3818dd7f96c027d1b1ea8a06883R52), [[2]](https://github.com/asgardeo/javascript/pull/87/files#diff-c91ab2a4227a3b32483db0f1a9f4268f2d6dd3818dd7f96c027d1b1ea8a06883R115), [[3]](https://github.com/asgardeo/javascript/pull/87/files#diff-c91ab2a4227a3b32483db0f1a9f4268f2d6dd3818dd7f96c027d1b1ea8a06883R133))

Related Issues

  • N/A

Related PRs

  • N/A

Checklist

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

Security checks

@brionmario brionmario mentioned this pull request Jul 2, 2025
9 tasks
brionmario added 25 commits July 2, 2025 16:48
- Renamed context property from `organizations` to `myOrganizations` in OrganizationSwitcher and related components.
- Introduced new server actions `getAllOrganizations` and `getMyOrganizations` for fetching organization data.
- Updated AsgardeoProvider to manage and provide `myOrganizations` and `getAllOrganizations` to the context.
- Refactored OrganizationProvider to utilize new organization fetching methods and removed legacy pagination logic.
- Enhanced BaseOrganizationList to handle both all organizations and user-specific organizations with switch access.
- Updated CreateOrganization component to refresh the list of user organizations after creation.
- Adjusted OrganizationList to fetch all organizations on mount and pass necessary props to BaseOrganizationList.
- Cleaned up unused code and improved error handling across organization-related components.
- Updated UserProfile component to utilize theme.vars for spacing, colors, and border radius.
- Modified Alert component to apply theme.vars for background, border, and text colors.
- Adjusted Avatar component to use theme.vars for background and text colors.
- Refactored Button component to implement theme.vars for padding, colors, and border styles.
- Changed Checkbox component to utilize theme.vars for sizing and accent color.
- Updated DatePicker component to apply theme.vars for padding, border, and background colors.
- Refactored Divider component to use theme.vars for spacing and background colors.
- Adjusted FormControl component to implement theme.vars for margin and spacing.
- Updated InputLabel component to utilize theme.vars for margin and color.
- Refactored KeyValueInput component to apply theme.vars for spacing, colors, and border radius.
- Changed OtpField component to use theme.vars for sizing, colors, and border styles.
- Updated Select component to implement theme.vars for padding, border, and background colors.
- Refactored Spinner component to utilize theme.vars for primary color.
- Adjusted Typography component to apply theme.vars for font sizes across various text styles.
… profile handling and simplify error alert rendering
… to handle multiple field variations and improve code readability

style(react): adjust dropdown dimensions in BaseUserDropdown for better UI consistency
refactor(react): simplify rendering logic in BaseUserProfile component for improved clarity and maintainability
@brionmario brionmario changed the title fix: correct header assignment in initializeEmbeddedSignInFlow function fix(nextjs): fix issues with B2B components Jul 3, 2025
@brionmario brionmario merged commit 43d8efa into asgardeo:main Jul 4, 2025
0 of 4 checks passed
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.

2 participants