Skip to content

Commit

Permalink
Address review feedback
Browse files Browse the repository at this point in the history
Co-authored-by: George Tsiolis <[email protected]>
Co-authored-by: Gero Posmyk-Leinemann <[email protected]>
  • Loading branch information
3 people committed Dec 13, 2021
1 parent 3c2d7d3 commit c8c3da4
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 12 deletions.
4 changes: 2 additions & 2 deletions components/dashboard/src/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ export default function Menu() {
]}>
<div className="flex h-full px-2 py-1 space-x-3.5">
{ !projectSlug && <span className="text-base text-gray-600 dark:text-gray-400 font-semibold">{team?.name || userFullName}</span>}
<img className="filter-grayscale" style={{marginTop: 5, marginBottom: 5}} src={CaretUpDown} />
<img alt="" aria-label="Toggle team selection menu" className="filter-grayscale" style={{marginTop: 5, marginBottom: 5}} src={CaretUpDown} />
</div>
</ContextMenu>
</div>
Expand All @@ -232,7 +232,7 @@ export default function Menu() {
)}
{ prebuildId && (
<div className="flex h-full ml-2 py-1">
<img className="mr-3 filter-grayscale m-auto transform -rotate-90" src={CaretDown} />
<img alt="" className="mr-3 filter-grayscale m-auto transform -rotate-90" src={CaretDown} />
<span className="text-base text-gray-600 dark:text-gray-400 font-semibold">{prebuildId}</span>
</div>
)}
Expand Down
2 changes: 1 addition & 1 deletion components/dashboard/src/components/CheckBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function CheckBox(props: {

const checkboxId = `checkbox-${props.title}-${String(Math.random())}`;

return <div className="flex mt-4">
return <div className="flex mt-4 max-w-2xl">
<input className={"h-4 w-4 focus:ring-0 mt-1 rounded cursor-pointer bg-transparent border-2 dark:filter-invert border-gray-800 dark:border-gray-900 focus:border-gray-900 dark:focus:border-gray-800 " + (props.checked ? 'bg-gray-800 dark:bg-gray-900' : '')} type="checkbox"
id={checkboxId}
{...inputProps}
Expand Down
3 changes: 1 addition & 2 deletions components/dashboard/src/projects/Prebuild.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { getGitpodService, gitpodHostUrl } from "../service/service";
import { TeamsContext, getCurrentTeam } from "../teams/teams-context";
import { PrebuildInstanceStatus } from "./Prebuilds";
import { shortCommitMessage } from "./render-utils";
import { Link } from "react-router-dom";

export default function () {
const history = useHistory();
Expand Down Expand Up @@ -81,7 +80,7 @@ export default function () {
{!!prebuild.info.basedOnPrebuildId && <>
<p className="mx-2 my-auto">·</p>
<div className="my-auto">
<p className="text-gray-500 dark:text-gray-50">Incremental Prebuild (<Link className="gp-link" title={prebuild.info.basedOnPrebuildId} to={`./${prebuild.info.basedOnPrebuildId}`}>base</Link>)</p>
<p className="text-gray-500 dark:text-gray-50">Incremental Prebuild (<a className="gp-link" title={prebuild.info.basedOnPrebuildId} href={`./${prebuild.info.basedOnPrebuildId}`}>base</a>)</p>
</div>
</>}
</div>)
Expand Down
10 changes: 5 additions & 5 deletions components/dashboard/src/projects/ProjectSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ export function getProjectSettingsMenu(project?: Project, team?: Team) {
const teamOrUserSlug = !!team ? 't/' + team.slug : 'projects';
return [
{
title: 'Configuration',
link: [`/${teamOrUserSlug}/${project?.slug || project?.name}/configure`],
title: 'General',
link: [`/${teamOrUserSlug}/${project?.slug || project?.name}/settings`],
},
{
title: 'Project',
link: [`/${teamOrUserSlug}/${project?.slug || project?.name}/settings`],
title: 'Configuration',
link: [`/${teamOrUserSlug}/${project?.slug || project?.name}/configure`],
},
];
}
Expand Down Expand Up @@ -82,7 +82,7 @@ export default function () {
}
}

return <PageWithSubMenu subMenu={getProjectSettingsMenu(project, team)} title="Settings" subtitle={`Manage settings for your project ${project?.name}`}>
return <PageWithSubMenu subMenu={getProjectSettingsMenu(project, team)} title="Settings" subtitle="Manage project settings and configuration">
<h3>Incremental Prebuilds</h3>
<CheckBox
title={<span>Enable Incremental Prebuilds <PillLabel type="warn" className="font-semibold mt-2 py-0.5 px-2 self-center">Beta</PillLabel></span>}
Expand Down
4 changes: 2 additions & 2 deletions components/dashboard/src/teams/TeamSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { getCurrentTeam, TeamsContext } from "./teams-context";
export function getTeamSettingsMenu(team?: Team) {
return [
{
title: 'Team',
title: 'General',
link: [`/t/${team?.slug}/settings`],
},
];
Expand Down Expand Up @@ -57,7 +57,7 @@ export default function TeamSettings() {
return <>
<PageWithSubMenu subMenu={getTeamSettingsMenu(team)} title="Settings" subtitle="Manage general team settings.">
<h3>Delete Team</h3>
<p className="text-base text-gray-500 pb-4">Deleting this team will also remove all associated data with this team, including projects and workspaces. Deleted teams cannot be restored!</p>
<p className="text-base text-gray-500 pb-4 max-w-2xl">Deleting this team will also remove all associated data with this team, including projects and workspaces. Deleted teams cannot be restored!</p>
<button className="danger secondary" onClick={() => setModal(true)}>Delete Team</button>
</PageWithSubMenu>

Expand Down
9 changes: 9 additions & 0 deletions components/server/src/workspace/gitpod-server-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1707,6 +1707,7 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable {

const user = this.checkAndBlockUser("setProjectConfiguration");
await this.guardProjectOperation(user, projectId, "update");

const parseResult = this.gitpodParser.parse(configString);
if (parseResult.validationErrors) {
throw new Error(`This configuration could not be parsed: ${parseResult.validationErrors.join(', ')}`);
Expand All @@ -1718,6 +1719,14 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable {
}

public async updateProjectPartial(ctx: TraceContext, partialProject: PartialProject): Promise<void> {
traceAPIParams(ctx, {
// censor everything irrelevant
partialProject: {
id: partialProject.id,
settings: partialProject.settings,
}
});

const user = this.checkUser("updateProjectPartial");
await this.guardProjectOperation(user, partialProject.id, "update");

Expand Down

0 comments on commit c8c3da4

Please sign in to comment.