Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an image thumbnail to wp-admin post list. (#20720)
* [not verified] First approach * [not verified] posts-page: start to rendering posts list with components * [not verified] add package to renovate github file * [not verified] wp-admin-plus: add composer compiling scripts * [not verified] doc * [not verified] rendering date button in date column * [not verified] eslint: fix override eslint path * [not verified] set post date optimistically * [not verified] update github files * [not verified] wp-admin-plus: changelog * [not verified] remove codeclimate file * [not verified] remove editorconfig file * [not verified] cleaning... * [not verified] wp-admin-plus: set selected day color * [not verified] twaeking post date label * [not verified] wp-admin-plus: refresh post status once saves * [not verified] move post-date cmp to its own folder * [not verified] add PostStatusLabel component * [not verified] refact -> add usePost hook * [not verified] usePost: refactoring hook * [not verified] add @wordpress/eslint-plugin dev dep * [not verified] post status label: pass status to hook * [not verified] Populate post status with espcial cases. Tidy. * [not verified] refactor pick and organize client data * [not verified] update dependencies * [not verified] add eslint config file * [not verified] requier `any` post status * [not verified] add "@babel/runtime": "7.14.0" dependency * [not verified] rename package to wp-admin-posts-list-page * [not verified] rename (again clap !) package name * [not verified] communicate: init component * [not verified] [not verified] * [not verified] improve jsdoc * [not verified] Copied thumbnail code from add/wpcom-posts-package to display a post's featured image in the posts list in wp-admin. * [not verified] rename package name * [not verified] rename changelog filename * [not verified] remove post-date stuff * [not verified] rename to Notice component. doc. * [not verified] inject post-feature-image container * [not verified] Add basic FeatureImage component * [not verified] remove thumbnail class * [not verified] First attempt to get the first image found in a post if a featured image is not set. Needs more work. * [not verified] check and get post image * [not verified] pick images inspecting post content * [not verified] If no featured image is set, get the first image on the post hosted by the media library. We use DOMDocument and DomXPath to parse the post HTML to find the first image with a class name attribute containing 'wp-image-'. * [not verified] Updated comments to pass linter. * [not verified] Apply suggestions from code review Co-authored-by: Jeremy Herve <[email protected]> * [not verified] Added composer.lock & .jshintrc to .gitignore. Replaced spaces with tabs in style.scss. * [not verified] Fixed infinite "jetpack build packages/post-list" build by changing "build-development" from "pnpm run start" fo "pnpm run build". * [not verified] Rebase * [not verified] Added content to changelog file. Alphabetized renovate.json. * [not verified] Upgrade @wordpress/scripts to v18, and adjust build scripts * [not verified] add no-featured-image image * [not verified] change style by image when no-featured * [not verified] add a super basic Tooltip when no featured image * [not verified] use a div to wrap no-featured-image * [not verified] Add Assets package as dependency * [not verified] tweak tooltip style * [not verified] clean CSS code * [not verified] add basic eslint config file * [not verified] Updated get_featured_or_first_post_image to find the class 'wp-image-ID' in the case of multiple class names. * [not verified] update eslint-plugin version * [not verified] Added unit test stub files. * [not verified] Add unit test support * [not verified] Updated our deprecated XML configuration scheme using the command './vendor/phpunit/phpunit/phpunit --migrate-configuration' * [not verified] Refactor to use global data object, and remove unused code. * [not verified] Remove unused eslintrc file * [not verified] update building scripts * [not verified] minor doc improvement * [not verified] removing post-list dependency * [not verified] Moved image get function to its own class and broke it up for more granular testing. Added additional unit test file for getting the image. * [not verified] Refactor feature flag query var. * [not verified] add @wordpress/icons dependency * [not verified] replace bitmap image by icon when no thumb * [not verified] build for dev without watching changes * [not verified] Added new tests for Post_Image. * [not verified] change image icon by a custom one * [not verified] Renamed Post_Image class to Post_Thumbnail. Added phpcs:ignore on unit test filenames. * [not verified] Ensure we only activate when thumbnails are supported * [not verified] Renamed Admin class to Post_List. * [not verified] Adding project structure requirments. * [not verified] Update package version number * [not verified] Correct .gitkeep location * [not verified] add alt image property * [not verified] remove post-list dependency from jetpack * [not verified] remove code about post date * [not verified] change package description * [not verified] improve getting image alt value * [not verified] Refactor how the package is initialized and remove actions.php * [not verified] Update projects/packages/post-list/.eslintrc.js Co-authored-by: Jeremy Herve <[email protected]> * [not verified] Update projects/packages/post-list/.eslintrc.js Co-authored-by: Jeremy Herve <[email protected]> * [not verified] Update projects/packages/post-list/.eslintrc.js Co-authored-by: Jeremy Herve <[email protected]> * [not verified] Update projects/packages/post-list/src/components/featured-image/index.js Co-authored-by: Jeremy Herve <[email protected]> * [not verified] Update projects/packages/post-list/composer.json Co-authored-by: Jeremy Herve <[email protected]> * [not verified] Update projects/packages/post-list/src/class-post-list.php Co-authored-by: Jeremy Herve <[email protected]> * [not verified] Remove is_wp_admin_posts_list_page check * [not verified] remove PACKAGE_VERSION class constant * [not verified] remove unused packages * [not verified] Removed actions.php reference. * [not verified] Added wp_set_script_translations. * [not verified] Implemented @dataProvider in test-post-thumbnail.php. Added WordBless for test-post-list.php unit tests. Updated get_first_image_id_from_post_content() regex and added a check for is_numeric. * [not verified] Defined $image_alt = null. Updated comment. * [not verified] Added /wordpress to .gitignore. * [not verified] Rebase, updated lock files, update noded version in package.json. * [not verified] Updating unit test configuration. * [not verified] Updated yoast/phpunit-polyfills version number. Edited error messages in unit tests. * [not verified] rebase * [not verified] create root element for the client app * [not verified] re-implement the app using portal The idea here is creating an only one APP compopnent to improve the client performance in terms of rendering. * [not verified] replace React by vanilla JS * [not verified] clean compiling JS stuff * [not verified] Updated unit tests, comments, and refactored namespace. * [not verified] Removed .eslintrc.js. * [not verified] Removed post-list dependency from Jetpack. * [not verified] Attempt to remove projects/plugins/jetpack/composer.lock from PR. * [not verified] Removed changelog since we removed the dependecy. Since we removed the post-list dependency from the plugins composer file, I don't think we need this changelog file. * [not verified] Updated Readme.md Updated initialization hook code. Capitalized words in headers. * [not verified] Added package version number. * [not verified] Escape return values just in case. * [not verified] Check for empty $post_content first and return null if true. * [not verified] Updated version number. * Apply suggestions from code review Co-authored-by: Damián Suárez <[email protected]> Co-authored-by: retrofox <[email protected]> Co-authored-by: Dusty Reagan <[email protected]> Co-authored-by: Jeremy Herve <[email protected]> Co-authored-by: Paul Bunkham <[email protected]> Co-authored-by: Allison Levine <[email protected]> Co-authored-by: Brandon Kraft <[email protected]>
- Loading branch information