feat(ui): support advanced proxy cache configurations in UI#23536
feat(ui): support advanced proxy cache configurations in UI#23536stonezdj wants to merge 1 commit into
Conversation
- Support repository filter configuration (pattern and kind) for proxy cache projects. - Ensure the local on not found and proxy referrer API checkbox editability is controlled by project configuration update permissions. Signed-off-by: stonezdj <stone.zhang@broadcom.com>
f3feca3 to
1184f00
Compare
There was a problem hiding this comment.
Pull request overview
Adds UI controls and localization for proxy-cache repository filters and permission-aware proxy settings.
Changes:
- Adds repository filter pattern/kind controls.
- Serializes filter metadata during project creation and updates.
- Updates proxy-cache permissions, layout, models, and translations.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/portal/src/i18n/lang/zh-tw-lang.json |
Adds Traditional Chinese filter strings. |
src/portal/src/i18n/lang/zh-cn-lang.json |
Adds Simplified Chinese filter strings. |
src/portal/src/i18n/lang/tr-tr-lang.json |
Adds Turkish filter strings. |
src/portal/src/i18n/lang/ru-ru-lang.json |
Adds Russian filter strings. |
src/portal/src/i18n/lang/pt-br-lang.json |
Adds Brazilian Portuguese filter strings. |
src/portal/src/i18n/lang/ko-kr-lang.json |
Adds Korean filter strings. |
src/portal/src/i18n/lang/fr-fr-lang.json |
Adds French filter strings. |
src/portal/src/i18n/lang/es-es-lang.json |
Adds Spanish filter strings. |
src/portal/src/i18n/lang/en-us-lang.json |
Adds English filter strings. |
src/portal/src/i18n/lang/de-de-lang.json |
Adds German filter strings. |
src/portal/src/app/shared/services/project.service.ts |
Serializes filter metadata on updates. |
src/portal/src/app/base/project/project.ts |
Extends project metadata and filter constants. |
src/portal/src/app/base/project/project-config/project-policy-config/project.ts |
Extends configuration metadata types. |
src/portal/src/app/base/project/project-config/project-policy-config/project-policy-config.component.ts |
Loads filter settings and updates permissions. |
src/portal/src/app/base/project/project-config/project-policy-config/project-policy-config.component.scss |
Adds filter-control styling. |
src/portal/src/app/base/project/project-config/project-policy-config/project-policy-config.component.html |
Adds filter controls and checkbox permission handling. |
src/portal/src/app/base/left-side-nav/projects/create-project/create-project.component.ts |
Includes filters in project creation. |
src/portal/src/app/base/left-side-nav/projects/create-project/create-project.component.html |
Adds creation-form filter controls. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| .subscribe(permissins => { | ||
| this.hasChangeConfigRole = permissins as boolean; | ||
| this.allowUpdateProxyCacheConfiguration = | ||
| this.hasChangeConfigRole && !this.isProxyCacheProject; | ||
| }); |
| metadata.proxy_cache_filter_pattern = | ||
| this.project.metadata.proxy_cache_filter_pattern; | ||
| metadata.proxy_cache_filter_kind = | ||
| this.project.metadata.proxy_cache_filter_kind || | ||
| REPOSITORY_FILTER_KIND_DOUBLESTAR; |
| metadata.proxy_cache_filter_pattern = | ||
| projectPolicy.ProxyCacheFilterPattern; | ||
| metadata.proxy_cache_filter_kind = | ||
| projectPolicy.ProxyCacheFilterKind || 'doublestar'; |
| </div> | ||
| </div> | ||
| </div> | ||
| } @if (isSystemAdmin && projectPolicy.ProxyCacheEnabled) { |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #23536 +/- ##
==========================================
+ Coverage 66.35% 68.99% +2.64%
==========================================
Files 1073 820 -253
Lines 117683 103280 -14403
Branches 2965 0 -2965
==========================================
- Hits 78090 71262 -6828
+ Misses 35293 28078 -7215
+ Partials 4300 3940 -360
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
Comparing this against the merged proposal (goharbor/community#280) and the backend implementation (#23527), a few deviations: 1. Client-side validation is missing The proposal's UI section requires: "Validation should happen both client-side and server-side." Neither the filter input in 2. Tooltip describes anchoring semantics the backend doesn't have
3. The proxy cache checkbox changes from hardcoded Related: sibling controls in the same section now gate on three different signals — the filter input/select on 4. Dead component state
5. Scope beyond the proposal The proposal's UI section only asks for the Repository filter (label, kind selector, pattern input) in the create view. This PR additionally reworks the referrer API checkbox layout and permission gating, switches the proxy-cache section gating to Minor: |
|
behavior changes for existing users:
|
Thank you for contributing to Harbor!
Comprehensive Summary of your change
Issue being fixed
Fixes #(issue)
Please indicate you've done the following: