Skip to content

Fix: Aligned Report Details Layout and Added BIRT Translation (WEB-821)#86

Open
vaishnavirrapolu-06 wants to merge 9 commits intoopenMF:devfrom
vaishnavirrapolu-06:feat/manage-report-detail-CLEAN
Open

Fix: Aligned Report Details Layout and Added BIRT Translation (WEB-821)#86
vaishnavirrapolu-06 wants to merge 9 commits intoopenMF:devfrom
vaishnavirrapolu-06:feat/manage-report-detail-CLEAN

Conversation

@vaishnavirrapolu-06
Copy link

@vaishnavirrapolu-06 vaishnavirrapolu-06 commented Mar 14, 2026

Description

I have completed the UI and localization fixes for the Manage Reports detail view.

Changes Made:

  • Layout Alignment: Updated ViewReports.tsx to use a consistent label width (w-48), ensuring all report details are perfectly aligned in a grid-like structure.
  • Localization: Added the missing translation for "BIRT" in en.json to display the full descriptive name: "Mifos Reporting Plugin for Eclipse Birt".
  • Code Cleanup: Ensured proper TypeScript typing with GetReportsResponse.

Verification:

I verified these changes using mock data to confirm the layout and translation logic work as intended (see attached screenshot). Note: Local environment routing currently defaults to an empty view, but the component code is fully tested.

Screenshot (485)

Summary by CodeRabbit

Release Notes

  • New Features

    • Expanded localization support with new UI labels for navigation, buttons, headings, and status indicators across the application.
    • Enhanced Reports view with multilingual translations, improved styling, and status badges.
  • UI Improvements

    • Restructured summary sections in Centers and Groups pages for better clarity and organization.
    • Refined layout and formatting across client management interfaces.
  • Chores

    • Updated internationalization and API tooling dependencies.

@coderabbitai
Copy link

coderabbitai bot commented Mar 14, 2026

📝 Walkthrough

Walkthrough

This PR updates package dependencies (particularly i18n-related packages), adds localization infrastructure for UI labels in products.json, and applies widespread JSX formatting and restructuring across multiple page components while maintaining existing functionality. The system/reports section includes i18n integration and UI styling updates.

Changes

Cohort / File(s) Summary
Dependencies
package.json
Updated @openapitools/openapi-generator-cli, i18next, i18next-browser-languagedetector, and react-i18next to newer patch versions.
Localization Infrastructure
src/locales/en-US/products.json
Added new nested "label" object containing anchor, button, heading, boolean, and text categories with UI localization keys.
Centers Components
src/pages/centers/centers-view/general-tab/CentersGeneralTab.tsx
Expanded and reordered summary metrics for borrowers and loans; adjusted table header formatting with wrapped translation keys.
Clients Core Components
src/pages/clients/Clients.tsx, src/pages/clients/clients-view/ClientsView.tsx
Reformatted JSX translation rendering in table captions and headers; added line breaks and div wrappers around values without functional logic changes.
Clients Tab Components
src/pages/clients/clients-view/Identities-tab/ClientsidentitiesTab.tsx, src/pages/clients/clients-view/address-tab/ClientsAddressTab.tsx, src/pages/clients/clients-view/charges/view-charge/ViewCharge.tsx
Minor formatting adjustments: condensed onClick handlers, wrapped placeholder text, and reformatted table cell translations.
Clients Family & General Tabs
src/pages/clients/clients-view/family-members-tab/ClientsFamilyMembersAddTab.tsx, src/pages/clients/clients-view/family-members-tab/ClientsFamilyMembersTab.tsx, src/pages/clients/clients-view/general-tab/ClientsGeneralTab.tsx
Restructured required field asterisks, reformatted SelectItem children across dropdowns, and wrapped heading/table header translations into multi-line JSX.
Groups Components
src/pages/groups/groups-view/GroupsView.tsx, src/pages/groups/groups-view/general-tab/GroupsGeneralTab.tsx
Reformatted menu item and tab object literals; reordered and expanded summary metrics for group and client borrowers/loans with adjusted table header rendering.
Groups Action Components
src/pages/groups/groups-view/group-actions/AttachMeeting.tsx, src/pages/groups/groups-view/group-actions/EditGroups.tsx, src/pages/groups/groups-view/group-actions/ManageGroupMembers.tsx, src/pages/groups/groups-view/group-actions/TransferClients.tsx
Applied consistent multi-line JSX formatting to headings, labels, SelectValue placeholders, and SelectItem children without changing control flow.
Reports Management
src/pages/system/manage-reports/ViewReports.tsx
Integrated i18n translations throughout (breadcrumbs, buttons, headings, field labels); added styled status badges with Yes/No translations; reworked layout with bordered container and spaced detail rows; maintained fetch logic with improved type safety.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested reviewers

  • IOhacker

