Merge branch 'master' into mm-46549-gather-intent-cloud-monthly-subscription
Этот коммит содержится в:
@@ -8004,8 +8004,8 @@ func (c *Client4) ConfirmCustomerPayment(confirmRequest *ConfirmPaymentMethodReq
|
||||
return BuildResponse(r), nil
|
||||
}
|
||||
|
||||
func (c *Client4) RequestCloudTrial(email *StartCloudTrialRequest) (*Subscription, *Response, error) {
|
||||
payload, err := json.Marshal(email)
|
||||
func (c *Client4) RequestCloudTrial(cloudTrialRequest *StartCloudTrialRequest) (*Subscription, *Response, error) {
|
||||
payload, err := json.Marshal(cloudTrialRequest)
|
||||
if err != nil {
|
||||
return nil, nil, NewAppError("RequestCloudTrial", "api.marshal_error", nil, "", http.StatusInternalServerError).Wrap(err)
|
||||
}
|
||||
|
||||
@@ -2747,6 +2747,16 @@ func (s *CloudSettings) SetDefaults() {
|
||||
}
|
||||
}
|
||||
|
||||
type ProductSettings struct {
|
||||
EnablePublicSharedBoards *bool
|
||||
}
|
||||
|
||||
func (s *ProductSettings) SetDefaults() {
|
||||
if s.EnablePublicSharedBoards == nil {
|
||||
s.EnablePublicSharedBoards = NewBool(false)
|
||||
}
|
||||
}
|
||||
|
||||
type PluginState struct {
|
||||
Enable bool
|
||||
}
|
||||
@@ -3136,6 +3146,7 @@ type Config struct {
|
||||
DataRetentionSettings DataRetentionSettings
|
||||
MessageExportSettings MessageExportSettings
|
||||
JobSettings JobSettings
|
||||
ProductSettings ProductSettings
|
||||
PluginSettings PluginSettings
|
||||
DisplaySettings DisplaySettings
|
||||
GuestAccountsSettings GuestAccountsSettings
|
||||
@@ -3235,6 +3246,7 @@ func (o *Config) SetDefaults() {
|
||||
o.ThemeSettings.SetDefaults()
|
||||
o.ClusterSettings.SetDefaults()
|
||||
o.PluginSettings.SetDefaults(o.LogSettings)
|
||||
o.ProductSettings.SetDefaults()
|
||||
o.AnalyticsSettings.SetDefaults()
|
||||
o.ComplianceSettings.SetDefaults()
|
||||
o.LocalizationSettings.SetDefaults()
|
||||
|
||||
@@ -72,7 +72,12 @@ type FeatureFlags struct {
|
||||
|
||||
PlanUpgradeButtonText string
|
||||
|
||||
// A/B Test on posting a welcome message
|
||||
SendWelcomePost bool
|
||||
|
||||
PostPriority bool
|
||||
|
||||
PeopleProduct bool
|
||||
}
|
||||
|
||||
func (f *FeatureFlags) SetDefaults() {
|
||||
@@ -99,7 +104,9 @@ func (f *FeatureFlags) SetDefaults() {
|
||||
f.CallsEnabled = true
|
||||
f.BoardsProduct = false
|
||||
f.PlanUpgradeButtonText = "upgrade"
|
||||
f.SendWelcomePost = true
|
||||
f.PostPriority = false
|
||||
f.PeopleProduct = false
|
||||
}
|
||||
|
||||
func (f *FeatureFlags) Plugins() map[string]string {
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -260,6 +261,23 @@ func StartOfDayForTimeRange(timeRange string, location *time.Location) *time.Tim
|
||||
return &resultTime
|
||||
}
|
||||
|
||||
// GetStartOfDayForTimeRange gets the unix start time in milliseconds from the given time range.
|
||||
// Time range can be one of: "today", "7_day", or "28_day".
|
||||
func GetStartOfDayForTimeRange(timeRange string, location *time.Location) (*time.Time, *AppError) {
|
||||
now := time.Now().In(location)
|
||||
resultTime := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, location)
|
||||
switch timeRange {
|
||||
case TimeRangeToday:
|
||||
case TimeRange7Day:
|
||||
resultTime = resultTime.Add(time.Hour * time.Duration(-144))
|
||||
case TimeRange28Day:
|
||||
resultTime = resultTime.Add(time.Hour * time.Duration(-648))
|
||||
default:
|
||||
return nil, NewAppError("GetStartOfDayForTimeRange", "model.insights.get_start_of_day_for_time_range.time_range.app_error", nil, "", http.StatusBadRequest)
|
||||
}
|
||||
return &resultTime, nil
|
||||
}
|
||||
|
||||
// GetTopReactionListWithPagination adds a rank to each item in the given list of TopReaction and checks if there is
|
||||
// another page that can be fetched based on the given limit and offset. The given list of TopReaction is assumed to be
|
||||
// sorted by Count. Returns a TopReactionList.
|
||||
|
||||
@@ -38,4 +38,5 @@ const (
|
||||
MigrationKeyAddPlaybooksPermissions = "playbooks_permissions"
|
||||
MigrationKeyAddCustomUserGroupsPermissions = "custom_groups_permissions"
|
||||
MigrationKeyAddPlayboosksManageRolesPermissions = "playbooks_manage_roles"
|
||||
MigrationKeyAddProductsBoardsPermissions = "products_boards"
|
||||
)
|
||||
|
||||
@@ -354,6 +354,9 @@ var PermissionRunManageProperties *Permission
|
||||
var PermissionRunManageMembers *Permission
|
||||
var PermissionRunView *Permission
|
||||
|
||||
var PermissionSysconsoleReadProductsBoards *Permission
|
||||
var PermissionSysconsoleWriteProductsBoards *Permission
|
||||
|
||||
// General permission that encompasses all system admin functions
|
||||
// in the future this could be broken up to allow access to some
|
||||
// admin functions but not others
|
||||
@@ -2070,6 +2073,19 @@ func initializePermissions() {
|
||||
PermissionScopeRun,
|
||||
}
|
||||
|
||||
PermissionSysconsoleReadProductsBoards = &Permission{
|
||||
"sysconsole_read_products_boards",
|
||||
"",
|
||||
"",
|
||||
PermissionScopeSystem,
|
||||
}
|
||||
PermissionSysconsoleWriteProductsBoards = &Permission{
|
||||
"sysconsole_write_products_boards",
|
||||
"",
|
||||
"",
|
||||
PermissionScopeSystem,
|
||||
}
|
||||
|
||||
SysconsoleReadPermissions = []*Permission{
|
||||
PermissionSysconsoleReadAboutEditionAndLicense,
|
||||
PermissionSysconsoleReadBilling,
|
||||
@@ -2125,6 +2141,7 @@ func initializePermissions() {
|
||||
PermissionSysconsoleReadExperimentalFeatures,
|
||||
PermissionSysconsoleReadExperimentalFeatureFlags,
|
||||
PermissionSysconsoleReadExperimentalBleve,
|
||||
PermissionSysconsoleReadProductsBoards,
|
||||
}
|
||||
|
||||
SysconsoleWritePermissions = []*Permission{
|
||||
@@ -2182,6 +2199,7 @@ func initializePermissions() {
|
||||
PermissionSysconsoleWriteExperimentalFeatures,
|
||||
PermissionSysconsoleWriteExperimentalFeatureFlags,
|
||||
PermissionSysconsoleWriteExperimentalBleve,
|
||||
PermissionSysconsoleWriteProductsBoards,
|
||||
}
|
||||
|
||||
SystemScopedPermissionsMinusSysconsole := []*Permission{
|
||||
|
||||
@@ -44,6 +44,7 @@ const (
|
||||
PostTypeChannelRestored = "system_channel_restored"
|
||||
PostTypeEphemeral = "system_ephemeral"
|
||||
PostTypeChangeChannelPrivacy = "system_change_chan_privacy"
|
||||
PostTypeWelcomePost = "system_welcome_post"
|
||||
PostTypeAddBotTeamsChannels = "add_bot_teams_channels"
|
||||
PostTypeSystemWarnMetricStatus = "warn_metric_status"
|
||||
PostTypeMe = "me"
|
||||
@@ -387,6 +388,7 @@ func (o *Post) IsValid(maxPostSize int) *AppError {
|
||||
PostTypeChangeChannelPrivacy,
|
||||
PostTypeAddBotTeamsChannels,
|
||||
PostTypeSystemWarnMetricStatus,
|
||||
PostTypeWelcomePost,
|
||||
PostTypeMe:
|
||||
default:
|
||||
if !strings.HasPrefix(o.Type, PostCustomTypePrefix) {
|
||||
|
||||
@@ -261,6 +261,7 @@ func init() {
|
||||
PermissionSysconsoleReadExperimentalFeatures.Id,
|
||||
PermissionSysconsoleReadExperimentalFeatureFlags.Id,
|
||||
PermissionSysconsoleReadExperimentalBleve.Id,
|
||||
PermissionSysconsoleReadProductsBoards.Id,
|
||||
}
|
||||
|
||||
SystemManagerDefaultPermissions = []string{
|
||||
@@ -339,6 +340,8 @@ func init() {
|
||||
PermissionSysconsoleWriteIntegrationsBotAccounts.Id,
|
||||
PermissionSysconsoleWriteIntegrationsGif.Id,
|
||||
PermissionSysconsoleWriteIntegrationsCors.Id,
|
||||
PermissionSysconsoleReadProductsBoards.Id,
|
||||
PermissionSysconsoleWriteProductsBoards.Id,
|
||||
}
|
||||
|
||||
SystemCustomGroupAdminDefaultPermissions = []string{
|
||||
|
||||
@@ -13,6 +13,7 @@ import (
|
||||
// It should be maintained in chronological order with most current
|
||||
// release at the front of the list.
|
||||
var versions = []string{
|
||||
"7.5.0",
|
||||
"7.4.0",
|
||||
"7.3.0",
|
||||
"7.2.0",
|
||||
|
||||
Ссылка в новой задаче
Block a user