Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:google/site-kit-wp into enhance/#…
Browse files Browse the repository at this point in the history
…6215-ga4-admin-bar-sessions.
  • Loading branch information
hussain-t committed Feb 23, 2023
2 parents 9f61e94 + 3734201 commit 2284d12
Show file tree
Hide file tree
Showing 153 changed files with 5,711 additions and 442 deletions.
19 changes: 18 additions & 1 deletion .storybook/preview-head-vrt.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@
#root *,
#root *::before,
#root *::after {
animation-duration: 0ms !important;
transition-duration: 0ms !important;
}

/* We only want to override animation-duration if _not_ pausing the animations via the .googlesitekit-vrt-animation-paused class. */
#root:not( :has( .googlesitekit-vrt-animation-paused ) ) *,
#root:not( :has( .googlesitekit-vrt-animation-paused ) ) *::before,
#root:not( :has( .googlesitekit-vrt-animation-paused ) ) *::after {
animation-duration: 0ms !important;
}

/**
* While the rules above set animation-duration to 0ms for VRT builds, there can be times where this is not appropriate.
* For example if there is a constant animation in a story, it results in the animation running constantly at top speed and the VRT screengrab becomes somewhat undeterministic.
Expand All @@ -18,4 +24,15 @@
animation: none !important;
transition: none !important;
}

/**
* An alternative scenario is that the VRT scenario does not render correctly unless the animation is active but paused.
* In this case, we can apply the following .googlesitekit-vrt-animation-paused class to a story wrapper element to pause animations for a given story.
* Please note, this only applies to animations and not transitions which don't have an equivalent paused state.
*/
#root .googlesitekit-vrt-animation-paused *,
#root .googlesitekit-vrt-animation-paused *::before,
#root .googlesitekit-vrt-animation-paused *::after {
animation-play-state: paused !important;
}
</style>
2 changes: 1 addition & 1 deletion .storybook/utils/resetGlobals.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/**
* External dependencies
*/
import cloneDeep from 'lodash/cloneDeep';
import { cloneDeep } from 'lodash';