Poem

🐰 Dependencies hop to newer ground,
Labels nest where translations are found,
Formats align with thoughtful care,
Multi-line JSX floating through the air—
One report shines bright with i18n's embrace,
Hoppy changes bringing harmony to this place! 🌿

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: layout alignment in the report details view and the addition of BIRT translation, which are the primary focuses across the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@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: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
src/pages/groups/groups-view/group-actions/TransferClients.tsx (1)

58-76: ⚠️ Potential issue | 🟡 Minor

Add language dependency to useEffect to refresh fallback labels on language change.

Line 68 uses the t function to create fallback labels, but the dependency array at line 76 only includes [id]. When the user changes language, the translated fallback labels won't update until the component reloads or id changes.

Suggested fix
-  const { t } = useTranslation('groups')
+  const { t, i18n } = useTranslation('groups')
...
-  }, [id])
+  }, [id, i18n.language])
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/pages/groups/groups-view/group-actions/TransferClients.tsx` around lines
58 - 76, The useEffect that builds fallback labels with t (in the async call
using (groupsApi as any).retrieveAll17?.()) currently only depends on id, so
translated fallback names won't update on language changes; update the
dependency array of that useEffect to include the translation change (e.g., add
t or i18n.language) so the effect re-runs and calls setDestOptions with new t
values when language changes.
src/pages/groups/groups-view/GroupsView.tsx (1)

86-197: ⚠️ Potential issue | 🟡 Minor

Include translation function in dependency array to prevent stale menu labels after language change.

menuOptions calls t() multiple times but doesn't include t or i18n.language in its dependency array. When a user switches language, the t function reference updates, but the memoized options won't recompute, causing menu labels to remain in the previous language.

Suggested fix
-  }, [group, isActive, hasMembers, hasCalendar, hasStaff, inCenter])
+  }, [
+    group,
+    isActive,
+    hasMembers,
+    hasCalendar,
+    hasStaff,
+    inCenter,
+    t,
+    i18n.language,
+  ])
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/pages/groups/groups-view/GroupsView.tsx` around lines 86 - 197,
menuOptions is memoized with useMemo but calls t() for translations and doesn't
include t or i18n.language in its dependency array, causing labels to stay stale
after language change; update the dependency array for the useMemo that defines
menuOptions to include the translation function/reference (t) or the current
language (i18n.language) so the menu recomputes on locale changes — locate the
useMemo that returns menuOptions in GroupsView.tsx and add t (or i18n.language)
to its dependency list along with the existing [group, isActive, hasMembers,
hasCalendar, hasStaff, inCenter].
src/pages/groups/groups-view/general-tab/GroupsGeneralTab.tsx (1)

385-389: ⚠️ Potential issue | 🟡 Minor

Redundant ternary — both branches return the same value.

The ternary expression returns acc.accountNo in both branches, making the condition pointless. The column header switches between "Closed Date" and "Last Active" based on showClosedSavingAccounts, so this cell should display different data for each state: the closed date for closed accounts, or the last active transaction date for active accounts.

Use the same pattern as ClientsGeneralTab for savings accounts:

  • acc?.timeline?.closedOnDate for closed accounts
  • acc?.lastActiveTransactionDate for active accounts (with fallback to acc?.timeline?.activatedOnDate)

