Add paginated cached resources with file upload/delete and mobile-first UI#31
Closed
thughari wants to merge 11 commits intofeat/career-resourcefrom
Closed
Add paginated cached resources with file upload/delete and mobile-first UI#31thughari wants to merge 11 commits intofeat/career-resourcefrom
thughari wants to merge 11 commits intofeat/career-resourcefrom
Conversation
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.
Motivation
Description
CareerResourcewithresourceType,originalFileName, andfileSizeBytes, addedCareerResourceDTOfields and a newCareerResourcePageResponsemodel, added paginated repository method and aGET /api/resources?page&sizeendpoint that returns cached pages via@Cacheableand supports anonymous/authenticated viewers.POST /api/resources/uploadto accept multipart file uploads andDELETE /api/resources/{id}to remove resources, implementedcreateResourceFromFileanddeleteResourceinCareerResourceServicewith@CacheEvictand storage cleanup via the existingStorageService(works for R2 and local mock).ResourceServicenow uses an in-memory page cache (Mapkeyed bypage:size), exposesgetResources(page,size,forceRefresh),uploadResourceFile(...),deleteResource(...)and invalidates cache on mutations.ResourcesComponentand template for mobile-first layout, added link vs file contribution modes, client-side file type/size checks (10MB max), a “Load more” paginated flow, file metadata display and an owner-only delete button; updated unit test mocks to the paged API shape and new methods.Testing
npm --prefix frontend run start -- --host 0.0.0.0 --port 4200started successfully and a mobile screenshot was captured for visual verification.npm --prefix frontend run test -- --watch=false --browsers=ChromeHeadlessfailed in this environment because aChromeHeadlessbinary is not available.npm --prefix frontend run buildfailed here due to inlining Google Fonts returning HTTP 403 during the build (external resource policy in this environment).mvn -q testcould not run in this environment because Maven could not resolve the parent POM from Maven Central (HTTP 403); component unit test mocks were updated to reflect the new paged API and added methods.Codex Task