mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: expose owner_name in coder_workspace resource (#11639)
This commit is contained in:
@@ -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;
|
||||
},
|
||||
};
|
||||
|
||||
Generated
+2
@@ -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>
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user