1
0
mirror of synced 2024-11-24 14:26:06 +03:00

Added multi dictionary support

This commit is contained in:
Vlasov 2023-05-03 11:39:23 +03:00
parent bc820d0a69
commit 47741acd28
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"
]
} }
} }
] ]