Import formatDate from @/lib/date-utils and apply it to handle array-type date fields.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/pages/groups/groups-view/general-tab/GroupsGeneralTab.tsx` around lines
385 - 389, The TableCell currently uses a redundant ternary over
showClosedSavingAccounts and always prints acc.accountNo; replace it so when
showClosedSavingAccounts is true it displays the closed date (use
acc?.timeline?.closedOnDate), otherwise display the last active transaction date
with fallback to activation (use acc?.lastActiveTransactionDate ??
acc?.timeline?.activatedOnDate), and pass the value through formatDate from
'@/lib/date-utils' to handle array/date formatting; update the import and the
TableCell rendering in GroupsGeneralTab where acc is referenced.
🧹 Nitpick comments (1)
src/pages/system/manage-reports/ViewReports.tsx (1)

1-1: Avoid disabling ESLint for the entire file.

A file-scoped /* eslint-disable */ hides unrelated regressions in this component. If one rule is noisy, suppress that rule as locally as possible instead of turning checks off across the whole view.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/pages/system/manage-reports/ViewReports.tsx` at line 1, The file-wide "/*
eslint-disable */" in ViewReports.tsx suppresses all linting and should be
removed; instead, remove that top-level directive and, if a specific rule is
noisy, add targeted inline disables (e.g., /* eslint-disable-next-line rule-name
*/) directly above the offending statement(s) or wrap only the minimal block
that needs suppression (for example around JSX in the ViewReports component or a
specific helper function), keeping the rest of the file linted normally.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/locales/en-US/products.json`:
- Around line 18-43: Add the missing 14 "label" keys (all nested keys under
label: anchor.home, anchor.system, anchor.managereports, button.edit,
button.back, heading.report, heading.reporttype, heading.reportcategory,
heading.corereport, heading.userreport, boolean.yes, boolean.no, text.BIRT,
text.Pentaho) from en-US/products.json into the corresponding locales (es-ES,
fr-FR, it-IT) so those files contain identical key structure and translated or
placeholder values; ensure the JSON nesting and key names exactly match the
en-US entries to prevent fallback to English.

In
`@src/pages/clients/clients-view/family-members-tab/ClientsFamilyMembersAddTab.tsx`:
- Around line 74-77: The Label components in ClientsFamilyMembersAddTab.tsx
(e.g., the <Label> wrapping the first name, last name, relationship, DOB, etc.)
are only visual siblings and not bound to their inputs; update each Label to
associate with its corresponding control by either adding a matching htmlFor on
the Label and an id on the input/select, or by wrapping the input inside the
Label, and also set the control's required/aria-required attribute (or required
prop for custom input components) so the required state is exposed
programmatically for screen readers; apply this change for the instances around
the firstName, lastName, relationship, birthDate, and other listed fields.

In `@src/pages/groups/groups-view/group-actions/ManageGroupMembers.tsx`:
- Around line 163-167: The Label next to the search Input in
ManageGroupMembers.tsx isn’t associated with the input element, so add a
matching id on the Input and htmlFor on the Label (e.g., id="clientSearch" and
htmlFor="clientSearch") to wire them together; update the JSX for the Label
component and the Input component used in that file (ensure the Input accepts an
id prop and Label accepts htmlFor if they are custom components) so the visible
client label is programmatically linked to the autocomplete/search field.

In `@src/pages/system/manage-reports/ViewReports.tsx`:
- Around line 101-109: The badge for report flags currently treats undefined the
same as false, causing "No" to display before data loads; update the rendering
for report?.coreReport (and likewise for report?.useReport) to explicitly check
for true/false and render a neutral placeholder (e.g., "-" or "Unknown") when
the value is undefined (for example use strict equality checks like
report?.coreReport === true / === false or test typeof report?.coreReport ===
"boolean" before choosing Yes/No), and apply the same change to the other badge
rendering block that references report?.useReport so undefined is not shown as
No.

---

Outside diff comments:
In `@src/pages/groups/groups-view/general-tab/GroupsGeneralTab.tsx`:
- Around line 385-389: The TableCell currently uses a redundant ternary over
showClosedSavingAccounts and always prints acc.accountNo; replace it so when
showClosedSavingAccounts is true it displays the closed date (use
acc?.timeline?.closedOnDate), otherwise display the last active transaction date
with fallback to activation (use acc?.lastActiveTransactionDate ??
acc?.timeline?.activatedOnDate), and pass the value through formatDate from
'@/lib/date-utils' to handle array/date formatting; update the import and the
TableCell rendering in GroupsGeneralTab where acc is referenced.

In `@src/pages/groups/groups-view/group-actions/TransferClients.tsx`:
- Around line 58-76: The useEffect that builds fallback labels with t (in the
async call using (groupsApi as any).retrieveAll17?.()) currently only depends on
id, so translated fallback names won't update on language changes; update the
dependency array of that useEffect to include the translation change (e.g., add
t or i18n.language) so the effect re-runs and calls setDestOptions with new t
values when language changes.

In `@src/pages/groups/groups-view/GroupsView.tsx`:
- Around line 86-197: menuOptions is memoized with useMemo but calls t() for
translations and doesn't include t or i18n.language in its dependency array,
causing labels to stay stale after language change; update the dependency array
for the useMemo that defines menuOptions to include the translation
function/reference (t) or the current language (i18n.language) so the menu
recomputes on locale changes — locate the useMemo that returns menuOptions in
GroupsView.tsx and add t (or i18n.language) to its dependency list along with
the existing [group, isActive, hasMembers, hasCalendar, hasStaff, inCenter].

---

Nitpick comments:
In `@src/pages/system/manage-reports/ViewReports.tsx`:
- Line 1: The file-wide "/* eslint-disable */" in ViewReports.tsx suppresses all
linting and should be removed; instead, remove that top-level directive and, if
a specific rule is noisy, add targeted inline disables (e.g., /*
eslint-disable-next-line rule-name */) directly above the offending statement(s)
or wrap only the minimal block that needs suppression (for example around JSX in
the ViewReports component or a specific helper function), keeping the rest of
the file linted normally.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 312d14ca-9a41-4aa7-96cd-a5fd0a493afa

📥 Commits

Reviewing files that changed from the base of the PR and between 1d69ff7 and 1160433.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (18)
  • package.json
  • src/locales/en-US/products.json
  • src/pages/centers/centers-view/general-tab/CentersGeneralTab.tsx
  • src/pages/clients/Clients.tsx
  • src/pages/clients/clients-view/ClientsView.tsx
  • src/pages/clients/clients-view/Identities-tab/ClientsidentitiesTab.tsx
  • src/pages/clients/clients-view/address-tab/ClientsAddressTab.tsx
  • src/pages/clients/clients-view/charges/view-charge/ViewCharge.tsx
  • src/pages/clients/clients-view/family-members-tab/ClientsFamilyMembersAddTab.tsx
  • src/pages/clients/clients-view/family-members-tab/ClientsFamilyMembersTab.tsx
  • src/pages/clients/clients-view/general-tab/ClientsGeneralTab.tsx
  • src/pages/groups/groups-view/GroupsView.tsx
  • src/pages/groups/groups-view/general-tab/GroupsGeneralTab.tsx
  • src/pages/groups/groups-view/group-actions/AttachMeeting.tsx
  • src/pages/groups/groups-view/group-actions/EditGroups.tsx
  • src/pages/groups/groups-view/group-actions/ManageGroupMembers.tsx
  • src/pages/groups/groups-view/group-actions/TransferClients.tsx
  • src/pages/system/manage-reports/ViewReports.tsx

Comment on lines +18 to +43
"label": {
"anchor": {
"home": "Home",
"system": "System",
"managereports": "Manage Reports"
},
"button": {
"edit": "Edit",
"back": "Back"
},
"heading": {
"report": "Report",
"reporttype": "Report Type",
"reportcategory": "Report Category",
"corereport": "Core Report",
"userreport": "User Report"
},
"boolean": {
"yes": "Yes",
"no": "No"
},
"text": {
"BIRT": "Mifos Reporting Plugin for Eclipse Birt",
"Pentaho": "Mifos Reporting Plugin for Pentaho"
}
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
python - <<'PY'
import json
from pathlib import Path

required = [
    ('label', 'anchor', 'home'),
    ('label', 'anchor', 'system'),
    ('label', 'anchor', 'managereports'),
    ('label', 'button', 'edit'),
    ('label', 'button', 'back'),
    ('label', 'heading', 'report'),
    ('label', 'heading', 'reporttype'),
    ('label', 'heading', 'reportcategory'),
    ('label', 'heading', 'corereport'),
    ('label', 'heading', 'userreport'),
    ('label', 'boolean', 'yes'),
    ('label', 'boolean', 'no'),
    ('label', 'text', 'BIRT'),
    ('label', 'text', 'Pentaho'),
]

for path in sorted(Path('src/locales').glob('*/products.json')):
    data = json.loads(path.read_text())
    missing = []
    for keys in required:
        current = data
        for key in keys:
            if isinstance(current, dict) and key in current:
                current = current[key]
            else:
                missing.append('.'.join(keys))
                break
    status = 'OK' if not missing else 'MISSING: ' + ', '.join(missing)
    print(f'{path}: {status}')
PY

Repository: openMF/mifos-x-web-app-react

Length of output: 1160


Add the new label keys to all shipped locale files.

The new report-detail keys are present only in en-US/products.json but missing from es-ES, fr-FR, and it-IT. The report detail view will silently fall back to English for users of these locales. Add all 14 new label.* keys to each of these three files.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/locales/en-US/products.json` around lines 18 - 43, Add the missing 14
"label" keys (all nested keys under label: anchor.home, anchor.system,
anchor.managereports, button.edit, button.back, heading.report,
heading.reporttype, heading.reportcategory, heading.corereport,
heading.userreport, boolean.yes, boolean.no, text.BIRT, text.Pentaho) from
en-US/products.json into the corresponding locales (es-ES, fr-FR, it-IT) so
those files contain identical key structure and translated or placeholder
values; ensure the JSON nesting and key names exactly match the en-US entries to
prevent fallback to English.

