-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Editor Media Google Photos: date range filter #25762
Commits on Feb 1, 2019
-
Configuration menu - View commit details
-
Copy full SHA for e280994 - Browse repository at this point
Copy the full SHA e280994View commit details -
Fix Date Filters to show only when enabled
Add both a config feature flag and prop to determine whether to show the Date Filters. Append `?flags=external-media/google-photos/date-filters` to enable the feature for testing
Configuration menu - View commit details
-
Copy full SHA for e2f1fe1 - Browse repository at this point
Copy the full SHA e2f1fe1View commit details -
Adds date range selection to Media Date Range
Updates DatePicker component to allow for usage of selectedDays and to show more than 1 month at a time. MediaDateRange component can now take advantage of this functionality to enable a date-range style picker.
Configuration menu - View commit details
-
Copy full SHA for 449f765 - Browse repository at this point
Copy the full SHA 449f765View commit details -
Adds support to DatePicker for more React Day Picker library props
Previously DatePicker component was missing support for toMonth, fromMonth and selectedDays props. This limited ability of consumers of DatePicker component to utilise features of React Day Picker library. Particularly useful if you need to create a range picker. See http://react-day-picker.js.org/examples/selected-range
Configuration menu - View commit details
-
Copy full SHA for 02bac1a - Browse repository at this point
Copy the full SHA 02bac1aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6dc3565 - Browse repository at this point
Copy the full SHA 6dc3565View commit details -
Refactor to make component render more readable
Previously component render was one huge method. Refactored to several smaller utliity methods to make main render more concise.
Configuration menu - View commit details
-
Copy full SHA for 4111f79 - Browse repository at this point
Copy the full SHA 4111f79View commit details -
Add Tests to Media Data Range component
# Conflicts: # package.json
Configuration menu - View commit details
-
Copy full SHA for 90c5a4d - Browse repository at this point
Copy the full SHA 90c5a4dView commit details -
Utilise moment props provided by localize HOC
Ensure dates used in MediaDateRange implements correct internationalization of dates and times using the moment instance provided by `i18n-calypso` https://github.com/Automattic/i18n-calypso
Configuration menu - View commit details
-
Copy full SHA for 3c467d2 - Browse repository at this point
Copy the full SHA 3c467d2View commit details -
Fixes errors generated by missing check for selectedDays prop
Prevously code attempted to access `from` and `to` properties of the `selectedDays` Component prop before checking that `selectedDays` existed.
Configuration menu - View commit details
-
Copy full SHA for 622cb5c - Browse repository at this point
Copy the full SHA 622cb5cView commit details -
Fix trigger date display to be in local timezone
Previously was hard coded to be in UK date format (DD/MM/YYYY). Updated to use moment utility to display in local date format.
Configuration menu - View commit details
-
Copy full SHA for 59629fa - Browse repository at this point
Copy the full SHA 59629faView commit details -
Add onDateSelect prop and test coverage
Adds a new onDateSelect prop which is trigger each time a date is selected by the user. Adds tests coverage for this. Also sets a known locale for the injected momentJS in tests to ensure consistent results.
Configuration menu - View commit details
-
Copy full SHA for 36269c0 - Browse repository at this point
Copy the full SHA 36269c0View commit details -
Configuration menu - View commit details
-
Copy full SHA for e25e923 - Browse repository at this point
Copy the full SHA e25e923View commit details -
Makes dateselection callbacks pass start/end date as args
Previously `onDateSelect` and `onDateCommit` callbacks were called without arguments. This meant they weren’t that useful. Now passes start and end dates as args when called. Test coverage added.
Configuration menu - View commit details
-
Copy full SHA for 8cb10f2 - Browse repository at this point
Copy the full SHA 8cb10f2View commit details -
Adds dateRange prop to MediaLibrary component trees and query
Previously the selected date range was not communicated outside of the MediaDateRange component. Adds a dateRange prop and onDateChange callback prop which are used to store the current date range and update the state of the dateRange prop respectively. This enables us to pass the dateRange into the API query used to retrieve photos data.
Configuration menu - View commit details
-
Copy full SHA for ac57285 - Browse repository at this point
Copy the full SHA ac57285View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4053ab7 - Browse repository at this point
Copy the full SHA 4053ab7View commit details -
Fixes EditorMediaModal tests by passing moment prop
Previously due to use of localize HOC, the tests were failing due to the missing moment property which is injected by the HOC but not included in the tests. Unlike the similarly required translate prop, we cannot simply ‘identity’ this so we inject the actual moment lib from i18n-calypso during tests
Configuration menu - View commit details
-
Copy full SHA for 2b7d788 - Browse repository at this point
Copy the full SHA 2b7d788View commit details -
Fixes Enzyme warning about isEmpty
Tweak test to utilise exists() rather than isEmpty(). Required inverting the assertions as the assertion itself is the inverse
Configuration menu - View commit details
-
Copy full SHA for dc913e6 - Browse repository at this point
Copy the full SHA dc913e6View commit details -
Adds text input based date entry in sync with DatePicker
Previously only way to select dates was to use the DatePicker. However, many users may be unable (or choose not) to use that interface. Best a11y practice is to provide a standard form input. Adds functionality and test coverage.
Configuration menu - View commit details
-
Copy full SHA for 6a1d1c9 - Browse repository at this point
Copy the full SHA 6a1d1c9View commit details -
Fix bug with blurring input caused both inputs to update to blurred i…
…nput’s date Previously when blurring input #1 the value would be automatically be “copied” to input #2 if input #1’s value was the same as that stored in state. This is due to the way the DateUtils.addDayToRange() method works. Fix this by checking whether the value of the input that has just been blurred is the same as that stored in state. If so then don’t trigger an update of the selected date range. Adds test coverage.
Configuration menu - View commit details
-
Copy full SHA for 09aecd2 - Browse repository at this point
Copy the full SHA 09aecd2View commit details -
Updates Media Date Range to utilise “mobile first” approach to layout
On screens smaller than 480px: * removes selected date text on button (leaving just an icon) * displays only 1 month of calendar at a time (instead of two) Adds tests to cover this.
Configuration menu - View commit details
-
Copy full SHA for 23ee7be - Browse repository at this point
Copy the full SHA 23ee7beView commit details -
Update implementation to utilise showOutside days prop
Standardise implementation to utilise prop “showOutsideDays” rather than the previously added (non-standard) “enableOutsideDays”.
Configuration menu - View commit details
-
Copy full SHA for ffe782d - Browse repository at this point
Copy the full SHA ffe782dView commit details -
Update tests to utilise “showOutsideDays” prop and properly mock matchMedia using standard Jest pattern
Configuration menu - View commit details
-
Copy full SHA for 162c85f - Browse repository at this point
Copy the full SHA 162c85fView commit details -
Restore styling for Media Date Range into 2 colums
Date range picker styling update to ensure 2 datepickers are in 2 columns.
Configuration menu - View commit details
-
Copy full SHA for 61a5a7f - Browse repository at this point
Copy the full SHA 61a5a7fView commit details -
Fixes moment date formats to standard on Media Date Range
Previously dates were being passed to momentJS using a nonstandard format (“MM/DD/YYYY”). Moment falls back to JS Date which has unreliable rules around parsing formats, so it’s best practise to give moment a explicit format as the second arg. Apply to code and tests.
Configuration menu - View commit details
-
Copy full SHA for 260f405 - Browse repository at this point
Copy the full SHA 260f405View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2808a2b - Browse repository at this point
Copy the full SHA 2808a2bView commit details -
Updates to utilise core DateRange component
Previously utillised a bespoke DateRange implementation. Updates to use the standard core DateRange component created in `29938`. Also removes custom `dateRange` prop and ensure `filter` and `onFilterChange` props are passed down into ExternalMediaHeader
Configuration menu - View commit details
-
Copy full SHA for b9896fb - Browse repository at this point
Copy the full SHA b9896fbView commit details -
Fixes DateRange Popover to appear over Dialog
Previously within the post editor Media Modal the Popover wasn’t visible because it was “behind” the Media modal. `client/components/date-range/index.js` defines a modifier `is-dialog-visible` which accounts for this. Ensure this is always applied to the DateRange to account for this scenario.
Configuration menu - View commit details
-
Copy full SHA for 1ea7ffe - Browse repository at this point
Copy the full SHA 1ea7ffeView commit details -
Adds ability to modify Media service query with date filters
Working prototype of date filtering of Google Photos Media now in place for post media modal view _only_. Adds “queryFilter” data prop and handler prop and update the query past to the REST API if the `DateRange` component triggers an update.
Configuration menu - View commit details
-
Copy full SHA for 682a3dd - Browse repository at this point
Copy the full SHA 682a3ddView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6b29b8d - Browse repository at this point
Copy the full SHA 6b29b8dView commit details -
Updates to convert dateRange to REST API query format
Update to handle edge cases around selected date ranges. Now handles scenarios where dates in the range aren’t selected and replaces with the “wildcard” selection. Any portion of the range passed as `0000-00-00` means any date. https://developers.google.com/photos/library/reference/rest/v1/mediaItems/search#Date
Configuration menu - View commit details
-
Copy full SHA for 51da934 - Browse repository at this point
Copy the full SHA 51da934View commit details -
This has been replaced with the core `DateRange` component
Configuration menu - View commit details
-
Copy full SHA for a220d39 - Browse repository at this point
Copy the full SHA a220d39View commit details -
Updates Media Date Range for better presentation on small viewports
Previously the DateRange button was large on small screens. With the limited screen real estate we need to drop down to only using icons. This commit implements that whilst also removing all of the other Media Date Range styles which are now part of the core DateRange and thus no longer needed.
Configuration menu - View commit details
-
Copy full SHA for 71b5d2b - Browse repository at this point
Copy the full SHA 71b5d2bView commit details -
Removes redunant Media Date Range tests
These tests are now covered in the core `DateRange` component.
Configuration menu - View commit details
-
Copy full SHA for 0feb410 - Browse repository at this point
Copy the full SHA 0feb410View commit details -
Fixes DateRange clear button to butt up against main trigger
Previously the Trigger button and the Clear “X” button we’re spaced due to a blanket CSS rule applying RHS margin to all `.button` elements. Overides this to ensure button and clear are butting up alongside each other as per a standard button group element.
Configuration menu - View commit details
-
Copy full SHA for b549071 - Browse repository at this point
Copy the full SHA b549071View commit details -
Fixes propagating invalid dates as queryFilter change
Previously strings such as “InvalidDate” were being propagated upwards with `onQueryFiltersChange`. This caused logic errors further up the component tree. Fixed by checking date validity prior to propagating.
Configuration menu - View commit details
-
Copy full SHA for a873947 - Browse repository at this point
Copy the full SHA a873947View commit details -
Updates “No Results” UI to account for query filters
Previously if a queryFilter (eg: date range) caused there to be no Media returned then the UI would show “No photos in your library” (or simialr). Updates so that if there is no Media when a queryFilter is applied then this is treated as a “No results” rather than “No content” issue and the appropriate UI is displayed.
Configuration menu - View commit details
-
Copy full SHA for a2c3d5b - Browse repository at this point
Copy the full SHA a2c3d5bView commit details -
ESLint was triggering warnings that had to be resolved (annoyingly in a single commit!). Firstly, regarding usage of setState in componentDidMount. This is often true. However React docs themselves say this is valid when doing DOM interaction such as measuring widths…etc. > …when you need to measure a DOM node before rendering something that depends on its size or position See https://reactjs.org/docs/react-component.html#componentdidmount Secondly, string refs were being used. Modified to use createRef() pattern.
Configuration menu - View commit details
-
Copy full SHA for acd01f9 - Browse repository at this point
Copy the full SHA acd01f9View commit details -
Adds query filters props to other instance of Media Library
Previously the query filters that allow for Date Range filtering were only added to the Media Modal instance of Media Library. Manually copied these across into the “main” Media library instance as well.
Configuration menu - View commit details
-
Copy full SHA for 6942cb7 - Browse repository at this point
Copy the full SHA 6942cb7View commit details -
Fixes use of invalid React string based ref
React has deprecated string based refs. Converted to a `createRef()` version.
Configuration menu - View commit details
-
Copy full SHA for b38967c - Browse repository at this point
Copy the full SHA b38967cView commit details -
Fixes code conditional logic and improves comments
Previously conditional logic and accompanying comment we’re very clear as to the intent of the conditional. Amended for clarity.
Configuration menu - View commit details
-
Copy full SHA for 74a9164 - Browse repository at this point
Copy the full SHA 74a9164View commit details -
Configuration menu - View commit details
-
Copy full SHA for cba3ac9 - Browse repository at this point
Copy the full SHA cba3ac9View commit details -
Updates DateRange to compact render mode
Matches existing toolbar styles more closely.
Configuration menu - View commit details
-
Copy full SHA for 1adf4cb - Browse repository at this point
Copy the full SHA 1adf4cbView commit details -
Fixes Media Library header toolbar responsive layout issues
Previously the responsive behaviour of the toolbar wasn’t consistent across viewports. Moreover the alignment and centering of content was achieved via hacks such as absolute positioning and margins. Updates to utilise flexbox for alignment in order to improve resilience of layout across various viewports sizes. Resolves: #25762 (comment)
Configuration menu - View commit details
-
Copy full SHA for 5c08958 - Browse repository at this point
Copy the full SHA 5c08958View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1d10883 - Browse repository at this point
Copy the full SHA 1d10883View commit details -
Fixes focused date defaults in DatePicker
Previously if you selected a single date away from the current month by a few months in the past and closed the picker and then reopened it the calendar would be focused on today’s date rather than the date you just picked. Fixes to always focus on the start date if there is not focused date explicitly set. Resolves #25762 (comment)
Configuration menu - View commit details
-
Copy full SHA for d33cf6e - Browse repository at this point
Copy the full SHA d33cf6eView commit details -
Fixes regression where buttons were too tall
Comparing with production all buttons were suddenly larger. Fixes to ensure toolbar buttons are not suddenly taller. Resolves #25762 (comment)
Configuration menu - View commit details
-
Copy full SHA for 15b32a8 - Browse repository at this point
Copy the full SHA 15b32a8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7476254 - Browse repository at this point
Copy the full SHA 7476254View commit details -
Fixes list data tests to match changes
Previously tests were out of sync with changes to files. Added initial date range filter test. Also updated wording of tests to avoid using the term “media query” as this is potentially confusing due to it’s significance in responsive design.
Configuration menu - View commit details
-
Copy full SHA for 14cf9b9 - Browse repository at this point
Copy the full SHA 14cf9b9View commit details -
Fixes logic errors uncovered by tests
Updating tests to cover various scenarios uncovered x2 errors: 1. Non-string dates were accepted by moment’s parsing and were incorrectly added to the filter (eg: `new Date()`) 2. If either from or to were wildcards (eg: `0000-00-00`) then the filer wouldn’t be added. However we only wanrt to avoid the filter being added if BOTH the dates are wildcards. Fixed and added tests to cover.
Configuration menu - View commit details
-
Copy full SHA for 0783bad - Browse repository at this point
Copy the full SHA 0783badView commit details -
Updates to simplify translation by removing Media type from no result…
…s listing Previously translated strings were broken up into separately translated strings and then concatenated to produce a full “no results” status string for the UI. This would not have been best practice as often sentances need to be compeltely reordered in other languages. Updates to ensure strings are translated in a single go. As part of this @johngodley and I decided to remove the Media type from the no results statement as it didn’t add much value and would have added considerably verbosity to the code. Resolves #25762 (comment)
Configuration menu - View commit details
-
Copy full SHA for 845ce46 - Browse repository at this point
Copy the full SHA 845ce46View commit details -
Resolves Circle CI Lint warnings: 1. incorrect usages of let var declaration 2. 'component-event' should be listed in the project's dependencies. Run 'npm i -S component-event' to add it. Both fixed.
Configuration menu - View commit details
-
Copy full SHA for ac19fad - Browse repository at this point
Copy the full SHA ac19fadView commit details -
Configuration menu - View commit details
-
Copy full SHA for 982c47e - Browse repository at this point
Copy the full SHA 982c47eView commit details