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

console recent changes to merged in master #1274

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
355a8ab
Enabled commands for debug remotely for project factory pod (#1249)
ashish-egov Dec 9, 2024
2bdd736
changed package json for debug (#1258)
ashish-egov Dec 9, 2024
016dc01
boundary code in update flow to be persisted in db (#1259)
nitish-egov Dec 10, 2024
d96bb2b
chnaged header creation logic in generate flow (#1261)
nitish-egov Dec 10, 2024
19283e0
made few changes for fetching boundaries from boundariesCombined (#1263)
nitish-egov Dec 10, 2024
74700da
some boundary bulk and microplan user changes (#1268)
ashish-egov Dec 11, 2024
9dee69b
localisation-cache-fix (#1270)
ashish-egov Dec 11, 2024
3ed33e6
Microplan fix (#1269)
ashish-egov Dec 12, 2024
49b5801
Boundary fix message (#1279)
ashish-egov Dec 12, 2024
b373ac4
Facility Fix (#1282)
ashish-egov Dec 17, 2024
b69ba14
added gzip handler in middleware (#1290)
nitish-egov Dec 19, 2024
ad9a5b8
refactor target generate and validate for generic type (#1296)
nitish-egov Dec 30, 2024
f13f4cf
Facility Singular Creation (#1302)
ashish-egov Dec 31, 2024
9df4256
BUGFIX campaignUtils.ts for update target fix (#1304)
ashish-egov Jan 2, 2025
d832441
Allow facility capacity to be 0 in sheet uploads for microplan (#1303)
ashish-egov Jan 2, 2025
fc6122e
Implemented functionality to include all boundaries present in the fa…
ashish-egov Jan 2, 2025
bfccb0a
Optimized latitude and longitude validation logic for improved effici…
ashish-egov Jan 3, 2025
5420d8e
Implemented locale and campaign check (#1300)
ashish-egov Jan 3, 2025
bd673e7
refactored target tabs validate logic (#1330)
nitish-egov Jan 7, 2025
97b4b32
Update campaignUtils.ts (#1332)
ashish-egov Jan 8, 2025
b5be48e
added config for retry for resource creation completion (#1333)
nitish-egov Jan 9, 2025
396673c
refactored code for header localization (#1338)
nitish-egov Jan 13, 2025
3fc3a41
feat: Implement facility list with inactive by default and toggle act…
ashish-egov Jan 22, 2025
343393e
Console dropdown logics (#1359)
nitish-egov Jan 28, 2025
d94b380
added locale column in generated resource table for generating templa…
nitish-egov Jan 29, 2025
b5aee12
Created User issue fixed (#1370)
ashish-egov Jan 30, 2025
0b7cdfb
corrected migration file for proejct-factory (#1371)
nitish-egov Jan 31, 2025
8107a82
added fix for type boundary-management (#1376)
nitish-egov Feb 4, 2025
faba517
User Jurisdiction enrichment (#1380)
ashish-egov Feb 10, 2025
23330be
renamed migration file (#1393)
nitish-egov Feb 12, 2025
b4fa23b
Patch for Boundary Bulk creation (#1396)
ashish-egov Feb 13, 2025
78f1eef
incomingRequestLimit5mb (#1383)
ashish-egov Feb 13, 2025
b1eb7fc
Localisation fix (#1397)
ashish-egov Feb 13, 2025
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
Prev Previous commit
Next Next commit
made few changes for fetching boundaries from boundariesCombined (#1263)
  • Loading branch information
nitish-egov authored and jagankumar-egov committed Dec 10, 2024
commit 19283e09fae8ba99ea3fb6885b1c9ba482c6b3fd
Original file line number Diff line number Diff line change
@@ -958,7 +958,7 @@ async function enrichAndPersistCampaignWithError(requestBody: any, error: any) {
requestBody.CampaignDetails.status = campaignStatuses?.failed;
// requestBody.CampaignDetails.isActive = false;
requestBody.CampaignDetails.boundaryCode =
getRootBoundaryCode(requestBody?.CampaignDetails?.boundaries) || null;
getRootBoundaryCode(requestBody?.boundariesCombined) || null;
requestBody.CampaignDetails.projectType =
requestBody?.CampaignDetails?.projectType || null;
requestBody.CampaignDetails.hierarchyType =
@@ -1035,7 +1035,7 @@ async function enrichAndPersistCampaignForCreate(
request.body.CampaignDetails.status =
action == "create" ? campaignStatuses.started : campaignStatuses.drafted;
request.body.CampaignDetails.boundaryCode = getRootBoundaryCode(
request.body.boundariesCombined
request.body?.boundariesCombined
);
request.body.CampaignDetails.projectType =
request?.body?.CampaignDetails?.projectType || null;
@@ -1111,7 +1111,7 @@ async function enrichAndPersistCampaignForUpdate(
? campaignStatuses.started
: campaignStatuses.drafted;
const boundaryCode = !request?.body?.CampaignDetails?.projectId
? getRootBoundaryCode(request.body.CampaignDetails.boundaries)
? getRootBoundaryCode(request.body?.boundariesCombined)
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)

Consider improving readability of the boundary code logic.

The nested ternary operator could be simplified for better readability.

Consider this alternative:

- const boundaryCode = !request?.body?.CampaignDetails?.projectId
-   ? getRootBoundaryCode(request.body?.boundariesCombined)
-   : request?.body?.CampaignDetails?.boundaryCode ||
-   ExistingCampaignDetails?.boundaryCode;
+ const boundaryCode = request?.body?.CampaignDetails?.projectId
+   ? (request?.body?.CampaignDetails?.boundaryCode || ExistingCampaignDetails?.boundaryCode)
+   : getRootBoundaryCode(request.body?.boundariesCombined);

Committable suggestion skipped: line range outside the PR's diff.

: request?.body?.CampaignDetails?.boundaryCode ||
ExistingCampaignDetails?.boundaryCode;
request.body.CampaignDetails.boundaryCode = boundaryCode;
@@ -2414,6 +2414,7 @@ async function processAfterPersist(request: any, actionInUrl: any) {
localizationMap
);
}
delete request.body?.boundariesCombined;
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Avoid using the delete operator on objects

Deleting properties from objects can negatively impact performance. Consider setting the property to undefined instead.

Apply this diff:

-        delete request.body?.boundariesCombined;
+        request.body.boundariesCombined = undefined;

Committable suggestion skipped: line range outside the PR's diff.

🧰 Tools
🪛 Biome (1.9.4)

[error] 2417-2417: Avoid the delete operator which can impact performance.

(lint/performance/noDelete)

} catch (error: any) {
console.log(error);
logger.error(error);