Comment on lines 74 to 77
<Label>
{t('familyMembers.labelFirstName')}<span className="text-red-500">*</span>
{t('familyMembers.labelFirstName')}
<span className="text-red-500">*</span>
</Label>
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

These required fields are still visually marked only.

Each touched <Label> here is still just a sibling of its control, so the inputs/selects do not get a programmatic label, and the red * is the only required cue. Please bind the labels to the underlying controls and expose the required state on the controls themselves.

♿ Suggested pattern
- <Label>
+ <Label htmlFor="first-name">
    {t('familyMembers.labelFirstName')}
-   <span className="text-red-500">*</span>
+   <span aria-hidden="true" className="text-red-500">*</span>
  </Label>
  <Input
+   id="first-name"
+   required
    value={form.firstName}
    onChange={e => set('firstName', e.target.value)}
  />

- <Label>
+ <Label htmlFor="relationship">
    {t('familyMembers.labelRelationship')}
-   <span className="text-red-500">*</span>
+   <span aria-hidden="true" className="text-red-500">*</span>
  </Label>
  <Select
    value={form.relationship}
    onValueChange={v => set('relationship', v)}
  >
-   <SelectTrigger className="rounded-none border-0 border-b border-zinc-300">
+   <SelectTrigger
+     id="relationship"
+     aria-required="true"
+     className="rounded-none border-0 border-b border-zinc-300"
+   >

