2021-06-10 13:49:10 +02:00
|
|
|
package iam
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
|
|
|
"golang.org/x/text/language"
|
|
|
|
|
|
|
|
"github.com/caos/zitadel/internal/eventstore"
|
|
|
|
"github.com/caos/zitadel/internal/eventstore/repository"
|
|
|
|
"github.com/caos/zitadel/internal/repository/policy"
|
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
feat(console): message and login texts, privacy policy (#2016)
* message texts wrapper components
* message-text sub, i18n, grid
* fix routing
* pack
* pack
* update material
* audit
* fix mgmt service for labelplcy
* map conv
* edit text from map
* request map
* fetch data, mgmt admin service
* warn box, i18n
* resetbtn
* login texts
* login text requests
* reset, default, i18n
* disabled, features, message text setter, service
* locale switcher
* policy grid
* password reset, domain claimed i18n
* lint files
* fix admin service, i18n, lang setter
* fix scss duplicate
* privacy policy, cleanup grid, fix message, login texts (#2031)
* policy grid everywhere 🦒
* cleanup home
* log login text request
* patch all data
* refresh toggle
* fix: add dialog for unsaved changes (#2057)
* logintexts dialog
* check for dialog on pairwise operation
* fix: patch value to local state after save
* fix: i18n and custom login texts (#2060)
* fix: i18n and custom login texts
* fix: tos and privacy texts
* fix frontend
* fix: tos and privacy texts and tests
* fix: i18n, tos and privacy texts and tests
* fix frontend maps
* i18n
* add ResetCustomLoginTextToDefault in admin api and fix template remove in handlers
* resetlogintexttodefault
Co-authored-by: Livio Amstutz <livio.a@gmail.com>
2021-07-26 12:44:45 +02:00
|
|
|
CustomTextSetEventType = iamEventTypePrefix + policy.CustomTextSetEventType
|
|
|
|
CustomTextRemovedEventType = iamEventTypePrefix + policy.CustomTextRemovedEventType
|
|
|
|
CustomTextTemplateRemovedEventType = iamEventTypePrefix + policy.CustomTextTemplateRemovedEventType
|
2021-06-10 13:49:10 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
type CustomTextSetEvent struct {
|
|
|
|
policy.CustomTextSetEvent
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewCustomTextSetEvent(
|
|
|
|
ctx context.Context,
|
|
|
|
aggregate *eventstore.Aggregate,
|
|
|
|
template,
|
|
|
|
key,
|
|
|
|
text string,
|
|
|
|
language language.Tag,
|
|
|
|
) *CustomTextSetEvent {
|
|
|
|
return &CustomTextSetEvent{
|
|
|
|
CustomTextSetEvent: *policy.NewCustomTextSetEvent(
|
|
|
|
eventstore.NewBaseEventForPush(ctx, aggregate, CustomTextSetEventType),
|
|
|
|
template,
|
|
|
|
key,
|
|
|
|
text,
|
|
|
|
language),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-03 09:19:07 +01:00
|
|
|
func CustomTextSetEventMapper(event *repository.Event) (eventstore.Event, error) {
|
2021-06-10 13:49:10 +02:00
|
|
|
e, err := policy.CustomTextSetEventMapper(event)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return &CustomTextSetEvent{CustomTextSetEvent: *e.(*policy.CustomTextSetEvent)}, nil
|
|
|
|
}
|
2021-07-05 15:10:49 +02:00
|
|
|
|
|
|
|
type CustomTextRemovedEvent struct {
|
|
|
|
policy.CustomTextRemovedEvent
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewCustomTextRemovedEvent(
|
|
|
|
ctx context.Context,
|
|
|
|
aggregate *eventstore.Aggregate,
|
|
|
|
template,
|
|
|
|
key string,
|
|
|
|
language language.Tag,
|
|
|
|
) *CustomTextRemovedEvent {
|
|
|
|
return &CustomTextRemovedEvent{
|
|
|
|
CustomTextRemovedEvent: *policy.NewCustomTextRemovedEvent(
|
|
|
|
eventstore.NewBaseEventForPush(ctx, aggregate, CustomTextRemovedEventType),
|
|
|
|
template,
|
|
|
|
key,
|
|
|
|
language),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-03 09:19:07 +01:00
|
|
|
func CustomTextRemovedEventMapper(event *repository.Event) (eventstore.Event, error) {
|
2021-07-05 15:10:49 +02:00
|
|
|
e, err := policy.CustomTextRemovedEventMapper(event)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return &CustomTextRemovedEvent{CustomTextRemovedEvent: *e.(*policy.CustomTextRemovedEvent)}, nil
|
|
|
|
}
|
feat(console): message and login texts, privacy policy (#2016)
* message texts wrapper components
* message-text sub, i18n, grid
* fix routing
* pack
* pack
* update material
* audit
* fix mgmt service for labelplcy
* map conv
* edit text from map
* request map
* fetch data, mgmt admin service
* warn box, i18n
* resetbtn
* login texts
* login text requests
* reset, default, i18n
* disabled, features, message text setter, service
* locale switcher
* policy grid
* password reset, domain claimed i18n
* lint files
* fix admin service, i18n, lang setter
* fix scss duplicate
* privacy policy, cleanup grid, fix message, login texts (#2031)
* policy grid everywhere 🦒
* cleanup home
* log login text request
* patch all data
* refresh toggle
* fix: add dialog for unsaved changes (#2057)
* logintexts dialog
* check for dialog on pairwise operation
* fix: patch value to local state after save
* fix: i18n and custom login texts (#2060)
* fix: i18n and custom login texts
* fix: tos and privacy texts
* fix frontend
* fix: tos and privacy texts and tests
* fix: i18n, tos and privacy texts and tests
* fix frontend maps
* i18n
* add ResetCustomLoginTextToDefault in admin api and fix template remove in handlers
* resetlogintexttodefault
Co-authored-by: Livio Amstutz <livio.a@gmail.com>
2021-07-26 12:44:45 +02:00
|
|
|
|
|
|
|
type CustomTextTemplateRemovedEvent struct {
|
|
|
|
policy.CustomTextTemplateRemovedEvent
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewCustomTextTemplateRemovedEvent(
|
|
|
|
ctx context.Context,
|
|
|
|
aggregate *eventstore.Aggregate,
|
|
|
|
template string,
|
|
|
|
language language.Tag,
|
|
|
|
) *CustomTextTemplateRemovedEvent {
|
|
|
|
return &CustomTextTemplateRemovedEvent{
|
|
|
|
CustomTextTemplateRemovedEvent: *policy.NewCustomTextTemplateRemovedEvent(
|
|
|
|
eventstore.NewBaseEventForPush(ctx, aggregate, CustomTextTemplateRemovedEventType),
|
|
|
|
template,
|
|
|
|
language,
|
|
|
|
),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-03 09:19:07 +01:00
|
|
|
func CustomTextTemplateRemovedEventMapper(event *repository.Event) (eventstore.Event, error) {
|
feat(console): message and login texts, privacy policy (#2016)
* message texts wrapper components
* message-text sub, i18n, grid
* fix routing
* pack
* pack
* update material
* audit
* fix mgmt service for labelplcy
* map conv
* edit text from map
* request map
* fetch data, mgmt admin service
* warn box, i18n
* resetbtn
* login texts
* login text requests
* reset, default, i18n
* disabled, features, message text setter, service
* locale switcher
* policy grid
* password reset, domain claimed i18n
* lint files
* fix admin service, i18n, lang setter
* fix scss duplicate
* privacy policy, cleanup grid, fix message, login texts (#2031)
* policy grid everywhere 🦒
* cleanup home
* log login text request
* patch all data
* refresh toggle
* fix: add dialog for unsaved changes (#2057)
* logintexts dialog
* check for dialog on pairwise operation
* fix: patch value to local state after save
* fix: i18n and custom login texts (#2060)
* fix: i18n and custom login texts
* fix: tos and privacy texts
* fix frontend
* fix: tos and privacy texts and tests
* fix: i18n, tos and privacy texts and tests
* fix frontend maps
* i18n
* add ResetCustomLoginTextToDefault in admin api and fix template remove in handlers
* resetlogintexttodefault
Co-authored-by: Livio Amstutz <livio.a@gmail.com>
2021-07-26 12:44:45 +02:00
|
|
|
e, err := policy.CustomTextTemplateRemovedEventMapper(event)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return &CustomTextTemplateRemovedEvent{CustomTextTemplateRemovedEvent: *e.(*policy.CustomTextTemplateRemovedEvent)}, nil
|
|
|
|
}
|