Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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 src/pages/system/manage-data-tables/ManageDataTables.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
{table.applicationTableName || '—'}
</TableCell>
<TableCell className="px-6 py-4 text-zinc-700 dark:text-zinc-200">
{'Missing in OpenAPI'}
{(table as any).entitySubType ?? '—'}

Check failure on line 173 in src/pages/system/manage-data-tables/ManageDataTables.tsx

View workflow job for this annotation

GitHub Actions / Run Lint, Build and Deploy

Unexpected any. Specify a different type
</TableCell>
</TableRow>
))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
{role.description || '—'}
</TableCell>
<TableCell className="px-6 py-4">
{'missing in OpenApi'}
{(role as any).disabled ? 'Disabled' : 'Enabled'}

Check failure on line 178 in src/pages/system/roles-and-permissions/RolesAndPermissions.tsx

View workflow job for this annotation

GitHub Actions / Run Lint, Build and Deploy

Unexpected any. Specify a different type
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

Do not map unknown disabled values to “Enabled” (Line 178).

If disabled is absent/undefined, the current ternary renders “Enabled”, which is a misleading status. Handle explicit true/false and fall back to unknown.

Suggested change
- {(role as any).disabled ? 'Disabled' : 'Enabled'}
+ {(role as any).disabled === true
+   ? 'Disabled'
+   : (role as any).disabled === false
+     ? 'Enabled'
+     : '—'}
📝 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
{(role as any).disabled ? 'Disabled' : 'Enabled'}
{(role as any).disabled === true
? 'Disabled'
: (role as any).disabled === false
? 'Enabled'
: '—'}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/pages/system/roles-and-permissions/RolesAndPermissions.tsx` at line 178,
The current status rendering in RolesAndPermissions.tsx uses (role as
any).disabled ? 'Disabled' : 'Enabled', which treats undefined as "Enabled";
change the logic to explicitly check for true/false on role.disabled (e.g.,
role.disabled === true ? 'Disabled' : role.disabled === false ? 'Enabled' :
'Unknown') so missing/undefined values render 'Unknown' instead of defaulting to
Enabled; update the component where the status is computed/rendered (the
expression referencing (role as any).disabled) to use this explicit three-way
check.

</TableCell>
<TableCell className="px-6 py-4">
{role.description && (
Expand Down
2 changes: 1 addition & 1 deletion src/pages/users/Users.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
{user.officeName}
</TableCell>
<TableCell className="px-6 py-4 text-zinc-700 dark:text-zinc-200">
{'Missing in OpenApi'}
{(user as any).isSelfServiceUser ? 'Yes' : 'No'}

Check failure on line 196 in src/pages/users/Users.tsx

View workflow job for this annotation

GitHub Actions / Run Lint, Build and Deploy

Unexpected any. Specify a different type
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

Avoid defaulting unknown isSelfServiceUser to “No” (Line 196).

When the field is missing/null, this currently renders “No”, which is inaccurate. Render Yes/No only for explicit booleans, otherwise show unknown.

Suggested change
- {(user as any).isSelfServiceUser ? 'Yes' : 'No'}
+ {(user as any).isSelfServiceUser === true
+   ? 'Yes'
+   : (user as any).isSelfServiceUser === false
+     ? 'No'
+     : '—'}
📝 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
{(user as any).isSelfServiceUser ? 'Yes' : 'No'}
{(user as any).isSelfServiceUser === true
? 'Yes'
: (user as any).isSelfServiceUser === false
? 'No'
: '—'}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/pages/users/Users.tsx` at line 196, The current JSX always shows "No"
when isSelfServiceUser is missing; update the render for (user as
any).isSelfServiceUser so it displays 'Yes' only if the value is === true, 'No'
only if === false, and 'Unknown' when the field is null/undefined or not a
boolean. Locate the expression "(user as any).isSelfServiceUser" in Users.tsx
and replace the single ternary with a boolean-type check (e.g. typeof ===
'boolean') to decide between 'Yes'/'No' and fall back to 'Unknown'; also
consider using the typed user property instead of casting to any if available.

</TableCell>
</TableRow>
))}
Expand Down
Loading