Add Tenor support#11587
Conversation
Generated by 🚫 dangerJS |
e0ce4cf to
009684b
Compare
|
Hello @planarvoid! Just for your information, I've added four additional commits directly to this branch. The c604372736bfb3366aab5ee46cdee3222bd73ebb to adjust the The 74082b99a8612d026dcea26a65ea1520a17e67a7, e163ac84c6b444e2e1744750d4b67c89fc0296db and 009684b9e1e1e034aa4fd3af37a1c4933cefab6e to fix the checkstyle and lint reports. Also, I've done some rebases with the What do you think? |
50086ea to
3b9a13d
Compare
|
Hey @ThomazFB, thanks for the PR! I was wondering about why you moved the error string from the |
Hello @planarvoid! It was exactly because of the lint warning! The report was pointing out about the unused strings. And so I thought that the project was restricted about using strings for Exception messages instead of UI ones, should we suppress those errors then? |
…ed to the PickerDataSourceFactory
…ewModel and GifPickerDataSource
…dded more documentation
3b9a13d to
ceac897
Compare
|
Hey @planarvoid! Thank you for your feedback! Just letting you know that I committed a fix with your proposed string suppression for unused warnings and reverted the translatable string usage. Here's the commit: 0c09c88. What do you think? edit: I've also done another rebase because of a new conflict with the |
|
thanks for the changes @ThomazFB, we usually do |
|
Thank you for the suggestions @planarvoid! I'll prioritize merges instead of rebases then! Also, I've just modified the suppression declaration right here: 13e88ec. Let me know what you think. |
planarvoid
left a comment
There was a problem hiding this comment.
Thanks for all the changes and the great PR description. It works nicely 👍
This dependency seems that was lastly used only for the no longer existing 'TenorProviderTest' test class (see 47ac89a), which was added as part of this #11587 PR. However, as part of this #14727 PR, this 'TenorProviderTest' test class got removed (see f29f6d0). As such, this leftover from back then can be now safely removed. PS: And with this change, the corresponding 'androidxTestCoreVersion' version is no longer necessary for unit test. As such, it is being moved from the more inclusive 'test' section to the more specific 'android test' section.
Summary
This pull request proposes a solution that brings a complete integration for the Tenor API within the pre-existent GIF selection code inside the WordPress application, solving the issue 11456.
This is an aggregation branch for four different branches:
Changelog
Tenor integration changes
GifProviderinterface is now the only coupling between all code for the GIF picker and the Tenor implementation, avoiding any reference to the Tenor library and making it easy to replace the Provider as we're doing now.TenorProviderimplements theGifProviderinterface and is injected within theDataSourcevia Dagger, this way only theAppplicationModuleknows about theTenorProvider. Also, theTenorProvideris covered by unit tests in theTenorProviderTestclass.GifProvider, this integration happens through the availablePositionalDataSource, The Tenor implementation makes sure that positioning tracking is respected.MediaBrowserActivitywas restored, making GIF selection available again.EditPostActivitywas restored, making GIF selection available again when writing or editing posts.UI changes
Giphyinformation was replaced withTenor.Refactoring and improvements changes
GiphyPickerDataSourcein order to better enforce the business logic when consuming anyGifProviderimplementation.giphypackages insideuiandviewmodelwere both renamed to onlygif.Giphynaming convention were renamed to onlyGifto better fit the agnostic gif provider implementation strategy.Giphyor the Giphy SDK were readapted to better fit theGifProviderstructure.Build configuration changes
BuildConfignow receive the declaration of the booleanTENOR_AVAILABLEfield directly from thebuild.gradle.TENOR_AVAILABLEvalue, if the value is false, the button doesn't get configured and should never appear on the screen.TENOR_AVAILABLEis set astruefor the Wasabi and Zalpha builds andfalsefor the Vanilla build.build.gradle.Testing
Before doing any tests, make sure that to create a Tenor API key and paste it associated with the
wp.tenor.api_keyas the value inside yourgradle.propertiesGIF picking from Media Browser
How to test
Choose from Tenoroptionselection,previewandaddare all working as expectedGIF picking from the Editor
How to test
Switch to classic editorChoose from Tenoroptionselection,previewandaddare all working as expectedTenor GIF picker feature flag - Post Editor
How to test with Wasabi and Zalpha build
Switch to classic editorChoose from Tenoroption is availableselection,previewandaddare all working as expectedHow to test with Vanilla build
Switch to classic editorChoose from Tenoroption isn't thereTenor GIF picker feature flag - Media Browser
How to test with Wasabi and Zalpha build
Choose from Tenoroption is availableselection,previewandaddare all working as expectedHow to test with Vanilla build
Choose from Tenoroption isn't therePR submission checklist
RELEASE-NOTES.txtif necessary.