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

fix #1611

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open

fix #1611

Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion micro-ui/web/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"homepage": "/core-ui",
"dependencies": {
"@egovernments/digit-ui-components": "0.0.2-beta.48",
"@egovernments/digit-ui-libraries": "1.8.2-beta.8",
"@egovernments/digit-ui-libraries": "1.8.2-beta.9",
"@egovernments/digit-ui-module-workbench": "1.0.2-beta.8",
"@egovernments/digit-ui-module-core": "1.8.2-beta.24",
"@egovernments/digit-ui-module-utilities": "1.0.1-beta.39",
Expand Down
2 changes: 1 addition & 1 deletion micro-ui/web/micro-ui-internals/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"start": "react-scripts start"
},
"devDependencies": {
"@egovernments/digit-ui-libraries": "1.8.2-beta.8",
"@egovernments/digit-ui-libraries": "1.8.2-beta.9",
"@egovernments/digit-ui-module-workbench": "1.0.2-beta.8",
"@egovernments/digit-ui-module-pgr": "1.8.1-beta.1",
"@egovernments/digit-ui-module-dss": "1.8.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@egovernments/digit-ui-libraries",
"version": "1.8.2-beta.8",
"version": "1.8.2-beta.9",
"main": "dist/index.js",
"module": "dist/index.modern.js",
"source": "src/index.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

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


if (typeof locality === "string") {
Copy link
Collaborator

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

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}`;
}
Copy link
Contributor

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
};

jagankumar-egov marked this conversation as resolved.
Show resolved Hide resolved
};

export const getRevenueLocalityCode = (locality, tenantId) => {
Expand Down
2 changes: 1 addition & 1 deletion micro-ui/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
],
"homepage": "/digit-ui",
"dependencies": {
"@egovernments/digit-ui-libraries": "1.8.2-beta.8",
"@egovernments/digit-ui-libraries": "1.8.2-beta.9",
"@egovernments/digit-ui-module-workbench": "1.0.2-beta.8",
"@egovernments/digit-ui-module-core": "1.8.2-beta.24",
"@egovernments/digit-ui-module-utilities": "1.0.1-beta.39",
Expand Down
2 changes: 1 addition & 1 deletion micro-ui/web/sandbox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
],
"homepage": "/sandbox-ui",
"dependencies": {
"@egovernments/digit-ui-libraries": "1.8.2-beta.8",
"@egovernments/digit-ui-libraries": "1.8.2-beta.9",
"@egovernments/digit-ui-module-sandbox": "0.0.1",
"@egovernments/digit-ui-module-workbench": "1.0.2-beta.8",
"@egovernments/digit-ui-components": "0.0.2-beta.48",
Expand Down
2 changes: 1 addition & 1 deletion micro-ui/web/workbench/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
],
"homepage": "/workbench-ui",
"dependencies": {
"@egovernments/digit-ui-libraries": "1.8.2-beta.8",
"@egovernments/digit-ui-libraries": "1.8.2-beta.9",
"@egovernments/digit-ui-module-workbench": "1.0.2-beta.8",
"@egovernments/digit-ui-components": "0.0.2-beta.48",
"@egovernments/digit-ui-module-core": "1.8.2-beta.24",
Expand Down