Open
Conversation
Author
|
Conflict has been merge for this. Please I will be awaiting for your review. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Close #98
Recent Activity Feature - Walkthrough
I have implemented a comprehensive Recent Activity tracking and display system. This feature allows users to see what's happening on the portal (new reports, vulnerabilities, and comments) and personalize their feed by following specific protocols, auditors, or companies.
Changes
Backend Architecture
ActivityModel: Central table tracking all system activities (Report Creation, Vulnerability Approval, etc.).
UserFollowModel: Tracks user subscriptions to Protocols, Auditors, and Companies.
CommentModel: Structure for storing user comments on various entities.
DbContext: Updated
Db.cs
to include new tables.
ActivityProcessor: Handles retrieving and enriching activity data with entity details (joining with Report/Protocol tables).
UserFollowService: Manages follow/unfollow actions and checks status.
Auto-tracking:
ReportsController
and
VulnerabilitiesController
now automatically generate activity records when items are created or approved.
GET /api/v1/activities: Fetch public activity feed.
GET /api/v1/activities/personalized: Fetch feed filtered by user's follows.
POST /api/v1/follows: Follow an entity.
POST /api/v1/comments: Add comments (backend support).
Frontend Implementation
RecentActivity: A new section on the Homepage displaying the latest 6 activities.
ActivityCard: A reusable component that renders activity details with:
Actor avatar and name
Action description and relative time
Entity links and status icons
ActivityPage: A dedicated /activity page with:
"Personalized" vs "All" feed toggles
Time range filtering (24h, 7d, 30d)
FollowButton: Added to Protocol Details page to allow users to subscribe to updates.
extended
soroban-security-portal-api.ts
with new methods for Activities, Follows, and Comments.
Verification
Automated Verification
The backend compiles (standard .NET build).
The frontend compiles (standard npm build).
Manual Verification Steps
Homepage Feed:
Open the homepage.
Observe the "Recent Activity" section.
Verify it shows recent reports/vulnerabilities.
Tracking:
Create a new Report.
Go back to Home -> The new report creation activity appears.
Approve the Report (as Admin) -> The approval activity appears.
Personalization:
Go to a Protocol page.
Click the "Follow" button.
Go to the Activity Page (/activity).
Switch to "Following" tab.
Verify activities related to that protocol appear.
Filtering:
On the Activity Page, use the time range toggle (7 days / 30 days) to see older activities.