-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #59 from akeneo/CXP-1480
CXP-1480: Update the Demo app JSON schema
- Loading branch information
Showing
16 changed files
with
393 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,19 @@ | ||
{% macro value(attribute) %} | ||
{% set displayValue = attribute.value %} | ||
{% if attribute.type is same as('pim_catalog_boolean') %} | ||
{% set trueValueTrans = 'page.product.attributes.boolean_values.yes' | trans %} | ||
{% set falseValueTrans = 'page.product.attributes.boolean_values.no' | trans %} | ||
{% set displayValue = displayValue ? trueValueTrans : falseValueTrans %} | ||
{% macro formatValue(value, type) %} | ||
{% if value is not null %} | ||
{% if type is same as('boolean') %} | ||
{{ value | ||
? 'page.product.attributes.boolean_values.yes' | trans | ||
: 'page.product.attributes.boolean_values.no' | trans | ||
}} | ||
{% elseif type is same as('string+uri') %} | ||
<a href="{{ value }}" target="_blank">{{ value }}</a> | ||
{% elseif type matches '{^array<.+>$}' %} | ||
{% set itemType = type|slice(6, type|length - 7) %} | ||
{% for itemValue in value %} | ||
{{ _self.formatValue(itemValue, itemType) }}{% if not loop.last %}<br />{% endif %} | ||
{% endfor %} | ||
{% else %} | ||
{{ value }} | ||
{% endif %} | ||
{% endif %} | ||
|
||
{{ displayValue }} | ||
{% endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
tests/Fixtures/responses/get-catalogs-mapped-product-missing-fields.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
{ | ||
"uuid": "a5eed606-4f98-4d8c-b926-5b59f8fb0ee7" | ||
"uuid": "a5eed606-4f98-4d8c-b926-5b59f8fb0ee7", | ||
"name": "Kodak i2600 for Govt", | ||
"sku": "1234567890317" | ||
} |
17 changes: 14 additions & 3 deletions
17
tests/Fixtures/responses/get-catalogs-mapped-product-scanner.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,17 @@ | ||
{ | ||
"uuid": "a5eed606-4f98-4d8c-b926-5b59f8fb0ee7", | ||
"title": "Kodak i2600 for Govt", | ||
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", | ||
"code": "" | ||
"sku": "1234567890317", | ||
"name": "Kodak i2600 for Govt", | ||
"type": "scanner", | ||
"body_html": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", | ||
"main_image": "https://www.example.com/kodak-i2600.jpg", | ||
"main_color": "navy blue", | ||
"colors": ["grey", "black", "navy blue"], | ||
"available": true, | ||
"price": "269", | ||
"publication_date": "2023-02-01T14:41:36+02:00", | ||
"certification_number": "213-451-2154-124", | ||
"size_letter": "M", | ||
"size_number": 36, | ||
"weight": 1452 | ||
} |
Oops, something went wrong.