From dbe9d10909bafaf5b00583c0453b6b96ac8c24a6 Mon Sep 17 00:00:00 2001 From: Jonas Hungershausen Date: Fri, 30 Aug 2024 10:32:19 +0000 Subject: [PATCH] chore: add missing text message fields (#4066) --- cmd/clidoc/main.go | 2 ++ text/id.go | 2 ++ text/id_test.go | 3 +++ text/message_system.go | 8 ++++++++ text/message_validation.go | 8 ++++++++ 5 files changed, 23 insertions(+) diff --git a/cmd/clidoc/main.go b/cmd/clidoc/main.go index 6cd127cd8a5a..834373d52e6d 100644 --- a/cmd/clidoc/main.go +++ b/cmd/clidoc/main.go @@ -179,6 +179,8 @@ func init() { "NewInfoLoginPassword": text.NewInfoLoginPassword(), "NewErrorValidationAccountNotFound": text.NewErrorValidationAccountNotFound(), "NewInfoSelfServiceLoginAAL2CodeAddress": text.NewInfoSelfServiceLoginAAL2CodeAddress("{channel}", "{address}"), + "NewErrorCaptchaFailed": text.NewErrorCaptchaFailed(), + "NewCaptchaContainerMessage": text.NewCaptchaContainerMessage(), } } diff --git a/text/id.go b/text/id.go index fafe8e450344..3d9028af8ed0 100644 --- a/text/id.go +++ b/text/id.go @@ -103,6 +103,7 @@ const ( InfoNodeLabelRegistrationCode // 1070012 InfoNodeLabelLoginCode // 1070013 InfoNodeLabelLoginAndLinkCredential // 1070014 + InfoNodeLabelCaptcha // 1070015 ) const ( @@ -151,6 +152,7 @@ const ( ErrorValidationNoCodeUser ErrorValidationTraitsMismatch ErrorValidationAccountNotFound + ErrorValidationCaptchaError ) const ( diff --git a/text/id_test.go b/text/id_test.go index a0190a2c0d8e..2efe742c667e 100644 --- a/text/id_test.go +++ b/text/id_test.go @@ -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)) } diff --git a/text/message_system.go b/text/message_system.go index d94ce73f9872..07f30374495a 100644 --- a/text/message_system.go +++ b/text/message_system.go @@ -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, + } +} diff --git a/text/message_validation.go b/text/message_validation.go index 2fd1e4c2d28d..b8e689deee03 100644 --- a/text/message_validation.go +++ b/text/message_validation.go @@ -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, + } +}