MM-44642 hide insights per license (#20490)
* MM-44642: Add a config key for Insights. * MM-44642: Includes feature flag in config key/value conditional. Adds tests. * MM-44642: Send the EnableCustomGroups and InsightsEnabled keys to unlicensed clients too. * MM-44642: Adds some tests for Custom Groups config setting.
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
19d6fe40c2
Коммит
3703f943ec
@@ -150,6 +150,118 @@ func TestGetClientConfig(t *testing.T) {
|
||||
"ShowFullName": "true",
|
||||
},
|
||||
},
|
||||
{
|
||||
"Insights professional license",
|
||||
&model.Config{
|
||||
FeatureFlags: &model.FeatureFlags{
|
||||
InsightsEnabled: true,
|
||||
},
|
||||
},
|
||||
"",
|
||||
&model.License{
|
||||
Features: &model.Features{},
|
||||
SkuShortName: model.LicenseShortSkuProfessional,
|
||||
},
|
||||
map[string]string{
|
||||
"InsightsEnabled": "true",
|
||||
},
|
||||
},
|
||||
{
|
||||
"Insights enterprise license",
|
||||
&model.Config{
|
||||
FeatureFlags: &model.FeatureFlags{
|
||||
InsightsEnabled: true,
|
||||
},
|
||||
},
|
||||
"",
|
||||
&model.License{
|
||||
Features: &model.Features{},
|
||||
SkuShortName: model.LicenseShortSkuEnterprise,
|
||||
},
|
||||
map[string]string{
|
||||
"InsightsEnabled": "true",
|
||||
},
|
||||
},
|
||||
{
|
||||
"Insights other license",
|
||||
&model.Config{
|
||||
FeatureFlags: &model.FeatureFlags{
|
||||
InsightsEnabled: true,
|
||||
},
|
||||
},
|
||||
"",
|
||||
&model.License{
|
||||
Features: &model.Features{},
|
||||
SkuShortName: "other",
|
||||
},
|
||||
map[string]string{
|
||||
"InsightsEnabled": "false",
|
||||
},
|
||||
},
|
||||
{
|
||||
"Insights professional license, feature flag disabled",
|
||||
&model.Config{
|
||||
FeatureFlags: &model.FeatureFlags{
|
||||
InsightsEnabled: false,
|
||||
},
|
||||
},
|
||||
"",
|
||||
&model.License{
|
||||
Features: &model.Features{},
|
||||
SkuShortName: model.LicenseShortSkuProfessional,
|
||||
},
|
||||
map[string]string{
|
||||
"InsightsEnabled": "false",
|
||||
},
|
||||
},
|
||||
{
|
||||
"Custom groups professional license",
|
||||
&model.Config{
|
||||
FeatureFlags: &model.FeatureFlags{
|
||||
CustomGroups: true,
|
||||
},
|
||||
},
|
||||
"",
|
||||
&model.License{
|
||||
Features: &model.Features{},
|
||||
SkuShortName: model.LicenseShortSkuProfessional,
|
||||
},
|
||||
map[string]string{
|
||||
"EnableCustomGroups": "true",
|
||||
},
|
||||
},
|
||||
{
|
||||
"Custom groups enterprise license",
|
||||
&model.Config{
|
||||
FeatureFlags: &model.FeatureFlags{
|
||||
CustomGroups: true,
|
||||
},
|
||||
},
|
||||
"",
|
||||
&model.License{
|
||||
Features: &model.Features{},
|
||||
SkuShortName: model.LicenseShortSkuEnterprise,
|
||||
},
|
||||
map[string]string{
|
||||
"EnableCustomGroups": "true",
|
||||
},
|
||||
},
|
||||
{
|
||||
"Custom groups other license",
|
||||
&model.Config{
|
||||
FeatureFlags: &model.FeatureFlags{
|
||||
InsightsEnabled: true,
|
||||
},
|
||||
},
|
||||
"",
|
||||
&model.License{
|
||||
Features: &model.Features{},
|
||||
SkuShortName: "other",
|
||||
},
|
||||
map[string]string{
|
||||
"EnableCustomGroups": "false",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for _, testCase := range testCases {
|
||||
|
||||
Ссылка в новой задаче
Block a user