GDB-12880 introduce repository picker list#2994
Conversation
There was a problem hiding this comment.
Pull request overview
Introduces a new “repository picker list” UI and surfaces it in the “repository required” banner, alongside styling/build changes to support the new layout.
Changes:
- Adds
RepositoryPickerListComponentUI (template + SCSS) and embeds it inRepositoryRequiredBannerComponent. - Adds i18n labels (EN/FR) for repository picker actions.
- Introduces Bootstrap SCSS imports and adjusts the Webpack/Sass loader configuration.
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/workbench/src/styles.scss | Adds scoped Bootstrap SCSS imports under app-root. |
| packages/workbench/src/assets/i18n/en.json | Adds repository picker list button labels. |
| packages/workbench/src/assets/i18n/fr.json | Adds repository picker list button labels (FR). |
| packages/workbench/src/app/components/repository-required-banner/repository-required-banner.component.ts | Imports and wires in the repository picker list component. |
| packages/workbench/src/app/components/repository-required-banner/repository-required-banner.component.html | Renders the repository picker list under the info message. |
| packages/workbench/src/app/components/repository-picker-list/repository-picker-list.component.ts | Implements repository picker list state/actions (currently incomplete). |
| packages/workbench/src/app/components/repository-picker-list/repository-picker-list.component.html | Adds toolbar + repository list rendering. |
| packages/workbench/src/app/components/repository-picker-list/repository-picker-list.component.scss | Adds styling/layout for the repository picker list. |
| packages/workbench/package.json | Adds Bootstrap dependency. |
| packages/workbench/package-lock.json | Locks Bootstrap and peer deps. |
| packages/workbench/extra-webpack.config.js | Patches sass-loader options (silencing deprecations + load paths). |
| packages/workbench/angular.json | Adjusts custom webpack merge strategy. |
Files not reviewed (1)
- packages/workbench/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
22ad51a to
9024a48
Compare
9df58cb to
4a78a0a
Compare
Enhance repository picker list component with improved styling and layout Add responsive breakpoints and update media queries in styles Add remote location display and toggle functionality in repository picker list component Improve styling of the repository list component. Improved the primeng's link button styling by removing the underline from icons if any Removed the lead class from the alert components in the core-error directive. It enforces a larger font-size and weight which makes everything inside the component bigger and inconsistent. This was probably added by some mistake long time ago. Add a new stateLowercase property to Repository model. This can be used as a marker css class inside templates for example without transformation. Redesigned the repository list component to match the mockup Added filter fields Change icon and messag ein the no repository banner Add section with primeng message components in the ux-test page Add tooltip to the repo state icon Use css variables consistently Subscribe to repository list changes and update the local list Don't show actions if license is invalid Add a page-restrictions component that wraps all alert banners and the repository list picker Experiment with the restricted message resolving Resolver Implemented restriction resolver service and updated the page restrictions component to use it. Hide filters and the repo list from the view when there aren't repositories in the instance. Update the isrestricted default value parameter and add a TODO to fix some issue related with the isRepoManager method Update restriction resolver to allow multiple restrictions to be combined Moved the repository-picker-list out of the loop because we don't want multiple picker to be rendered and restricted it to be rendered only when there is no selected repository and there are available repositories Extracted a view model for the repository picker list component. Also changed visibility of some parts based on different conditions. Position the repo icon vertically in the middle Change row hover cursor to normal Fix the banner position Updated restrictions resolver and labels Add label that should not be checked for translation Fix failing test
4a78a0a to
43b59b0
Compare
|
| super(repositories); | ||
| } | ||
|
|
||
| filterWithCallback(filterCallback: (repository: Repository) => boolean): RepositoryList { |
There was a problem hiding this comment.
Why is this called filterCallback? Isn't filter informative enough?
There was a problem hiding this comment.
Is there a collision with the super's names?
There was a problem hiding this comment.
Ok, so .. what it does different than the already inherited filter method is that it returns a new List with the values. I think filterWithCallback should be renamed to something like filteredList.
There was a problem hiding this comment.
OK. The argument can be renamed to filter I guess. My idea was somewhat I've seen in lodash for example where they have functions like unionWith, uniqueWith, etc. where those take a callback/comparator function but made it a bit more verbose.
There was a problem hiding this comment.
I agree with the lodash functions, but here you already have filter which does the same thing, only difference is that here you return a new reference for a list.
If you need both: to get a list and to get an array, perhaps this shoud be a .toFilteredList or something like this.
| externalUrl: repositoryData.externalUrl, | ||
| location: repositoryData.location, | ||
| state: toEnum(RepositoryState, repositoryData.state), | ||
| stateLowercase: repositoryData.state ? repositoryData.state.toLowerCase() : undefined, |
There was a problem hiding this comment.
Why set this here? Isn't it more apropriate to set it in the constructor? It is a helper prop.
There was a problem hiding this comment.
Yes this should be in the constructor as it is a derived property. I used to change it, but I guess I've dropped it somewhere down the road
| /** | ||
| * Retrieves a list of repositories that the user has access to, based on the specified parameters. | ||
| * @param includeRemote - If true, includes remote repositories in the list; otherwise, only local repositories are included. | ||
| * @param isRestricted - If true, returns repositories that the user has write access to; if false, returns repositories that the user has read access to. |
There was a problem hiding this comment.
This is kind of strange. If isRestricted is true I get unrestricted access repos (write/read) and if it is false, I am restricted only to read access.
There was a problem hiding this comment.
yeah, this was a blind copy/paste from the core-errors. It's stupid indeed.
| <div class="page-restrictions"> | ||
| @if (restrictions().length) { | ||
| <p-message [severity]="'info'" icon="ri-alert-line"> | ||
| @for (reason of restrictions(); track reason.translationKey) { |
There was a problem hiding this comment.
not big deal but strange
shouldn't the restrictions() give back a restriction which might/might not have a reason?
There was a problem hiding this comment.
I saw it is actually RestrictionReason so it makes sense for the var to be reason if restrictions is actually restrictionReasons
| } | ||
|
|
||
| if (repo) { | ||
| if (isSecurityEnabled && !canWrite) { |
There was a problem hiding this comment.
I believe a user can have only read with the security off. This would be by using the override user from config. @plamen-yordanov can confirm if this is possible.
| } | ||
|
|
||
| if (!hasAccessibleRepositories) { | ||
| if (ctx.isRestricted) { |
There was a problem hiding this comment.
I am now totally baffled by what isRestricted means in all the contexts
| text-decoration-style: dotted; | ||
| text-decoration-thickness: var(--link-decoration-thickness); | ||
| text-underline-offset: var(--link-underline-offset); | ||
| color: var(--gw-button-primary-link-hover-color); |
There was a problem hiding this comment.
This is not right. There should be a --gw-button-primary-link-color var
There was a problem hiding this comment.
yeah, but it has wrong color and I set this until the other one gets fixed. I probably shouldn't have to.
| @@ -0,0 +1,113 @@ | |||
| @use 'src/styles/variables' as *; | |||
There was a problem hiding this comment.
Is this actually used here?
There was a problem hiding this comment.
It was. I used to use the responsive-breakpoints in some initial versions, but then this was changed and I forgot to delete this
| @@ -0,0 +1,7 @@ | |||
| // Responsive breakpoints | |||
There was a problem hiding this comment.
Wouln't it be better if those were actually defined in the DS?
Or at least as css vars, so they can be accessed everywhere.
There was a problem hiding this comment.
The design system should not declare responsive breakpoints I think. This is the application's responsibility IMO




What
Introduce repository picker list component.
Why
This is a component which is accessible on all pages that depend on having an active repository.
How
Implemented a repository picker list component that allows the user to select a repository, filter available local or remote repositories or quick access the repository create page.
Additionally:
Testing
Implemented tests.
Screenshots
Checklist