Skip to content

Commit

Permalink
chore: add missing text message fields (#4066)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas-jonas authored Aug 30, 2024
1 parent f949173 commit dbe9d10
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmd/clidoc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ func init() {
"NewInfoLoginPassword": text.NewInfoLoginPassword(),
"NewErrorValidationAccountNotFound": text.NewErrorValidationAccountNotFound(),
"NewInfoSelfServiceLoginAAL2CodeAddress": text.NewInfoSelfServiceLoginAAL2CodeAddress("{channel}", "{address}"),
"NewErrorCaptchaFailed": text.NewErrorCaptchaFailed(),
"NewCaptchaContainerMessage": text.NewCaptchaContainerMessage(),
}
}

Expand Down
2 changes: 2 additions & 0 deletions text/id.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ const (
InfoNodeLabelRegistrationCode // 1070012
InfoNodeLabelLoginCode // 1070013
InfoNodeLabelLoginAndLinkCredential // 1070014
InfoNodeLabelCaptcha // 1070015
)

const (
Expand Down Expand Up @@ -151,6 +152,7 @@ const (
ErrorValidationNoCodeUser
ErrorValidationTraitsMismatch
ErrorValidationAccountNotFound
ErrorValidationCaptchaError
)

const (
Expand Down
3 changes: 3 additions & 0 deletions text/id_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,7 @@ func TestIDs(t *testing.T) {
assert.Equal(t, 1080001, int(InfoSelfServiceVerificationEmailSent))
assert.Equal(t, 1080002, int(InfoSelfServiceVerificationSuccessful))
assert.Equal(t, 1080003, int(InfoSelfServiceVerificationEmailWithCodeSent))

assert.Equal(t, 1070015, int(InfoNodeLabelCaptcha))
assert.Equal(t, 4000038, int(ErrorValidationCaptchaError))
}
8 changes: 8 additions & 0 deletions text/message_system.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,11 @@ func NewErrorSystemGeneric(reason string) *Message {
}),
}
}

func NewCaptchaContainerMessage() *Message {
return &Message{
ID: InfoNodeLabelCaptcha,
Text: "Please complete the captcha challenge to continue.",
Type: Info,
}
}
8 changes: 8 additions & 0 deletions text/message_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -424,3 +424,11 @@ func NewErrorValidationTraitsMismatch() *Message {
Type: Error,
}
}

func NewErrorCaptchaFailed() *Message {
return &Message{
ID: ErrorValidationCaptchaError,
Text: "Captcha verification failed, please try again.",
Type: Error,
}
}

0 comments on commit dbe9d10

Please sign in to comment.