1
0
mirror of synced 2024-11-22 13:26:08 +03:00

Merge pull request #166 from ilyavlasoff/add_multiselect_custom_field_support

Added multi dictionary custom field support
This commit is contained in:
azgalot 2023-05-05 14:23:35 +03:00 committed by GitHub
commit 847fbd0bd0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 62 additions and 3 deletions

View File

@ -84,6 +84,7 @@ class CustomField
public $entity; public $entity;
/** /**
* @deprecated Please use $defaultTyped instead.
* @var string * @var string
* *
* @JMS\Type("string") * @JMS\Type("string")
@ -122,4 +123,12 @@ class CustomField
* @JMS\SerializedName("dictionary") * @JMS\SerializedName("dictionary")
*/ */
public $dictionary; public $dictionary;
/**
* @var mixed
*
* @JMS\Type("mixed")
* @JMS\SerializedName("defaultTyped")
*/
public $defaultTyped;
} }

View File

@ -58,6 +58,40 @@ class CustomFieldsTest extends AbstractApiResourceGroupTestCase
"ordering": 50, "ordering": 50,
"displayArea": "customer", "displayArea": "customer",
"viewMode": "editable" "viewMode": "editable"
},
{
"name": "мультисправочник",
"code": "multi-dictionary",
"required": false,
"inFilter": true,
"inList": true,
"inGroupActions": false,
"type": "multiselect_dictionary",
"entity": "order",
"ordering": 50,
"displayArea": "customer",
"viewMode": "editable",
"dictionary": "test_dictionary",
"defaultTyped": [
"test1",
"test2"
]
},
{
"name": "справочник",
"code": "dictionary",
"required": false,
"inFilter": true,
"inList": true,
"inGroupActions": false,
"type": "dictionary",
"entity": "order",
"ordering": 50,
"displayArea": "customer",
"viewMode": "editable",
"dictionary": "test_dictionary",
"default": 1,
"defaultTyped": "test1"
} }
] ]
} }
@ -296,7 +330,8 @@ EOF;
"default": "false", "default": "false",
"ordering": 50, "ordering": 50,
"displayArea": "customer", "displayArea": "customer",
"viewMode": "editable" "viewMode": "editable",
"defaultTyped": false
} }
} }
EOF; EOF;

View File

@ -191,8 +191,18 @@ class CustomersTest extends AbstractApiResourceGroupTestCase
"allowedSendByPhone": false "allowedSendByPhone": false
} }
} }
],
"customFields": {
"bool_field": true,
"string_field": "my_string",
"float_field": 3.8,
"dictionary": "test1",
"multiselect_dictionary": [
"test2",
"test3"
] ]
} }
}
] ]
} }
EOF; EOF;

View File

@ -450,7 +450,12 @@ class OrdersTest extends AbstractApiResourceGroupTestCase
"galka": false, "galka": false,
"test_number": 0, "test_number": 0,
"otpravit_dozakaz": false, "otpravit_dozakaz": false,
"moyskladexternalid": "0f203a5f-7734-11eb-0a80-026b0001f435" "moyskladexternalid": "0f203a5f-7734-11eb-0a80-026b0001f435",
"dictionary": "test2",
"multiselect": [
"test1",
"test3"
]
} }
} }
] ]