Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Themes API Frontend Support #1982

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

Conversation

kanikabansal-juspay
Copy link
Collaborator

@kanikabansal-juspay kanikabansal-juspay commented Dec 27, 2024

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

Added support for theme_id in userInfo and integrated themes API in HyperSwitchApp and Entry. Introduced a generic URL updater and getThemesJson API caller in ThemesProvider.res.

Motivation and Context

Support dynamic themes configuration.

How did you test it?

  • Turn on the feature flag dev_theme_feature.
  • Update Proxy Configuration:
"/themes": {
    "target": "https://integ.hyperswitch.io/",
    "changeOrigin": true
}
  • Clean and Rebuild
  • For login page testing, append the theme_id as a query parameter to the URL
  • Themes are applied according to the api response.

Where to test it?

  • INTEG
  • SANDBOX
  • PROD

Checklist

  • I ran npm run re:build
  • I reviewed submitted code
  • I added unit tests for my changes where possible

@kanikabansal-juspay kanikabansal-juspay requested a review from a team as a code owner December 27, 2024 09:17
Copy link

semanticdiff-com bot commented Dec 27, 2024

Review changes with  SemanticDiff

Changed Files
File Status
  public/hyperswitch/module.js  0% smaller
  src/context/ThemeProvider.res Unsupported file format
  src/entryPoints/AuthModule/UserInfo/UserInfoTypes.res Unsupported file format
  src/entryPoints/AuthModule/UserInfo/UserInfoUtils.res Unsupported file format
  src/entryPoints/HyperSwitchApp.res Unsupported file format
  src/entryPoints/HyperSwitchEntry.res Unsupported file format

@kanikabansal-juspay kanikabansal-juspay self-assigned this Dec 27, 2024
@kanikabansal-juspay kanikabansal-juspay added the C-feature Category: Feature request or enhancement label Dec 27, 2024
@kanikabansal-juspay kanikabansal-juspay linked an issue Dec 27, 2024 that may be closed by this pull request
7 tasks
Comment on lines 60 to 61
let _ = updateThemeURLs(themeData)
let _ = themeData->configCustomDomainTheme
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please move both the functions inside the getThemeJSON

faviconUrl: urlsDict->getString("faviconUrl", "")->getNonEmptyString,
logoUrl: urlsDict->getString("logoUrl", "")->getNonEmptyString,
}
Js.log2("val", val)
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove the logs

let _ = setAttribute(a, "rel", "shortcut icon")
let _ = setAttribute(a, "type", "image/x-icon")
let _ = appendHead(a)
Js.log(a)
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove the log

@kanikabansal-juspay kanikabansal-juspay added the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature Category: Feature request or enhancement S-waiting-on-review Status: This PR has been implemented and needs to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Support themes
2 participants