Skip to content

Commit 9bbc251

Browse files
committed
Fix lint and tests
1 parent 73594f9 commit 9bbc251

File tree

5 files changed

+20
-6
lines changed

5 files changed

+20
-6
lines changed

coderd/database/dbmem/dbmem.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3758,7 +3758,7 @@ func (q *FakeQuerier) GetUserLinksByUserID(_ context.Context, userID uuid.UUID)
37583758
return uls, nil
37593759
}
37603760

3761-
func (q *FakeQuerier) GetUserWorkspaceBuildParameters(ctx context.Context, ownerID uuid.UUID) ([]database.GetUserWorkspaceBuildParametersRow, error) {
3761+
func (q *FakeQuerier) GetUserWorkspaceBuildParameters(_ context.Context, ownerID uuid.UUID) ([]database.GetUserWorkspaceBuildParametersRow, error) {
37623762
q.mutex.RLock()
37633763
defer q.mutex.RUnlock()
37643764

site/src/components/RichParameterInput/RichParameterInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ export const RichParameterInput: FC<RichParameterInputProps> = ({
161161
<RichParameterField {...fieldProps} size={size} parameter={parameter} />
162162
{defaultReason && (
163163
<div css={{ marginTop: 4, fontSize: 12 }}>
164-
🪄 Autofilled {defaultReason}
164+
🪄 Autofilled: {defaultReason}
165165
</div>
166166
)}
167167
</div>

site/src/pages/CreateWorkspacePage/CreateWorkspacePage.test.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,9 @@ describe("CreateWorkspacePage", () => {
241241
"me",
242242
expect.objectContaining({
243243
template_id: MockTemplate.id,
244-
rich_parameter_values: [{ name: param, value: paramValue }],
244+
rich_parameter_values: [
245+
{ name: param, value: paramValue, reason: <>supplied by URL</> },
246+
],
245247
}),
246248
);
247249
});
@@ -266,7 +268,9 @@ describe("CreateWorkspacePage", () => {
266268
"me",
267269
expect.objectContaining({
268270
template_version_id: MockTemplate.active_version_id,
269-
rich_parameter_values: [{ name: param, value: paramValue }],
271+
rich_parameter_values: [
272+
{ name: param, value: paramValue, reason: <>supplied by URL</> },
273+
],
270274
}),
271275
);
272276
});

site/src/pages/CreateWorkspacePage/CreateWorkspacePage.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import {
22
TemplateVersionParameter,
33
UserParameter,
44
Workspace,
5-
WorkspaceBuildParameter,
65
} from "api/typesGenerated";
76
import { useMe } from "hooks/useMe";
87
import { useOrganizationId } from "hooks/useOrganizationId";
@@ -243,7 +242,11 @@ const getDefaultBuildParameters = (
243242
buildValues.push({
244243
name: param.name,
245244
value: param.value,
246-
reason: <>recently used value</>,
245+
reason: (
246+
<>
247+
recently used <code>{param.name}</code> value.
248+
</>
249+
),
247250
});
248251
});
249252
return buildValues;

site/src/pages/CreateWorkspacePage/CreateWorkspacePageView.stories.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,13 @@ export const Parameters: Story = {
8686
ephemeral: false,
8787
},
8888
],
89+
defaultBuildParameters: [
90+
{
91+
name: "first_parameter",
92+
value: "It works!",
93+
reason: <>recently used.</>,
94+
},
95+
],
8996
},
9097
};
9198

0 commit comments

Comments
 (0)