feat: expose owner_name in coder_workspace resource (#11639)

This commit is contained in:
Marcin Tojek
2024-01-17 13:20:45 +01:00
committed by GitHub
parent b173195e0d
commit 5eb3e1cdaa
40 changed files with 353 additions and 146 deletions
+4
View File
@@ -221,6 +221,7 @@ export interface Metadata {
workspaceOwnerOidcAccessToken: string;
workspaceOwnerSessionToken: string;
templateId: string;
workspaceOwnerName: string;
}
/** Config represents execution configuration shared by all subsequent requests in the Session */
@@ -796,6 +797,9 @@ export const Metadata = {
if (message.templateId !== "") {
writer.uint32(98).string(message.templateId);
}
if (message.workspaceOwnerName !== "") {
writer.uint32(106).string(message.workspaceOwnerName);
}
return writer;
},
};
+2
View File
@@ -1294,6 +1294,7 @@ export interface UpdateUserPasswordRequest {
// From codersdk/users.go
export interface UpdateUserProfileRequest {
readonly username: string;
readonly name: string;
}
// From codersdk/users.go
@@ -1341,6 +1342,7 @@ export interface UploadResponse {
export interface User {
readonly id: string;
readonly username: string;
readonly name: string;
readonly email: string;
readonly created_at: string;
readonly last_seen_at: string;
@@ -10,6 +10,7 @@ const meta: Meta<typeof AccountForm> = {
isLoading: false,
initialValues: {
username: "test-user",
name: "",
},
updateProfileError: undefined,
},
@@ -13,6 +13,7 @@ describe("AccountForm", () => {
// Given
const mockInitialValues: UpdateUserProfileRequest = {
username: MockUser2.username,
name: "",
};
// When
@@ -43,6 +44,7 @@ describe("AccountForm", () => {
// Given
const mockInitialValues: UpdateUserProfileRequest = {
username: MockUser2.username,
name: "",
};
// When
@@ -7,6 +7,7 @@ import { mockApiError } from "testHelpers/entities";
const newData = {
username: "user",
name: "",
};
const fillAndSubmitForm = async () => {
@@ -32,7 +32,7 @@ export const AccountPage: FC = () => {
email={me.email}
updateProfileError={updateProfileError}
isLoading={isUpdatingProfile}
initialValues={{ username: me.username }}
initialValues={{ username: me.username, name: me.name }}
onSubmit={updateProfile}
/>
</Section>
+4
View File
@@ -285,6 +285,7 @@ export const MockUser: TypesGen.User = {
last_seen_at: "",
login_type: "password",
theme_preference: "",
name: "",
};
export const MockUserAdmin: TypesGen.User = {
@@ -299,6 +300,7 @@ export const MockUserAdmin: TypesGen.User = {
last_seen_at: "",
login_type: "password",
theme_preference: "",
name: "",
};
export const MockUser2: TypesGen.User = {
@@ -313,6 +315,7 @@ export const MockUser2: TypesGen.User = {
last_seen_at: "2022-09-14T19:12:21Z",
login_type: "oidc",
theme_preference: "",
name: "",
};
export const SuspendedMockUser: TypesGen.User = {
@@ -327,6 +330,7 @@ export const SuspendedMockUser: TypesGen.User = {
last_seen_at: "",
login_type: "password",
theme_preference: "",
name: "",
};
export const MockProvisioner: TypesGen.ProvisionerDaemon = {