-
-
Notifications
You must be signed in to change notification settings - Fork 719
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DFC API] add image to product #11756
Merged
mkllnk
merged 6 commits into
openfoodfoundation:master
from
rioug:11712_DFC_add_image_to_product
Nov 8, 2023
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
424954e
Add ofn:image to SuppliedProduct
rioug 12c6257
Pass the image url to DfcProvider::SuppliedProduct
rioug 7987967
Check product image url is present on supplied product endpoint
rioug 11ee4b3
Update Swagger documentation to include ofn:image
rioug f76bdf0
Fix rubocop warning
rioug d0dd6e5
Replace variable values with fixed values in Swagger doc
mkllnk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -343,11 +343,12 @@ paths: | |
dfc-b:usageOrStorageCondition: '' | ||
dfc-b:totalTheoreticalStock: 0.0 | ||
ofn:spree_product_id: 90000 | ||
ofn:image: http://test.host/rails/active_storage/url/logo-white.png | ||
- "@id": http://test.host/api/dfc/enterprises/10000/catalog_items/10001 | ||
"@type": dfc-b:CatalogItem | ||
dfc-b:references: http://test.host/api/dfc/enterprises/10000/supplied_products/10001 | ||
dfc-b:sku: APP | ||
dfc-b:stockLimitation: 0 | ||
dfc-b:stockLimitation: 5 | ||
Comment on lines
-350
to
+351
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess that's due to the different factory used? |
||
dfc-b:offeredThrough: http://test.host/api/dfc/enterprises/10000/offers/10001 | ||
'404': | ||
description: not found | ||
|
@@ -406,7 +407,7 @@ paths: | |
dfc-b:hasQuantity: | ||
"@type": dfc-b:QuantitativeValue | ||
dfc-b:hasUnit: dfc-m:Gram | ||
dfc-b:value: 3.0 | ||
dfc-b:value: 6.0 | ||
dfc-b:alcoholPercentage: 0.0 | ||
dfc-b:lifetime: '' | ||
dfc-b:usageOrStorageCondition: '' | ||
|
@@ -431,11 +432,12 @@ paths: | |
dfc-b:hasQuantity: | ||
"@type": dfc-b:QuantitativeValue | ||
dfc-b:hasUnit: dfc-m:Gram | ||
dfc-b:value: 3.0 | ||
dfc-b:value: 6 | ||
dfc-b:alcoholPercentage: 0.0 | ||
dfc-b:lifetime: '' | ||
dfc-b:usageOrStorageCondition: '' | ||
dfc-b:totalTheoreticalStock: 0.0 | ||
ofn:spree_product_id: 90000 | ||
"/api/dfc/enterprises/{enterprise_id}/supplied_products/{id}": | ||
parameters: | ||
- name: enterprise_id | ||
|
@@ -475,6 +477,7 @@ paths: | |
dfc-b:usageOrStorageCondition: '' | ||
dfc-b:totalTheoreticalStock: 0.0 | ||
ofn:spree_product_id: 90000 | ||
ofn:image: http://test.host/rails/active_storage/url/logo-white.png | ||
'404': | ||
description: not found | ||
put: | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On production, this will directly link to AWS S3. And in order to do that for variants, it will process the image first. That shouldn't be a problem because all images should be processed already. Just flagging it here in case there's some performance issue later.