Rebuild channel index (#26080)
* WIP * Added rebuild channels index functionality * Added rough logic to send message to all sysadmins * WIP * WIP * WIP * Cleanup * i18n fix * reading through all pages of system admins * Fixed webapp style * i18n fix * Added help text * i18n fix * i18n update * Updated system console button action * Updated snapshots * some cleanup * Updated snapshot * Update server/channels/app/server.go Co-authored-by: Daniel Espino García <larkox@gmail.com> * fixed typo * Refactoring to improve readibility * moved index check to API later during config update * Added some docs * Updated get system bot --------- Co-authored-by: Daniel Espino García <larkox@gmail.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
ccc00b9077
Коммит
774df37464
@@ -16,16 +16,6 @@ import (
|
||||
"github.com/mattermost/mattermost/server/v8/channels/store"
|
||||
)
|
||||
|
||||
func (a *App) getSysAdminsEmailRecipients() ([]*model.User, *model.AppError) {
|
||||
userOptions := &model.UserGetOptions{
|
||||
Page: 0,
|
||||
PerPage: 100,
|
||||
Role: model.SystemAdminRoleId,
|
||||
Inactive: false,
|
||||
}
|
||||
return a.GetUsersFromProfiles(userOptions)
|
||||
}
|
||||
|
||||
func getCurrentPlanName(a *App) (string, *model.AppError) {
|
||||
subscription, err := a.Cloud().GetSubscription("")
|
||||
if err != nil {
|
||||
@@ -48,7 +38,7 @@ func getCurrentPlanName(a *App) (string, *model.AppError) {
|
||||
}
|
||||
|
||||
func (a *App) SendPaymentFailedEmail(failedPayment *model.FailedPayment) *model.AppError {
|
||||
sysAdmins, err := a.getSysAdminsEmailRecipients()
|
||||
sysAdmins, err := a.getAllSystemAdmins()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -77,7 +67,7 @@ func getCurrentProduct(subscriptionProductID string, products []*model.Product)
|
||||
}
|
||||
|
||||
func (a *App) SendDelinquencyEmail(emailToSend model.DelinquencyEmail) *model.AppError {
|
||||
sysAdmins, aErr := a.getSysAdminsEmailRecipients()
|
||||
sysAdmins, aErr := a.getAllSystemAdmins()
|
||||
if aErr != nil {
|
||||
return aErr
|
||||
}
|
||||
@@ -161,7 +151,7 @@ func getNextBillingDateString() string {
|
||||
}
|
||||
|
||||
func (a *App) SendUpgradeConfirmationEmail(isYearly bool) *model.AppError {
|
||||
sysAdmins, e := a.getSysAdminsEmailRecipients()
|
||||
sysAdmins, e := a.getAllSystemAdmins()
|
||||
if e != nil {
|
||||
return e
|
||||
}
|
||||
@@ -220,7 +210,7 @@ func (a *App) SendUpgradeConfirmationEmail(isYearly bool) *model.AppError {
|
||||
|
||||
// SendNoCardPaymentFailedEmail
|
||||
func (a *App) SendNoCardPaymentFailedEmail() *model.AppError {
|
||||
sysAdmins, err := a.getSysAdminsEmailRecipients()
|
||||
sysAdmins, err := a.getAllSystemAdmins()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -323,7 +313,7 @@ func (a *App) DoSubscriptionRenewalCheck() {
|
||||
return
|
||||
}
|
||||
|
||||
sysAdmins, aErr := a.getSysAdminsEmailRecipients()
|
||||
sysAdmins, aErr := a.getAllSystemAdmins()
|
||||
if aErr != nil {
|
||||
a.Log().Error("Error getting sys admins", mlog.Err(aErr))
|
||||
return
|
||||
|
||||
Ссылка в новой задаче
Block a user