/**
* Internal dependencies
Expand Down
8 changes: 4 additions & 4 deletions .storybook/utils/zeroReports.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/**
* Returns a copy of the provided Analytics report with all metric values replaced with zero.
*
* @since n.e.x.t
* @since 1.95.0
*
* @param {Array<Object>} report Array containing Analytics report object(s).
* @return {Array<Object>} Array containing zeroed Analytics report object(s).
Expand Down Expand Up @@ -48,14 +48,14 @@ export function replaceValuesInAnalyticsReportWithZeroData( report ) {
* Returns a copy of the provided Analytics 4 report with all values removed,
* matching the format of an empty report.
*
* @since n.e.x.t
* @since 1.95.0
*
* @param {Object} report Analytics 4 report object.
* @return {Object} Empty Analytics 4 report object.
*/
export function replaceValuesInAnalytics4ReportWithZeroData( report ) {
// eslint-disable-next-line no-unused-vars -- Ignore `rows` since we're omitting it from the returned report object.
const { rows, ...reportWithoutRows } = report;
// eslint-disable-next-line no-unused-vars -- Ignore `rows` and `rowCount` since we're omitting them from the returned report object.
const { rows, rowCount, ...reportWithoutRows } = report;

return {
...reportWithoutRows,
Expand Down
2 changes: 1 addition & 1 deletion assets/js/all-datastores.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/**
* External dependencies
*/
import omit from 'lodash/omit';
import { omit } from 'lodash';

/**
* Internal dependencies
Expand Down
2 changes: 1 addition & 1 deletion assets/js/components/Alert.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* External dependencies
*/
import PropTypes from 'prop-types';
import isPlainObject from 'lodash/isPlainObject';
import { isPlainObject } from 'lodash';

/**
* WordPress dependencies
Expand Down
4 changes: 2 additions & 2 deletions assets/js/components/DashboardNavigation/Navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
/**
* External dependencies
*/
import classnames from 'classnames';
import { throttle } from 'lodash';
import { useMount } from 'react-use';
import { Chip } from '@material/react-chips';
import classnames from 'classnames';
import throttle from 'lodash/throttle';

/**
* WordPress dependencies
Expand Down
2 changes: 1 addition & 1 deletion assets/js/components/EntityHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/**
* External dependencies
*/
import throttle from 'lodash/throttle';
import { throttle } from 'lodash';

/**
* WordPress dependencies
Expand Down
4 changes: 1 addition & 3 deletions assets/js/components/GoogleChart/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@
/**
* External dependencies
*/
import set from 'lodash/set';
import cloneDeep from 'lodash/cloneDeep';
import merge from 'lodash/merge';
import { set, cloneDeep, merge } from 'lodash';

/**
* Internal dependencies
Expand Down
2 changes: 1 addition & 1 deletion assets/js/components/ReportError.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* External dependencies
*/
import PropTypes from 'prop-types';
import uniqWith from 'lodash/uniqWith';
import { uniqWith } from 'lodash';

/**
* WordPress dependencies
Expand Down
2 changes: 1 addition & 1 deletion assets/js/components/ReportTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
* External dependencies
*/
import classnames from 'classnames';
import get from 'lodash/get';
import invariant from 'invariant';
import PropTypes from 'prop-types';
import { get } from 'lodash';

/**
* Internal dependencies.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*/
import PropTypes from 'prop-types';
import classnames from 'classnames';
import map from 'lodash/map';
import { map } from 'lodash';
import { useMount, useMountedState, useIntersection } from 'react-use';
import { useWindowWidth } from '@react-hook/window-size/throttled';

Expand Down
4 changes: 2 additions & 2 deletions assets/js/components/notifications/UnsatisfiedScopesAlert.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/**
* External dependencies
*/
import unique from 'lodash/uniq';
import { uniq } from 'lodash';

/**
* WordPress dependencies
Expand Down Expand Up @@ -114,7 +114,7 @@ export default function UnsatisfiedScopesAlert() {
if ( ! moduleNames || moduleNames.some( ( name ) => name === false ) ) {
messageID = MESSAGE_GENERIC;
} else {
moduleNames = unique( moduleNames );
moduleNames = uniq( moduleNames );
messageID =
1 < moduleNames.length ? MESSAGE_MULTIPLE : MESSAGE_SINGULAR;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*/
import PropTypes from 'prop-types';
import { useHistory, useParams } from 'react-router-dom';
import isEmpty from 'lodash/isEmpty';
import { isEmpty } from 'lodash';

/**
* WordPress dependencies
Expand Down
2 changes: 1 addition & 1 deletion assets/js/components/surveys/SurveyQuestionMultiSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*/
import classnames from 'classnames';
import PropTypes from 'prop-types';
import keyBy from 'lodash/keyBy';
import { keyBy } from 'lodash';

/**
* WordPress dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/**
* External dependencies
*/
import cloneDeep from 'lodash/cloneDeep';
import { cloneDeep } from 'lodash';

/**
* WordPress dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/**
* External dependencies
*/
import isEmpty from 'lodash/isEmpty';
import { isEmpty } from 'lodash';

/**
* WordPress dependencies
Expand Down
2 changes: 1 addition & 1 deletion assets/js/googlesitekit-adminbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/**
* External dependencies
*/
import once from 'lodash/once';
import { once } from 'lodash';

/**
* WordPress dependencies
Expand Down
2 changes: 1 addition & 1 deletion assets/js/googlesitekit/data/create-fetch-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* External dependencies
*/
import invariant from 'invariant';
import isPlainObject from 'lodash/isPlainObject';
import { isPlainObject } from 'lodash';

/**
* Internal dependencies
Expand Down
2 changes: 1 addition & 1 deletion assets/js/googlesitekit/data/create-fetch-store.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* External dependencies
*/
import invariant from 'invariant';
import isPlainObject from 'lodash/isPlainObject';
import { isPlainObject } from 'lodash';

/**
* WordPress dependencies
Expand Down
4 changes: 1 addition & 3 deletions assets/js/googlesitekit/data/create-settings-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
* External dependencies
*/
import invariant from 'invariant';
import isPlainObject from 'lodash/isPlainObject';
import isEqual from 'lodash/isEqual';
import pick from 'lodash/pick';
import { isPlainObject, isEqual, pick } from 'lodash';

/**
* Internal dependencies
Expand Down
2 changes: 1 addition & 1 deletion assets/js/googlesitekit/data/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
* External dependencies
*/
import invariant from 'invariant';
import mapValues from 'lodash/mapValues';
import memize from 'memize';
import { mapValues } from 'lodash';

/**
* WordPress dependencies
Expand Down
2 changes: 1 addition & 1 deletion assets/js/googlesitekit/data/utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/**
* External dependencies
*/
import noop from 'lodash/noop';
import { noop } from 'lodash';

/**
* WordPress dependencies
Expand Down
2 changes: 1 addition & 1 deletion assets/js/googlesitekit/datastore/forms/forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* External dependencies
*/
import invariant from 'invariant';
import isPlainObject from 'lodash/isPlainObject';
import { isPlainObject } from 'lodash';

const SET_FORM_VALUES = 'SET_FORM_VALUES';

Expand Down
2 changes: 1 addition & 1 deletion assets/js/googlesitekit/datastore/site/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* External dependencies
*/
import invariant from 'invariant';
import isPlainObject from 'lodash/isPlainObject';
import { isPlainObject } from 'lodash';

/**
* WordPress dependencies
Expand Down
2 changes: 1 addition & 1 deletion assets/js/googlesitekit/datastore/ui/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* External dependencies
*/
import invariant from 'invariant';
import isPlainObject from 'lodash/isPlainObject';
import { isPlainObject } from 'lodash';

/**
* Internal dependencies
Expand Down
2 changes: 1 addition & 1 deletion assets/js/googlesitekit/datastore/user/feature-tours.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*/
import compareVersions from 'compare-versions';
import invariant from 'invariant';
import isPlainObject from 'lodash/isPlainObject';
import { isPlainObject } from 'lodash';

/**
* Internal dependencies
Expand Down
2 changes: 1 addition & 1 deletion assets/js/googlesitekit/datastore/user/key-metrics.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* External dependencies
*/
import invariant from 'invariant';
import isPlainObject from 'lodash/isPlainObject';
import { isPlainObject } from 'lodash';

/**
* Internal dependencies
Expand Down
2 changes: 1 addition & 1 deletion assets/js/googlesitekit/datastore/user/surveys.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
/**
* External dependencies
*/
import isPlainObject from 'lodash/isPlainObject';
import invariant from 'invariant';
import { isPlainObject } from 'lodash';

/**
* Internal dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
* External dependencies
*/
import invariant from 'invariant';
import isPlainObject from 'lodash/isPlainObject';
import isEqual from 'lodash/isEqual';
import pick from 'lodash/pick';
import { isPlainObject, isEqual, pick } from 'lodash';

/**
* Internal dependencies
Expand Down
8 changes: 3 additions & 5 deletions assets/js/googlesitekit/modules/datastore/modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,16 @@
* External dependencies
*/
import memize from 'memize';
import defaults from 'lodash/defaults';
import merge from 'lodash/merge';
import isPlainObject from 'lodash/isPlainObject';
import invariant from 'invariant';
import { sprintf, __ } from '@wordpress/i18n';
import { defaults, merge, isPlainObject } from 'lodash';

/**
* WordPress dependencies
*/
// This is used for JSDoc purposes.
// eslint-disable-next-line no-unused-vars
import { WPComponent } from '@wordpress/element';
import { sprintf, __ } from '@wordpress/i18n';

/**
* Internal dependencies
Expand Down Expand Up @@ -1348,7 +1346,7 @@ const baseSelectors = {
*
* Returns an Object/map of objects, keyed by slug as same as `getModules`.
*
* @since n.e.x.t
* @since 1.95.0
*
* @param {Object} state Data store's state.
* @return {(Object|undefined)} Non-internal shareable modules available on the site; `undefined` if not loaded.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
* External dependencies
*/
import invariant from 'invariant';
import isEqual from 'lodash/isEqual';
import isEmpty from 'lodash/isEmpty';
import pick from 'lodash/pick';
import { isEqual, isEmpty, pick } from 'lodash';

/**
* Internal dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* External dependencies
*/
import PropTypes from 'prop-types';
import intersection from 'lodash/intersection';
import { intersection } from 'lodash';

/**
* WordPress dependencies
Expand Down
2 changes: 1 addition & 1 deletion assets/js/googlesitekit/widgets/datastore/key-metrics.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const selectors = {
/**
* Gets the Key Metric widget slugs based on the user input settings.
*
* @since n.e.x.t
* @since 1.95.0
*
* @return {Array<string>|undefined} An array of Key Metric widget slugs, or undefined if the user input settings are not loaded.
*/
Expand Down
2 changes: 1 addition & 1 deletion assets/js/googlesitekit/widgets/datastore/widgets.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* External dependencies
*/
import invariant from 'invariant';
import intersection from 'lodash/intersection';
import { intersection } from 'lodash';
import { original } from 'immer';

/**
Expand Down
Loading

0 comments on commit 2284d12

Please sign in to comment.