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

feat(explorer): As a user, I want the Portal page to display latest Attestations #837

Merged
merged 4 commits into from
Nov 29, 2024

Conversation

Chirag-S-Kotian
Copy link
Contributor

@Chirag-S-Kotian Chirag-S-Kotian commented Nov 28, 2024

What does this PR do?

Summary

This PR introduces the RecentAttestations component to the Portal page, providing users with an overview of the last 5 attestations issued through the portal. The component mirrors the functionality available on the Schema page, displaying data in a structured, interactive table format.


Key Changes

  1. New Component: RecentAttestations

    • Fetches and displays the last 5 attestations issued via the portal.
    • Shows a loading skeleton while data is being fetched.
    • Handles error states with an appropriate message.
    • Displays a "No Data Available" message when no attestations exist.
  2. Integration on Portal Page

    • Added the RecentAttestations component to the Portal page layout.
    • Ensures consistent behavior and UI with the Schema page.
  3. Enhanced User Experience

    • Uses SWR for efficient data fetching and state management.
    • Includes accessibility-friendly error and loading states.
    • Localized strings using i18n for global language support.
  4. Robust Error Handling

    • Gracefully manages fetch errors and empty data scenarios.

Testing Instructions

  1. Navigate to the Portal page.

  2. Observe the "Recent Attestations" section.

  3. Verify the following scenarios:

    • Data Available: Displays the last 5 attestations in a DataTable.
    • Loading State: Displays a skeleton UI while fetching data.
    • No Data: Shows a "No recent attestations available" message if no data exists.
    • Error State: Shows an error message when data fetching fails.
  4. Check language translation by switching i18n locales.


Additional Notes

  • Translation keys added for better internationalization:

    • attestation.recent
    • attestation.noData
    • error.fetchFailed
  • Component is designed to be reusable and adaptable for other pages if needed.


Checklist

  • Added RecentAttestations component.
  • Integrated RecentAttestations on the Portal page.
  • Implemented robust error and loading state handling.
  • Verified localization with i18n.
  • Tested all scenarios: data available, loading, no data, error.
  • Followed coding standards and best practices.

Related ticket

Fixes #783

Type of change

  • Chore
  • Bug fix
  • New feature
  • Documentation update

Check list

  • Unit tests for any smart contract change
  • Contracts and functions are documented

…component to handle global attestations, and made minor changes to SchemaLoadingSkeleton and Schema components.
@alainncls alainncls changed the title Add Recent Attestations Component to Display Latest Attestations on Portal Page feat(explorer): As a user, I want the Portal page to display latest Attestations Nov 29, 2024
@alainncls
Copy link
Collaborator

Overall, the PR is good, just a slight change to display recent Attestations specifically for the Portal that we're looking at.
(cf. comments above + add <RecentAttestations portalId={portal.id} /> to the Portal page)

@alainncls alainncls merged commit ef284ae into Consensys:dev Nov 29, 2024
10 checks passed
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.

[US] As a user, I want the Portal page to display latest Attestations
2 participants