Also applies to: 93-96, 114-117, 136-139, 167-170, 246-249

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/pages/clients/clients-view/family-members-tab/ClientsFamilyMembersAddTab.tsx`
around lines 74 - 77, The Label components in ClientsFamilyMembersAddTab.tsx
(e.g., the <Label> wrapping the first name, last name, relationship, DOB, etc.)
are only visual siblings and not bound to their inputs; update each Label to
associate with its corresponding control by either adding a matching htmlFor on
the Label and an id on the input/select, or by wrapping the input inside the
Label, and also set the control's required/aria-required attribute (or required
prop for custom input components) so the required state is exposed
programmatically for screen readers; apply this change for the instances around
the firstName, lastName, relationship, birthDate, and other listed fields.

Comment on lines +163 to 167
<Label className="mb-1 block">
{t('manageMembers.labelClient')}
</Label>
<Input
placeholder={t('manageMembers.placeholderSearch')}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Wire this label to the autocomplete input.

The visible client label is still separate from the <Input>, so the search box has no programmatic name; the placeholder does not replace it. Add htmlFor/id here before shipping.

♿ Suggested fix
- <Label className="mb-1 block">
+ <Label htmlFor="client-search" className="mb-1 block">
    {t('manageMembers.labelClient')}
  </Label>
  <Input
+   id="client-search"
    placeholder={t('manageMembers.placeholderSearch')}
📝 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
<Label className="mb-1 block">
{t('manageMembers.labelClient')}
</Label>
<Input
placeholder={t('manageMembers.placeholderSearch')}
<Label htmlFor="client-search" className="mb-1 block">
{t('manageMembers.labelClient')}
</Label>
<Input
id="client-search"
placeholder={t('manageMembers.placeholderSearch')}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/pages/groups/groups-view/group-actions/ManageGroupMembers.tsx` around
lines 163 - 167, The Label next to the search Input in ManageGroupMembers.tsx
isn’t associated with the input element, so add a matching id on the Input and
htmlFor on the Label (e.g., id="clientSearch" and htmlFor="clientSearch") to
wire them together; update the JSX for the Label component and the Input
component used in that file (ensure the Input accepts an id prop and Label
accepts htmlFor if they are custom components) so the visible client label is
programmatically linked to the autocomplete/search field.

