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

feat(sdk): apply user interface color overrides to the sdk #42834

Merged
merged 5 commits into from
May 21, 2024

Conversation

heypoom
Copy link
Contributor

@heypoom heypoom commented May 17, 2024

Closes #42705

Description

Applies the user interface colors in the enterprise appearance settings as the SDK's default value.

How to verify

  • Go to the test-sdk-colors branch in the demo app
  • Go to AppProvider.tsx, and ensure that everything in colors are commented out
  • Take note of the brand colors in the admin appearance settings
  • The loading spinner should take the brand color from appearance settings.
  • Try to override the brand color in the SDK, the sdk color should now take precedence.

Caveat

  • The filter should take the filter color not the brand color, but this is out-of-scope of this PR and @deniskaber is fixing this in his PR.

Demo

Checklist

  • Tests have been added/updated to cover changes in this PR

@heypoom heypoom self-assigned this May 17, 2024
@heypoom heypoom force-pushed the sdk-apply-ui-color-overrides branch from 63ff183 to ad91607 Compare May 20, 2024 15:45
@heypoom heypoom marked this pull request as ready for review May 20, 2024 15:51
@heypoom heypoom added the no-backport Do not backport this PR to any branch label May 20, 2024
@heypoom heypoom requested a review from a team May 20, 2024 15:52
Copy link

github-actions bot commented May 20, 2024

Codenotify: Notifying subscribers in CODENOTIFY files for diff fca30b1...c8f39d2.

No notifications.

Copy link

replay-io bot commented May 20, 2024

Status Complete ↗︎
Commit c8f39d2
Results
⚠️ 2 Flaky
2567 Passed

Comment on lines +18 to +21
export const SdkThemeProvider = ({ theme, children }: Props) => {
const appColors = useSelector(state =>
getApplicationColors(getSettings(state)),
);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The extra component is needed because of the provider structure, the call to useSelector needs to be below ReduxProvider but above ThemeProvider

selector state

set global embedding colors

rename the method
@heypoom heypoom force-pushed the sdk-apply-ui-color-overrides branch from 57d8a05 to 41e996b Compare May 20, 2024 16:19
Copy link
Contributor

@deniskaber deniskaber left a comment

Choose a reason for hiding this comment

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

Nice!

@heypoom
Copy link
Contributor Author

heypoom commented May 21, 2024

(Waiting for the offset e2e fix by the QC folks to be merged - #42944)

@heypoom heypoom enabled auto-merge (squash) May 21, 2024 15:51
@heypoom heypoom merged commit 2e9a53a into master May 21, 2024
110 checks passed
@heypoom heypoom deleted the sdk-apply-ui-color-overrides branch May 21, 2024 17:29
oisincoveney pushed a commit that referenced this pull request May 21, 2024
* feat(sdk): apply ui color overrides to the sdk

selector state

set global embedding colors

rename the method

* test(sdk): add unit test on color overrides
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-backport Do not backport this PR to any branch .Team/Embedding
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom user interface colors does not get applied on SDK
2 participants