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

Commitf9eca5a

Browse files
committed
feat: add additional fields to first time setup trial flow
1 parentf9f94b5 commitf9eca5a

File tree

21 files changed

+1336
-33
lines changed

21 files changed

+1336
-33
lines changed

‎.gitattributes‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ provisionersdk/proto/*.go linguist-generated=true
1212
*.tfstate.dotlinguist-generated=true
1313
*.tfplan.dotlinguist-generated=true
1414
site/src/api/typesGenerated.tslinguist-generated=true
15+
site/src/pages/SetupPage/countries.tsxlinguist-generated=true

‎.github/workflows/typos.toml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ darcula = "darcula"
1414
Hashi ="Hashi"
1515
trialer ="trialer"
1616
encrypter ="encrypter"
17-
hel ="hel"# as in helsinki
17+
hel ="hel"# as in helsinki
1818

1919
[files]
2020
extend-exclude = [
@@ -31,4 +31,5 @@ extend-exclude = [
3131
"**/*.test.tsx",
3232
"**/pnpm-lock.yaml",
3333
"tailnet/testdata/**",
34+
"site/src/pages/SetupPage/countries.tsx",
3435
]

‎coderd/apidoc/docs.go‎

Lines changed: 29 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎coderd/apidoc/swagger.json‎

Lines changed: 29 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎coderd/coderd.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ type Options struct {
123123
TracerProvider trace.TracerProvider
124124
ExternalAuthConfigs []*externalauth.Config
125125
RealIPConfig*httpmw.RealIPConfig
126-
TrialGeneratorfunc(ctx context.Context,emailstring)error
126+
TrialGeneratorfunc(ctx context.Context,body codersdk.LicensorTrialRequest)error
127127
// TLSCertificates is used to mesh DERP servers securely.
128128
TLSCertificates []tls.Certificate
129129
TailnetCoordinator tailnet.Coordinator

‎coderd/coderdtest/coderdtest.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ type Options struct {
107107
Auditor audit.Auditor
108108
TLSCertificates []tls.Certificate
109109
ExternalAuthConfigs []*externalauth.Config
110-
TrialGeneratorfunc(context.Context,string)error
110+
TrialGeneratorfunc(ctxcontext.Context,body codersdk.LicensorTrialRequest)error
111111
TemplateScheduleStore schedule.TemplateScheduleStore
112112
Coordinator tailnet.Coordinator
113113

‎coderd/externalauth/externalauth.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ func (c *DeviceAuth) AuthorizeDevice(ctx context.Context) (*codersdk.ExternalAut
325325
// return a better error.
326326
switchresp.StatusCode {
327327
casehttp.StatusTooManyRequests:
328-
returnnil,fmt.Errorf("rate limit hit, unable to authorize device. please try again later")
328+
returnnil,xerrors.New("rate limit hit, unable to authorize device. please try again later")
329329
default:
330330
returnnil,err
331331
}

‎coderd/httpapi/websocket.go‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ import (
44
"context"
55
"time"
66

7-
"cdr.dev/slog"
87
"nhooyr.io/websocket"
8+
9+
"cdr.dev/slog"
910
)
1011

1112
// Heartbeat loops to ping a WebSocket to keep it alive.

‎coderd/promoauth/github.go‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
package promoauth
22

33
import (
4-
"fmt"
54
"net/http"
65
"strconv"
76
"time"
7+
8+
"golang.org/x/xerrors"
89
)
910

1011
typerateLimitsstruct {
@@ -81,7 +82,7 @@ func (p *headerParser) string(key string) string {
8182

8283
v:=p.header.Get(key)
8384
ifv=="" {
84-
p.errors[key]=fmt.Errorf("missing header %q",key)
85+
p.errors[key]=xerrors.Errorf("missing header %q",key)
8586
}
8687
returnv
8788
}

‎coderd/users.go‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,16 @@ func (api *API) postFirstUser(rw http.ResponseWriter, r *http.Request) {
152152
}
153153

154154
ifcreateUser.Trial&&api.TrialGenerator!=nil {
155-
err=api.TrialGenerator(ctx,createUser.Email)
155+
err=api.TrialGenerator(ctx, codersdk.LicensorTrialRequest{
156+
Email:createUser.Email,
157+
FirstName:createUser.TrialInfo.FirstName,
158+
LastName:createUser.TrialInfo.LastName,
159+
PhoneNumber:createUser.TrialInfo.PhoneNumber,
160+
JobTitle:createUser.TrialInfo.JobTitle,
161+
CompanyName:createUser.TrialInfo.CompanyName,
162+
Country:createUser.TrialInfo.CompanyName,
163+
Developers:createUser.TrialInfo.Developers,
164+
})
156165
iferr!=nil {
157166
httpapi.Write(ctx,rw,http.StatusInternalServerError, codersdk.Response{
158167
Message:"Failed to generate trial",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp