openvsx-webui-test 0.17.2 → 0.18.0-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/button-with-progress.d.ts +1 -0
- package/lib/components/button-with-progress.d.ts.map +1 -1
- package/lib/components/button-with-progress.js +1 -1
- package/lib/components/button-with-progress.js.map +1 -1
- package/lib/components/sanitized-markdown.d.ts.map +1 -1
- package/lib/components/sanitized-markdown.js +79 -1
- package/lib/components/sanitized-markdown.js.map +1 -1
- package/lib/components/scan-admin/common/auto-refresh.d.ts +21 -0
- package/lib/components/scan-admin/common/auto-refresh.d.ts.map +1 -0
- package/lib/components/scan-admin/common/auto-refresh.js +45 -0
- package/lib/components/scan-admin/common/auto-refresh.js.map +1 -0
- package/lib/components/scan-admin/common/conditional-tooltip.d.ts +24 -0
- package/lib/components/scan-admin/common/conditional-tooltip.d.ts.map +1 -0
- package/lib/components/scan-admin/common/conditional-tooltip.js +63 -0
- package/lib/components/scan-admin/common/conditional-tooltip.js.map +1 -0
- package/lib/components/scan-admin/common/file-table.d.ts +23 -0
- package/lib/components/scan-admin/common/file-table.d.ts.map +1 -0
- package/lib/components/scan-admin/common/file-table.js +350 -0
- package/lib/components/scan-admin/common/file-table.js.map +1 -0
- package/lib/components/scan-admin/common/index.d.ts +18 -0
- package/lib/components/scan-admin/common/index.d.ts.map +1 -0
- package/lib/components/scan-admin/common/index.js +18 -0
- package/lib/components/scan-admin/common/index.js.map +1 -0
- package/lib/components/scan-admin/common/tab-panel.d.ts +25 -0
- package/lib/components/scan-admin/common/tab-panel.d.ts.map +1 -0
- package/lib/components/scan-admin/common/tab-panel.js +22 -0
- package/lib/components/scan-admin/common/tab-panel.js.map +1 -0
- package/lib/components/scan-admin/common/utils.d.ts +15 -0
- package/lib/components/scan-admin/common/utils.d.ts.map +1 -0
- package/lib/components/scan-admin/common/utils.js +46 -0
- package/lib/components/scan-admin/common/utils.js.map +1 -0
- package/lib/components/scan-admin/dialogs/file-dialog.d.ts +19 -0
- package/lib/components/scan-admin/dialogs/file-dialog.d.ts.map +1 -0
- package/lib/components/scan-admin/dialogs/file-dialog.js +85 -0
- package/lib/components/scan-admin/dialogs/file-dialog.js.map +1 -0
- package/lib/components/scan-admin/dialogs/index.d.ts +15 -0
- package/lib/components/scan-admin/dialogs/index.d.ts.map +1 -0
- package/lib/components/scan-admin/dialogs/index.js +15 -0
- package/lib/components/scan-admin/dialogs/index.js.map +1 -0
- package/lib/components/scan-admin/dialogs/quarantine-dialog.d.ts +23 -0
- package/lib/components/scan-admin/dialogs/quarantine-dialog.d.ts.map +1 -0
- package/lib/components/scan-admin/dialogs/quarantine-dialog.js +192 -0
- package/lib/components/scan-admin/dialogs/quarantine-dialog.js.map +1 -0
- package/lib/components/scan-admin/index.d.ts +20 -0
- package/lib/components/scan-admin/index.d.ts.map +1 -0
- package/lib/components/scan-admin/index.js +25 -0
- package/lib/components/scan-admin/index.js.map +1 -0
- package/lib/components/scan-admin/scan-card/index.d.ts +20 -0
- package/lib/components/scan-admin/scan-card/index.d.ts.map +1 -0
- package/lib/components/scan-admin/scan-card/index.js +20 -0
- package/lib/components/scan-admin/scan-card/index.js.map +1 -0
- package/lib/components/scan-admin/scan-card/scan-card-content.d.ts +30 -0
- package/lib/components/scan-admin/scan-card/scan-card-content.d.ts.map +1 -0
- package/lib/components/scan-admin/scan-card/scan-card-content.js +232 -0
- package/lib/components/scan-admin/scan-card/scan-card-content.js.map +1 -0
- package/lib/components/scan-admin/scan-card/scan-card-expand-strip-badges.d.ts +26 -0
- package/lib/components/scan-admin/scan-card/scan-card-expand-strip-badges.d.ts.map +1 -0
- package/lib/components/scan-admin/scan-card/scan-card-expand-strip-badges.js +121 -0
- package/lib/components/scan-admin/scan-card/scan-card-expand-strip-badges.js.map +1 -0
- package/lib/components/scan-admin/scan-card/scan-card-expand-strip.d.ts +27 -0
- package/lib/components/scan-admin/scan-card/scan-card-expand-strip.d.ts.map +1 -0
- package/lib/components/scan-admin/scan-card/scan-card-expand-strip.js +66 -0
- package/lib/components/scan-admin/scan-card/scan-card-expand-strip.js.map +1 -0
- package/lib/components/scan-admin/scan-card/scan-card-expanded-content.d.ts +26 -0
- package/lib/components/scan-admin/scan-card/scan-card-expanded-content.d.ts.map +1 -0
- package/lib/components/scan-admin/scan-card/scan-card-expanded-content.js +151 -0
- package/lib/components/scan-admin/scan-card/scan-card-expanded-content.js.map +1 -0
- package/lib/components/scan-admin/scan-card/scan-card-header.d.ts +26 -0
- package/lib/components/scan-admin/scan-card/scan-card-header.d.ts.map +1 -0
- package/lib/components/scan-admin/scan-card/scan-card-header.js +101 -0
- package/lib/components/scan-admin/scan-card/scan-card-header.js.map +1 -0
- package/lib/components/scan-admin/scan-card/scan-card.d.ts +34 -0
- package/lib/components/scan-admin/scan-card/scan-card.d.ts.map +1 -0
- package/lib/components/scan-admin/scan-card/scan-card.js +90 -0
- package/lib/components/scan-admin/scan-card/scan-card.js.map +1 -0
- package/lib/components/scan-admin/scan-card/scan-detail-card.d.ts +38 -0
- package/lib/components/scan-admin/scan-card/scan-detail-card.d.ts.map +1 -0
- package/lib/components/scan-admin/scan-card/scan-detail-card.js +72 -0
- package/lib/components/scan-admin/scan-card/scan-detail-card.js.map +1 -0
- package/lib/components/scan-admin/scan-card/utils.d.ts +48 -0
- package/lib/components/scan-admin/scan-card/utils.d.ts.map +1 -0
- package/lib/components/scan-admin/scan-card/utils.js +166 -0
- package/lib/components/scan-admin/scan-card/utils.js.map +1 -0
- package/lib/components/scan-admin/tab-contents/allow-list-tab-content.d.ts +19 -0
- package/lib/components/scan-admin/tab-contents/allow-list-tab-content.d.ts.map +1 -0
- package/lib/components/scan-admin/tab-contents/allow-list-tab-content.js +55 -0
- package/lib/components/scan-admin/tab-contents/allow-list-tab-content.js.map +1 -0
- package/lib/components/scan-admin/tab-contents/auto-rejected-tab-content.d.ts +19 -0
- package/lib/components/scan-admin/tab-contents/auto-rejected-tab-content.d.ts.map +1 -0
- package/lib/components/scan-admin/tab-contents/auto-rejected-tab-content.js +43 -0
- package/lib/components/scan-admin/tab-contents/auto-rejected-tab-content.js.map +1 -0
- package/lib/components/scan-admin/tab-contents/block-list-tab-content.d.ts +19 -0
- package/lib/components/scan-admin/tab-contents/block-list-tab-content.d.ts.map +1 -0
- package/lib/components/scan-admin/tab-contents/block-list-tab-content.js +55 -0
- package/lib/components/scan-admin/tab-contents/block-list-tab-content.js.map +1 -0
- package/lib/components/scan-admin/tab-contents/index.d.ts +18 -0
- package/lib/components/scan-admin/tab-contents/index.d.ts.map +1 -0
- package/lib/components/scan-admin/tab-contents/index.js +18 -0
- package/lib/components/scan-admin/tab-contents/index.js.map +1 -0
- package/lib/components/scan-admin/tab-contents/quarantined-tab-content.d.ts +19 -0
- package/lib/components/scan-admin/tab-contents/quarantined-tab-content.d.ts.map +1 -0
- package/lib/components/scan-admin/tab-contents/quarantined-tab-content.js +78 -0
- package/lib/components/scan-admin/tab-contents/quarantined-tab-content.js.map +1 -0
- package/lib/components/scan-admin/tab-contents/scans-tab-content.d.ts +19 -0
- package/lib/components/scan-admin/tab-contents/scans-tab-content.d.ts.map +1 -0
- package/lib/components/scan-admin/tab-contents/scans-tab-content.js +52 -0
- package/lib/components/scan-admin/tab-contents/scans-tab-content.js.map +1 -0
- package/lib/components/scan-admin/toolbars/counts-toolbar.d.ts +35 -0
- package/lib/components/scan-admin/toolbars/counts-toolbar.d.ts.map +1 -0
- package/lib/components/scan-admin/toolbars/counts-toolbar.js +132 -0
- package/lib/components/scan-admin/toolbars/counts-toolbar.js.map +1 -0
- package/lib/components/scan-admin/toolbars/index.d.ts +16 -0
- package/lib/components/scan-admin/toolbars/index.d.ts.map +1 -0
- package/lib/components/scan-admin/toolbars/index.js +16 -0
- package/lib/components/scan-admin/toolbars/index.js.map +1 -0
- package/lib/components/scan-admin/toolbars/search-toolbar.d.ts +43 -0
- package/lib/components/scan-admin/toolbars/search-toolbar.d.ts.map +1 -0
- package/lib/components/scan-admin/toolbars/search-toolbar.js +106 -0
- package/lib/components/scan-admin/toolbars/search-toolbar.js.map +1 -0
- package/lib/components/scan-admin/toolbars/tab-toolbar.d.ts +25 -0
- package/lib/components/scan-admin/toolbars/tab-toolbar.d.ts.map +1 -0
- package/lib/components/scan-admin/toolbars/tab-toolbar.js +33 -0
- package/lib/components/scan-admin/toolbars/tab-toolbar.js.map +1 -0
- package/lib/context/scan-admin/index.d.ts +21 -0
- package/lib/context/scan-admin/index.d.ts.map +1 -0
- package/lib/context/scan-admin/index.js +27 -0
- package/lib/context/scan-admin/index.js.map +1 -0
- package/lib/context/scan-admin/scan-actions.d.ts +19 -0
- package/lib/context/scan-admin/scan-actions.d.ts.map +1 -0
- package/lib/context/scan-admin/scan-actions.js +64 -0
- package/lib/context/scan-admin/scan-actions.js.map +1 -0
- package/lib/context/scan-admin/scan-api-actions.d.ts +26 -0
- package/lib/context/scan-admin/scan-api-actions.d.ts.map +1 -0
- package/lib/context/scan-admin/scan-api-actions.js +118 -0
- package/lib/context/scan-admin/scan-api-actions.js.map +1 -0
- package/lib/context/scan-admin/scan-api-effects.d.ts +40 -0
- package/lib/context/scan-admin/scan-api-effects.d.ts.map +1 -0
- package/lib/context/scan-admin/scan-api-effects.js +446 -0
- package/lib/context/scan-admin/scan-api-effects.js.map +1 -0
- package/lib/context/scan-admin/scan-context-types.d.ts +69 -0
- package/lib/context/scan-admin/scan-context-types.d.ts.map +1 -0
- package/lib/context/scan-admin/scan-context-types.js +14 -0
- package/lib/context/scan-admin/scan-context-types.js.map +1 -0
- package/lib/context/scan-admin/scan-context.d.ts +17 -0
- package/lib/context/scan-admin/scan-context.d.ts.map +1 -0
- package/lib/context/scan-admin/scan-context.js +90 -0
- package/lib/context/scan-admin/scan-context.js.map +1 -0
- package/lib/context/scan-admin/scan-helpers.d.ts +28 -0
- package/lib/context/scan-admin/scan-helpers.d.ts.map +1 -0
- package/lib/context/scan-admin/scan-helpers.js +56 -0
- package/lib/context/scan-admin/scan-helpers.js.map +1 -0
- package/lib/context/scan-admin/scan-reducer.d.ts +18 -0
- package/lib/context/scan-admin/scan-reducer.d.ts.map +1 -0
- package/lib/context/scan-admin/scan-reducer.js +194 -0
- package/lib/context/scan-admin/scan-reducer.js.map +1 -0
- package/lib/context/scan-admin/scan-types.d.ts +292 -0
- package/lib/context/scan-admin/scan-types.d.ts.map +1 -0
- package/lib/context/scan-admin/scan-types.js +67 -0
- package/lib/context/scan-admin/scan-types.js.map +1 -0
- package/lib/default/page-settings.d.ts.map +1 -1
- package/lib/default/page-settings.js +3 -0
- package/lib/default/page-settings.js.map +1 -1
- package/lib/default/theme.d.ts +50 -12
- package/lib/default/theme.d.ts.map +1 -1
- package/lib/default/theme.js +42 -0
- package/lib/default/theme.js.map +1 -1
- package/lib/extension-registry-service.d.ts +85 -1
- package/lib/extension-registry-service.d.ts.map +1 -1
- package/lib/extension-registry-service.js +197 -0
- package/lib/extension-registry-service.js.map +1 -1
- package/lib/extension-registry-types.d.ts +140 -0
- package/lib/extension-registry-types.d.ts.map +1 -1
- package/lib/extension-registry-types.js.map +1 -1
- package/lib/hooks/scan-admin/index.d.ts +34 -0
- package/lib/hooks/scan-admin/index.d.ts.map +1 -0
- package/lib/hooks/scan-admin/index.js +28 -0
- package/lib/hooks/scan-admin/index.js.map +1 -0
- package/lib/hooks/scan-admin/use-auto-rejected-tab.d.ts +76 -0
- package/lib/hooks/scan-admin/use-auto-rejected-tab.d.ts.map +1 -0
- package/lib/hooks/scan-admin/use-auto-rejected-tab.js +79 -0
- package/lib/hooks/scan-admin/use-auto-rejected-tab.js.map +1 -0
- package/lib/hooks/scan-admin/use-dialogs.d.ts +43 -0
- package/lib/hooks/scan-admin/use-dialogs.d.ts.map +1 -0
- package/lib/hooks/scan-admin/use-dialogs.js +55 -0
- package/lib/hooks/scan-admin/use-dialogs.js.map +1 -0
- package/lib/hooks/scan-admin/use-file-list-tab.d.ts +208 -0
- package/lib/hooks/scan-admin/use-file-list-tab.d.ts.map +1 -0
- package/lib/hooks/scan-admin/use-file-list-tab.js +125 -0
- package/lib/hooks/scan-admin/use-file-list-tab.js.map +1 -0
- package/lib/hooks/scan-admin/use-pagination.d.ts +36 -0
- package/lib/hooks/scan-admin/use-pagination.d.ts.map +1 -0
- package/lib/hooks/scan-admin/use-pagination.js +79 -0
- package/lib/hooks/scan-admin/use-pagination.js.map +1 -0
- package/lib/hooks/scan-admin/use-quarantined-tab.d.ts +92 -0
- package/lib/hooks/scan-admin/use-quarantined-tab.d.ts.map +1 -0
- package/lib/hooks/scan-admin/use-quarantined-tab.js +125 -0
- package/lib/hooks/scan-admin/use-quarantined-tab.js.map +1 -0
- package/lib/hooks/scan-admin/use-scan-card-state.d.ts +29 -0
- package/lib/hooks/scan-admin/use-scan-card-state.d.ts.map +1 -0
- package/lib/hooks/scan-admin/use-scan-card-state.js +50 -0
- package/lib/hooks/scan-admin/use-scan-card-state.js.map +1 -0
- package/lib/hooks/scan-admin/use-scan-filters.d.ts +53 -0
- package/lib/hooks/scan-admin/use-scan-filters.d.ts.map +1 -0
- package/lib/hooks/scan-admin/use-scan-filters.js +75 -0
- package/lib/hooks/scan-admin/use-scan-filters.js.map +1 -0
- package/lib/hooks/scan-admin/use-scans-tab.d.ts +85 -0
- package/lib/hooks/scan-admin/use-scans-tab.d.ts.map +1 -0
- package/lib/hooks/scan-admin/use-scans-tab.js +87 -0
- package/lib/hooks/scan-admin/use-scans-tab.js.map +1 -0
- package/lib/hooks/scan-admin/use-search.d.ts +32 -0
- package/lib/hooks/scan-admin/use-search.d.ts.map +1 -0
- package/lib/hooks/scan-admin/use-search.js +48 -0
- package/lib/hooks/scan-admin/use-search.js.map +1 -0
- package/lib/hooks/scan-admin/use-tab-navigation.d.ts +96 -0
- package/lib/hooks/scan-admin/use-tab-navigation.d.ts.map +1 -0
- package/lib/hooks/scan-admin/use-tab-navigation.js +70 -0
- package/lib/hooks/scan-admin/use-tab-navigation.js.map +1 -0
- package/lib/hooks/scan-admin/use-url-sync.d.ts +22 -0
- package/lib/hooks/scan-admin/use-url-sync.d.ts.map +1 -0
- package/lib/hooks/scan-admin/use-url-sync.js +252 -0
- package/lib/hooks/scan-admin/use-url-sync.js.map +1 -0
- package/lib/page-settings.d.ts +4 -0
- package/lib/page-settings.d.ts.map +1 -1
- package/lib/pages/admin-dashboard/admin-dashboard.d.ts +1 -0
- package/lib/pages/admin-dashboard/admin-dashboard.d.ts.map +1 -1
- package/lib/pages/admin-dashboard/admin-dashboard.js +23 -3
- package/lib/pages/admin-dashboard/admin-dashboard.js.map +1 -1
- package/lib/pages/admin-dashboard/publisher-admin.js +1 -1
- package/lib/pages/admin-dashboard/publisher-admin.js.map +1 -1
- package/lib/pages/admin-dashboard/publisher-revoke-dialog.d.ts.map +1 -1
- package/lib/pages/admin-dashboard/publisher-revoke-dialog.js +1 -1
- package/lib/pages/admin-dashboard/publisher-revoke-dialog.js.map +1 -1
- package/lib/pages/admin-dashboard/scan-admin.d.ts +20 -0
- package/lib/pages/admin-dashboard/scan-admin.d.ts.map +1 -0
- package/lib/pages/admin-dashboard/scan-admin.js +66 -0
- package/lib/pages/admin-dashboard/scan-admin.js.map +1 -0
- package/lib/pages/admin-dashboard/welcome.d.ts.map +1 -1
- package/lib/pages/admin-dashboard/welcome.js +2 -1
- package/lib/pages/admin-dashboard/welcome.js.map +1 -1
- package/lib/pages/extension-detail/extension-detail-overview.d.ts.map +1 -1
- package/lib/pages/extension-detail/extension-detail-overview.js +9 -1
- package/lib/pages/extension-detail/extension-detail-overview.js.map +1 -1
- package/lib/pages/extension-detail/extension-detail-reviews.d.ts.map +1 -1
- package/lib/pages/extension-detail/extension-detail-reviews.js +67 -18
- package/lib/pages/extension-detail/extension-detail-reviews.js.map +1 -1
- package/lib/pages/extension-detail/extension-detail.js +2 -2
- package/lib/pages/extension-detail/extension-detail.js.map +1 -1
- package/lib/pages/extension-detail/extension-rating-stars.d.ts +2 -2
- package/lib/pages/extension-detail/extension-rating-stars.d.ts.map +1 -1
- package/lib/pages/extension-detail/extension-rating-stars.js +1 -1
- package/lib/pages/extension-detail/extension-rating-stars.js.map +1 -1
- package/lib/pages/extension-list/extension-list-item.js +2 -2
- package/lib/pages/extension-list/extension-list-item.js.map +1 -1
- package/lib/pages/user/user-namespace-extension-list-item.d.ts.map +1 -1
- package/lib/pages/user/user-namespace-extension-list-item.js +23 -9
- package/lib/pages/user/user-namespace-extension-list-item.js.map +1 -1
- package/lib/pages/user/user-publisher-agreement.d.ts.map +1 -1
- package/lib/pages/user/user-publisher-agreement.js +34 -13
- package/lib/pages/user/user-publisher-agreement.js.map +1 -1
- package/lib/pages/user/user-settings-profile.d.ts.map +1 -1
- package/lib/pages/user/user-settings-profile.js +10 -5
- package/lib/pages/user/user-settings-profile.js.map +1 -1
- package/lib/pages/user/user-settings-tokens.d.ts.map +1 -1
- package/lib/pages/user/user-settings-tokens.js +13 -5
- package/lib/pages/user/user-settings-tokens.js.map +1 -1
- package/package.json +10 -9
- package/src/components/button-with-progress.tsx +2 -1
- package/src/components/sanitized-markdown.tsx +81 -1
- package/src/components/scan-admin/common/auto-refresh.tsx +79 -0
- package/src/components/scan-admin/common/conditional-tooltip.tsx +74 -0
- package/src/components/scan-admin/common/file-table.tsx +508 -0
- package/src/components/scan-admin/common/index.ts +18 -0
- package/src/components/scan-admin/common/tab-panel.tsx +42 -0
- package/src/components/scan-admin/common/utils.ts +48 -0
- package/src/components/scan-admin/dialogs/file-dialog.tsx +137 -0
- package/src/components/scan-admin/dialogs/index.ts +15 -0
- package/src/components/scan-admin/dialogs/quarantine-dialog.tsx +270 -0
- package/src/components/scan-admin/index.ts +52 -0
- package/src/components/scan-admin/scan-card/index.ts +20 -0
- package/src/components/scan-admin/scan-card/scan-card-content.tsx +457 -0
- package/src/components/scan-admin/scan-card/scan-card-expand-strip-badges.tsx +186 -0
- package/src/components/scan-admin/scan-card/scan-card-expand-strip.tsx +104 -0
- package/src/components/scan-admin/scan-card/scan-card-expanded-content.tsx +262 -0
- package/src/components/scan-admin/scan-card/scan-card-header.tsx +176 -0
- package/src/components/scan-admin/scan-card/scan-card.tsx +152 -0
- package/src/components/scan-admin/scan-card/scan-detail-card.tsx +144 -0
- package/src/components/scan-admin/scan-card/utils.ts +199 -0
- package/src/components/scan-admin/tab-contents/allow-list-tab-content.tsx +119 -0
- package/src/components/scan-admin/tab-contents/auto-rejected-tab-content.tsx +106 -0
- package/src/components/scan-admin/tab-contents/block-list-tab-content.tsx +119 -0
- package/src/components/scan-admin/tab-contents/index.ts +18 -0
- package/src/components/scan-admin/tab-contents/quarantined-tab-content.tsx +158 -0
- package/src/components/scan-admin/tab-contents/scans-tab-content.tsx +113 -0
- package/src/components/scan-admin/toolbars/counts-toolbar.tsx +262 -0
- package/src/components/scan-admin/toolbars/index.ts +16 -0
- package/src/components/scan-admin/toolbars/search-toolbar.tsx +255 -0
- package/src/components/scan-admin/toolbars/tab-toolbar.tsx +56 -0
- package/src/context/scan-admin/index.ts +43 -0
- package/src/context/scan-admin/scan-actions.ts +87 -0
- package/src/context/scan-admin/scan-api-actions.ts +137 -0
- package/src/context/scan-admin/scan-api-effects.ts +491 -0
- package/src/context/scan-admin/scan-context-types.ts +102 -0
- package/src/context/scan-admin/scan-context.tsx +123 -0
- package/src/context/scan-admin/scan-helpers.ts +63 -0
- package/src/context/scan-admin/scan-reducer.ts +321 -0
- package/src/context/scan-admin/scan-types.ts +337 -0
- package/src/default/page-settings.tsx +3 -0
- package/src/default/theme.tsx +102 -13
- package/src/extension-registry-service.ts +216 -1
- package/src/extension-registry-types.ts +157 -0
- package/src/hooks/scan-admin/index.ts +48 -0
- package/src/hooks/scan-admin/use-auto-rejected-tab.ts +85 -0
- package/src/hooks/scan-admin/use-dialogs.ts +83 -0
- package/src/hooks/scan-admin/use-file-list-tab.ts +149 -0
- package/src/hooks/scan-admin/use-pagination.ts +90 -0
- package/src/hooks/scan-admin/use-quarantined-tab.ts +138 -0
- package/src/hooks/scan-admin/use-scan-card-state.ts +73 -0
- package/src/hooks/scan-admin/use-scan-filters.ts +83 -0
- package/src/hooks/scan-admin/use-scans-tab.ts +92 -0
- package/src/hooks/scan-admin/use-search.ts +54 -0
- package/src/hooks/scan-admin/use-tab-navigation.ts +82 -0
- package/src/hooks/scan-admin/use-url-sync.ts +293 -0
- package/src/page-settings.ts +4 -0
- package/src/pages/admin-dashboard/admin-dashboard.tsx +26 -2
- package/src/pages/admin-dashboard/publisher-admin.tsx +1 -1
- package/src/pages/admin-dashboard/publisher-revoke-dialog.tsx +2 -1
- package/src/pages/admin-dashboard/scan-admin.tsx +109 -0
- package/src/pages/admin-dashboard/welcome.tsx +1 -0
- package/src/pages/extension-detail/extension-detail-overview.tsx +16 -2
- package/src/pages/extension-detail/extension-detail-reviews.tsx +116 -30
- package/src/pages/extension-detail/extension-detail.tsx +2 -2
- package/src/pages/extension-detail/extension-rating-stars.tsx +2 -2
- package/src/pages/extension-list/extension-list-item.tsx +2 -2
- package/src/pages/user/user-namespace-extension-list-item.tsx +38 -13
- package/src/pages/user/user-publisher-agreement.tsx +30 -11
- package/src/pages/user/user-settings-profile.tsx +10 -6
- package/src/pages/user/user-settings-tokens.tsx +15 -6
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2026 Contributors to the Eclipse Foundation
|
|
3
|
+
*
|
|
4
|
+
* See the NOTICE file(s) distributed with this work for additional
|
|
5
|
+
* information regarding copyright ownership.
|
|
6
|
+
*
|
|
7
|
+
* This program and the accompanying materials are made available under the
|
|
8
|
+
* terms of the Eclipse Public License 2.0 which is available at
|
|
9
|
+
* https://www.eclipse.org/legal/epl-2.0
|
|
10
|
+
*
|
|
11
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
12
|
+
********************************************************************************/
|
|
13
|
+
|
|
14
|
+
import { useMemo, useCallback } from 'react';
|
|
15
|
+
import { useScanContext, FileDecisionType } from '../../context/scan-admin';
|
|
16
|
+
import { usePagination } from './use-pagination';
|
|
17
|
+
import { useSearch } from './use-search';
|
|
18
|
+
|
|
19
|
+
interface UseFileListTabOptions {
|
|
20
|
+
tabIndex: 3 | 4;
|
|
21
|
+
decisionType: FileDecisionType;
|
|
22
|
+
tabName: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Hook for the Allowed Files (tab 3) and Blocked Files (tab 4) tabs.
|
|
27
|
+
* Provides file list data, selection management, and file actions.
|
|
28
|
+
*/
|
|
29
|
+
export const useFileListTab = ({ tabIndex, decisionType, tabName }: UseFileListTabOptions) => {
|
|
30
|
+
const { state, actions, derived } = useScanContext();
|
|
31
|
+
const pagination = usePagination();
|
|
32
|
+
const search = useSearch();
|
|
33
|
+
|
|
34
|
+
// Files are already filtered server-side by decision parameter
|
|
35
|
+
const files = state.files;
|
|
36
|
+
|
|
37
|
+
// Auto-refresh state (shared with all tabs)
|
|
38
|
+
const lastRefreshed = state.lastRefreshed;
|
|
39
|
+
const autoRefresh = state.autoRefresh;
|
|
40
|
+
const onAutoRefreshChange = actions.setAutoRefresh;
|
|
41
|
+
|
|
42
|
+
// Selection state (files already filtered server-side by decision)
|
|
43
|
+
const selection = useMemo(() => ({
|
|
44
|
+
checked: state.filesChecked,
|
|
45
|
+
selectedCount: state.filesChecked.size,
|
|
46
|
+
selectedFiles: derived.selectedFiles,
|
|
47
|
+
}), [state.filesChecked, derived.selectedFiles]);
|
|
48
|
+
|
|
49
|
+
// Selection actions
|
|
50
|
+
const setFilesChecked = useCallback((fileIds: Set<string>) => {
|
|
51
|
+
actions.setFilesChecked(fileIds);
|
|
52
|
+
}, [actions]);
|
|
53
|
+
|
|
54
|
+
const selectAll = useCallback(() => {
|
|
55
|
+
const allIds = new Set(files.map(f => f.id));
|
|
56
|
+
actions.setFilesChecked(allIds);
|
|
57
|
+
}, [files, actions]);
|
|
58
|
+
|
|
59
|
+
const deselectAll = useCallback(() => {
|
|
60
|
+
actions.setFilesChecked(new Set());
|
|
61
|
+
}, [actions]);
|
|
62
|
+
|
|
63
|
+
const isAllSelected = useMemo(() => {
|
|
64
|
+
return files.length > 0 && files.every(file => state.filesChecked.has(file.id));
|
|
65
|
+
}, [files, state.filesChecked]);
|
|
66
|
+
|
|
67
|
+
const isSomeSelected = useMemo(() => {
|
|
68
|
+
return files.some(file => state.filesChecked.has(file.id)) && !isAllSelected;
|
|
69
|
+
}, [files, state.filesChecked, isAllSelected]);
|
|
70
|
+
|
|
71
|
+
// File actions
|
|
72
|
+
const fileActions = useMemo(() => ({
|
|
73
|
+
openAllowDialog: () => actions.openFileDialog('allow'),
|
|
74
|
+
openBlockDialog: () => actions.openFileDialog('block'),
|
|
75
|
+
openDeleteDialog: () => actions.openFileDialog('delete'),
|
|
76
|
+
canPerformAction: selection.selectedCount > 0,
|
|
77
|
+
}), [actions, selection.selectedCount]);
|
|
78
|
+
|
|
79
|
+
// Get count from file counts
|
|
80
|
+
const fileCount = state.fileCounts
|
|
81
|
+
? (decisionType === 'allowed' ? state.fileCounts.allowed : state.fileCounts.blocked)
|
|
82
|
+
: 0;
|
|
83
|
+
|
|
84
|
+
return useMemo(() => ({
|
|
85
|
+
tabIndex,
|
|
86
|
+
tabName,
|
|
87
|
+
decisionType,
|
|
88
|
+
files,
|
|
89
|
+
isLoading: state.isLoadingFiles,
|
|
90
|
+
fileCount,
|
|
91
|
+
lastRefreshed,
|
|
92
|
+
autoRefresh,
|
|
93
|
+
onAutoRefreshChange,
|
|
94
|
+
search,
|
|
95
|
+
pagination,
|
|
96
|
+
selection,
|
|
97
|
+
setFilesChecked,
|
|
98
|
+
selectAll,
|
|
99
|
+
deselectAll,
|
|
100
|
+
isAllSelected,
|
|
101
|
+
isSomeSelected,
|
|
102
|
+
fileActions,
|
|
103
|
+
}), [
|
|
104
|
+
tabIndex,
|
|
105
|
+
tabName,
|
|
106
|
+
decisionType,
|
|
107
|
+
files,
|
|
108
|
+
state.isLoadingFiles,
|
|
109
|
+
fileCount,
|
|
110
|
+
lastRefreshed,
|
|
111
|
+
autoRefresh,
|
|
112
|
+
onAutoRefreshChange,
|
|
113
|
+
search,
|
|
114
|
+
pagination,
|
|
115
|
+
selection,
|
|
116
|
+
setFilesChecked,
|
|
117
|
+
selectAll,
|
|
118
|
+
deselectAll,
|
|
119
|
+
isAllSelected,
|
|
120
|
+
isSomeSelected,
|
|
121
|
+
fileActions,
|
|
122
|
+
]);
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Hook specifically for the Allow List tab (tab index 3).
|
|
127
|
+
*/
|
|
128
|
+
export const useAllowListTab = () => {
|
|
129
|
+
return useFileListTab({
|
|
130
|
+
tabIndex: 3,
|
|
131
|
+
decisionType: 'allowed',
|
|
132
|
+
tabName: 'Allow List',
|
|
133
|
+
});
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Hook specifically for the Block List tab (tab index 4).
|
|
138
|
+
*/
|
|
139
|
+
export const useBlockListTab = () => {
|
|
140
|
+
return useFileListTab({
|
|
141
|
+
tabIndex: 4,
|
|
142
|
+
decisionType: 'blocked',
|
|
143
|
+
tabName: 'Block List',
|
|
144
|
+
});
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
export type UseFileListTabReturn = ReturnType<typeof useFileListTab>;
|
|
148
|
+
export type UseAllowListTabReturn = ReturnType<typeof useAllowListTab>;
|
|
149
|
+
export type UseBlockListTabReturn = ReturnType<typeof useBlockListTab>;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2026 Contributors to the Eclipse Foundation
|
|
3
|
+
*
|
|
4
|
+
* See the NOTICE file(s) distributed with this work for additional
|
|
5
|
+
* information regarding copyright ownership.
|
|
6
|
+
*
|
|
7
|
+
* This program and the accompanying materials are made available under the
|
|
8
|
+
* terms of the Eclipse Public License 2.0 which is available at
|
|
9
|
+
* https://www.eclipse.org/legal/epl-2.0
|
|
10
|
+
*
|
|
11
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
12
|
+
********************************************************************************/
|
|
13
|
+
|
|
14
|
+
import { useMemo, useCallback } from 'react';
|
|
15
|
+
import { useScanContext } from '../../context/scan-admin';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Hook for managing pagination state and actions.
|
|
19
|
+
* Provides page navigation, total pages calculation, and loading state.
|
|
20
|
+
*/
|
|
21
|
+
export const usePagination = () => {
|
|
22
|
+
const { state, actions, derived } = useScanContext();
|
|
23
|
+
|
|
24
|
+
const goToPage = useCallback((page: number) => {
|
|
25
|
+
if (page >= 0 && page < derived.totalPages) {
|
|
26
|
+
actions.setPage(page);
|
|
27
|
+
}
|
|
28
|
+
}, [actions, derived.totalPages]);
|
|
29
|
+
|
|
30
|
+
const goToNextPage = useCallback(() => {
|
|
31
|
+
if (state.currentPage < derived.totalPages - 1) {
|
|
32
|
+
actions.setPage(state.currentPage + 1);
|
|
33
|
+
}
|
|
34
|
+
}, [state.currentPage, derived.totalPages, actions]);
|
|
35
|
+
|
|
36
|
+
const goToPreviousPage = useCallback(() => {
|
|
37
|
+
if (state.currentPage > 0) {
|
|
38
|
+
actions.setPage(state.currentPage - 1);
|
|
39
|
+
}
|
|
40
|
+
}, [state.currentPage, actions]);
|
|
41
|
+
|
|
42
|
+
const goToFirstPage = useCallback(() => {
|
|
43
|
+
actions.setPage(0);
|
|
44
|
+
}, [actions]);
|
|
45
|
+
|
|
46
|
+
const goToLastPage = useCallback(() => {
|
|
47
|
+
if (derived.totalPages > 0) {
|
|
48
|
+
actions.setPage(derived.totalPages - 1);
|
|
49
|
+
}
|
|
50
|
+
}, [derived.totalPages, actions]);
|
|
51
|
+
|
|
52
|
+
// Determine if we're in a loading state based on selected tab
|
|
53
|
+
const isLoading = state.selectedTab >= 3 ? state.isLoadingFiles : state.isLoadingScans;
|
|
54
|
+
|
|
55
|
+
// Get total items based on selected tab
|
|
56
|
+
const totalItems = state.selectedTab >= 3 ? state.totalFiles : state.totalScans;
|
|
57
|
+
|
|
58
|
+
return useMemo(() => ({
|
|
59
|
+
currentPage: state.currentPage,
|
|
60
|
+
pageSize: state.pageSize,
|
|
61
|
+
totalPages: derived.totalPages,
|
|
62
|
+
totalItems,
|
|
63
|
+
isLoading,
|
|
64
|
+
goToPage,
|
|
65
|
+
goToNextPage,
|
|
66
|
+
goToPreviousPage,
|
|
67
|
+
goToFirstPage,
|
|
68
|
+
goToLastPage,
|
|
69
|
+
hasNextPage: state.currentPage < derived.totalPages - 1,
|
|
70
|
+
hasPreviousPage: state.currentPage > 0,
|
|
71
|
+
isFirstPage: state.currentPage === 0,
|
|
72
|
+
isLastPage: state.currentPage >= derived.totalPages - 1,
|
|
73
|
+
// Range info (1-indexed for display)
|
|
74
|
+
startItem: totalItems > 0 ? state.currentPage * state.pageSize + 1 : 0,
|
|
75
|
+
endItem: Math.min((state.currentPage + 1) * state.pageSize, totalItems),
|
|
76
|
+
}), [
|
|
77
|
+
state.currentPage,
|
|
78
|
+
state.pageSize,
|
|
79
|
+
derived.totalPages,
|
|
80
|
+
totalItems,
|
|
81
|
+
isLoading,
|
|
82
|
+
goToPage,
|
|
83
|
+
goToNextPage,
|
|
84
|
+
goToPreviousPage,
|
|
85
|
+
goToFirstPage,
|
|
86
|
+
goToLastPage,
|
|
87
|
+
]);
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export type UsePaginationReturn = ReturnType<typeof usePagination>;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2026 Contributors to the Eclipse Foundation
|
|
3
|
+
*
|
|
4
|
+
* See the NOTICE file(s) distributed with this work for additional
|
|
5
|
+
* information regarding copyright ownership.
|
|
6
|
+
*
|
|
7
|
+
* This program and the accompanying materials are made available under the
|
|
8
|
+
* terms of the Eclipse Public License 2.0 which is available at
|
|
9
|
+
* https://www.eclipse.org/legal/epl-2.0
|
|
10
|
+
*
|
|
11
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
12
|
+
********************************************************************************/
|
|
13
|
+
|
|
14
|
+
import { useMemo, useCallback } from 'react';
|
|
15
|
+
import { useScanContext } from '../../context/scan-admin';
|
|
16
|
+
import { useScanFilters } from './use-scan-filters';
|
|
17
|
+
import { usePagination } from './use-pagination';
|
|
18
|
+
import { useSearch } from './use-search';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Hook for the Quarantined tab (tab index 1).
|
|
22
|
+
* Provides quarantined scan data, selection management, and bulk actions.
|
|
23
|
+
*/
|
|
24
|
+
export const useQuarantinedTab = () => {
|
|
25
|
+
const { state, actions, derived } = useScanContext();
|
|
26
|
+
const { globalFilters, quarantineFilters } = useScanFilters();
|
|
27
|
+
const pagination = usePagination();
|
|
28
|
+
const search = useSearch();
|
|
29
|
+
|
|
30
|
+
// Scans are already filtered server-side by threatScannerName parameter
|
|
31
|
+
const quarantinedScans = state.scans;
|
|
32
|
+
|
|
33
|
+
// Determine which scans are selectable (need review)
|
|
34
|
+
// A scan needs review if: no admin decision AND has at least one enforced threat
|
|
35
|
+
const selectableScans = useMemo(() => {
|
|
36
|
+
return quarantinedScans.filter(scan => {
|
|
37
|
+
const hasEnforcedThreat = scan.threats.some(t => t.enforcedFlag);
|
|
38
|
+
const needsReview = !scan.adminDecision?.decision && hasEnforcedThreat;
|
|
39
|
+
return needsReview;
|
|
40
|
+
});
|
|
41
|
+
}, [quarantinedScans]);
|
|
42
|
+
|
|
43
|
+
// Selection state
|
|
44
|
+
const selection = useMemo(() => {
|
|
45
|
+
const keys = Object.keys(state.quarantinedChecked);
|
|
46
|
+
const selectedCount = keys.filter(key => state.quarantinedChecked[key]).length;
|
|
47
|
+
return {
|
|
48
|
+
checked: state.quarantinedChecked,
|
|
49
|
+
selectedCount,
|
|
50
|
+
selectedExtensions: derived.selectedExtensions,
|
|
51
|
+
};
|
|
52
|
+
}, [state.quarantinedChecked, derived.selectedExtensions]);
|
|
53
|
+
|
|
54
|
+
// Selection actions
|
|
55
|
+
const toggleCheck = useCallback((id: string, checked: boolean) => {
|
|
56
|
+
actions.toggleQuarantinedCheck(id, checked);
|
|
57
|
+
}, [actions]);
|
|
58
|
+
|
|
59
|
+
const selectAll = useCallback(() => {
|
|
60
|
+
// Only select scans that are selectable (need review)
|
|
61
|
+
actions.selectAllQuarantined(selectableScans);
|
|
62
|
+
}, [actions, selectableScans]);
|
|
63
|
+
|
|
64
|
+
const deselectAll = useCallback(() => {
|
|
65
|
+
actions.deselectAllQuarantined();
|
|
66
|
+
}, [actions]);
|
|
67
|
+
|
|
68
|
+
const isAllSelected = useMemo(() => {
|
|
69
|
+
// Check if all selectable scans are selected
|
|
70
|
+
return selectableScans.length > 0 &&
|
|
71
|
+
selectableScans.every(scan => state.quarantinedChecked[scan.id]);
|
|
72
|
+
}, [selectableScans, state.quarantinedChecked]);
|
|
73
|
+
|
|
74
|
+
const isSomeSelected = useMemo(() => {
|
|
75
|
+
return selectableScans.some(scan => state.quarantinedChecked[scan.id]) &&
|
|
76
|
+
!isAllSelected;
|
|
77
|
+
}, [selectableScans, state.quarantinedChecked, isAllSelected]);
|
|
78
|
+
|
|
79
|
+
// Bulk actions
|
|
80
|
+
const bulkActions = useMemo(() => ({
|
|
81
|
+
openAllowDialog: actions.openAllowDialog,
|
|
82
|
+
openBlockDialog: actions.openBlockDialog,
|
|
83
|
+
canPerformBulkAction: selection.selectedCount > 0,
|
|
84
|
+
}), [actions, selection.selectedCount]);
|
|
85
|
+
|
|
86
|
+
// Get total count from the counts API (unaffected by search filters and admin decision checkbox filters)
|
|
87
|
+
const totalCount = (state.scanCounts?.STARTED ?? 0) + (state.scanCounts?.VALIDATING ?? 0) +
|
|
88
|
+
(state.scanCounts?.SCANNING ?? 0) + (state.scanCounts?.PASSED ?? 0) +
|
|
89
|
+
(state.scanCounts?.QUARANTINED ?? 0) + (state.scanCounts?.AUTO_REJECTED ?? 0) +
|
|
90
|
+
(state.scanCounts?.ERROR ?? 0);
|
|
91
|
+
|
|
92
|
+
// Check if there are any threat scanners available to filter by
|
|
93
|
+
const hasThreatScanners = state.availableThreatScanners.length > 0;
|
|
94
|
+
|
|
95
|
+
return useMemo(() => ({
|
|
96
|
+
tabIndex: 1,
|
|
97
|
+
tabName: 'Quarantined',
|
|
98
|
+
scans: quarantinedScans,
|
|
99
|
+
isLoading: state.isLoadingScans,
|
|
100
|
+
lastRefreshed: state.lastRefreshed,
|
|
101
|
+
autoRefresh: state.autoRefresh,
|
|
102
|
+
onAutoRefreshChange: actions.setAutoRefresh,
|
|
103
|
+
totalCount,
|
|
104
|
+
hasThreatScanners,
|
|
105
|
+
search,
|
|
106
|
+
globalFilters,
|
|
107
|
+
quarantineFilters,
|
|
108
|
+
pagination,
|
|
109
|
+
selection,
|
|
110
|
+
toggleCheck,
|
|
111
|
+
selectAll,
|
|
112
|
+
deselectAll,
|
|
113
|
+
isAllSelected,
|
|
114
|
+
isSomeSelected,
|
|
115
|
+
bulkActions,
|
|
116
|
+
}), [
|
|
117
|
+
quarantinedScans,
|
|
118
|
+
state.isLoadingScans,
|
|
119
|
+
state.lastRefreshed,
|
|
120
|
+
state.autoRefresh,
|
|
121
|
+
actions.setAutoRefresh,
|
|
122
|
+
totalCount,
|
|
123
|
+
hasThreatScanners,
|
|
124
|
+
search,
|
|
125
|
+
globalFilters,
|
|
126
|
+
quarantineFilters,
|
|
127
|
+
pagination,
|
|
128
|
+
selection,
|
|
129
|
+
toggleCheck,
|
|
130
|
+
selectAll,
|
|
131
|
+
deselectAll,
|
|
132
|
+
isAllSelected,
|
|
133
|
+
isSomeSelected,
|
|
134
|
+
bulkActions,
|
|
135
|
+
]);
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
export type UseQuarantinedTabReturn = ReturnType<typeof useQuarantinedTab>;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2026 Contributors to the Eclipse Foundation
|
|
3
|
+
*
|
|
4
|
+
* See the NOTICE file(s) distributed with this work for additional
|
|
5
|
+
* information regarding copyright ownership.
|
|
6
|
+
*
|
|
7
|
+
* This program and the accompanying materials are made available under the
|
|
8
|
+
* terms of the Eclipse Public License 2.0 which is available at
|
|
9
|
+
* https://www.eclipse.org/legal/epl-2.0
|
|
10
|
+
*
|
|
11
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
12
|
+
********************************************************************************/
|
|
13
|
+
|
|
14
|
+
import { useState, useEffect, useRef, useMemo } from 'react';
|
|
15
|
+
import { ScanResult } from '../../context/scan-admin';
|
|
16
|
+
import { formatDuration } from '../../components/scan-admin/common';
|
|
17
|
+
import {
|
|
18
|
+
isRunning,
|
|
19
|
+
shouldShowExpandButton,
|
|
20
|
+
getDetailBadges,
|
|
21
|
+
DetailBadge,
|
|
22
|
+
} from '../../components/scan-admin/scan-card/utils';
|
|
23
|
+
|
|
24
|
+
interface UseScanCardStateReturn {
|
|
25
|
+
expanded: boolean;
|
|
26
|
+
handleExpandClick: () => void;
|
|
27
|
+
showExpandButton: boolean;
|
|
28
|
+
badges: DetailBadge[];
|
|
29
|
+
liveDuration: string;
|
|
30
|
+
// Card ref for height tracking
|
|
31
|
+
cardRef: React.RefObject<HTMLDivElement>;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Custom hook that encapsulates all ScanCard state logic.
|
|
36
|
+
*/
|
|
37
|
+
export const useScanCardState = (scan: ScanResult): UseScanCardStateReturn => {
|
|
38
|
+
const [expanded, setExpanded] = useState(false);
|
|
39
|
+
const [liveDuration, setLiveDuration] = useState('');
|
|
40
|
+
|
|
41
|
+
const cardRef = useRef<HTMLDivElement>(null);
|
|
42
|
+
|
|
43
|
+
const badges = useMemo(() => getDetailBadges(scan), [scan]);
|
|
44
|
+
|
|
45
|
+
const showExpandButton = shouldShowExpandButton(scan);
|
|
46
|
+
|
|
47
|
+
const handleExpandClick = () => {
|
|
48
|
+
setExpanded(!expanded);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
// Live duration for running scans
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
if (isRunning(scan.status) && scan.dateScanStarted) {
|
|
54
|
+
const updateDuration = () => {
|
|
55
|
+
const duration = formatDuration(scan.dateScanStarted, new Date().toISOString());
|
|
56
|
+
setLiveDuration(duration);
|
|
57
|
+
};
|
|
58
|
+
updateDuration();
|
|
59
|
+
const interval = setInterval(updateDuration, 1000);
|
|
60
|
+
return () => clearInterval(interval);
|
|
61
|
+
}
|
|
62
|
+
return undefined;
|
|
63
|
+
}, [scan.status, scan.dateScanStarted]);
|
|
64
|
+
|
|
65
|
+
return {
|
|
66
|
+
expanded,
|
|
67
|
+
handleExpandClick,
|
|
68
|
+
showExpandButton,
|
|
69
|
+
badges,
|
|
70
|
+
liveDuration,
|
|
71
|
+
cardRef,
|
|
72
|
+
};
|
|
73
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2026 Contributors to the Eclipse Foundation
|
|
3
|
+
*
|
|
4
|
+
* See the NOTICE file(s) distributed with this work for additional
|
|
5
|
+
* information regarding copyright ownership.
|
|
6
|
+
*
|
|
7
|
+
* This program and the accompanying materials are made available under the
|
|
8
|
+
* terms of the Eclipse Public License 2.0 which is available at
|
|
9
|
+
* https://www.eclipse.org/legal/epl-2.0
|
|
10
|
+
*
|
|
11
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
12
|
+
********************************************************************************/
|
|
13
|
+
|
|
14
|
+
import { useMemo } from 'react';
|
|
15
|
+
import { useScanContext } from '../../context/scan-admin';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Hook for managing scan filter state and actions.
|
|
19
|
+
* Provides access to global filters (date range, enforcement) and
|
|
20
|
+
* tab-specific filters (status, quarantine, threat scanner, validation type).
|
|
21
|
+
*/
|
|
22
|
+
export const useScanFilters = () => {
|
|
23
|
+
const { state, actions } = useScanContext();
|
|
24
|
+
|
|
25
|
+
// Global filters
|
|
26
|
+
const globalFilters = useMemo(() => ({
|
|
27
|
+
dateRange: state.dateRange,
|
|
28
|
+
enforcement: state.enforcement,
|
|
29
|
+
setDateRange: actions.setDateRange,
|
|
30
|
+
setEnforcement: actions.setEnforcement,
|
|
31
|
+
}), [state.dateRange, state.enforcement, actions]);
|
|
32
|
+
|
|
33
|
+
// Status filters (for Scans tab)
|
|
34
|
+
const statusFilters = useMemo(() => ({
|
|
35
|
+
filters: state.statusFilters,
|
|
36
|
+
toggle: actions.toggleStatusFilter,
|
|
37
|
+
menuAnchor: state.filterMenuAnchor,
|
|
38
|
+
openMenu: actions.openFilterMenu,
|
|
39
|
+
closeMenu: actions.closeFilterMenu,
|
|
40
|
+
}), [state.statusFilters, state.filterMenuAnchor, actions]);
|
|
41
|
+
|
|
42
|
+
// Quarantine filters (for Quarantined tab)
|
|
43
|
+
const quarantineFilters = useMemo(() => ({
|
|
44
|
+
filters: state.quarantineFilters,
|
|
45
|
+
toggle: actions.toggleQuarantineFilter,
|
|
46
|
+
threatScannerFilters: state.threatScannerFilters,
|
|
47
|
+
toggleThreatScanner: actions.toggleThreatScannerFilter,
|
|
48
|
+
availableThreatScanners: state.availableThreatScanners,
|
|
49
|
+
menuAnchor: state.quarantineFilterMenuAnchor,
|
|
50
|
+
openMenu: actions.openQuarantineFilterMenu,
|
|
51
|
+
closeMenu: actions.closeQuarantineFilterMenu,
|
|
52
|
+
}), [
|
|
53
|
+
state.quarantineFilters,
|
|
54
|
+
state.threatScannerFilters,
|
|
55
|
+
state.availableThreatScanners,
|
|
56
|
+
state.quarantineFilterMenuAnchor,
|
|
57
|
+
actions,
|
|
58
|
+
]);
|
|
59
|
+
|
|
60
|
+
// Validation type filters (for Auto Rejected tab)
|
|
61
|
+
const validationTypeFilters = useMemo(() => ({
|
|
62
|
+
filters: state.validationTypeFilters,
|
|
63
|
+
toggle: actions.toggleValidationTypeFilter,
|
|
64
|
+
availableValidationTypes: state.availableValidationTypes,
|
|
65
|
+
menuAnchor: state.autoRejectedFilterMenuAnchor,
|
|
66
|
+
openMenu: actions.openAutoRejectedFilterMenu,
|
|
67
|
+
closeMenu: actions.closeAutoRejectedFilterMenu,
|
|
68
|
+
}), [
|
|
69
|
+
state.validationTypeFilters,
|
|
70
|
+
state.availableValidationTypes,
|
|
71
|
+
state.autoRejectedFilterMenuAnchor,
|
|
72
|
+
actions,
|
|
73
|
+
]);
|
|
74
|
+
|
|
75
|
+
return {
|
|
76
|
+
globalFilters,
|
|
77
|
+
statusFilters,
|
|
78
|
+
quarantineFilters,
|
|
79
|
+
validationTypeFilters,
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export type UseScanFiltersReturn = ReturnType<typeof useScanFilters>;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2026 Contributors to the Eclipse Foundation
|
|
3
|
+
*
|
|
4
|
+
* See the NOTICE file(s) distributed with this work for additional
|
|
5
|
+
* information regarding copyright ownership.
|
|
6
|
+
*
|
|
7
|
+
* This program and the accompanying materials are made available under the
|
|
8
|
+
* terms of the Eclipse Public License 2.0 which is available at
|
|
9
|
+
* https://www.eclipse.org/legal/epl-2.0
|
|
10
|
+
*
|
|
11
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
12
|
+
********************************************************************************/
|
|
13
|
+
|
|
14
|
+
import { useMemo } from 'react';
|
|
15
|
+
import { useScanContext } from '../../context/scan-admin';
|
|
16
|
+
import { useScanFilters } from './use-scan-filters';
|
|
17
|
+
import { usePagination } from './use-pagination';
|
|
18
|
+
import { useSearch } from './use-search';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Hook for the main Scans tab (tab index 0).
|
|
22
|
+
* Provides all data and actions needed for displaying scan overview.
|
|
23
|
+
*/
|
|
24
|
+
export const useScansTab = () => {
|
|
25
|
+
const { state, actions } = useScanContext();
|
|
26
|
+
const { globalFilters, statusFilters } = useScanFilters();
|
|
27
|
+
const pagination = usePagination();
|
|
28
|
+
const search = useSearch();
|
|
29
|
+
|
|
30
|
+
// Get scan counts for display
|
|
31
|
+
const counts = useMemo(() => {
|
|
32
|
+
if (!state.scanCounts) {
|
|
33
|
+
return {
|
|
34
|
+
started: 0,
|
|
35
|
+
validating: 0,
|
|
36
|
+
scanning: 0,
|
|
37
|
+
passed: 0,
|
|
38
|
+
quarantined: 0,
|
|
39
|
+
autoRejected: 0,
|
|
40
|
+
error: 0,
|
|
41
|
+
allowed: 0,
|
|
42
|
+
blocked: 0,
|
|
43
|
+
needsReview: 0,
|
|
44
|
+
total: 0,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
started: state.scanCounts.STARTED,
|
|
49
|
+
validating: state.scanCounts.VALIDATING,
|
|
50
|
+
scanning: state.scanCounts.SCANNING,
|
|
51
|
+
passed: state.scanCounts.PASSED,
|
|
52
|
+
quarantined: state.scanCounts.QUARANTINED,
|
|
53
|
+
autoRejected: state.scanCounts.AUTO_REJECTED,
|
|
54
|
+
error: state.scanCounts.ERROR,
|
|
55
|
+
allowed: state.scanCounts.ALLOWED,
|
|
56
|
+
blocked: state.scanCounts.BLOCKED,
|
|
57
|
+
needsReview: state.scanCounts.NEEDS_REVIEW,
|
|
58
|
+
// Total = sum of scan statuses only (ALLOWED/BLOCKED/NEEDS_REVIEW are admin decisions, not statuses)
|
|
59
|
+
total: state.scanCounts.STARTED + state.scanCounts.VALIDATING + state.scanCounts.SCANNING +
|
|
60
|
+
state.scanCounts.PASSED + state.scanCounts.QUARANTINED + state.scanCounts.AUTO_REJECTED +
|
|
61
|
+
state.scanCounts.ERROR,
|
|
62
|
+
};
|
|
63
|
+
}, [state.scanCounts]);
|
|
64
|
+
|
|
65
|
+
return useMemo(() => ({
|
|
66
|
+
tabIndex: 0,
|
|
67
|
+
tabName: 'Scans',
|
|
68
|
+
scans: state.scans,
|
|
69
|
+
isLoading: state.isLoadingScans,
|
|
70
|
+
lastRefreshed: state.lastRefreshed,
|
|
71
|
+
autoRefresh: state.autoRefresh,
|
|
72
|
+
onAutoRefreshChange: actions.setAutoRefresh,
|
|
73
|
+
counts,
|
|
74
|
+
search,
|
|
75
|
+
globalFilters,
|
|
76
|
+
statusFilters,
|
|
77
|
+
pagination,
|
|
78
|
+
}), [
|
|
79
|
+
state.scans,
|
|
80
|
+
state.isLoadingScans,
|
|
81
|
+
state.lastRefreshed,
|
|
82
|
+
state.autoRefresh,
|
|
83
|
+
actions.setAutoRefresh,
|
|
84
|
+
counts,
|
|
85
|
+
search,
|
|
86
|
+
globalFilters,
|
|
87
|
+
statusFilters,
|
|
88
|
+
pagination,
|
|
89
|
+
]);
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export type UseScansTabReturn = ReturnType<typeof useScansTab>;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2026 Contributors to the Eclipse Foundation
|
|
3
|
+
*
|
|
4
|
+
* See the NOTICE file(s) distributed with this work for additional
|
|
5
|
+
* information regarding copyright ownership.
|
|
6
|
+
*
|
|
7
|
+
* This program and the accompanying materials are made available under the
|
|
8
|
+
* terms of the Eclipse Public License 2.0 which is available at
|
|
9
|
+
* https://www.eclipse.org/legal/epl-2.0
|
|
10
|
+
*
|
|
11
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
12
|
+
********************************************************************************/
|
|
13
|
+
|
|
14
|
+
import { useMemo, useCallback } from 'react';
|
|
15
|
+
import { useScanContext } from '../../context/scan-admin';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Hook for managing search state and actions.
|
|
19
|
+
* Provides publisher, namespace, and name search functionality.
|
|
20
|
+
*/
|
|
21
|
+
export const useSearch = () => {
|
|
22
|
+
const { state, actions, dispatch } = useScanContext();
|
|
23
|
+
|
|
24
|
+
const clearSearch = useCallback(() => {
|
|
25
|
+
dispatch({ type: 'CLEAR_SEARCH' });
|
|
26
|
+
}, [dispatch]);
|
|
27
|
+
|
|
28
|
+
const hasActiveSearch = useMemo(() => {
|
|
29
|
+
return !!(state.publisherQuery || state.namespaceQuery || state.nameQuery);
|
|
30
|
+
}, [state.publisherQuery, state.namespaceQuery, state.nameQuery]);
|
|
31
|
+
|
|
32
|
+
return useMemo(() => ({
|
|
33
|
+
publisherQuery: state.publisherQuery,
|
|
34
|
+
namespaceQuery: state.namespaceQuery,
|
|
35
|
+
nameQuery: state.nameQuery,
|
|
36
|
+
setPublisherQuery: actions.setPublisherQuery,
|
|
37
|
+
setNamespaceQuery: actions.setNamespaceQuery,
|
|
38
|
+
setNameQuery: actions.setNameQuery,
|
|
39
|
+
handlePublisherChange: actions.handlePublisherChange,
|
|
40
|
+
handleNamespaceChange: actions.handleNamespaceChange,
|
|
41
|
+
handleNameChange: actions.handleNameChange,
|
|
42
|
+
clearSearch,
|
|
43
|
+
hasActiveSearch,
|
|
44
|
+
}), [
|
|
45
|
+
state.publisherQuery,
|
|
46
|
+
state.namespaceQuery,
|
|
47
|
+
state.nameQuery,
|
|
48
|
+
actions,
|
|
49
|
+
clearSearch,
|
|
50
|
+
hasActiveSearch,
|
|
51
|
+
]);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export type UseSearchReturn = ReturnType<typeof useSearch>;
|