fix: Custom text split features (#2225)

* fix: separate tier of custom text (message and login)

* fix: add migration

* fix: build problems

* fix: tests

* Update internal/api/grpc/admin/features.go

Co-authored-by: Livio Amstutz <livio.a@gmail.com>

* Update internal/api/grpc/admin/features.go

Co-authored-by: Livio Amstutz <livio.a@gmail.com>

* fix: rename sql file

* fix: change sql files

* fix: console

* fix: console

Co-authored-by: Livio Amstutz <livio.a@gmail.com>
This commit is contained in:
Fabi
2021-08-18 12:58:57 +02:00
committed by GitHub
parent 0ab973b967
commit f4fa3ecef3
26 changed files with 339 additions and 60 deletions

View File

@@ -35,9 +35,10 @@ type FeaturesSetEvent struct {
LabelPolicyPrivateLabel *bool `json:"labelPolicyPrivateLabel,omitempty"`
LabelPolicyWatermark *bool `json:"labelPolicyWatermark,omitempty"`
CustomDomain *bool `json:"customDomain,omitempty"`
CustomText *bool `json:"customText,omitempty"`
PrivacyPolicy *bool `json:"privacyPolicy,omitempty"`
MetadataUser *bool `json:"metadataUser,omitempty"`
CustomTextMessage *bool `json:"customTextMessage,omitempty"`
CustomTextLogin *bool `json:"customTextLogin,omitempty"`
}
func (e *FeaturesSetEvent) Data() interface{} {
@@ -156,12 +157,6 @@ func ChangeCustomDomain(customDomain bool) func(event *FeaturesSetEvent) {
}
}
func ChangeCustomText(customText bool) func(event *FeaturesSetEvent) {
return func(e *FeaturesSetEvent) {
e.CustomText = &customText
}
}
func ChangePrivacyPolicy(privacyPolicy bool) func(event *FeaturesSetEvent) {
return func(e *FeaturesSetEvent) {
e.PrivacyPolicy = &privacyPolicy
@@ -173,6 +168,19 @@ func ChangeMetadataUser(metadataUser bool) func(event *FeaturesSetEvent) {
e.MetadataUser = &metadataUser
}
}
func ChangeCustomTextMessage(customTextMessage bool) func(event *FeaturesSetEvent) {
return func(e *FeaturesSetEvent) {
e.CustomTextMessage = &customTextMessage
}
}
func ChangeCustomTextLogin(customTextLogin bool) func(event *FeaturesSetEvent) {
return func(e *FeaturesSetEvent) {
e.CustomTextLogin = &customTextLogin
}
}
func FeaturesSetEventMapper(event *repository.Event) (eventstore.EventReader, error) {
e := &FeaturesSetEvent{
BaseEvent: *eventstore.BaseEventFromRepo(event),