diff --git a/components/dashboard/src/projects/NewProject.tsx b/components/dashboard/src/projects/NewProject.tsx
index 74c532e4d07a35..029318414d3e40 100644
--- a/components/dashboard/src/projects/NewProject.tsx
+++ b/components/dashboard/src/projects/NewProject.tsx
@@ -274,6 +274,10 @@ export default function NewProject() {
const showSearchInput = !!repoSearchFilter || filteredRepos.length > 0;
+ const userLink = (r: ProviderRepository) => {
+ return `https://${new URL(r.cloneUrl).host}/${r.inUse?.userName}`
+ }
+
const projectText = () => {
return
Projects allow you to manage prebuilds and workspaces for your repository. Learn more
}
@@ -324,7 +328,7 @@ export default function NewProject() {
) : (
- @{r.inUse.userName} already
added this repo
+ @{r.inUse.userName} already
added this repo
)}
diff --git a/components/server/ee/src/workspace/gitpod-server-impl.ts b/components/server/ee/src/workspace/gitpod-server-impl.ts
index 5f164b98ca3c29..5dbf12b1fd07e6 100644
--- a/components/server/ee/src/workspace/gitpod-server-impl.ts
+++ b/components/server/ee/src/workspace/gitpod-server-impl.ts
@@ -42,6 +42,7 @@ import { SnapshotService, WaitForSnapshotOptions } from "./snapshot-service";
import { SafePromise } from "@gitpod/gitpod-protocol/lib/util/safe-promise";
import { ClientMetadata } from "../../../src/websocket/websocket-connection-manager";
import { BitbucketAppSupport } from "../bitbucket/bitbucket-app-support";
+import { URL } from 'url';
@injectable()
export class GitpodServerEEImpl extends GitpodServerImpl {
@@ -1444,12 +1445,17 @@ export class GitpodServerEEImpl extends GitpodServerImpl {
for (const repo of repositories) {
const p = cloneUrlToProject.get(repo.cloneUrl);
+ const repoProvider = new URL(repo.cloneUrl).host.split(".")[0];
+
if (p) {
if (p.userId) {
const owner = await this.userDB.findUserById(p.userId);
if (owner) {
- repo.inUse = {
- userName: owner?.name || owner?.fullName || 'somebody'
+ const ownerProviderMatchingRepoProvider = owner.identities.find((identity, index) => identity.authProviderId.toLowerCase().includes(repoProvider));
+ if (ownerProviderMatchingRepoProvider) {
+ repo.inUse = {
+ userName: ownerProviderMatchingRepoProvider?.authName
+ }
}
}
} else if (p.teamOwners && p.teamOwners[0]) {