Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace /workspaces → /projects as default landing page for both users and teams #6048

Merged
merged 2 commits into from
Oct 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .werft/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ export async function deployToDev(deploymentConfig: DeploymentConfig, workspaceF
werft.fail('deploy', err);
} finally {
// produce the result independently of Helm succeding, so that in case Helm fails we still have the URL.
exec(`werft log result -d "dev installation" -c github-check-preview-env url ${url}/workspaces/`);
exec(`werft log result -d "dev installation" -c github-check-preview-env url ${url}/projects`);
Copy link
Contributor

Choose a reason for hiding this comment

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

praise: Nice one! 💯

Copy link
Contributor

Choose a reason for hiding this comment

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

question: Probably going with / this could also work, right?

}

werft.log(`observability`, "Running observability static checks.")
Expand Down
4 changes: 2 additions & 2 deletions components/dashboard/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ function App() {
<Route path="/admin/workspaces" component={WorkspacesSearch} />

<Route path={["/", "/login"]} exact>
<Redirect to="/workspaces" />
<Redirect to="/projects" />
</Route>
<Route path={["/settings"]} exact>
<Redirect to="/account" />
Expand Down Expand Up @@ -283,7 +283,7 @@ function App() {
{(teams || []).map(team =>
<Route path={`/t/${team.slug}`} key={team.slug}>
<Route exact path={`/t/${team.slug}`}>
<Redirect to={`/t/${team.slug}/workspaces`} />
<Redirect to={`/t/${team.slug}/projects`} />
</Route>
<Route exact path={`/t/${team.slug}/:maybeProject/:resourceOrPrebuild?`} render={(props) => {
const { maybeProject, resourceOrPrebuild } = props.match.params;
Expand Down
2 changes: 1 addition & 1 deletion components/dashboard/src/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export default function Menu() {
return (
<div className="flex p-1 pl-3 ">
{ projectName && <div className="flex h-full rounded-lg hover:bg-gray-100 dark:hover:bg-gray-800 px-2 py-1">
<Link to={team ? `/t/${team.slug}/projects` : "/workspaces"}>
<Link to={team ? `/t/${team.slug}/projects` : `/projects`}>
<span className="text-base text-gray-600 dark:text-gray-400 font-semibold">{team?.name || userFullName}</span>
</Link>
</div> }
Expand Down
21 changes: 14 additions & 7 deletions components/dashboard/src/projects/Projects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,17 +112,24 @@ export default function () {
{projects.filter(filter).sort(hasNewerPrebuild).map(p => (<div key={`project-${p.id}`} className="h-52">
<div className="h-42 border border-gray-100 dark:border-gray-800 rounded-t-xl">
<div className="h-32 p-6">
<div className="flex text-xl font-semibold text-gray-700 dark:text-gray-200 font-medium">
<div className="flex text-gray-700 dark:text-gray-200 font-medium">
<Link to={`/${teamOrUserSlug}/${p.name}`}>
{p.name}
<span className="text-xl font-semibold">{p.name}</span>
</Link>
<span className="flex-grow" />
<div className="justify-end">
<ContextMenu menuEntries={[{
title: "Remove Project",
customFontStyle: 'text-red-600 dark:text-red-400 hover:text-red-800 dark:hover:text-red-300',
onClick: () => onRemoveProject(p)
}]} />
<ContextMenu menuEntries={[
Copy link
Contributor

Choose a reason for hiding this comment

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

issue: This is out of the scope of these changes but do you think it'd be easy to add a hover state on the more action button as seen everywhere else?

Adding hover:bg-gray-200 dark:hover:bg-gray-700 rounded-md in the Context Menu component could suffice unless I'm missing something. What do you think? Feel free to open a follow up PR if needed.

const children = props.children || <svg className="w-8 h-8 p-1 text-gray-600 dark:text-gray-300" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>Actions</title><g fill="currentColor" transform="rotate(90 12 12)"><circle cx="1" cy="1" r="2" transform="translate(5 11)" /><circle cx="1" cy="1" r="2" transform="translate(11 11)" /><circle cx="1" cy="1" r="2" transform="translate(17 11)" /></g></svg>;

Copy link
Contributor Author

@jankeromnes jankeromnes Oct 13, 2021

Choose a reason for hiding this comment

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

Good catch! Pushed a new drive-by commit to fix this. 🚀

EDIT: In #6185, that is.

{
title: "New Workspace",
Copy link
Contributor

Choose a reason for hiding this comment

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

praise: YES!

href: `/#${p.cloneUrl}`,
separator: true,
},
{
title: "Remove Project",
customFontStyle: 'text-red-600 dark:text-red-400 hover:text-red-800 dark:hover:text-red-300',
onClick: () => onRemoveProject(p)
},
]} />
</div>
</div>
<a href={p.cloneUrl.replace(/\.git$/, '')}>
Expand Down
10 changes: 5 additions & 5 deletions components/gitpod-protocol/src/util/gitpod-host-url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,23 +85,23 @@ export class GitpodHostUrl {
}

asDashboard(): GitpodHostUrl {
return this.with(url => ({ pathname: '/workspaces/' }));
return this.with(url => ({ pathname: '/projects' }));
}

asLogin(): GitpodHostUrl {
return this.with(url => ({ pathname: '/login/' }));
return this.with(url => ({ pathname: '/login' }));
}

asUpgradeSubscription(): GitpodHostUrl {
return this.with(url => ({ pathname: '/plans/' }));
return this.with(url => ({ pathname: '/plans' }));
}

asAccessControl(): GitpodHostUrl {
return this.with(url => ({ pathname: '/access-control/' }));
return this.with(url => ({ pathname: '/integrations' }));
}

asSettings(): GitpodHostUrl {
return this.with(url => ({ pathname: '/settings/' }));
return this.with(url => ({ pathname: '/settings' }));
}

asGraphQLApi(): GitpodHostUrl {
Expand Down