Comment on lines +101 to +109
<div
className={`px-2 py-0.5 rounded text-xs font-bold ${
report?.coreReport
? "bg-green-100 text-green-700"
: "bg-gray-100 text-gray-700"
}`}
>
{report?.coreReport ? t("label.boolean.yes") : t("label.boolean.no")}
</div>
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Don't render unknown report flags as No.

Both badges currently treat undefined the same as false, so the page shows negative values before the fetch resolves and after a failed fetch. Render a neutral placeholder until those booleans are actually known.

💡 Suggested fix
- report?.coreReport
-   ? "bg-green-100 text-green-700"
-   : "bg-gray-100 text-gray-700"
+ report?.coreReport == null
+   ? "bg-zinc-100 text-zinc-500"
+   : report.coreReport
+     ? "bg-green-100 text-green-700"
+     : "bg-gray-100 text-gray-700"
...
- {report?.coreReport ? t("label.boolean.yes") : t("label.boolean.no")}
+ {report?.coreReport == null
+   ? "—"
+   : report.coreReport
+     ? t("label.boolean.yes")
+     : t("label.boolean.no")}

Apply the same branch to report?.useReport.

Also applies to: 116-124

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/pages/system/manage-reports/ViewReports.tsx` around lines 101 - 109, The
badge for report flags currently treats undefined the same as false, causing
"No" to display before data loads; update the rendering for report?.coreReport
(and likewise for report?.useReport) to explicitly check for true/false and
render a neutral placeholder (e.g., "-" or "Unknown") when the value is
undefined (for example use strict equality checks like report?.coreReport ===
true / === false or test typeof report?.coreReport === "boolean" before choosing
Yes/No), and apply the same change to the other badge rendering block that
references report?.useReport so undefined is not shown as No.

@IOhacker
Copy link
Contributor

@vaishnavirrapolu-06 the expected repository is https://github.com/openMF/web-app

@IOhacker
Copy link
Contributor

this PR has missing translation files

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