Skip to content

Commit abe0bb5

Browse files
committed
Apply PR review suggestions
1 parent 10a133e commit abe0bb5

33 files changed

+152
-69
lines changed

site/e2e/helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -982,7 +982,7 @@ export const updateTemplateSettings = async (
982982
await page.getByLabel(labelText, { exact: true }).fill(value);
983983
}
984984

985-
await page.getByRole("button", { name: /save settings/i }).click();
985+
await page.getByRole("button", { name: /save/i }).click();
986986

987987
const name = templateSettingValues.name ?? templateName;
988988
await expectUrl(page).toHavePathNameEndingWith(`/${name}`);

site/e2e/tests/deployment/appearance.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ test("set application name", async ({ page }) => {
2020
await form
2121
.getByLabel("Application name", { exact: true })
2222
.fill(applicationName);
23-
await form.getByRole("button", { name: /save settings/i }).click();
23+
await form.getByRole("button", { name: /save/i }).click();
2424

2525
// Open a new session without cookies to see the login page
2626
const browser = await chromium.launch();

site/e2e/tests/organizationGroups.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ test("create group", async ({ page }) => {
3434
const displayName = `Group ${name}`;
3535
await page.getByLabel("Display Name").fill(displayName);
3636
await page.getByLabel("Avatar URL").fill("/emojis/1f60d.png");
37-
await page.getByRole("button", { name: "Create group" }).click();
37+
await page.getByRole("button", { name: "Save" }).click();
3838

3939
await expectUrl(page).toHavePathName(
4040
`/organizations/${org.name}/groups/${name}`,

site/e2e/tests/templates/updateTemplateSchedule.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ test("update template schedule settings without override other settings", async
3636
waitUntil: "domcontentloaded",
3737
});
3838
await page.getByLabel("Default autostop (hours)").fill("48");
39-
await page.getByRole("button", { name: /save settings/i }).click();
39+
await page.getByRole("button", { name: /save/i }).click();
4040
await expect(page.getByText("Template updated successfully")).toBeVisible();
4141

4242
const updatedTemplate = await API.getTemplate(template.id);

site/e2e/tests/updateTemplate.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ test("require latest version", async ({ page }) => {
6767
await expectUrl(page).toHavePathName(`/templates/${templateName}/settings`);
6868
let checkbox = await page.waitForSelector("#require_active_version");
6969
await checkbox.click();
70-
await page.getByRole("button", { name: /save settings/i }).click();
70+
await page.getByRole("button", { name: /save/i }).click();
7171

7272
await page.goto(`/templates/${templateName}/settings`, {
7373
waitUntil: "domcontentloaded",

site/src/components/FullPageForm/FullPageForm.stories.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,8 @@ const Template: FC<FullPageFormProps> = (props) => (
1717
<TextField fullWidth label="Field 1" name="field1" />
1818
<TextField fullWidth label="Field 2" name="field2" />
1919
<FormFooter>
20-
<Button type="button" variant="outline">
21-
Cancel
22-
</Button>
23-
<Button>Save</Button>
20+
<Button variant="outline">Cancel</Button>
21+
<Button type="submit">Save</Button>
2422
</FormFooter>
2523
</Stack>
2624
</form>

site/src/index.css

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,9 @@
1818
--surface-quaternary: 240, 5%, 84%;
1919
--surface-invert-primary: 240, 4%, 16%;
2020
--surface-invert-secondary: 240, 5%, 26%;
21-
--surface-error: 0, 100%, 14%;
2221
--surface-destructive: 0, 93%, 94%;
2322
--border-default: 240, 6%, 90%;
2423
--border-success: 142, 76%, 36%;
25-
--border-error: 0, 84%, 60%;
2624
--border-destructive: 0, 84%, 60%;
2725
--radius: 0.5rem;
2826
--chart-1: 12 76% 61%;
@@ -52,11 +50,9 @@
5250
--surface-quaternary: 240, 5%, 26%;
5351
--surface-invert-primary: 240, 6%, 90%;
5452
--surface-invert-secondary: 240, 5%, 65%;
55-
--surface-error: 0, 100%, 14%;
5653
--surface-destructive: 0, 75%, 15%;
5754
--border-default: 240, 4%, 16%;
5855
--border-success: 142, 76%, 36%;
59-
--border-error: 0, 91%, 71%;
6056
--border-destructive: 0, 91%, 71%;
6157
--chart-1: 220 70% 50%;
6258
--chart-2: 160 60% 45%;

site/src/modules/workspaces/WorkspaceTiming/WorkspaceTimings.stories.tsx

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,3 +126,101 @@ export const LoadingWhenAgentScriptTimingsAreEmpty: Story = {
126126
agentScriptTimings: undefined,
127127
},
128128
};
129+
130+
export const MemoryLeak: Story = {
131+
args: {
132+
provisionerTimings: [
133+
{
134+
job_id: "49fe19b4-19e9-4320-8e17-1a63164453da",
135+
started_at: "2025-01-05T12:47:14.819777Z",
136+
ended_at: "2025-01-05T12:47:18.654211Z",
137+
stage: "init",
138+
source: "terraform",
139+
action: "initializing terraform",
140+
resource: "state file",
141+
},
142+
{
143+
job_id: "49fe19b4-19e9-4320-8e17-1a63164453da",
144+
started_at: "2025-01-05T12:47:19.003863Z",
145+
ended_at: "2025-01-05T12:47:19.004863Z",
146+
stage: "plan",
147+
source: "coder",
148+
action: "read",
149+
resource: "data.coder_workspace.me",
150+
},
151+
{
152+
job_id: "49fe19b4-19e9-4320-8e17-1a63164453da",
153+
started_at: "2025-01-05T12:47:19.004077Z",
154+
ended_at: "2025-01-05T12:47:19.004819Z",
155+
stage: "plan",
156+
source: "coder",
157+
action: "read",
158+
resource: "data.coder_provisioner.me",
159+
},
160+
{
161+
job_id: "49fe19b4-19e9-4320-8e17-1a63164453da",
162+
started_at: "2025-01-05T12:47:19.004141Z",
163+
ended_at: "2025-01-05T12:47:19.004989Z",
164+
stage: "plan",
165+
source: "coder",
166+
action: "read",
167+
resource: "data.coder_workspace_owner.me",
168+
},
169+
{
170+
job_id: "49fe19b4-19e9-4320-8e17-1a63164453da",
171+
started_at: "2025-01-05T12:47:19.00933Z",
172+
ended_at: "2025-01-05T12:47:19.030038Z",
173+
stage: "plan",
174+
source: "docker",
175+
action: "state refresh",
176+
resource: "docker_image.main",
177+
},
178+
{
179+
job_id: "49fe19b4-19e9-4320-8e17-1a63164453da",
180+
started_at: "2025-01-05T12:47:19.01011Z",
181+
ended_at: "2025-01-05T12:47:19.013026Z",
182+
stage: "plan",
183+
source: "coder",
184+
action: "state refresh",
185+
resource: "coder_agent.main",
186+
},
187+
{
188+
job_id: "49fe19b4-19e9-4320-8e17-1a63164453da",
189+
started_at: "2025-01-05T12:47:19.019742Z",
190+
ended_at: "2025-01-05T12:47:19.020578Z",
191+
stage: "plan",
192+
source: "coder",
193+
action: "state refresh",
194+
resource: "coder_app.code-server",
195+
},
196+
{
197+
job_id: "49fe19b4-19e9-4320-8e17-1a63164453da",
198+
started_at: "2025-01-05T12:47:19.056489Z",
199+
ended_at: "2025-01-05T12:47:19.494507Z",
200+
stage: "graph",
201+
source: "terraform",
202+
action: "building terraform dependency graph",
203+
resource: "state file",
204+
},
205+
{
206+
job_id: "49fe19b4-19e9-4320-8e17-1a63164453da",
207+
started_at: "2025-01-05T12:47:19.815179Z",
208+
ended_at: "2025-01-05T12:47:20.238378Z",
209+
stage: "apply",
210+
source: "docker",
211+
action: "create",
212+
resource: "docker_container.workspace[0]",
213+
},
214+
],
215+
agentScriptTimings: [],
216+
agentConnectionTimings: [
217+
{
218+
started_at: "2025-01-05T12:47:20.782132Z",
219+
ended_at: "2025-01-05T12:47:21.05562Z",
220+
stage: "connect",
221+
workspace_agent_id: "27941bd8-2f3b-4c0a-ad1d-46ea90cca242",
222+
workspace_agent_name: "main",
223+
},
224+
],
225+
},
226+
};

site/src/pages/CreateTemplatePage/CreateTemplateForm.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,10 +353,10 @@ export const CreateTemplateForm: FC<CreateTemplateFormProps> = (props) => {
353353
)}
354354

355355
<FormFooter>
356-
<Button onClick={onCancel} type="button" variant="outline">
356+
<Button onClick={onCancel} variant="outline">
357357
Cancel
358358
</Button>
359-
<Button disabled={isSubmitting}>
359+
<Button type="submit" disabled={isSubmitting}>
360360
{isSubmitting && <Spinner />}
361361
{jobError ? "Retry" : "Create template"}
362362
</Button>

site/src/pages/CreateTokenPage/CreateTokenForm.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,14 +148,10 @@ export const CreateTokenForm: FC<CreateTokenFormProps> = ({
148148
</FormSection>
149149

150150
<FormFooter>
151-
<Button
152-
onClick={() => navigate("/settings/tokens")}
153-
type="button"
154-
variant="outline"
155-
>
151+
<Button onClick={() => navigate("/settings/tokens")} variant="outline">
156152
Cancel
157153
</Button>
158-
<Button disabled={isCreating}>
154+
<Button type="submit" disabled={isCreating}>
159155
{isCreating && <Spinner />}
160156
{creationFailed ? "Retry" : "Create token"}
161157
</Button>

site/src/pages/CreateUserPage/CreateUserForm.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,12 +206,12 @@ export const CreateUserForm: FC<
206206
</Stack>
207207

208208
<FormFooter className="mt-8">
209-
<Button onClick={onCancel} type="button" variant="outline">
209+
<Button onClick={onCancel} variant="outline">
210210
Cancel
211211
</Button>
212-
<Button disabled={isLoading}>
212+
<Button type="submit" disabled={isLoading}>
213213
{isLoading && <Spinner />}
214-
Create user
214+
Save
215215
</Button>
216216
</FormFooter>
217217
</form>

site/src/pages/CreateUserPage/CreateUserPage.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const fillForm = async ({
3535
await userEvent.type(loginTypeField, "password");
3636
await userEvent.type(passwordField as HTMLElement, password);
3737
const submitButton = screen.getByRole("button", {
38-
name: "Create user",
38+
name: "Save",
3939
});
4040
fireEvent.click(submitButton);
4141
};

site/src/pages/CreateWorkspacePage/CreateWorkspacePageView.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,10 +315,13 @@ export const CreateWorkspacePageView: FC<CreateWorkspacePageViewProps> = ({
315315
)}
316316

317317
<FormFooter>
318-
<Button onClick={onCancel} type="button" variant="outline">
318+
<Button onClick={onCancel} variant="outline">
319319
Cancel
320320
</Button>
321-
<Button disabled={creatingWorkspace || !hasAllRequiredExternalAuth}>
321+
<Button
322+
type="submit"
323+
disabled={creatingWorkspace || !hasAllRequiredExternalAuth}
324+
>
322325
{creatingWorkspace && <Spinner />}
323326
Create workspace
324327
</Button>

site/src/pages/GroupsPage/CreateGroupPageView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,13 @@ export const CreateGroupPageView: FC<CreateGroupPageViewProps> = ({
8080
</Stack>
8181

8282
<FormFooter className="mt-8">
83-
<Button type="button" onClick={onCancel} variant="outline">
83+
<Button onClick={onCancel} variant="outline">
8484
Cancel
8585
</Button>
8686

8787
<Button type="submit" disabled={isLoading}>
8888
{isLoading && <Spinner />}
89-
Create group
89+
Save
9090
</Button>
9191
</FormFooter>
9292
</form>

site/src/pages/GroupsPage/SettingsGroupPageView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,13 @@ const UpdateGroupForm: FC<UpdateGroupFormProps> = ({
108108
</Stack>
109109

110110
<FormFooter>
111-
<Button type="button" onClick={onCancel} variant="outline">
111+
<Button onClick={onCancel} variant="outline">
112112
Cancel
113113
</Button>
114114

115115
<Button type="submit" disabled={isLoading}>
116116
{isLoading && <Spinner />}
117-
Save settings
117+
Save
118118
</Button>
119119
</FormFooter>
120120
</form>

site/src/pages/ManagementSettingsPage/CreateOrganizationPageView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ export const CreateOrganizationPageView: FC<
160160
<FormFooter>
161161
<Button type="submit" disabled={form.isSubmitting}>
162162
{form.isSubmitting && <Spinner />}
163-
Create organization
163+
Save
164164
</Button>
165165
</FormFooter>
166166
</HorizontalForm>

site/src/pages/ManagementSettingsPage/CustomRolesPage/CreateEditRolePageView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export const CreateEditRolePageView: FC<CreateEditRolePageViewProps> = ({
136136
</FormFields>
137137
{canAssignOrgRole && (
138138
<FormFooter>
139-
<Button type="button" onClick={onCancel} variant="outline">
139+
<Button onClick={onCancel} variant="outline">
140140
Cancel
141141
</Button>
142142

site/src/pages/ManagementSettingsPage/GroupsPage/CreateGroupPageView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,13 @@ export const CreateGroupPageView: FC<CreateGroupPageViewProps> = ({
8888
</FormSection>
8989

9090
<FormFooter>
91-
<Button type="button" onClick={onCancel} variant="outline">
91+
<Button onClick={onCancel} variant="outline">
9292
Cancel
9393
</Button>
9494

9595
<Button type="submit" disabled={isLoading}>
9696
{isLoading && <Spinner />}
97-
Create group
97+
Save
9898
</Button>
9999
</FormFooter>
100100
</HorizontalForm>

site/src/pages/ManagementSettingsPage/GroupsPage/GroupSettingsPageView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,13 @@ const UpdateGroupForm: FC<UpdateGroupFormProps> = ({
119119
</FormSection>
120120

121121
<FormFooter className="mt-8">
122-
<Button type="button" onClick={onCancel} variant="outline">
122+
<Button onClick={onCancel} variant="outline">
123123
Cancel
124124
</Button>
125125

126126
<Button type="submit" disabled={isLoading}>
127127
{isLoading && <Spinner />}
128-
Save settings
128+
Save
129129
</Button>
130130
</FormFooter>
131131
</HorizontalForm>

site/src/pages/ManagementSettingsPage/OrganizationSettingsPageView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export const OrganizationSettingsPageView: FC<
120120
<FormFooter>
121121
<Button type="submit" disabled={form.isSubmitting}>
122122
{form.isSubmitting && <Spinner />}
123-
Save settings
123+
Save
124124
</Button>
125125
</FormFooter>
126126
</HorizontalForm>

site/src/pages/TemplateSettingsPage/TemplateGeneralSettingsPage/TemplateSettingsForm.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,13 +293,13 @@ export const TemplateSettingsForm: FC<TemplateSettingsForm> = ({
293293
</FormSection>
294294

295295
<FormFooter>
296-
<Button type="button" onClick={onCancel} variant="outline">
296+
<Button onClick={onCancel} variant="outline">
297297
Cancel
298298
</Button>
299299

300300
<Button type="submit" disabled={isSubmitting}>
301301
{isSubmitting && <Spinner />}
302-
Save settings
302+
Save
303303
</Button>
304304
</FormFooter>
305305
</HorizontalForm>

0 commit comments

Comments
 (0)