Skip to content
This repository has been archived by the owner on Feb 4, 2025. It is now read-only.

Add Stock photo caption and include it when uploading a photo #1846

Closed
wants to merge 8 commits into from

Conversation

fluiddot
Copy link
Contributor

@fluiddot fluiddot commented Jan 20, 2021

Issue: wordpress-mobile/gutenberg-mobile#1609

Related PRs

Description

Parse caption field from the response of Stock media search requests and add it to the Stock media model and item. This field is now also included in the payload when a photo is uploaded.

Test

The changes can be tested in two different flows:

Media screen

Steps

  1. Go to a site.
  2. Tap on Media button.
  3. Tap on + button.
  4. Tap on Choose from Free Photo Library
  5. Search any term.
  6. Tap one or multiple photos.
  7. Tap on ✔️ button.
  8. Wait for the items to be uploaded.
  9. [Back in the Media screen] Tap on any of the recently uploaded photos.
  10. Check that Caption field has value.

Note: It's possible that in some cases the item doesn't have a caption value with the credit/attribution of the photo. In this case try another one.

Image block

Steps

  1. Go to a site.
  2. Open a post/page.
  3. Tap on + button.
  4. Tap on Image block.
  5. Tap on ADD IMAGE.
  6. Tap on Choose from Free Photo Library
  7. Search any term.
  8. Tap one photo.
  9. Tap on ✔️ button.
  10. Wait for the item to be uploaded.
  11. Check that below the photo the caption field has a value.

Note: It's possible that in some cases the item doesn't have a caption value with the credit/attribution of the photo. In this case try another one.


Merge Instructions:
Only merger after WordPress Android PR has been tested and approved.

Caption field has been added to be included in the payload when uploading a stock media item.
The caption value is parsed when deserializing the response of searching.
Copy link
Contributor

@jd-alexander jd-alexander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good @fluiddot I checked the code including the tests and all is well. I left a comment you can check out as well. Once that's resolved we can LGTM this.

Copy link
Contributor

@jd-alexander jd-alexander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for these changes @fluiddot We are good to go! LGTM 🚢

@fluiddot fluiddot marked this pull request as ready for review January 27, 2021 11:18
@jd-alexander
Copy link
Contributor

@fluiddot there's a conflict here that will require resolution :)

# Conflicts:
#	fluxc/src/main/java/org/wordpress/android/fluxc/persistence/WellSqlConfig.kt
@fluiddot
Copy link
Contributor Author

fluiddot commented Feb 2, 2021

@fluiddot there's a conflict here that will require resolution :)

Thanks @jd-alexander for raising the issue, I've just solved the conflict in f2e5d10.

@justtwago justtwago closed this Dec 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants