Skip to content

Commit ca2bafa

Browse files
committed
s/name/full_name
1 parent 7cf406d commit ca2bafa

File tree

9 files changed

+24
-24
lines changed

9 files changed

+24
-24
lines changed

cli/login.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ func (r *RootCmd) login() *serpent.Command {
269269
_, err = client.CreateFirstUser(ctx, codersdk.CreateFirstUserRequest{
270270
Email: email,
271271
Username: username,
272-
Name: name,
272+
FullName: name,
273273
Password: password,
274274
Trial: trial,
275275
})
@@ -375,8 +375,8 @@ func (r *RootCmd) login() *serpent.Command {
375375
Value: serpent.StringOf(&username),
376376
},
377377
{
378-
Flag: "first-user-name",
379-
Env: "CODER_FIRST_USER_NAME",
378+
Flag: "first-user-full-name",
379+
Env: "CODER_FIRST_USER_FULL_NAME",
380380
Description: "Specifies a human-readable name for the first user of the deployment.",
381381
Value: serpent.StringOf(&name),
382382
},

cli/login_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func TestLogin(t *testing.T) {
9191
matches := []string{
9292
"first user?", "yes",
9393
"username", coderdtest.FirstUserParams.Username,
94-
"name", coderdtest.FirstUserParams.Name,
94+
"name", coderdtest.FirstUserParams.FullName,
9595
"email", coderdtest.FirstUserParams.Email,
9696
"password", coderdtest.FirstUserParams.Password,
9797
"password", coderdtest.FirstUserParams.Password, // confirm
@@ -115,7 +115,7 @@ func TestLogin(t *testing.T) {
115115
me, err := client.User(ctx, codersdk.Me)
116116
require.NoError(t, err)
117117
assert.Equal(t, coderdtest.FirstUserParams.Username, me.Username)
118-
assert.Equal(t, coderdtest.FirstUserParams.Name, me.Name)
118+
assert.Equal(t, coderdtest.FirstUserParams.FullName, me.Name)
119119
assert.Equal(t, coderdtest.FirstUserParams.Email, me.Email)
120120
})
121121

@@ -180,7 +180,7 @@ func TestLogin(t *testing.T) {
180180
matches := []string{
181181
"first user?", "yes",
182182
"username", coderdtest.FirstUserParams.Username,
183-
"name", coderdtest.FirstUserParams.Name,
183+
"name", coderdtest.FirstUserParams.FullName,
184184
"email", coderdtest.FirstUserParams.Email,
185185
"password", coderdtest.FirstUserParams.Password,
186186
"password", coderdtest.FirstUserParams.Password, // confirm
@@ -203,7 +203,7 @@ func TestLogin(t *testing.T) {
203203
me, err := client.User(ctx, codersdk.Me)
204204
require.NoError(t, err)
205205
assert.Equal(t, coderdtest.FirstUserParams.Username, me.Username)
206-
assert.Equal(t, coderdtest.FirstUserParams.Name, me.Name)
206+
assert.Equal(t, coderdtest.FirstUserParams.FullName, me.Name)
207207
assert.Equal(t, coderdtest.FirstUserParams.Email, me.Email)
208208
})
209209

@@ -213,7 +213,7 @@ func TestLogin(t *testing.T) {
213213
inv, _ := clitest.New(
214214
t, "login", client.URL.String(),
215215
"--first-user-username", coderdtest.FirstUserParams.Username,
216-
"--first-user-name", coderdtest.FirstUserParams.Name,
216+
"--first-user-full-name", coderdtest.FirstUserParams.FullName,
217217
"--first-user-email", coderdtest.FirstUserParams.Email,
218218
"--first-user-password", coderdtest.FirstUserParams.Password,
219219
"--first-user-trial",
@@ -232,7 +232,7 @@ func TestLogin(t *testing.T) {
232232
me, err := client.User(ctx, codersdk.Me)
233233
require.NoError(t, err)
234234
assert.Equal(t, coderdtest.FirstUserParams.Username, me.Username)
235-
assert.Equal(t, coderdtest.FirstUserParams.Name, me.Name)
235+
assert.Equal(t, coderdtest.FirstUserParams.FullName, me.Name)
236236
assert.Equal(t, coderdtest.FirstUserParams.Email, me.Email)
237237
})
238238

@@ -284,7 +284,7 @@ func TestLogin(t *testing.T) {
284284
matches := []string{
285285
"first user?", "yes",
286286
"username", coderdtest.FirstUserParams.Username,
287-
"name", coderdtest.FirstUserParams.Name,
287+
"name", coderdtest.FirstUserParams.FullName,
288288
"email", coderdtest.FirstUserParams.Email,
289289
"password", coderdtest.FirstUserParams.Password,
290290
"password", "something completely different",

cli/testdata/coder_login_--help.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ OPTIONS:
1010
Specifies an email address to use if creating the first user for the
1111
deployment.
1212

13-
--first-user-name string, $CODER_FIRST_USER_NAME
13+
--first-user-full-name string, $CODER_FIRST_USER_FULL_NAME
1414
Specifies a human-readable name for the first user of the deployment.
1515

1616
--first-user-password string, $CODER_FIRST_USER_PASSWORD

coderd/coderdtest/coderdtest.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ var FirstUserParams = codersdk.CreateFirstUserRequest{
645645
Email: "testuser@coder.com",
646646
Username: "testuser",
647647
Password: "SomeSecurePassword!",
648-
Name: "Test User",
648+
FullName: "Test User",
649649
}
650650

651651
// CreateFirstUser creates a user with preset credentials and authenticates

coderd/users.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,14 +202,14 @@ func (api *API) postFirstUser(rw http.ResponseWriter, r *http.Request) {
202202
return
203203
}
204204

205-
//nolint:gocritic // Neded to create first user.
205+
//nolint:gocritic // Needed to create first user.
206206
if _, err := api.Database.UpdateUserProfile(dbauthz.AsSystemRestricted(ctx), database.UpdateUserProfileParams{
207207
ID: user.ID,
208208
UpdatedAt: dbtime.Now(),
209209
Email: user.Email,
210210
Username: user.Username,
211211
AvatarURL: user.AvatarURL,
212-
Name: createUser.Name,
212+
Name: createUser.FullName,
213213
}); err != nil {
214214
// This should not be a fatal error. Updating the user's profile can be done separately.
215215
api.Logger.Error(ctx, "failed to update userprofile.Name", slog.Error(err))

coderd/users_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func TestFirstUser(t *testing.T) {
7575
_ = coderdtest.CreateFirstUser(t, client)
7676
u, err := client.User(ctx, codersdk.Me)
7777
require.NoError(t, err)
78-
assert.Equal(t, coderdtest.FirstUserParams.Name, u.Name)
78+
assert.Equal(t, coderdtest.FirstUserParams.FullName, u.Name)
7979
assert.Equal(t, coderdtest.FirstUserParams.Email, u.Email)
8080
assert.Equal(t, coderdtest.FirstUserParams.Username, u.Username)
8181
})
@@ -102,7 +102,7 @@ func TestFirstUser(t *testing.T) {
102102
req := codersdk.CreateFirstUserRequest{
103103
Email: "testuser@coder.com",
104104
Username: "testuser",
105-
Name: "Test User",
105+
FullName: "Test User",
106106
Password: "SomeSecurePassword!",
107107
Trial: true,
108108
}

codersdk/users.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ type LicensorTrialRequest struct {
9090
type CreateFirstUserRequest struct {
9191
Email string `json:"email" validate:"required,email"`
9292
Username string `json:"username" validate:"required,username"`
93-
Name string `json:"name" validate:"user_real_name"`
93+
FullName string `json:"name" validate:"user_real_name"`
9494
Password string `json:"password" validate:"required"`
9595
Trial bool `json:"trial"`
9696
TrialInfo CreateFirstUserTrialInfo `json:"trial_info"`

docs/cli/login.md

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/src/pages/SetupPage/SetupPageView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import { countries } from "./countries";
2323
export const Language = {
2424
emailLabel: "Email",
2525
passwordLabel: "Password",
26-
nameLabel: "Name",
26+
fullNameLabel: "Full Name",
2727
nameHelperText: "Optional human-readable name",
2828
usernameLabel: "Username",
2929
emailInvalid: "Please enter a valid email address.",
@@ -175,7 +175,7 @@ export const SetupPageView: FC<SetupPageViewProps> = ({
175175
}}
176176
autoComplete="name"
177177
fullWidth
178-
label={Language.nameLabel}
178+
label={Language.fullNameLabel}
179179
helperText={Language.nameHelperText}
180180
/>
181181
<label

0 commit comments

Comments
 (0)