mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 00: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:
@@ -9,11 +9,14 @@ import (
|
||||
type PrivacyPolicyWriteModel struct {
|
||||
eventstore.WriteModel
|
||||
|
||||
TOSLink string
|
||||
PrivacyLink string
|
||||
HelpLink string
|
||||
SupportEmail domain.EmailAddress
|
||||
State domain.PolicyState
|
||||
TOSLink string
|
||||
PrivacyLink string
|
||||
HelpLink string
|
||||
SupportEmail domain.EmailAddress
|
||||
State domain.PolicyState
|
||||
DocsLink string
|
||||
CustomLink string
|
||||
CustomLinkText string
|
||||
}
|
||||
|
||||
func (wm *PrivacyPolicyWriteModel) Reduce() error {
|
||||
@@ -25,6 +28,9 @@ func (wm *PrivacyPolicyWriteModel) Reduce() error {
|
||||
wm.HelpLink = e.HelpLink
|
||||
wm.SupportEmail = e.SupportEmail
|
||||
wm.State = domain.PolicyStateActive
|
||||
wm.DocsLink = e.DocsLink
|
||||
wm.CustomLink = e.CustomLink
|
||||
wm.CustomLinkText = e.CustomLinkText
|
||||
case *policy.PrivacyPolicyChangedEvent:
|
||||
if e.PrivacyLink != nil {
|
||||
wm.PrivacyLink = *e.PrivacyLink
|
||||
@@ -38,6 +44,15 @@ func (wm *PrivacyPolicyWriteModel) Reduce() error {
|
||||
if e.SupportEmail != nil {
|
||||
wm.SupportEmail = *e.SupportEmail
|
||||
}
|
||||
if e.DocsLink != nil {
|
||||
wm.DocsLink = *e.DocsLink
|
||||
}
|
||||
if e.CustomLink != nil {
|
||||
wm.CustomLink = *e.CustomLink
|
||||
}
|
||||
if e.CustomLinkText != nil {
|
||||
wm.CustomLinkText = *e.CustomLinkText
|
||||
}
|
||||
case *policy.PrivacyPolicyRemovedEvent:
|
||||
wm.State = domain.PolicyStateRemoved
|
||||
}
|
||||
|
Reference in New Issue
Block a user