Skip to content

Commit

Permalink
fixup fromWorkspaceAutostartOption
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexTugarev committed Dec 5, 2023
1 parent fa5d001 commit 7664094
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* See License.AGPL.txt in the project root for license information.
*/

import "reflect-metadata";

import { Timestamp, toPlainMessage, PartialMessage, Duration } from "@bufbuild/protobuf";
import { Code, ConnectError } from "@connectrpc/connect";
import {
Expand Down Expand Up @@ -135,6 +137,7 @@ import type { DeepPartial } from "@gitpod/gitpod-protocol/lib/util/deep-partial"
import { BlockedRepository as ProtocolBlockedRepository } from "@gitpod/gitpod-protocol/lib/blocked-repositories-protocol";
import { RoleOrPermission } from "@gitpod/gitpod-protocol/lib/permission";
import { parseGoDurationToMs } from "@gitpod/gitpod-protocol/lib/util/timeutil";
import { isWorkspaceRegion } from "@gitpod/gitpod-protocol/lib/workspace-cluster";

export type PartialConfiguration = DeepPartial<Configuration> & Pick<Configuration, "id">;

Expand Down Expand Up @@ -1228,7 +1231,7 @@ export class PublicAPIConverter {
if (!e) {
return undefined;
}
return <IDESettings>{
return {
defaultIde: e.name,
useLatestVersion: e.version === "latest",
};
Expand All @@ -1245,11 +1248,12 @@ export class PublicAPIConverter {
}

fromWorkspaceAutostartOption(o: User_WorkspaceAutostartOption): WorkspaceAutostartOption {
return <WorkspaceAutostartOption>{
const region = isWorkspaceRegion(o.region) ? o.region : "";
return {
cloneURL: o.cloneUrl,
editorSettings: this.fromEditorReference(o.editorSettings),
ideSettings: this.fromEditorReference(o.editorSettings),
organizationId: o.organizationId,
region: o.region,
region,
workspaceClass: o.workspaceClass,
};
}
Expand Down
2 changes: 1 addition & 1 deletion components/server/src/user/user-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { CreateUserParams } from "./user-authentication";
import { IAnalyticsWriter } from "@gitpod/gitpod-protocol/lib/analytics";
import { TransactionalContext } from "@gitpod/gitpod-db/lib/typeorm/transactional-db-impl";
import { RelationshipUpdater } from "../authorization/relationship-updater";
import { getProfile } from "@gitpod/public-api-common/src/user-utils";
import { getProfile } from "@gitpod/public-api-common/lib/user-utils";

@injectable()
export class UserService {
Expand Down

0 comments on commit 7664094

Please sign in to comment.