Skip to content

fix(users): display isSelfServiceUser field in ViewUsers page#96

Open
deepthi-kolipaka wants to merge 2 commits into
openMF:devfrom
deepthi-kolipaka:fix/users-display-isSelfServiceUser
Open

fix(users): display isSelfServiceUser field in ViewUsers page#96
deepthi-kolipaka wants to merge 2 commits into
openMF:devfrom
deepthi-kolipaka:fix/users-display-isSelfServiceUser

Conversation

@deepthi-kolipaka
Copy link
Copy Markdown

@deepthi-kolipaka deepthi-kolipaka commented Mar 16, 2026

Summary

Fixed the ViewUsers page to display the actual isSelfServiceUser
value instead of the hardcoded 'Missing in OpenApi' text.

Problem

The isSelfServiceUser field was hardcoded as 'Missing in OpenApi'
in the ViewUsers page because the field was missing from the
OpenAPI spec.

Changes

  • Updated ViewUsers.tsx to display isSelfServiceUser as 'Yes' or 'No'

Screenshots

Before: Shows 'Missing in OpenApi'
After: Shows 'Yes' or 'No' based on actual value

Related

Summary by CodeRabbit

  • Bug Fixes
    • Replaced placeholder text with a dynamic display of self-service user status, showing "Yes" or "No" instead of a static placeholder, improving clarity and accuracy in the user view.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 16, 2026

📝 Walkthrough

Walkthrough

The ViewUsers component now renders the self-service user status dynamically: it shows "Yes" when users?.isSelfServiceUser is truthy and "No" otherwise, replacing the previous static placeholder.

Changes

Cohort / File(s) Summary
Self-Service Status Rendering
src/pages/users/ViewUsers.tsx
Replaced static "Missing in OpenApi" placeholder with conditional rendering: displays "Yes" if users?.isSelfServiceUser is truthy, otherwise "No".

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Suggested reviewers

  • gkbishnoi07

Poem

🐰 Where once a placeholder did sit and wait,
A truth now hops in — no longer late.
Yes or No the field will say,
Clear and simple, bright as day. ✨

🚥 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 change: fixing the ViewUsers page to display the actual isSelfServiceUser field value instead of a hardcoded placeholder.
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

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.

Tip

You can get early access to new features in CodeRabbit.

Enable the early_access setting to enable early access features such as new models, tools, and more.

Copy link
Copy Markdown

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

