Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit888c43a

Browse files
committed
feat(setup): organization is not longer needed
1 parent4b7c710 commit888c43a

File tree

9 files changed

+21
-47
lines changed

9 files changed

+21
-47
lines changed

‎cli/login.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,9 @@ func login() *cobra.Command {
163163
}
164164

165165
_,err=client.CreateFirstUser(cmd.Context(), codersdk.CreateFirstUserRequest{
166-
Email:email,
167-
Username:username,
168-
OrganizationName:username,
169-
Password:password,
166+
Email:email,
167+
Username:username,
168+
Password:password,
170169
})
171170
iferr!=nil {
172171
returnxerrors.Errorf("create initial user: %w",err)

‎cli/resetpassword_test.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,9 @@ func TestResetPassword(t *testing.T) {
6060
client:=codersdk.New(accessURL)
6161

6262
_,err=client.CreateFirstUser(ctx, codersdk.CreateFirstUserRequest{
63-
Email:email,
64-
Username:username,
65-
Password:oldPassword,
66-
OrganizationName:"example",
63+
Email:email,
64+
Username:username,
65+
Password:oldPassword,
6766
})
6867
require.NoError(t,err)
6968

‎cli/server_test.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,9 @@ func TestServer(t *testing.T) {
7171
client:=codersdk.New(accessURL)
7272

7373
_,err=client.CreateFirstUser(ctx, codersdk.CreateFirstUserRequest{
74-
Email:"some@one.com",
75-
Username:"example",
76-
Password:"password",
77-
OrganizationName:"example",
74+
Email:"some@one.com",
75+
Username:"example",
76+
Password:"password",
7877
})
7978
require.NoError(t,err)
8079
cancelFunc()

‎coderd/coderdtest/coderdtest.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -346,10 +346,9 @@ func NewProvisionerDaemon(t *testing.T, coderAPI *coderd.API) io.Closer {
346346
}
347347

348348
varFirstUserParams= codersdk.CreateFirstUserRequest{
349-
Email:"testuser@coder.com",
350-
Username:"testuser",
351-
Password:"testpass",
352-
OrganizationName:"testorg",
349+
Email:"testuser@coder.com",
350+
Username:"testuser",
351+
Password:"testpass",
353352
}
354353

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

‎coderd/users_test.go

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,9 @@ func TestFirstUser(t *testing.T) {
4949
defercancel()
5050

5151
_,err:=client.CreateFirstUser(ctx, codersdk.CreateFirstUserRequest{
52-
Email:"some@email.com",
53-
Username:"exampleuser",
54-
Password:"password",
55-
OrganizationName:"someorg",
52+
Email:"some@email.com",
53+
Username:"exampleuser",
54+
Password:"password",
5655
})
5756
varapiErr*codersdk.Error
5857
require.ErrorAs(t,err,&apiErr)
@@ -249,10 +248,9 @@ func TestPostLogin(t *testing.T) {
249248
defercancel()
250249

251250
req:= codersdk.CreateFirstUserRequest{
252-
Email:"testuser@coder.com",
253-
Username:"testuser",
254-
Password:"testpass",
255-
OrganizationName:"testorg",
251+
Email:"testuser@coder.com",
252+
Username:"testuser",
253+
Password:"testpass",
256254
}
257255
_,err:=client.CreateFirstUser(ctx,req)
258256
require.NoError(t,err)

‎codersdk/users.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,9 @@ type UserCountResponse struct {
6262
}
6363

6464
typeCreateFirstUserRequeststruct {
65-
Emailstring`json:"email" validate:"required,email"`
66-
Usernamestring`json:"username" validate:"required,username"`
67-
Passwordstring`json:"password" validate:"required"`
68-
OrganizationNamestring`json:"organization" validate:"required,username"`
65+
Emailstring`json:"email" validate:"required,email"`
66+
Usernamestring`json:"username" validate:"required,username"`
67+
Passwordstring`json:"password" validate:"required"`
6968
}
7069

7170
// CreateFirstUserResponse contains IDs for newly created user info.

‎site/src/api/typesGenerated.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ export interface CreateFirstUserRequest {
143143
readonlyemail:string
144144
readonlyusername:string
145145
readonlypassword:string
146-
readonlyorganization:string
147146
}
148147

149148
// From codersdk/users.go

‎site/src/pages/SetupPage/SetupPage.test.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,14 @@ const fillForm = async ({
1212
username="someuser",
1313
email="someone@coder.com",
1414
password="password",
15-
organization="Coder",
1615
}:{
1716
username?:string
1817
email?:string
1918
password?:string
20-
organization?:string
2119
}={})=>{
2220
constusernameField=screen.getByLabelText(PageViewLanguage.usernameLabel)
2321
constemailField=screen.getByLabelText(PageViewLanguage.emailLabel)
2422
constpasswordField=screen.getByLabelText(PageViewLanguage.passwordLabel)
25-
constorganizationField=screen.getByLabelText(
26-
PageViewLanguage.organizationLabel,
27-
)
28-
awaituserEvent.type(organizationField,organization)
2923
awaituserEvent.type(usernameField,username)
3024
awaituserEvent.type(emailField,email)
3125
awaituserEvent.type(passwordField,password)

‎site/src/pages/SetupPage/SetupPageView.tsx

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@ export const Language = {
1313
emailLabel:"Email",
1414
passwordLabel:"Password",
1515
usernameLabel:"Username",
16-
organizationLabel:"Organization name",
1716
emailInvalid:"Please enter a valid email address.",
1817
emailRequired:"Please enter an email address.",
1918
passwordRequired:"Please enter a password.",
20-
organizationRequired:"Please enter an organization name.",
2119
create:"Setup account",
2220
welcomeMessage:(
2321
<>
@@ -32,7 +30,6 @@ const validationSchema = Yup.object({
3230
.email(Language.emailInvalid)
3331
.required(Language.emailRequired),
3432
password:Yup.string().required(Language.passwordRequired),
35-
organization:Yup.string().required(Language.organizationRequired),
3633
username:nameValidator(Language.usernameLabel),
3734
})
3835

@@ -55,7 +52,6 @@ export const SetupPageView: React.FC<SetupPageViewProps> = ({
5552
email:"",
5653
password:"",
5754
username:"",
58-
organization:"",
5955
},
6056
validationSchema,
6157
onSubmit,
@@ -70,14 +66,6 @@ export const SetupPageView: React.FC<SetupPageViewProps> = ({
7066
<Welcomemessage={Language.welcomeMessage}/>
7167
<formonSubmit={form.handleSubmit}>
7268
<Stack>
73-
<TextField
74-
{...getFieldHelpers("organization")}
75-
onChange={onChangeTrimmed(form)}
76-
autoFocus
77-
fullWidth
78-
label={Language.organizationLabel}
79-
variant="outlined"
80-
/>
8169
<TextField
8270
{...getFieldHelpers("username")}
8371
onChange={onChangeTrimmed(form)}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp