mirror of
https://github.com/lukaszraczylo/gohoarder.git
synced 2026-11-26 06:37:07 +00:00
feat(ui): page, search and filter packages on the server
The package list loaded every package, then grouped and paged in the browser. The dashboard did the same to show ten recent rows. - PackageList asks the server for one page of 25 groups. The registry filter and a debounced search box (300 ms) change the request. A newer request replaces the answer of an older one. - Dashboard loads a page of 10 groups sorted by cached_at, newest first, and runs its stats, recent list and chart requests in parallel. - Stats already used /api/stats only and does not change. - The store keeps the loading flag on until the last overlapping request settles. Deleting a package no longer reloads the full list, and the list reloads its own page instead. - VulnerablePackages keeps the unpaginated call because it filters on scan results in the browser.
This commit is contained in:
@@ -208,7 +208,7 @@ describe('view smoke tests (strict mode throw, fixture data)', () => {
|
||||
|
||||
it('PackageList still fetches through the store on mount', async () => {
|
||||
await smoke(PackageList, '/packages')
|
||||
expect(usePackageStore().packages.length).toBe(PACKAGES.length)
|
||||
expect(usePackageStore().packagePage.packages.length).toBe(PACKAGES.length)
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user