-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
fix: Brand colors sometimes shows different colors on cloud #19672
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we using multi-tenant Architecture to manage branding of each company? if yes how are we cache if multiple tenants are present in a single browser session? For example, Two tenants: ABC and XYZ have different branding configs, then how are we caching these configs in local storage.
I think in that scenario we should cache tenantConfig based on each tenant.
const cachedTenantConfig = localStorage.getItem("tenantConfig"); | ||
let cachedTenantConfigParsed = { | ||
brandColors: { | ||
...createBrandColorsFromPrimaryColor("#000"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets move this color to a constant
if (cachedTenantConfig) { | ||
cachedTenantConfigParsed = JSON.parse(cachedTenantConfig); | ||
} | ||
} catch (e) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than a blank catch block, can we use log.debug
to log any errors that occur
return { | ||
...cachedTenantConfigParsed, | ||
...(state.tenant?.tenantConfiguration || {}), | ||
} as Record<string, any>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the as
keyword, We can instead provide the return type in the function definition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
export const initialState: TenantReduxState<any> = { | ||
userPermissions: [], | ||
tenantConfiguration: { | ||
brandColors: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since earlier we were setting the initial state with some value, why are we replacing it with the blank object?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes because the logic for setting default values is now moved to the selector instead of the reducer.
…cache-branding-values
/ok-to-test sha=0986124 |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/4013203840. |
The following are new failures, please fix them before merging the PR |
The following are new failures, please fix them before merging the PR cypress/integration/Regression_TestSuite/ClientSideTests/Templates/Fork_Template_To_App_spec.js |
/ok-to-test=b8b2b80 |
/ok-to-test sha=b8b2b80 |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/4051368563. |
The following are new failures, please fix them before merging the PR |
The following are new failures, please fix them before merging the PR cypress/integration/Regression_TestSuite/Application/PromisesApp_spec.js |
The following are new failures, please fix them before merging the PR |
The following are new failures, please fix them before merging the PR cypress/integration/Regression_TestSuite/ClientSideTests/Linting/BasicLint_spec.ts |
The following are new failures, please fix them before merging the PR |
The following are new failures, please fix them before merging the PR cypress/integration/Regression_TestSuite/ClientSideTests/Linting/BasicLint_spec.ts |
…cache-branding-values
/ok-to-test sha=fb2d586 |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/4061641296. |
The following are new failures, please fix them before merging the PR |
The following are new failures, please fix them before merging the PR cypress/integration/Regression_TestSuite/ClientSideTests/Git/GitSync/GitBugs_spec.js |
Warning Rate limit exceeded@Nikhil-Nandagopal has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 28 minutes and 46 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
Caches the tenant config so that we don't show the ugly black color
Description
Fixes #19530
Type of change
How Has This Been Tested?
Test Plan
Issues raised during DP testing
Checklist:
Dev activity
QA activity: