Skip to content

GDB-12880 introduce repository picker list#2994

Open
svilenvelikov wants to merge 1 commit into
masterfrom
GDB-12880-introduce-repository-picker-list-component
Open

GDB-12880 introduce repository picker list#2994
svilenvelikov wants to merge 1 commit into
masterfrom
GDB-12880-introduce-repository-picker-list-component

Conversation

@svilenvelikov

@svilenvelikov svilenvelikov commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

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:

  • Added responsive breakpoints and updated media queries in styles
  • 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.
  • Added a new stateLowercase property to Repository model. This can be used as a marker css class inside templates for example without transformation.
  • Added a section with primeng message components in the ux-test page

Testing

Implemented tests.

Screenshots

image image image

Checklist

  • Branch name
  • Target branch
  • Commit messages
  • Squash commits
  • MR name
  • MR Description
  • Tests
  • Browser support verified

Copilot AI review requested due to automatic review settings June 3, 2026 13:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 RepositoryPickerListComponent UI (template + SCSS) and embeds it in RepositoryRequiredBannerComponent.
  • 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.

@svilenvelikov svilenvelikov force-pushed the GDB-12880-introduce-repository-picker-list-component branch 9 times, most recently from 22ad51a to 9024a48 Compare June 10, 2026 05:15
@svilenvelikov svilenvelikov force-pushed the GDB-12880-introduce-repository-picker-list-component branch 6 times, most recently from 9df58cb to 4a78a0a Compare June 16, 2026 06:27
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
@yordanalexandrov yordanalexandrov force-pushed the GDB-12880-introduce-repository-picker-list-component branch from 4a78a0a to 43b59b0 Compare June 19, 2026 10:40
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed for 'Shared-components'

Failed conditions
1 New Bugs (required ≤ 0)
2 New Code Smells (required ≤ 0)
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

super(repositories);
}

filterWithCallback(filterCallback: (repository: Repository) => boolean): RepositoryList {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this called filterCallback? Isn't filter informative enough?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a collision with the super's names?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why set this here? Isn't it more apropriate to set it in the constructor? It is a helper prop.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not big deal but strange

shouldn't the restrictions() give back a restriction which might/might not have a reason?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not right. There should be a --gw-button-primary-link-color var

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 *;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this actually used here?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The design system should not declare responsive breakpoints I think. This is the application's responsibility IMO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants