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

Develop fixes #2184

Closed
wants to merge 8 commits into from
Closed

Develop fixes #2184

wants to merge 8 commits into from

Conversation

Tulika-eGov
Copy link
Contributor

@Tulika-eGov Tulika-eGov commented Feb 3, 2025

Summary by CodeRabbit

  • New Features

    • Enhanced language support with improved localization for chart legends, search placeholders, and address selection.
    • Introduced a file upload indicator in complaint details and refined tenant default handling on login.
    • Added a new changelog entry documenting fixes related to the PGR Ethiopia demo.
  • Refactor

    • Revised data transformations for complaint details and dropdown options, ensuring consistent and more robust displays.
    • Updated dependency management in various hooks to improve responsiveness when language or complaint type settings change.
  • Bug Fixes

    • Improved error handling in file uploads and tenant data processing, preventing runtime issues and ensuring smoother user experiences.
    • Corrected typographical errors in changelog entries for better clarity.

@Tulika-eGov Tulika-eGov requested a review from a team as a code owner February 3, 2025 06:28
@@ -206,12 +206,12 @@ const UploadFile = (props) => {
textStyles={props?.textStyles}
type={props.buttonType}
/>
{props?.uploadedFiles?.map((file, index) => {
{/* {props?.uploadedFiles?.map((file, index) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

we cant comment in develop, it would cause some issue in other modules

userType: "EMPLOYEE",
};
requestData.tenantId = data?.city?.code || Digit.ULBService.getStateId();
requestData.tenantId = requestData?.city?.code || Digit.ULBService.getStateId();
Copy link
Collaborator

Choose a reason for hiding this comment

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

not sure about this change

Copy link
Contributor Author

Choose a reason for hiding this comment

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

checked it seems fine, as we are spreading data in requestdata before that so, in any case the value of data will be present in request data.

@@ -49,7 +49,7 @@ const EmployeeSideBar = () => {

const configEmployeeSideBar = {};
data?.actions
.filter((e) => e.url === "url")
.filter((e) => e.url === "link")
Copy link
Collaborator

Choose a reason for hiding this comment

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

it is not required

@@ -20,7 +20,7 @@ const getDetailsRow = ({ id, service, complaintType }) => ({
ES_CREATECOMPLAINT_ADDRESS: [
service.address.landmark,
Digit.Utils.getMultiRootTenant() ? `ADMIN_${service.address.locality.code}` : Digit.Utils.locale.getLocalityCode(service.address.locality, service.tenantId),
service.address.city,
`TENANT_TENANTS_PG_${service.address.city.toUpperCase()}`,
Copy link
Collaborator

Choose a reason for hiding this comment

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

even pg shouldnt be hardcoded

@jagankumar-egov
Copy link
Collaborator

@Tulika-eGov please check

@jagankumar-egov
Copy link
Collaborator

we added many css fixes as well

Copy link
Contributor

coderabbitai bot commented Feb 3, 2025

📝 Walkthrough

Walkthrough

This pull request includes multiple modifications across hooks and components. Changes involve updating how tenant details are processed in complaint-related hooks, enhancing dependency arrays and filtering logic, and introducing language awareness where needed. Other updates include refactoring employee login logic, improving localization in chart components, and adding state handling for file uploads in complaint details. Overall, the modifications aim to improve code safety, robustness, and internationalization without altering core functionalities.

Changes

File(s) Change Summary
libraries/src/hooks/pgr/useComplaintDetails.js
libraries/src/hooks/pgr/useComplaintSubType.js
libraries/src/hooks/pgr/useInboxData.js
Updated complaint details hook to change address construction (using tenantId formatting), added dependency (t) in the complaint sub-type hook, and introduced a filtering mechanism for response processing in inbox data.
libraries/src/hooks/useLocalities.js
libraries/src/hooks/useModuleTenants.js
Modified localities hook to include an extra language parameter and updated module tenants hook to use optional chaining for safe property access.
modules/core/src/pages/employee/Login/login.js Introduced new variables (defaultTenant, defaultValues) to refactor tenant information retrieval and improved form validation via enhanced onFormValueChange.
modules/dss/src/components/CustomAreaChart.js
modules/dss/src/components/CustomHorizontalBarChart.js
modules/dss/src/components/GenericChart.js
Enhanced localization: applied translation functions to legend labels, chart data names, and input placeholders, and removed deprecated commented code.
modules/pgr/src/pages/citizen/Create/Steps/SelectAddress.js
modules/pgr/src/pages/employee/ComplaintDetails.js
modules/pgr/src/pages/employee/CreateComplaint/index.js
Added language variable support for locality fetching in address selection, introduced file upload state management and improved error handling in complaint details modal, and ensured dropdown components receive valid default arrays.

Sequence Diagram(s)

sequenceDiagram
  participant U as User
  participant CDM as ComplaintDetailsModal
  participant FS as FileService
  
  U->>CDM: Initiate file upload
  CDM->>CDM: set fileUploading = true
  CDM->>FS: Upload file
  FS-->>CDM: Return upload result
  alt Upload fails or file too large
    CDM->>CDM: Set error message
  end
  CDM->>CDM: set fileUploading = false
  U->>CDM: Trigger menu action
  CDM->>CDM: Close modal (setPopup(false))
Loading

Possibly related PRs

Suggested reviewers

  • nipunarora-eGov

Poem

I'm a rabbit with a triple-hop cheer,
Coding through changes, far and near.
Tenant IDs and languages now sing in sync,
File uploads and charts, all fixed in a blink.
With waggling ears, I celebrate each line—
Hopping through code, making everything fine! 🐇💻


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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

🔭 Outside diff range comments (2)
micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useModuleTenants.js (1)

11-34: Consider refactoring to reduce code duplication.

The mapping logic for both ddr and ulb arrays is nearly identical. Consider extracting the common transformation logic into a reusable function to improve maintainability.

 const useModuleTenants = (module, config = {}) => {
   const { t } = useTranslation();
+  
+  const transformTenant = (tenant, data) => ({
+    ...tenant,
+    ulbKey: t(`TENANT_TENANTS_${tenant?.code?.toUpperCase?.()?.replace(".", "_")}`),
+    ddrKey: t(
+      `DDR_${data.tenants
+        .filter((t) => t.code === tenant.code)?.[0]
+        ?.city?.districtTenantCode?.toUpperCase?.()
+        .replace(".", "_")}`
+    ),
+  });

   return useQuery(["ULB_TENANTS", module], () => Digit.SessionStorage.get("initData"), {
     select: (data) => ({
       ddr: data.modules
         .find((e) => e.module === module)
-        .tenants.map((tenant) => ({
-          ...tenant,
-          ulbKey: t(`TENANT_TENANTS_${tenant?.code?.toUpperCase?.()?.replace(".", "_")}`),
-          ddrKey: t(
-            `DDR_${data.tenants
-              .filter((t) => t.code === tenant.code)?.[0]
-              ?.city?.districtTenantCode?.toUpperCase?.()
-              .replace(".", "_")}`
-          ),
-        }))
+        .tenants.map(tenant => transformTenant(tenant, data))
         .filter((item, i, arr) => i === arr.findIndex((t) => t.ddrKey === item.ddrKey)),
       ulb: data.modules
         .find((e) => e.module === module)
-        .tenants.map((tenant) => ({
-          ...tenant,
-          ulbKey: t(`TENANT_TENANTS_${tenant?.code?.toUpperCase?.()?.replace(".", "_")}`),
-          ddrKey: t(
-            `DDR_${data.tenants
-              .filter((t) => t.code === tenant.code)?.[0]
-              ?.city?.districtTenantCode?.toUpperCase?.()
-              .replace(".", "_")}`
-          ),
-        })),
+        .tenants.map(tenant => transformTenant(tenant, data)),
     }),
     ...config,
   });
 };
micro-ui/web/micro-ui-internals/packages/modules/dss/src/components/CustomAreaChart.js (1)

170-234: Consider refactoring tooltip rendering logic.

The tooltip rendering functions (renderTooltip and renderTooltipForLine) contain similar formatting logic. Consider extracting the common formatting logic into a utility function to improve maintainability and reduce code duplication.

Example refactor:

+ const formatTooltipValue = (value, symbol, denomination, t) => {
+   const prefix = symbol?.toLowerCase() === "amount" && denomination === "Unit" ? " ₹" : " ";
+   const postfix = symbol?.toLowerCase() === "percentage" 
+     ? " %"
+     : symbol?.toLowerCase() === "amount" && denomination !== "Unit"
+       ? t(Digit.Utils.locale.getTransformedLocale(`ES_DSS_${denomination}`))
+       : "";
+   
+   return `${prefix}${
+     symbol?.toLowerCase() === "amount"
+       ? Digit.Utils.dss.formatter(getDenominatedValue(denomination, value), 'number', denomination, true, t)
+       : Digit.Utils.dss.formatter(value, 'number', denomination, true, t)
+   }${postfix}`;
+ };
🧰 Tools
🪛 Biome (1.9.4)

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

(lint/performance/noDelete)


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

(lint/performance/noDelete)


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

(lint/performance/noDelete)


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

(lint/performance/noDelete)


[error] 171-171: This let declares a variable that is only assigned once.

'formattedLabel' is never reassigned.

Safe fix: Use const instead.

(lint/style/useConst)


[error] 172-172: This let declares a variable that is only assigned once.

'payloadObj' is never reassigned.

Safe fix: Use const instead.

(lint/style/useConst)


[error] 196-196: This let declares a variable that is only assigned once.

'payloadObj' is never reassigned.

Safe fix: Use const instead.

(lint/style/useConst)


[error] 197-197: This let declares a variable that is only assigned once.

'prefix' is never reassigned.

Safe fix: Use const instead.

(lint/style/useConst)


[error] 198-198: This let declares a variable that is only assigned once.

'postfix' is never reassigned.

Safe fix: Use const instead.

(lint/style/useConst)


[error] 204-204: This let declares a variable that is only assigned once.

'newPayload' is never reassigned.

Safe fix: Use const instead.

(lint/style/useConst)


[error] 208-208: This let declares a variable that is only assigned once.

'newObjArray' is never reassigned.

Safe fix: Use const instead.

(lint/style/useConst)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 13efcf8 and 2a6f2c5.

📒 Files selected for processing (12)
  • micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintDetails.js (1 hunks)
  • micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintSubType.js (1 hunks)
  • micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useInboxData.js (1 hunks)
  • micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useLocalities.js (1 hunks)
  • micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useModuleTenants.js (2 hunks)
  • micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/Login/login.js (3 hunks)
  • micro-ui/web/micro-ui-internals/packages/modules/dss/src/components/CustomAreaChart.js (1 hunks)
  • micro-ui/web/micro-ui-internals/packages/modules/dss/src/components/CustomHorizontalBarChart.js (2 hunks)
  • micro-ui/web/micro-ui-internals/packages/modules/dss/src/components/GenericChart.js (1 hunks)
  • micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/citizen/Create/Steps/SelectAddress.js (2 hunks)
  • micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/ComplaintDetails.js (5 hunks)
  • micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/CreateComplaint/index.js (1 hunks)
🧰 Additional context used
📓 Path-based instructions (12)
micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintSubType.js (1)

Pattern **/*.js: check

micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/CreateComplaint/index.js (1)

Pattern **/*.js: check

micro-ui/web/micro-ui-internals/packages/modules/dss/src/components/CustomAreaChart.js (1)

Pattern **/*.js: check

micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintDetails.js (1)

Pattern **/*.js: check

micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/citizen/Create/Steps/SelectAddress.js (1)

Pattern **/*.js: check

micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useLocalities.js (1)

Pattern **/*.js: check

micro-ui/web/micro-ui-internals/packages/modules/dss/src/components/GenericChart.js (1)

Pattern **/*.js: check

micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useModuleTenants.js (1)

Pattern **/*.js: check

micro-ui/web/micro-ui-internals/packages/modules/dss/src/components/CustomHorizontalBarChart.js (1)

Pattern **/*.js: check

micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/Login/login.js (1)

Pattern **/*.js: check

micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useInboxData.js (1)

Pattern **/*.js: check

micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/ComplaintDetails.js (1)

Pattern **/*.js: check

🪛 Biome (1.9.4)
micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/Login/login.js

[error] 150-150: This let declares a variable that is only assigned once.

'config' is never reassigned.

Safe fix: Use const instead.

(lint/style/useConst)


[error] 161-161: Reassigning a function parameter is confusing.

The parameter is declared here:

Use a local variable instead.

(lint/style/noParameterAssign)


[error] 161-161: Avoid the use of spread (...) syntax on accumulators.

Spread syntax should be avoided on accumulators (like those in .reduce) because it causes a time complexity of O(n^2).
Consider methods such as .splice or .push instead.

(lint/performance/noAccumulatingSpread)

micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useInboxData.js

[error] 50-50: This let declares a variable that is only assigned once.

'filtered' is never reassigned.

Safe fix: Use const instead.

(lint/style/useConst)

⏰ Context from checks skipped due to timeout of 10000ms (2)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (actions)
🔇 Additional comments (20)
micro-ui/web/micro-ui-internals/packages/modules/dss/src/components/GenericChart.js (1)

114-114: LGTM! Good internationalization practice.

The placeholder text is now properly internationalized using the translation function, which aligns with the application's localization standards.

micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useModuleTenants.js (1)

18-18: LGTM! Safety improvements with optional chaining.

The addition of optional chaining operators improves code safety by preventing potential runtime errors when accessing nested properties.

Also applies to: 31-31

micro-ui/web/micro-ui-internals/packages/modules/dss/src/components/CustomAreaChart.js (2)

151-151: LGTM! Good localization enhancement.

The addition of translation wrapper for legend text improves internationalization support.


267-279: LGTM! Good code cleanup.

Removing commented-out Y-axis label code improves code maintainability.

Also applies to: 301-315

micro-ui/web/micro-ui-internals/packages/modules/core/src/pages/employee/Login/login.js (3)

74-77: LGTM! Improved tenant handling logic.

The changes to tenant initialization and request data handling look good. The extraction of defaultTenant and the use of requestData.city.code are safe improvements.

Also applies to: 144-148


167-167: LGTM! Improved form validation.

Good optimization to only check mandatory fields in the validation logic.


200-200: LGTM! Added defaultValues prop.

The addition of defaultValues prop to FormComposerV2 is consistent with the new default values handling.

micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintSubType.js (1)

14-14: LGTM! Good dependency array update.

Adding t to the dependency array is correct as it's used within the effect to translate menu items.

micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/useLocalities.js (1)

5-6: LGTM! Good i18n enhancement.

Adding language to both the function parameters and query key ensures proper cache invalidation when the language changes.

micro-ui/web/micro-ui-internals/packages/libraries/src/hooks/pgr/useComplaintDetails.js (1)

23-23: LGTM! Good removal of hardcoded value.

The change correctly uses a dynamic tenantId with proper formatting, addressing previous review comments about hardcoded values.

micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/citizen/Create/Steps/SelectAddress.js (3)

8-8: LGTM: Language retrieval from session storage

The language retrieval from session storage is implemented correctly with proper JSON parsing.


12-12: LGTM: Improved city selection logic

The initial state for selectedCity now properly handles the case when there's only one city in the list.


38-39: LGTM: Language support in boundary localities hook

The useBoundaryLocalities hook now correctly receives translation and language parameters for proper localization.

micro-ui/web/micro-ui-internals/packages/modules/dss/src/components/CustomHorizontalBarChart.js (2)

66-66: LGTM: Enhanced plot name localization

The plot name is now properly transformed using the locale utility before translation.


95-95: LGTM: Improved legend localization

Legend values are now properly transformed using the locale utility before translation.

micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/CreateComplaint/index.js (1)

236-236: LGTM: Added null safety for menu options

The dropdown now safely handles undefined menu values by providing an empty array fallback.

micro-ui/web/micro-ui-internals/packages/modules/pgr/src/pages/employee/ComplaintDetails.js (4)

95-95: LGTM: Added file upload state tracking

Added state variable to track file upload status.


111-111: LGTM: Improved file upload state management

File upload state is properly managed with clear start and end states.

Also applies to: 120-120


504-504: LGTM: Enhanced menu styling

Added margin adjustment to improve menu text alignment.


338-338: LGTM: Logical operation ordering

The popup is closed before initiating the assignment operation.

code: Digit.ULBService.getStateId(),
name: Digit.Utils.locale.getTransformedLocale(`TENANT_TENANTS_${Digit.ULBService.getStateId()}`),
code: defaultTenant,
name: Digit.Utils.locale.getTransformedLocale(`TENANT_TENANTS_${defaultTenant}`),
};

let config = [{ body: propsConfig?.inputs }];
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)

Use const for immutable declarations.

The config variable is never reassigned, so it should be declared with const instead of let.

- let config = [{ body: propsConfig?.inputs }];
+ const config = [{ body: propsConfig?.inputs }];
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
let config = [{ body: propsConfig?.inputs }];
const config = [{ body: propsConfig?.inputs }];
🧰 Tools
🪛 Biome (1.9.4)

[error] 150-150: This let declares a variable that is only assigned once.

'config' is never reassigned.

Safe fix: Use const instead.

(lint/style/useConst)

Comment on lines +159 to +164
const defaultValues = config[0].body.reduce((acc, curr) => {
if (curr?.populators?.defaultValue) {
acc = { ...acc, [curr?.populators?.name]: curr?.populators?.defaultValue };
}
return acc;
}, {});
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)

Optimize reducer performance.

The current implementation using spread operator in the reducer could lead to O(n^2) complexity with large configs.

Consider using Object.assign for better performance:

  const defaultValues = config[0].body.reduce((acc, curr) => {
    if (curr?.populators?.defaultValue) {
-     acc = { ...acc, [curr?.populators?.name]: curr?.populators?.defaultValue };
+     return Object.assign(acc, { [curr?.populators?.name]: curr?.populators?.defaultValue });
    }
    return acc;
  }, {});
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const defaultValues = config[0].body.reduce((acc, curr) => {
if (curr?.populators?.defaultValue) {
acc = { ...acc, [curr?.populators?.name]: curr?.populators?.defaultValue };
}
return acc;
}, {});
const defaultValues = config[0].body.reduce((acc, curr) => {
if (curr?.populators?.defaultValue) {
return Object.assign(acc, { [curr?.populators?.name]: curr?.populators?.defaultValue });
}
return acc;
}, {});
🧰 Tools
🪛 Biome (1.9.4)

[error] 161-161: Reassigning a function parameter is confusing.

The parameter is declared here:

Use a local variable instead.

(lint/style/noParameterAssign)


[error] 161-161: Avoid the use of spread (...) syntax on accumulators.

Spread syntax should be avoided on accumulators (like those in .reduce) because it causes a time complexity of O(n^2).
Consider methods such as .splice or .push instead.

(lint/performance/noAccumulatingSpread)

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 6

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2a6f2c5 and f001258.

⛔ Files ignored due to path filters (5)
  • micro-ui/web/micro-ui-internals/example/package.json is excluded by !**/*.json
  • micro-ui/web/micro-ui-internals/packages/modules/core/package.json is excluded by !**/*.json
  • micro-ui/web/micro-ui-internals/packages/modules/dss/package.json is excluded by !**/*.json
  • micro-ui/web/micro-ui-internals/packages/modules/pgr/package.json is excluded by !**/*.json
  • micro-ui/web/package.json is excluded by !**/*.json
📒 Files selected for processing (3)
  • micro-ui/web/micro-ui-internals/packages/modules/core/CHANGELOG.md (1 hunks)
  • micro-ui/web/micro-ui-internals/packages/modules/dss/CHANGELOG.md (1 hunks)
  • micro-ui/web/micro-ui-internals/packages/modules/pgr/CHANGELOG.md (1 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
micro-ui/web/micro-ui-internals/packages/modules/core/CHANGELOG.md

3-3: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


4-4: Lists should be surrounded by blank lines
null

(MD032, blanks-around-lists)

micro-ui/web/micro-ui-internals/packages/modules/dss/CHANGELOG.md

2-2: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


2-2: First line in a file should be a top-level heading
null

(MD041, first-line-heading, first-line-h1)


3-3: Lists should be surrounded by blank lines
null

(MD032, blanks-around-lists)

micro-ui/web/micro-ui-internals/packages/modules/pgr/CHANGELOG.md

2-2: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


2-2: First line in a file should be a top-level heading
null

(MD041, first-line-heading, first-line-h1)


3-3: Lists should be surrounded by blank lines
null

(MD032, blanks-around-lists)

Comment on lines +2 to +3
## [1.8.11] [3-Feb-2025]
- Fixed PGR issues and related found in PGR ethopia demo
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)

Review the new version entry details.
The new entry for version 1.8.11 is added with the description:
- Fixed PGR issues and related found in PGR ethopia demo
Consider correcting the spelling "ethopia" to "Ethiopia" and rephrasing for clarity (e.g. "Fixed PGR issues and related problems found in the PGR Ethiopia demo").

🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

2-2: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


2-2: First line in a file should be a top-level heading
null

(MD041, first-line-heading, first-line-h1)


3-3: Lists should be surrounded by blank lines
null

(MD032, blanks-around-lists)

Comment on lines 1 to +4

## [1.8.11] [3-Feb-2025]
- Fixed PGR issues and related found in PGR ethopia demo

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)

Improve Markdown Formatting.
Markdownlint suggests that headings and list items be surrounded by blank lines. Adding a blank line before and after headings and list items will enhance readability and compliance with MD022, MD041, and MD032.

🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

2-2: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


2-2: First line in a file should be a top-level heading
null

(MD041, first-line-heading, first-line-h1)


3-3: Lists should be surrounded by blank lines
null

(MD032, blanks-around-lists)

Comment on lines +2 to +3
## [1.8.11] [3-Feb-2025]
- Fixed DSS issues and related found in PGR ethopia demo, and enhanced few keys related to localisations issue.
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)

Review the new version entry content.
The new entry for version 1.8.11 currently reads:
- Fixed DSS issues and related found in PGR ethopia demo, and enhanced few keys related to localisations issue.
Please consider:

  • Correcting "ethopia" to "Ethiopia".
  • Revising the phrasing (for example, "Fixed DSS issues and related problems found in the PGR Ethiopia demo and enhanced localization key settings.").
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

2-2: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


2-2: First line in a file should be a top-level heading
null

(MD041, first-line-heading, first-line-h1)


3-3: Lists should be surrounded by blank lines
null

(MD032, blanks-around-lists)

Comment on lines 1 to +4

## [1.8.11] [3-Feb-2025]
- Fixed DSS issues and related found in PGR ethopia demo, and enhanced few keys related to localisations issue.

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)

Enhance Markdown Formatting.
Similar to other changelog files, adding blank lines before and after headings and lists would improve readability and adhere to markdownlint guidelines.

🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

2-2: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


2-2: First line in a file should be a top-level heading
null

(MD041, first-line-heading, first-line-h1)


3-3: Lists should be surrounded by blank lines
null

(MD032, blanks-around-lists)

Comment on lines +3 to +4
## [1.8.22] [3-Feb-2025]
- Fixed core issues and related found in PGR ethopia demo
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)

Review the new core changelog entry.
The new changelog entry for version 1.8.22 states:
- Fixed core issues and related found in PGR ethopia demo
For clarity and consistency, consider:

  • Correcting "ethopia" to "Ethiopia".
  • Revising the phrasing to something like "Fixed core issues and related bugs identified in the PGR Ethiopia demo."
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

3-3: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


4-4: Lists should be surrounded by blank lines
null

(MD032, blanks-around-lists)

Comment on lines 1 to +4
# Changelog

## [1.8.22] [3-Feb-2025]
- Fixed core issues and related found in PGR ethopia demo
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)

Improve Markdown Styling.
To comply with markdownlint guidelines (MD022, MD041, MD032), consider ensuring that all headings and list items are properly separated by blank lines. This will promote better readability and consistency across the changelog.

🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

1-1: Trailing spaces
Expected: 0 or 2; Actual: 1

(MD009, no-trailing-spaces)


3-3: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


4-4: Lists should be surrounded by blank lines
null

(MD032, blanks-around-lists)

@Tulika-eGov Tulika-eGov closed this Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants