[MM-62695] Extend property types for CPA (#30201)
* test: Add unit tests for custom profile attributes select options
* feat: Add custom profile attributes model with validation and constants
* refactor: Trim spaces from name and color in custom profile attribute select option constructor
* gofmt
* refactor: Fix typo in custom profile attributes select option function name
* feat: Add IsValid method to validate CustomProfileAttributesSelectOptions
* refactor: Replace map[string]bool with map[string]struct{} for key existence check
* refactor: Rename NewCustomProfileAttributeSelectOption to NewCustomProfileAttributesSelectOption
* feat: Add validation to prevent empty custom profile attribute options
* refactor: Add validation and creation methods for custom profile attributes
* feat: Add index number to validation error messages in custom profile attributes
* fix tests
* add default visibility
* feat: Add comprehensive test cases for custom profile attributes field validation
* fix: Update custom profile attributes map keys to use capitalized names
* feat: Add support for lowercase and title case keys in custom profile attributes map
* test: Add comprehensive test for NewCustomProfileAttributesSelectOptionFromMap
* feat: Add validation for custom profile attributes fields
* refactor: Update CustomProfileAttributesSelectOption constructor to prioritize ID parameter
* test: Add test cases for preserving IDs in custom profile attributes
* feat: Enhance ID validation and trimming in custom profile attributes
* don't do validation in constructor
* test: Add test case for preserving option IDs when patching select field
* improve test
* i18n
* refactor: Modify CustomProfileAttributesSelectOption to use lowercase JSON keys
* fix casing in custom profilte attributes test
* refactor: Use consistent "ValidateCPAField" in error messages for custom profile attributes
* use custom types rather than string
* lint
* fix api test
* refactor: Make color field optional in custom profile attributes
* style
* generic options
* removed unused i18n
* test: Add tests for NewCPAFieldFromPropertyField and CPAFieldToPropertyField
* test: Add test case for property field with empty attributes
* refactor: Cleanup whitespace and remove empty Attrs in custom profile attributes test
* test: Add test case for CPA field with empty attributes
* refactor: Improve custom profile attributes field handling and validation
* refactor: Move validateCustomProfileAttributesField to Validate method on CPAField struct
* use CPAField
* code style
* add validation and tests
* tests
* i18n
* err->appErr
* fix TestDeleteCPAField test
* i18n
* Add SAML and LDAP attr
* rename CustomProfileAttributes in method to CPA
* rename CPASortOrder method
* rearrange consts
* use Len test method
* sanitize and validate
* manage error the same way property field and value do
* fix: Update test error ID for custom profile attributes validation
* test: Update error ID expectations in custom profile attributes tests
* refactor: Convert CPAAttrs.SortOrder from string to int
* json uses float64
* feat: Add length validation for custom profile attribute option name and color
---------
Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
@@ -1865,6 +1865,10 @@
|
||||
"id": "api.custom_groups.no_remote_id",
|
||||
"translation": "remote_id must be blank for custom group"
|
||||
},
|
||||
{
|
||||
"id": "api.custom_profile_attributes.field_conversion_error",
|
||||
"translation": "Unable to convert the property field to a custom profile attribute field"
|
||||
},
|
||||
{
|
||||
"id": "api.custom_profile_attributes.field_not_found",
|
||||
"translation": "trying to patch a field that does not exist"
|
||||
@@ -5050,6 +5054,10 @@
|
||||
"id": "app.custom_profile_attributes.list_property_values.app_error",
|
||||
"translation": "Unable to get custom profile attribute values"
|
||||
},
|
||||
{
|
||||
"id": "app.custom_profile_attributes.property_field_conversion.app_error",
|
||||
"translation": "Unable to convert the property field to a custom profile attribute field"
|
||||
},
|
||||
{
|
||||
"id": "app.custom_profile_attributes.property_field_delete.app_error",
|
||||
"translation": "Unable to delete Custom Profile Attribute field"
|
||||
@@ -5066,6 +5074,10 @@
|
||||
"id": "app.custom_profile_attributes.property_value_upsert.app_error",
|
||||
"translation": "Unable to upsert Custom Profile Attribute fields"
|
||||
},
|
||||
{
|
||||
"id": "app.custom_profile_attributes.sanitize_and_validate.app_error",
|
||||
"translation": "Invalid property value attributes : {{.AttributeName}} ({{.Reason}})."
|
||||
},
|
||||
{
|
||||
"id": "app.custom_profile_attributes.search_property_fields.app_error",
|
||||
"translation": "Unable to search Custom Profile Attribute fields"
|
||||
|
||||
Ссылка в новой задаче
Block a user