Skip to content

fix/INJIWEB-1789-isserspageupdate#486

Open
sanehema9 wants to merge 4 commits intoinji:developfrom
sanehema9:fix/INJIWEB-1789-isserspageupdate
Open

fix/INJIWEB-1789-isserspageupdate#486
sanehema9 wants to merge 4 commits intoinji:developfrom
sanehema9:fix/INJIWEB-1789-isserspageupdate

Conversation

@sanehema9
Copy link

@sanehema9 sanehema9 commented Jan 12, 2026

Description

changed the files
CredentialList.tsx , CredentialListWrapper.tsx , CredentialsPage.tsx , Issuerspage.tsx and IssuersList.tsx

Issue ticket number and link

INJIWEB-1789(https://mosip.atlassian.net/browse/INJIWEB-1789)

Video

INJIWEB-1789.mp4

Summary by CodeRabbit

  • Style

    • Improved responsive grid layout for credential and issuer listings across screen sizes.
    • Streamlined loading, empty-state and spacing for clearer, consistent presentation.
  • Chores

    • Standardized DOM/wrapper structure and made layout props optional to simplify component composition.

✏️ Tip: You can customize this high-level summary in your review settings.

Signed-off-by: sanehema9 <sanehema9@gmail.com>
@coderabbitai
Copy link

coderabbitai bot commented Jan 12, 2026

Walkthrough

UI/layout-only updates: responsive grid wrappers and minor class/tags adjustments across credential and issuer components and pages; CredentialListWrapper.className made optional with a default; useParams typing in CredentialsPage switched to an inline type. No business logic, API, or state-management changes. (34 words)

Changes

Cohort / File(s) Summary
Credential UI
inji-web/src/components/Credentials/CredentialList.tsx, inji-web/src/components/Credentials/CredentialListWrapper.tsx
Added col-span-full to a credential items wrapper; made CredentialListWrapperProps.className optional (className?: string) with default ""; wrapped CredentialList in a responsive grid (grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6) and adjusted DOM nesting.
Issuers UI
inji-web/src/components/Issuers/IssuersList.tsx, inji-web/src/pages/IssuersPage.tsx
Replaced flex wrappers with a responsive grid for issuer items (grid-cols-1 sm:grid-cols-2 lg:grid-cols-3); simplified empty/error/loading branches and removed extra wrapper elements; normalized JSX formatting and spacing.
Credentials Page
inji-web/src/pages/CredentialsPage.tsx
Changed useParams type to inline { issuerId: string }; switched selectedIssuer declaration to const; added an outer container div around CredentialListWrapper (layout/class changes only).
Manifest
package.json
Single-line edit in manifest (minor change).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • jackjain
  • swatigoel

Poem

🐰
I hopped through grids and set the span,
Gave props a nook and a tidy plan,
Columns twirl where rows once played,
A lighter DOM where classes stayed,
Carrots for code — a cheerful stand!

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title is vague and lacks clarity; 'isserspageupdate' is a misspelled, generic descriptor that doesn't clearly convey the primary change or purpose of the changeset. Use a clear, specific title that describes the main objective. For example: 'Convert credential and issuer lists to responsive grid layout' or 'Refactor list components for improved layout consistency'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

Caution

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

⚠️ Outside diff range comments (1)
inji-web/src/components/Credentials/CredentialList.tsx (1)

97-119: Layout inconsistency between success and empty/error states.

The success case returns a React Fragment, making HeaderTile and the credentials container separate grid items within the parent grid (grid-cols-1 sm:grid-cols-2 lg:grid-cols-3). This means HeaderTile will only occupy 1 column on larger screens.

However, the empty/error states (lines 76-84) wrap both HeaderTile and content in a single <div>, making them one grid item.

Consider wrapping both elements in a single container with col-span-full for consistent layout:

Suggested fix for consistent layout
     return (
-        <>
+        <div className="col-span-full">
             <HeaderTile
                 content={t("containerHeading")}
                 subContent={t("containerSubHeading")}
             />
            <div className="col-span-full flex flex-wrap gap-3 p-4 pb-20 justify-start">
+           <div className="flex flex-wrap gap-3 p-4 pb-20 justify-start">
                 {filteredCredentialsWithLangSupport.map(
                     ...
                 )}
             </div>
-        </>
+        </div>
     );
🤖 Fix all issues with AI agents
In @inji-web/src/components/Issuers/IssuersList.tsx:
- Around line 32-34: The Issuer component is missing the required index prop
when rendered in the map; update the issuers.filtered_issuers.map callback in
IssuersList (where <Issuer key={issuer.issuer_id} issuer={issuer} /> is used) to
accept the map index and pass it as the index prop to <Issuer> (matching
IssuerProps and the index expected by ItemBox), e.g., map((issuer, index) =>
<Issuer key={issuer.issuer_id} issuer={issuer} index={index} />).
🧹 Nitpick comments (3)
inji-web/src/components/Issuers/IssuersList.tsx (1)

18-37: Inconsistent indentation throughout the component.

The file mixes 2-space and 4-space indentation (e.g., lines 22-26 use 2-space, while lines 30, 35-36 use 4-space). Consider running a formatter to ensure consistent code style.

inji-web/src/pages/IssuersPage.tsx (2)

50-62: Consider simplifying error handling logic.

The try/catch in initializeIssuersData catches errors from both fetchUserProfile and fetchIssuers. However, fetchIssuers already handles its own errors internally (lines 29-31) and won't throw. The outer catch block will only catch errors from fetchUserProfile.

For clarity, consider either:

  1. Wrapping only fetchUserProfile in try/catch, or
  2. Adding a comment explaining the intended error handling scope.
♻️ Suggested clarification
         const initializeIssuersData = async () => {
             if (isUserLoggedIn()) {
                 try {
                     await fetchUserProfile();
-                    await fetchIssuers();
                 } catch (error: any) {
                     console.error("Error fetching user profile:", error);
                     toast.error(t("errorContent"));
+                    return;
                 }
-            } else {
-                await fetchIssuers();
             }
+            await fetchIssuers();
         };

68-78: Inconsistent indentation in JSX.

Similar to IssuersList.tsx, this file mixes 2-space (lines 70-74) and 4-space (lines 72-76) indentation. Consider running a formatter for consistent styling across the codebase.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 222fcb4 and 73fab92.

📒 Files selected for processing (5)
  • inji-web/src/components/Credentials/CredentialList.tsx
  • inji-web/src/components/Credentials/CredentialListWrapper.tsx
  • inji-web/src/components/Issuers/IssuersList.tsx
  • inji-web/src/pages/CredentialsPage.tsx
  • inji-web/src/pages/IssuersPage.tsx
🧰 Additional context used
🧬 Code graph analysis (3)
inji-web/src/components/Issuers/IssuersList.tsx (6)
inji-web/src/components/Common/GradientWrapper.tsx (1)
  • GradientWrapper (4-25)
inji-web/src/components/Common/SpinningLoader.tsx (1)
  • SpinningLoader (4-21)
inji-web/src/components/Common/HeaderTile.tsx (1)
  • HeaderTile (4-11)
inji-web/src/components/Common/EmptyListContainer.tsx (1)
  • EmptyListContainer (4-13)
inji-web/src/types/data.d.ts (1)
  • IssuerObject (42-57)
inji-web/src/components/Issuers/Issuer.tsx (1)
  • Issuer (12-30)
inji-web/src/pages/CredentialsPage.tsx (3)
inji-web/src/types/redux.d.ts (1)
  • RootState (3-3)
inji-web/src/types/data.d.ts (2)
  • IssuerWellknownDisplayArrayObject (7-14)
  • IssuerObject (42-57)
inji-web/src/components/Credentials/CredentialListWrapper.tsx (1)
  • CredentialListWrapper (10-22)
inji-web/src/components/Credentials/CredentialListWrapper.tsx (1)
inji-web/src/components/Credentials/CredentialList.tsx (1)
  • CredentialList (18-121)
🔇 Additional comments (4)
inji-web/src/pages/CredentialsPage.tsx (1)

82-87: Good responsive container structure.

The container wrapper with responsive padding (px-4 sm:px-6 md:px-10 lg:px-20) provides proper mobile-first responsive design, while the container mx-auto ensures consistent max-width and centering.

inji-web/src/components/Credentials/CredentialListWrapper.tsx (2)

5-10: Good use of optional prop with default value.

Making className optional with an empty string default is a clean approach that maintains backward compatibility.


16-19: Grid wrapper may not achieve intended responsive layout.

The responsive grid (grid-cols-1 sm:grid-cols-2 lg:grid-cols-3) is applied here, but CredentialList returns a Fragment containing:

  1. HeaderTile (becomes 1 grid item)
  2. A div with flex flex-wrap containing credential cards

The credential cards themselves use flexbox layout (flex flex-wrap), not CSS grid, so this grid wrapper won't directly control the card column layout. The grid only affects the Fragment's direct children (HeaderTile and the wrapper div), not the individual cards.

If the goal is responsive card columns, consider either:

  1. Moving the grid classes to the credential cards' container inside CredentialList
  2. Or restructuring so credential cards are direct grid children

Please verify the rendered layout matches expectations across breakpoints (mobile, tablet, desktop).

inji-web/src/pages/IssuersPage.tsx (1)

15-15: LGTM on simplified component signature.

Removing the unused className prop and simplifying the type to React.FC is a good cleanup.

Signed-off-by: sanehema9 <sanehema9@gmail.com>
@sanehema9
Copy link
Author

Actionable comments posted: 1

Caution

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

⚠️ Outside diff range comments (1)

inji-web/src/components/Credentials/CredentialList.tsx (1)> 97-119: Layout inconsistency between success and empty/error states.

The success case returns a React Fragment, making HeaderTile and the credentials container separate grid items within the parent grid (grid-cols-1 sm:grid-cols-2 lg:grid-cols-3). This means HeaderTile will only occupy 1 column on larger screens.
However, the empty/error states (lines 76-84) wrap both HeaderTile and content in a single <div>, making them one grid item.
Consider wrapping both elements in a single container with col-span-full for consistent layout:

Suggested fix for consistent layout

     return (
-        <>
+        <div className="col-span-full">
             <HeaderTile
                 content={t("containerHeading")}
                 subContent={t("containerSubHeading")}
             />
            <div className="col-span-full flex flex-wrap gap-3 p-4 pb-20 justify-start">
+           <div className="flex flex-wrap gap-3 p-4 pb-20 justify-start">
                 {filteredCredentialsWithLangSupport.map(
                     ...
                 )}
             </div>
-        </>
+        </div>
     );

🤖 Fix all issues with AI agents

In @inji-web/src/components/Issuers/IssuersList.tsx:
- Around line 32-34: The Issuer component is missing the required index prop
when rendered in the map; update the issuers.filtered_issuers.map callback in
IssuersList (where <Issuer key={issuer.issuer_id} issuer={issuer} /> is used) to
accept the map index and pass it as the index prop to <Issuer> (matching
IssuerProps and the index expected by ItemBox), e.g., map((issuer, index) =>
<Issuer key={issuer.issuer_id} issuer={issuer} index={index} />).

🧹 Nitpick comments (3)

inji-web/src/components/Issuers/IssuersList.tsx (1)> 18-37: Inconsistent indentation throughout the component.

The file mixes 2-space and 4-space indentation (e.g., lines 22-26 use 2-space, while lines 30, 35-36 use 4-space). Consider running a formatter to ensure consistent code style.

inji-web/src/pages/IssuersPage.tsx (2)> 50-62: Consider simplifying error handling logic.

The try/catch in initializeIssuersData catches errors from both fetchUserProfile and fetchIssuers. However, fetchIssuers already handles its own errors internally (lines 29-31) and won't throw. The outer catch block will only catch errors from fetchUserProfile.
For clarity, consider either:

  1. Wrapping only fetchUserProfile in try/catch, or
  2. Adding a comment explaining the intended error handling scope.

♻️ Suggested clarification

         const initializeIssuersData = async () => {
             if (isUserLoggedIn()) {
                 try {
                     await fetchUserProfile();
-                    await fetchIssuers();
                 } catch (error: any) {
                     console.error("Error fetching user profile:", error);
                     toast.error(t("errorContent"));
+                    return;
                 }
-            } else {
-                await fetchIssuers();
             }
+            await fetchIssuers();
         };

68-78: Inconsistent indentation in JSX.
Similar to IssuersList.tsx, this file mixes 2-space (lines 70-74) and 4-space (lines 72-76) indentation. Consider running a formatter for consistent styling across the codebase.

📜 Review details

Fixed the missing index prop in IssuersList.tsx. The latest commit addresses the issue flagged by the bot. Ready for review

import {useUser} from "../hooks/User/useUser";

export const IssuersPage: React.FC<IssuerPageProps> = ({className}) => {
export const IssuersPage: React.FC = () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Did we confirm on the usages of the components before removing the className ? Please check the post login flow if the alignment is working properly on it. Please add the video for it in the PR post checking it.

// Excludes issuers with protocol 'OTP' and those whose issuer_id is in the ignoredIssuersFromRendering list (or contains any ignored issuer id as a substring).
issuer.protocol !== 'OTP' &&
(ignoredIssuerIds.length === 0 || !ignoredIssuerIds.some((ignoredIssuerId) =>
issuer.protocol !== "OTP" &&
Copy link
Contributor

Choose a reason for hiding this comment

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

Did we intend to remove the comment here ?

@sanehema9 sanehema9 requested a review from jackjain January 29, 2026 15:55
Signed-off-by: sanehema9 <sanehema9@gmail.com>
Signed-off-by: sanehema9 <sanehema9@gmail.com>
@sonarqubecloud
Copy link

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: 0

Caution

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

⚠️ Outside diff range comments (1)
inji-web/src/pages/IssuersPage.tsx (1)

70-76: ⚠️ Potential issue | 🟠 Major

Add top margin to IssuersList to maintain consistent spacing.

The flex wrapper (line 71) with gap-6 provides 1.5rem spacing between IntroBox and SearchIssuer, but IssuersList (line 75) is a sibling outside this wrapper without its own top margin. This creates inconsistent vertical spacing. Add mt-6 to the IssuersList component to match the spacing pattern, or move it inside the flex wrapper.

Copy link
Contributor

@Rudhhi-Shah-14 Rudhhi-Shah-14 left a comment

Choose a reason for hiding this comment

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

Image

The code changes are breaking the existing UI. Please ensure the existing UI is not impacted.

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