This commit is contained in:
Julien Tant
2025-02-12 15:29:23 -07:00
parent a44f6f40eb
commit 861e12c1fc
2 changed files with 27 additions and 3 deletions
@@ -263,7 +263,7 @@ func validateCustomProfileAttributesField(field *model.PropertyField) *model.App
}
valueTypeStr = strings.TrimSpace(valueTypeStr)
if !model.IsKnownCustomProfilteAttributesValueType(valueTypeStr) {
return model.NewAppError("CreateCPAField", "app.custom_profile_attributes.unknown_value_type.app_error", map[string]any{"value_type": valueTypeStr}, "", http.StatusUnprocessableEntity)
return model.NewAppError("CreateCPAField", "app.custom_profile_attributes.unknown_value_type.app_error", map[string]any{"ValueType": valueTypeStr}, "", http.StatusUnprocessableEntity)
}
field.Attrs[model.CustomProfileAttributesPropertyAttrsValueType] = valueTypeStr
@@ -279,7 +279,7 @@ func validateCustomProfileAttributesField(field *model.PropertyField) *model.App
for i, option := range optionsArr {
optionMap, ok := option.(map[string]any)
if !ok {
return model.NewAppError("CreateCPAField", "app.custom_profile_attributes.not_map_option.app_error", map[string]any{"index": i}, "", http.StatusUnprocessableEntity)
return model.NewAppError("CreateCPAField", "app.custom_profile_attributes.not_map_option.app_error", map[string]any{"Index": i}, "", http.StatusUnprocessableEntity)
}
option := model.NewCustomProfileAttributesSelectOptionFromMap(optionMap)
finalOptions = append(finalOptions, option)
@@ -296,7 +296,7 @@ func validateCustomProfileAttributesField(field *model.PropertyField) *model.App
if visibilityStr, ok := visibilityAttr.(string); ok {
visibilityStr = strings.TrimSpace(visibilityStr)
if !model.IsKnownCustomProfilteAttributesVisibility(visibilityStr) {
return model.NewAppError("CreateCPAField", "app.custom_profile_attributes.unknown_visibility.app_error", map[string]any{"visibility": visibilityStr}, "", http.StatusUnprocessableEntity)
return model.NewAppError("CreateCPAField", "app.custom_profile_attributes.unknown_visibility.app_error", map[string]any{"Visibility": visibilityStr}, "", http.StatusUnprocessableEntity)
}
visibility = visibilityStr
}
+24
View File
@@ -5018,6 +5018,10 @@
"id": "app.custom_profile_attributes.get_property_field.app_error",
"translation": "Unable to get Custom Profile Attribute field"
},
{
"id": "app.custom_profile_attributes.invalid_options.app_error",
"translation": "Unable to validate the options"
},
{
"id": "app.custom_profile_attributes.limit_reached.app_error",
"translation": "Custom Profile Attributes field limit reached"
@@ -5026,6 +5030,18 @@
"id": "app.custom_profile_attributes.list_property_values.app_error",
"translation": "Unable to get custom profile attribute values"
},
{
"id": "app.custom_profile_attributes.not_array_options.app_error",
"translation": "The attribute options must be an array"
},
{
"id": "app.custom_profile_attributes.not_map_option.app_error",
"translation": "The attribute option #{{.Index}} must be a key value pair"
},
{
"id": "app.custom_profile_attributes.not_string_value_type.app_error",
"translation": "The value type must be a string"
},
{
"id": "app.custom_profile_attributes.property_field_delete.app_error",
"translation": "Unable to delete Custom Profile Attribute field"
@@ -5054,6 +5070,14 @@
"id": "app.custom_profile_attributes.search_property_fields.app_error",
"translation": "Unable to search Custom Profile Attribute fields"
},
{
"id": "app.custom_profile_attributes.unknown_value_type.app_error",
"translation": "The value type '{{.ValueType}}' is not supported"
},
{
"id": "app.custom_profile_attributes.unknown_visibility.app_error",
"translation": "The visibility '{{.Visibility}}' is not supported"
},
{
"id": "app.delete_scheduled_post.delete_error",
"translation": "Failed to delete scheduled post from database."