Skip to content

Commit

Permalink
[WC Analytics] Fix fatal error when cart is null (#40729)
Browse files Browse the repository at this point in the history
* Prevent fatal when cat is null

* Changelog

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/12493424562

Upstream-Ref: Automattic/jetpack@70ea294
  • Loading branch information
zinigor authored and matticbot committed Dec 25, 2024
1 parent 76fbf8a commit e253a02
Show file tree
Hide file tree
Showing 116 changed files with 3,295 additions and 409 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ node_modules export-ignore

# Files to exclude from the mirror repo
/changelog/** production-exclude
/.eslintrc.cjs production-exclude
/jest.config.cjs production-exclude
**/stories/** production-exclude
**/test/** production-exclude
265 changes: 256 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,215 @@

### This is a list detailing changes for the Jetpack RNA Components package releases.

## [0.65.1] - 2024-12-23
### Changed
- Internal updates.

## [0.65.0] - 2024-12-16
### Changed
- Fixes ThreatsDataViews defaultLayouts. [#40598]
- Updated package dependencies. [#40564] [#40598]

### Fixed
- Fix ToggleControl's help text indent to align with label text. [#40510]

## [0.64.1] - 2024-12-09
### Removed
- Remove bulk action support from the ThreatsDataViews component. [#40483]

### Fixed
- Fixed threat type values and labels. [#40467]

## [0.64.0] - 2024-12-04
### Changed
- Changed text domain from 'jetpack' to 'jetpack-components'. [#40368]
- Minor enhancements to the ThreatsDataViews component [#40398]
- Updated package dependencies. [#40363]

## [0.63.0] - 2024-11-26
### Changed
- Updates ThreatModal flow [#40214]

## [0.62.0] - 2024-11-25
### Added
- Add Stats icon [#40236]
- Adds ThreatModal component and stories [#40197]

### Changed
- Updated package dependencies. [#40288]

## [0.61.0] - 2024-11-18
### Added
- Gridicon Component: Add support for help-outline icon. [#39867]

## [0.60.0] - 2024-11-14
### Added
- Adds tooltips for each ThreatFixerButton state [#40111]

### Fixed
- Fixes the loading placeholder that didn't disappear when the price loads. [#40157]

## [0.59.0] - 2024-11-11
### Added
- Add ThreatsDataViews component [#39754]
- Components: add ref for container component [#39850]
- IconTooltip: add support for showing tooltip on hover. [#39916]

### Changed
- Add ToggleGroupControl to ThreatsDataViews for easily toggling between Active and Historical threats [#39901]
- Updated package dependencies. [#39999] [#40000] [#40060]

## [0.58.1] - 2024-11-04
### Added
- Enable test coverage. [#39961]

### Fixed
- Fix tooltip behavior. [#39879]

## [0.58.0] - 2024-10-15
### Added
- Add DiffViewer component [#39672]
- Add ThreatSeverityBadge component [#39758]

## [0.57.0] - 2024-10-14
### Added
- Add JetpackProtectLogo component. [#39703]
- Add MarkedLines component. [#39674]

## [0.56.3] - 2024-10-10
### Changed
- Components - getRedirectUrl: use file extension on import for linter to find definitions
- Updated package dependencies.

## [0.56.2] - 2024-10-07
### Changed
- Updated package dependencies. [#39594]

## [0.56.1] - 2024-10-02
### Changed
- Updated package dependencies. [#39610]

## [0.56.0] - 2024-09-25
### Added
- Added StatCard component export [#35739]

## [0.55.17] - 2024-09-18
### Changed
- Internal updates.

## [0.55.16] - 2024-09-16
### Changed
- Updated package dependencies. [#39332]

## [0.55.15] - 2024-09-10
### Changed
- Updated package dependencies. [#39302]

## [0.55.14] - 2024-09-09
### Changed
- Updated package dependencies. [#39278]

## [0.55.13] - 2024-09-05
### Changed
- Internal updates.

## [0.55.12] - 2024-09-05
### Changed
- Updated package dependencies. [#39176]

### Fixed
- ToggleControl: Update styles for WordPress/gutenberg#63490. [#39176]

## [0.55.11] - 2024-08-29
### Changed
- Updated package dependencies. [#39111]

## [0.55.10] - 2024-08-23
### Changed
- Internal updates.

## [0.55.9] - 2024-08-21
### Fixed
- Revert recent SVG image optimizations. [#38981]

## [0.55.8] - 2024-08-19
### Changed
- Updated package dependencies. [#38893]

### Fixed
- Lossless image optimization for images (should improve performance with no visible changes). [#38750]

## [0.55.7] - 2024-08-15
### Changed
- Updated package dependencies. [#38665]

## [0.55.6] - 2024-08-09
### Removed
- Tests: Removed react-test-renderer. [#38755]

## [0.55.5] - 2024-08-05
### Fixed
- Fixed TS types for Notice components by marking optional props as such [#38686]

## [0.55.4] - 2024-08-01
### Added
- Update Welcome Banner and set async site-only connection [#38534]

## [0.55.3] - 2024-07-30
### Changed
- React: Changing global JSX namespace to React.JSX [#38585]

## [0.55.2] - 2024-07-26
### Added
- Export button props type to be used elsewhere [#38549]

## [0.55.1] - 2024-07-25
### Added
- Added `className` prop to `Alert` component [#38450]

### Changed
- React compatibility: Ensuring createRoot is not called more than once. [#38495]

## [0.55.0] - 2024-07-22
### Removed
- Remove compatibility with WordPress 6.4. [#38386]

## [0.54.4] - 2024-07-18
### Changed
- Internal updates.

## [0.54.3] - 2024-07-03
### Changed
- Updated package dependencies. [#38132]

## [0.54.2] - 2024-06-25
### Added
- Added social preview for Threads [#38003]

## [0.54.1] - 2024-06-24
### Fixed
- Updated threads icon color [#37977]

## [0.54.0] - 2024-06-21
### Added
- Added Chip component [#37916]

## [0.53.10] - 2024-06-12
### Changed
- Updated package dependencies. [#37796]

## [0.53.9] - 2024-06-11
### Changed
- Updated package dependencies. [#37779]

## [0.53.8] - 2024-06-10
### Changed
- Change codebase to use clsx instead of classnames. [#37708]

## [0.53.7] - 2024-06-05
### Changed
- Updated package dependencies. [#37669]

## [0.53.6] - 2024-05-30
### Changed
- Connection: Update connection ToS messaging slightly [#37536]
Expand All @@ -19,9 +228,7 @@
- Social | Wired up confirmation UI with connect button [#37295]

### Changed
- Updated package dependencies. [#37379]
- Updated package dependencies. [#37380]
- Updated package dependencies. [#37382]
- Updated package dependencies. [#37379] [#37380] [#37382]

## [0.53.2] - 2024-05-13
### Added
Expand Down Expand Up @@ -246,8 +453,7 @@

## [0.42.1] - 2023-09-04
### Changed
- Updated package dependencies. [#32803]
- Updated package dependencies. [#32804]
- Updated package dependencies. [#32803] [#32804]

## [0.42.0] - 2023-09-01
### Added
Expand Down Expand Up @@ -297,8 +503,7 @@
## [0.40.1] - 2023-07-05
### Changed
- Adjust component pricing slider border and box-shadow styling. [#31593]
- Updated package dependencies. [#31659]
- Updated package dependencies. [#31661]
- Updated package dependencies. [#31659] [#31661]
- Update storybook mdx to use `@storybook/blocks` directly rather than `@storybook/addon-docs`. [#31607]

### Fixed
Expand Down Expand Up @@ -576,8 +781,7 @@
- Fix ProductPrice layout for long prices [#26595]
- IconTooltip: Use click instead of mouseover for summoning [#26457]
- Refactor props for structure consistency with JetpackLogo component. [#26510]
- Updated package dependencies. [#26568]
- Updated package dependencies. [#26583]
- Updated package dependencies. [#26568] [#26583]

### Fixed
- Components: fix the positio of TOS component of the PricingTable cmp [#26509]
Expand Down Expand Up @@ -1051,6 +1255,49 @@
### Changed
- Update node version requirement to 14.16.1

[0.65.1]: https://github.com/Automattic/jetpack-components/compare/0.65.0...0.65.1
[0.65.0]: https://github.com/Automattic/jetpack-components/compare/0.64.1...0.65.0
[0.64.1]: https://github.com/Automattic/jetpack-components/compare/0.64.0...0.64.1
[0.64.0]: https://github.com/Automattic/jetpack-components/compare/0.63.0...0.64.0
[0.63.0]: https://github.com/Automattic/jetpack-components/compare/0.62.0...0.63.0
[0.62.0]: https://github.com/Automattic/jetpack-components/compare/0.61.0...0.62.0
[0.61.0]: https://github.com/Automattic/jetpack-components/compare/0.60.0...0.61.0
[0.60.0]: https://github.com/Automattic/jetpack-components/compare/0.59.0...0.60.0
[0.59.0]: https://github.com/Automattic/jetpack-components/compare/0.58.1...0.59.0
[0.58.1]: https://github.com/Automattic/jetpack-components/compare/0.58.0...0.58.1
[0.58.0]: https://github.com/Automattic/jetpack-components/compare/0.57.0...0.58.0
[0.57.0]: https://github.com/Automattic/jetpack-components/compare/0.56.3...0.57.0
[0.56.3]: https://github.com/Automattic/jetpack-components/compare/0.56.2...0.56.3
[0.56.2]: https://github.com/Automattic/jetpack-components/compare/0.56.1...0.56.2
[0.56.1]: https://github.com/Automattic/jetpack-components/compare/0.56.0...0.56.1
[0.56.0]: https://github.com/Automattic/jetpack-components/compare/0.55.17...0.56.0
[0.55.17]: https://github.com/Automattic/jetpack-components/compare/0.55.16...0.55.17
[0.55.16]: https://github.com/Automattic/jetpack-components/compare/0.55.15...0.55.16
[0.55.15]: https://github.com/Automattic/jetpack-components/compare/0.55.14...0.55.15
[0.55.14]: https://github.com/Automattic/jetpack-components/compare/0.55.13...0.55.14
[0.55.13]: https://github.com/Automattic/jetpack-components/compare/0.55.12...0.55.13
[0.55.12]: https://github.com/Automattic/jetpack-components/compare/0.55.11...0.55.12
[0.55.11]: https://github.com/Automattic/jetpack-components/compare/0.55.10...0.55.11
[0.55.10]: https://github.com/Automattic/jetpack-components/compare/0.55.9...0.55.10
[0.55.9]: https://github.com/Automattic/jetpack-components/compare/0.55.8...0.55.9
[0.55.8]: https://github.com/Automattic/jetpack-components/compare/0.55.7...0.55.8
[0.55.7]: https://github.com/Automattic/jetpack-components/compare/0.55.6...0.55.7
[0.55.6]: https://github.com/Automattic/jetpack-components/compare/0.55.5...0.55.6
[0.55.5]: https://github.com/Automattic/jetpack-components/compare/0.55.4...0.55.5
[0.55.4]: https://github.com/Automattic/jetpack-components/compare/0.55.3...0.55.4
[0.55.3]: https://github.com/Automattic/jetpack-components/compare/0.55.2...0.55.3
[0.55.2]: https://github.com/Automattic/jetpack-components/compare/0.55.1...0.55.2
[0.55.1]: https://github.com/Automattic/jetpack-components/compare/0.55.0...0.55.1
[0.55.0]: https://github.com/Automattic/jetpack-components/compare/0.54.4...0.55.0
[0.54.4]: https://github.com/Automattic/jetpack-components/compare/0.54.3...0.54.4
[0.54.3]: https://github.com/Automattic/jetpack-components/compare/0.54.2...0.54.3
[0.54.2]: https://github.com/Automattic/jetpack-components/compare/0.54.1...0.54.2
[0.54.1]: https://github.com/Automattic/jetpack-components/compare/0.54.0...0.54.1
[0.54.0]: https://github.com/Automattic/jetpack-components/compare/0.53.10...0.54.0
[0.53.10]: https://github.com/Automattic/jetpack-components/compare/0.53.9...0.53.10
[0.53.9]: https://github.com/Automattic/jetpack-components/compare/0.53.8...0.53.9
[0.53.8]: https://github.com/Automattic/jetpack-components/compare/0.53.7...0.53.8
[0.53.7]: https://github.com/Automattic/jetpack-components/compare/0.53.6...0.53.7
[0.53.6]: https://github.com/Automattic/jetpack-components/compare/0.53.5...0.53.6
[0.53.5]: https://github.com/Automattic/jetpack-components/compare/0.53.4...0.53.5
[0.53.4]: https://github.com/Automattic/jetpack-components/compare/0.53.3...0.53.4
Expand Down
19 changes: 13 additions & 6 deletions components/action-button/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import { Spinner } from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import classNames from 'classnames';
import clsx from 'clsx';
import PropTypes from 'prop-types';
/**
* Internal dependencies
Expand All @@ -20,7 +20,7 @@ import styles from './style.module.scss';
* It is useful to async actions when the user has to wait the result of a request or process.
*
* @param {object} props - The properties.
* @returns {React.Component} The `ActionButton` component.
* @return {React.Component} The `ActionButton` component.
*/
const ActionButton = props => {
const {
Expand All @@ -30,7 +30,9 @@ const ActionButton = props => {
loadingText,
isDisabled,
displayError = false,
errorMessage = __( 'An error occurred. Please try again.', 'jetpack' ),
errorMessage = __( 'An error occurred. Please try again.', 'jetpack-components' ),
variant = 'primary',
isExternalLink = false,
customClass,
} = props;

Expand All @@ -40,18 +42,19 @@ const ActionButton = props => {
<>
{
<Button
className={ classNames( styles.button, 'jp-action-button--button', customClass ) }
className={ clsx( styles.button, 'jp-action-button--button', customClass ) }
label={ label }
onClick={ onClick }
variant="primary"
variant={ isExternalLink ? 'link' : variant }
isExternalLink={ isExternalLink }
disabled={ isLoading || isDisabled }
>
{ isLoading ? loadingContent : label }
</Button>
}

{ displayError && (
<p className={ classNames( styles.error, 'jp-action-button__error' ) }>{ errorMessage }</p>
<p className={ clsx( styles.error, 'jp-action-button__error' ) }>{ errorMessage }</p>
) }
</>
);
Expand All @@ -70,6 +73,10 @@ ActionButton.propTypes = {
displayError: PropTypes.bool,
/** The error message string */
errorMessage: PropTypes.oneOfType( [ PropTypes.string, PropTypes.element ] ),
/** The type/variant of button */
variant: PropTypes.arrayOf( PropTypes.oneOf( [ 'primary', 'secondary', 'link' ] ) ),
/** Will display the button as a link with an external icon. */
isExternalLink: PropTypes.bool,
};

export default ActionButton;
2 changes: 1 addition & 1 deletion components/action-popover/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const ActionPopover = ( {
if ( showSteps ) {
stepsText = sprintf(
/* translators: 1 Current step, 2 Total steps */
__( '%1$d of %2$d', 'jetpack' ),
__( '%1$d of %2$d', 'jetpack-components' ),
step,
totalSteps
);
Expand Down
Loading

0 comments on commit e253a02

Please sign in to comment.