mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 19:17:32 +00:00
feat(cnsl): docs link can be customized and custom button is available (#7840)
* feat: customize doc link and additional custom link * feat: add e2e tests * fix: update docs * fix: add @peintnermax changes about cache * fix: golangci-lint complains preparation.PrepareCommands --------- Co-authored-by: Max Peintner <max@caos.ch>
This commit is contained in:
@@ -24,6 +24,7 @@ func NewPrivacyPolicyAddedEvent(
|
||||
privacyLink,
|
||||
helpLink string,
|
||||
supportEmail domain.EmailAddress,
|
||||
docsLink, customLink, customLinkText string,
|
||||
) *PrivacyPolicyAddedEvent {
|
||||
return &PrivacyPolicyAddedEvent{
|
||||
PrivacyPolicyAddedEvent: *policy.NewPrivacyPolicyAddedEvent(
|
||||
@@ -34,7 +35,10 @@ func NewPrivacyPolicyAddedEvent(
|
||||
tosLink,
|
||||
privacyLink,
|
||||
helpLink,
|
||||
supportEmail),
|
||||
supportEmail,
|
||||
docsLink,
|
||||
customLink,
|
||||
customLinkText),
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -25,6 +25,7 @@ func NewPrivacyPolicyAddedEvent(
|
||||
privacyLink,
|
||||
helpLink string,
|
||||
supportEmail domain.EmailAddress,
|
||||
docsLink, customLink, customLinkText string,
|
||||
) *PrivacyPolicyAddedEvent {
|
||||
return &PrivacyPolicyAddedEvent{
|
||||
PrivacyPolicyAddedEvent: *policy.NewPrivacyPolicyAddedEvent(
|
||||
@@ -35,7 +36,10 @@ func NewPrivacyPolicyAddedEvent(
|
||||
tosLink,
|
||||
privacyLink,
|
||||
helpLink,
|
||||
supportEmail),
|
||||
supportEmail,
|
||||
docsLink,
|
||||
customLink,
|
||||
customLinkText),
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -15,10 +15,13 @@ const (
|
||||
type PrivacyPolicyAddedEvent struct {
|
||||
eventstore.BaseEvent `json:"-"`
|
||||
|
||||
TOSLink string `json:"tosLink,omitempty"`
|
||||
PrivacyLink string `json:"privacyLink,omitempty"`
|
||||
HelpLink string `json:"helpLink,omitempty"`
|
||||
SupportEmail domain.EmailAddress `json:"supportEmail,omitempty"`
|
||||
TOSLink string `json:"tosLink,omitempty"`
|
||||
PrivacyLink string `json:"privacyLink,omitempty"`
|
||||
HelpLink string `json:"helpLink,omitempty"`
|
||||
SupportEmail domain.EmailAddress `json:"supportEmail,omitempty"`
|
||||
DocsLink string `json:"docsLink,omitempty"`
|
||||
CustomLink string `json:"customLink,omitempty"`
|
||||
CustomLinkText string `json:"customLinkText,omitempty"`
|
||||
}
|
||||
|
||||
func (e *PrivacyPolicyAddedEvent) Payload() interface{} {
|
||||
@@ -35,13 +38,17 @@ func NewPrivacyPolicyAddedEvent(
|
||||
privacyLink,
|
||||
helpLink string,
|
||||
supportEmail domain.EmailAddress,
|
||||
docsLink, customLink, customLinkText string,
|
||||
) *PrivacyPolicyAddedEvent {
|
||||
return &PrivacyPolicyAddedEvent{
|
||||
BaseEvent: *base,
|
||||
TOSLink: tosLink,
|
||||
PrivacyLink: privacyLink,
|
||||
HelpLink: helpLink,
|
||||
SupportEmail: supportEmail,
|
||||
BaseEvent: *base,
|
||||
TOSLink: tosLink,
|
||||
PrivacyLink: privacyLink,
|
||||
HelpLink: helpLink,
|
||||
SupportEmail: supportEmail,
|
||||
DocsLink: docsLink,
|
||||
CustomLink: customLink,
|
||||
CustomLinkText: customLinkText,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,10 +67,13 @@ func PrivacyPolicyAddedEventMapper(event eventstore.Event) (eventstore.Event, er
|
||||
type PrivacyPolicyChangedEvent struct {
|
||||
eventstore.BaseEvent `json:"-"`
|
||||
|
||||
TOSLink *string `json:"tosLink,omitempty"`
|
||||
PrivacyLink *string `json:"privacyLink,omitempty"`
|
||||
HelpLink *string `json:"helpLink,omitempty"`
|
||||
SupportEmail *domain.EmailAddress `json:"supportEmail,omitempty"`
|
||||
TOSLink *string `json:"tosLink,omitempty"`
|
||||
PrivacyLink *string `json:"privacyLink,omitempty"`
|
||||
HelpLink *string `json:"helpLink,omitempty"`
|
||||
SupportEmail *domain.EmailAddress `json:"supportEmail,omitempty"`
|
||||
DocsLink *string `json:"docsLink,omitempty"`
|
||||
CustomLink *string `json:"customLink,omitempty"`
|
||||
CustomLinkText *string `json:"customLinkText,omitempty"`
|
||||
}
|
||||
|
||||
func (e *PrivacyPolicyChangedEvent) Payload() interface{} {
|
||||
@@ -116,6 +126,24 @@ func ChangeSupportEmail(supportEmail domain.EmailAddress) func(*PrivacyPolicyCha
|
||||
}
|
||||
}
|
||||
|
||||
func ChangeDocsLink(docsLink string) func(*PrivacyPolicyChangedEvent) {
|
||||
return func(e *PrivacyPolicyChangedEvent) {
|
||||
e.DocsLink = &docsLink
|
||||
}
|
||||
}
|
||||
|
||||
func ChangeCustomLink(customLink string) func(*PrivacyPolicyChangedEvent) {
|
||||
return func(e *PrivacyPolicyChangedEvent) {
|
||||
e.CustomLink = &customLink
|
||||
}
|
||||
}
|
||||
|
||||
func ChangeCustomLinkText(customLinkText string) func(*PrivacyPolicyChangedEvent) {
|
||||
return func(e *PrivacyPolicyChangedEvent) {
|
||||
e.CustomLinkText = &customLinkText
|
||||
}
|
||||
}
|
||||
|
||||
func PrivacyPolicyChangedEventMapper(event eventstore.Event) (eventstore.Event, error) {
|
||||
e := &PrivacyPolicyChangedEvent{
|
||||
BaseEvent: *eventstore.BaseEventFromRepo(event),
|
||||
|
Reference in New Issue
Block a user