🤖 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/pages/users/ViewUsers.tsx`:
- Line 175: The users list rendering references users?.isSelfServiceUser which
is not provided by the /users/{id} schema, causing the ternary to default to
"No"; either remove that field from the UI or implement three-state rendering:
check for undefined and render a placeholder (e.g., "—") when
users?.isSelfServiceUser is undefined, "Yes" when true, and "No" when false;
update the JSX in ViewUsers (the expression containing users?.isSelfServiceUser)
accordingly so it no longer incorrectly shows "No" for missing data.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5ac982ce-04f7-4561-880c-a26b51674851

📥 Commits

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

📒 Files selected for processing (1)
  • src/pages/users/ViewUsers.tsx

<div className="font-medium">Is Self Service</div>
<div className="text-zinc-600 dark:text-zinc-400">
{'Missing in OpenApi'}
{users?.isSelfServiceUser ? 'Yes' : 'No'}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Verify OpenAPI schema has isSelfServiceUser on /users/{id} response =="
SPEC_FILE="$(fd '^fineract\.ya?ml$' | head -n1)"
echo "Using spec: ${SPEC_FILE:-NOT_FOUND}"
if [ -n "${SPEC_FILE:-}" ]; then
  rg -n -A40 -B5 'GetUsersUserIdResponse:' "$SPEC_FILE"
  echo
  rg -n 'isSelfServiceUser' "$SPEC_FILE" || true
fi

echo
echo "== Verify generated TS type includes isSelfServiceUser =="
rg -n -A25 -B5 'interface\s+GetUsersUserIdResponse|type\s+GetUsersUserIdResponse' src || true
rg -n 'isSelfServiceUser' src || true

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

Length of output: 4176


🏁 Script executed:

fd -e ts -e tsx -path "*/fineract-api/*" -type f | head -20

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

Length of output: 240


🏁 Script executed:

fd -type f -name "*.ts" src/fineract-api | head -20

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

Length of output: 242


🏁 Script executed:

fd fineract-api src --type d

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

Length of output: 54


🏁 Script executed:

cat tsconfig.json | grep -A5 "@/"

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

Length of output: 108


🏁 Script executed:

find src/fineract-api -type f -name "*.ts" | head -10

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

Length of output: 123


🏁 Script executed:

rg "interface GetUsersUserIdResponse|type GetUsersUserIdResponse" -A30

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

Length of output: 1869


🏁 Script executed:

rg "GetUsersUserIdResponse" --type-list | head -5 && rg -g "index.ts" "GetUsersUserIdResponse" -A20

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

Length of output: 610


🏁 Script executed:

find . -name "index.ts" -o -name "index.js" | xargs rg "GetUsersUserIdResponse" 2>/dev/null | head -5

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

Length of output: 411


🏁 Script executed:

rg -A5 -B2 "Missing in.*GetUsersUserIdResponse" ISSUES.md

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

Length of output: 160


Remove field access or implement three-state rendering.

isSelfServiceUser is missing from the /users/{id} response schema (documented in ISSUES.md). This causes the ternary to always evaluate to 'No' for all users. Either remove the field display until the schema is updated, or render a distinct state (e.g., ) for undefined values.

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

In `@src/pages/users/ViewUsers.tsx` at line 175, The users list rendering
references users?.isSelfServiceUser which is not provided by the /users/{id}
schema, causing the ternary to default to "No"; either remove that field from
the UI or implement three-state rendering: check for undefined and render a
placeholder (e.g., "—") when users?.isSelfServiceUser is undefined, "Yes" when
true, and "No" when false; update the JSX in ViewUsers (the expression
containing users?.isSelfServiceUser) accordingly so it no longer incorrectly
shows "No" for missing data.

Copy link
Copy Markdown

@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.

♻️ Duplicate comments (1)
src/pages/users/ViewUsers.tsx (1)

174-174: ⚠️ Potential issue | 🔴 Critical

Build is blocked: isSelfServiceUser is not in GetUsersUserIdResponse (TS2339).

Line 174 fails compilation and also collapses missing data to 'No'. Please either regenerate/consume the updated OpenAPI types from PR #88, or add a temporary local extended type and render a third state when undefined.

Proposed minimal fix (temporary, type-safe)
- const [users, setUsers] = useState<GetUsersUserIdResponse | null>(null)
+ type ViewUserResponse = GetUsersUserIdResponse & { isSelfServiceUser?: boolean }
+ const [users, setUsers] = useState<ViewUserResponse | null>(null)
...
- {users?.isSelfServiceUser ? 'Yes' : 'No'}
+ {users?.isSelfServiceUser === undefined
+   ? '—'
+   : users.isSelfServiceUser
+     ? 'Yes'
+     : 'No'}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/pages/users/ViewUsers.tsx` at line 174, The component is referencing
users?.isSelfServiceUser which doesn't exist on GetUsersUserIdResponse (causing
TS2339) and collapses undefined to "No"; fix by either pulling in the
regenerated OpenAPI types that include isSelfServiceUser or add a local extended
type (e.g., declare an ExtendedUser type that extends GetUsersUserIdResponse
with isSelfServiceUser?: boolean) and update the ViewUsers rendering to
explicitly handle three states (true => "Yes", false => "No", undefined => a
third state like "—" or "Unknown") when reading users (the symbols to change are
users, GetUsersUserIdResponse and the ViewUsers component).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@src/pages/users/ViewUsers.tsx`:
- Line 174: The component is referencing users?.isSelfServiceUser which doesn't
exist on GetUsersUserIdResponse (causing TS2339) and collapses undefined to
"No"; fix by either pulling in the regenerated OpenAPI types that include
isSelfServiceUser or add a local extended type (e.g., declare an ExtendedUser
type that extends GetUsersUserIdResponse with isSelfServiceUser?: boolean) and
update the ViewUsers rendering to explicitly handle three states (true => "Yes",
false => "No", undefined => a third state like "—" or "Unknown") when reading
users (the symbols to change are users, GetUsersUserIdResponse and the ViewUsers
component).

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5926c8cb-fc8a-4ed3-9054-5675a21fabb6

📥 Commits

Reviewing files that changed from the base of the PR and between 96b85a2 and 5988766.

📒 Files selected for processing (1)
  • src/pages/users/ViewUsers.tsx

@DavidH-1
Copy link
Copy Markdown
Contributor

CLA check = failed Please sign our CLA so this can be considered

Copy link
Copy Markdown
Collaborator

@gkbishnoi07 gkbishnoi07 left a comment

Choose a reason for hiding this comment

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

your one workflow is failing please fix and please check david comment

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.

3 participants