diff --git a/components/dashboard/src/start/CreateWorkspace.tsx b/components/dashboard/src/start/CreateWorkspace.tsx index 7b870ba5248395..86b602148235e5 100644 --- a/components/dashboard/src/start/CreateWorkspace.tsx +++ b/components/dashboard/src/start/CreateWorkspace.tsx @@ -17,6 +17,7 @@ import { openAuthorizeWindow } from "../provider-utils"; import { SelectAccountPayload } from "@gitpod/gitpod-protocol/lib/auth"; import { SelectAccountModal } from "../settings/SelectAccountModal"; import { watchHeadlessLogs } from "../components/PrebuildLogs"; +import CodeText from "../components/CodeText"; const WorkspaceLogs = React.lazy(() => import('../components/WorkspaceLogs')); @@ -233,9 +234,11 @@ function LimitReachedOutOfHours() { function RepositoryNotFoundView(p: { error: StartWorkspaceError }) { const [statusMessage, setStatusMessage] = useState(); + const { host, owner, repoName, userIsOwner, userScopes, lastUpdate } = p.error.data; + const repoFullName = (owner && repoName) ? `${owner}/${repoName}` : ''; + useEffect(() => { (async () => { - const { host, owner, repoName, userIsOwner, userScopes, lastUpdate } = p.error.data; console.log('host', host); console.log('owner', owner); console.log('repoName', repoName); @@ -248,8 +251,6 @@ function RepositoryNotFoundView(p: { error: StartWorkspaceError }) { return; } - const repoFullName = (owner && repoName) ? `${owner}/${repoName}` : ''; - // TODO: this should be aware of already granted permissions const missingScope = authProvider.host === 'github.com' ? 'repo' : 'read_repository'; const authorizeURL = gitpodHostUrl.withApi({ @@ -259,15 +260,15 @@ function RepositoryNotFoundView(p: { error: StartWorkspaceError }) { if (!userScopes.includes(missingScope)) { setStatusMessage(
-

The repository '{`${repoFullName}`}' may be private. Please authorize Gitpod to access to private repositories.

- +

The repository may be private. Please authorize Gitpod to access to private repositories.

+
); return; } if (userIsOwner) { setStatusMessage(
-

The repository '{`${repoFullName}`}' is not found in your account.

+

The repository was not found in your account.

); return; } @@ -284,22 +285,27 @@ function RepositoryNotFoundView(p: { error: StartWorkspaceError }) { if (!updatedRecently) { setStatusMessage(
-

Permission to access private repositories has been granted. If you are a member of '{owner}', please try to request access for Gitpod.

- +

Permission to access private repositories has been granted. If you are a member of {owner}, please try to request access for Gitpod.

+
); return; } setStatusMessage(
-

Your access token was updated recently. Please try again if the repository exists and Gitpod was approved for '{owner}'.

- +

Your access token was updated recently. Please try again if the repository exists and Gitpod was approved for {owner}.

+
); })(); }, []); - return - {statusMessage} - ; + return ( + +

+ {repoFullName} +

+ {statusMessage} +
+ ); } interface RunningPrebuildViewProps {