-
Notifications
You must be signed in to change notification settings - Fork 19
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 #1611
base: develop
Are you sure you want to change the base?
fix #1611
Conversation
📝 Walkthrough📝 WalkthroughWalkthroughThe changes in the Changes
Possibly related PRs
Suggested reviewers
Poem
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 using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 3
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
⛔ Files ignored due to path filters (6)
micro-ui/web/core/package.json
is excluded by!**/*.json
micro-ui/web/micro-ui-internals/example/package.json
is excluded by!**/*.json
micro-ui/web/micro-ui-internals/packages/libraries/package.json
is excluded by!**/*.json
micro-ui/web/package.json
is excluded by!**/*.json
micro-ui/web/sandbox/package.json
is excluded by!**/*.json
micro-ui/web/workbench/package.json
is excluded by!**/*.json
📒 Files selected for processing (1)
- micro-ui/web/micro-ui-internals/packages/libraries/src/utils/locale.js (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
micro-ui/web/micro-ui-internals/packages/libraries/src/utils/locale.js (1)
Pattern
**/*.js
: check
@@ -10,8 +10,21 @@ | |||
*/ | |||
|
|||
export const getLocalityCode = (locality, tenantId) => { | |||
if (typeof locality === "string") return locality.includes("_") ? locality : `${tenantId.replace(".", "_").toUpperCase()}_ADMIN_${locality}`; | |||
else if (locality.code) return locality.code.includes("_") ? locality : `${tenantId.replace(".", "_").toUpperCase()}_ADMIN_${locality.code}`; | |||
const isMultiRootTenant = Digit.Utils.getMultiRootTenant(); // Replace with your actual condition |
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.
Replace TODO comment with actual implementation.
The comment suggests replacing Digit.Utils.getMultiRootTenant()
with the actual condition. Ensure this is implemented correctly.
Also, consider adding error handling for this call:
const isMultiRootTenant = Digit.Utils.getMultiRootTenant() ?? false; // Provide a default value
export const getLocalityCode = (locality, tenantId) => { | ||
if (typeof locality === "string") return locality.includes("_") ? locality : `${tenantId.replace(".", "_").toUpperCase()}_ADMIN_${locality}`; | ||
else if (locality.code) return locality.code.includes("_") ? locality : `${tenantId.replace(".", "_").toUpperCase()}_ADMIN_${locality.code}`; | ||
const isMultiRootTenant = Digit.Utils.getMultiRootTenant(); // Replace with your actual condition | ||
|
||
if (typeof locality === "string") { | ||
return locality.includes("_") | ||
? locality | ||
: isMultiRootTenant | ||
? `ADMIN_${locality}` | ||
:`${tenantId.replace(".", "_").toUpperCase()}_ADMIN_${locality}`; | ||
} else if (locality.code) { | ||
return locality.code.includes("_") | ||
? locality.code | ||
: isMultiRootTenant | ||
? `ADMIN_${locality.code}` | ||
:`${tenantId.replace(".", "_").toUpperCase()}_ADMIN_${locality.code}`; | ||
} |
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.
🧹 Nitpick (assertive)
Update function signature and add JSDoc.
The function now depends on Digit.Utils
. Consider updating the function signature and adding JSDoc to reflect this change:
/**
* Get the locality code based on the input and tenant type.
* @param {string|Object} locality - The locality string or object with a code property.
* @param {string} tenantId - The tenant ID.
* @returns {string} The formatted locality code.
*/
export const getLocalityCode = (locality, tenantId) => {
// ... existing implementation
};
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
📒 Files selected for processing (1)
- micro-ui/web/micro-ui-internals/packages/libraries/src/utils/locale.js (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
micro-ui/web/micro-ui-internals/packages/libraries/src/utils/locale.js (1)
Pattern
**/*.js
: check
else if (locality.code) return locality.code.includes("_") ? locality : `${tenantId.replace(".", "_").toUpperCase()}_ADMIN_${locality.code}`; | ||
const isMultiRootTenant = Digit.Utils.getMultiRootTenant(); | ||
|
||
if (typeof locality === "string") { |
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.
dont change in common method, it will be used outside pgr
so do it in pgr module code
Summary by CodeRabbit
New Features
Bug Fixes