Skip to content

Commit

Permalink
Merge branch 'trunk' into add/jetpack-admin-menu-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
coder-karen authored Oct 1, 2024
2 parents d60a3c2 + 9dacd9f commit e8b950e
Show file tree
Hide file tree
Showing 63 changed files with 494 additions and 280 deletions.
22 changes: 4 additions & 18 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions projects/js-packages/publicize-components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.71.0] - 2024-10-01
### Added
- Social: Added support for Bluesky [#39561]

## [0.70.1] - 2024-09-30
### Changed
- Update dependencies. [#39528]
Expand Down Expand Up @@ -948,6 +952,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Updated package dependencies. [#24470]

[0.71.0]: https://github.com/Automattic/jetpack-publicize-components/compare/v0.70.1...v0.71.0
[0.70.1]: https://github.com/Automattic/jetpack-publicize-components/compare/v0.70.0...v0.70.1
[0.70.0]: https://github.com/Automattic/jetpack-publicize-components/compare/v0.69.0...v0.70.0
[0.69.0]: https://github.com/Automattic/jetpack-publicize-components/compare/v0.68.0...v0.69.0
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion projects/js-packages/publicize-components/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@automattic/jetpack-publicize-components",
"version": "0.70.1",
"version": "0.71.0",
"description": "A library of JS components required by the Publicize editor plugin",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/publicize-components/#readme",
"bugs": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: changed

Changes the error Blaze shows during sync to be a warning
28 changes: 20 additions & 8 deletions projects/packages/blaze/src/class-dashboard-rest-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -329,10 +329,6 @@ public function get_blaze_posts( $req ) {
return array();
}

if ( ! $this->are_posts_ready() ) {
return new WP_Error( 'posts_not_ready', 'Posts are not synced yet.' );
}

// We don't use sub_path in the blaze posts, only query strings
if ( isset( $req['sub_path'] ) ) {
unset( $req['sub_path'] );
Expand All @@ -353,6 +349,24 @@ public function get_blaze_posts( $req ) {
$response['posts'] = $this->add_prices_in_posts( $response['posts'] );
}

$response = $this->add_warnings_to_posts_response( $response );

return $response;
}

/**
* Adds warning flags to the posts response.
*
* @param array $response The response object.
* @return array
*/
private function add_warnings_to_posts_response( $response ) {
if ( ! $this->are_posts_ready() && is_array( $response ) ) {
$response['warnings'] = array_merge(
array( 'sync_in_progress' ),
$response['warnings'] ?? array()
);
}
return $response;
}

Expand Down Expand Up @@ -392,10 +406,6 @@ public function get_dsp_blaze_posts( $req ) {
return array();
}

if ( ! $this->are_posts_ready() ) {
return new WP_Error( 'posts_not_ready', 'Posts are not synced yet.' );
}

// We don't use sub_path in the blaze posts, only query strings
if ( isset( $req['sub_path'] ) ) {
unset( $req['sub_path'] );
Expand All @@ -412,6 +422,8 @@ public function get_dsp_blaze_posts( $req ) {
$response['results'] = $this->add_prices_in_posts( $response['results'] );
}

$response = $this->add_warnings_to_posts_response( $response );

return $response;
}

Expand Down
4 changes: 4 additions & 0 deletions projects/packages/calypsoify/changelog/renovate-core-js-3.x
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed
Comment: Remove unneeded `core-js` JS dep.

1 change: 0 additions & 1 deletion projects/packages/calypsoify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"devDependencies": {
"@automattic/jetpack-webpack-config": "workspace:*",
"@wordpress/browserslist-config": "6.7.0",
"core-js": "3.23.5",
"sass": "1.64.1",
"sass-loader": "12.4.0",
"webpack": "5.94.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed
Comment: Remove unneeded `core-js` JS dep.

1 change: 0 additions & 1 deletion projects/packages/classic-theme-helper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"@wordpress/browserslist-config": "6.7.0",
"@wordpress/dependency-extraction-webpack-plugin": "6.7.0",
"autoprefixer": "10.4.14",
"core-js": "3.23.5",
"glob": "10.4.1",
"postcss": "8.4.31",
"postcss-loader": "6.2.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: fixed
Comment: Fix for WP.com sites


4 changes: 4 additions & 0 deletions projects/packages/masterbar/changelog/renovate-core-js-3.x
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed
Comment: Remove unneeded `core-js` JS dep.

1 change: 0 additions & 1 deletion projects/packages/masterbar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
"@wordpress/browserslist-config": "6.7.0",
"@wordpress/dependency-extraction-webpack-plugin": "6.7.0",
"autoprefixer": "10.4.14",
"core-js": "3.23.5",
"glob": "10.4.1",
"postcss": "8.4.31",
"postcss-loader": "6.2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,11 +328,15 @@ public function add_jetpack_menu() {
parent::add_jetpack_menu();
}

$scan_position = $this->get_submenu_item_count( 'jetpack' ) - 1;

global $submenu;
$backup_submenu_label = __( 'Backup', 'jetpack-masterbar' );
$submenu_labels = array_column( $submenu['jetpack'], 3 );
$backup_position = array_search( $backup_submenu_label, $submenu_labels, true );
$scan_position = $backup_position !== false ? $backup_position + 1 : $this->get_submenu_item_count( 'jetpack' ) - 1;
if ( isset( $submenu['jetpack'] ) ) {
$backup_submenu_label = __( 'Backup', 'jetpack-masterbar' );
$submenu_labels = array_column( $submenu['jetpack'], 3 );
$backup_position = array_search( $backup_submenu_label, $submenu_labels, true );
$scan_position = $backup_position !== false ? $backup_position + 1 : $this->get_submenu_item_count( 'jetpack' ) - 1;
}

// @phan-suppress-next-line PhanTypeMismatchArgumentProbablyReal -- Core should ideally document null for no-callback arg. https://core.trac.wordpress.org/ticket/52539.
add_submenu_page( 'jetpack', esc_attr__( 'Scan', 'jetpack-masterbar' ), __( 'Scan', 'jetpack-masterbar' ), 'manage_options', 'https://wordpress.com/scan/history/' . $this->domain, null, $scan_position );
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Social: Fixed Bluesky not showing up on page load
1 change: 1 addition & 0 deletions projects/packages/publicize/src/class-publicize.php
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,7 @@ public function get_services( $filter = 'all', $_blog_id = false, $_user_id = fa
'instagram-business' => array(),
'nextdoor' => array(),
'threads' => array(),
'bluesky' => array(),
);

if ( 'all' === $filter ) {
Expand Down
2 changes: 1 addition & 1 deletion projects/packages/search/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"autoprefixer": "10.4.14",
"babel-jest": "29.4.3",
"concurrently": "7.6.0",
"core-js": "3.23.5",
"core-js": "3.38.1",
"jest": "29.7.0",
"jest-environment-jsdom": "29.7.0",
"postcss": "8.4.31",
Expand Down
2 changes: 1 addition & 1 deletion projects/packages/wordads/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"@wordpress/dependency-extraction-webpack-plugin": "6.7.0",
"babel-jest": "29.4.3",
"concurrently": "7.6.0",
"core-js": "3.23.5",
"core-js": "3.38.1",
"jest": "29.7.0",
"jest-environment-jsdom": "29.7.0",
"prettier": "npm:[email protected]",
Expand Down
12 changes: 2 additions & 10 deletions projects/plugins/jetpack/_inc/client/at-a-glance/connections.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ export class DashConnections extends Component {
<Gridicon icon="globe" size={ 64 } />
) }
<div className="jp-connection-settings__text">
{ __( 'Your site is connected to WordPress.com.', 'jetpack' ) }
{ this.props.isConnectionOwner && (
<span className="jp-connection-settings__is-owner">
{ __( 'You are the Jetpack owner.', 'jetpack' ) }
Expand Down Expand Up @@ -100,7 +99,7 @@ export class DashConnections extends Component {
*/
userConnection() {
const maybeShowLinkUnlinkBtn = this.props.isConnectionOwner ? null : (
<ConnectButton asLink connectUser={ true } from="connection-settings" />
<ConnectButton asBanner connectUser={ true } from="connection-settings" />
);

let cardContent = '';
Expand Down Expand Up @@ -131,14 +130,7 @@ export class DashConnections extends Component {
}

if ( ! this.props.isLinked ) {
cardContent = (
<div>
<div className="jp-connection-settings__info">
{ __( 'Get the most out of Jetpack.', 'jetpack' ) }
</div>
<div className="jp-connection-settings__actions">{ maybeShowLinkUnlinkBtn }</div>
</div>
);
cardContent = <div className="jp-connection-settings__info">{ maybeShowLinkUnlinkBtn }</div>;
} else if ( this.props.isFetchingUserData ) {
cardContent = __( 'Loading…', 'jetpack' );
} else if ( ! this.props.wpComConnectedUser?.email ) {
Expand Down
34 changes: 19 additions & 15 deletions projects/plugins/jetpack/_inc/client/at-a-glance/monitor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import { createInterpolateElement } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import Button from 'components/button';
import DashItem from 'components/dash-item';
import JetpackBanner from 'components/jetpack-banner';
import analytics from 'lib/analytics';
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { Component } from 'react';
import { connect } from 'react-redux';
import { isOfflineMode, hasConnectedOwner, connectUser } from 'state/connection';
import { isModuleAvailable } from 'state/modules';
Expand Down Expand Up @@ -78,26 +79,29 @@ class DashMonitor extends Component {
support={ support }
className="jp-dash-item__is-inactive"
noToggle={ ! this.props.hasConnectedOwner }
overrideContent={
( ! this.props.hasConnectedOwner && ! this.props.isOfflineMode && (
<JetpackBanner
title={ __(
'Connect your WordPress.com account to enable alerts if your site goes down.',
'jetpack'
) }
noIcon
callToAction={ __( 'Connect', 'jetpack' ) }
onClick={ this.props.connectUser }
eventFeature="monitor"
path="dashboard"
eventProps={ { type: 'connect' } }
/>
) ) ||
null
}
>
<p className="jp-dash-item__description">
{ this.props.isOfflineMode
? __( 'Unavailable in Offline Mode.', 'jetpack' )
: activateMessage }
</p>

{ ! this.props.isOfflineMode && ! this.props.hasConnectedOwner && (
<p className="jp-dash-item__description jp-dash-item__connect">
{ createInterpolateElement(
__(
'<Button>Connect your WordPress.com</Button> account to use this feature.',
'jetpack'
),
{
Button: <Button className="jp-link-button" onClick={ this.connect } />,
}
) }
</p>
) }
</DashItem>
);
}
Expand Down
34 changes: 34 additions & 0 deletions projects/plugins/jetpack/_inc/client/at-a-glance/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -717,3 +717,37 @@ a.jp-dash-item__manage-in-wpcom,
border-top: 1px solid $gray-5;
}
}

.jp-dash-item.jp-connection-type {
border: 1px solid transparent;
border-radius: 4px;

.jp-dash-item__card {
padding: 16px 16px 16px 24px;
}

.jp-dash-item__content {
display: block;
}

.jp-connection-settings__text {
flex-grow: 1;
}

.jp-dash-item__content,
.jp-connection-settings__text {
align-self: center;
}

.dops-banner {
padding: 0;

&__title {
padding: 0 0.5rem 0 0;
}
}

.dops-banner.dops-card {
display: block;
}
}
Loading

0 comments on commit e8b950e

Please sign in to comment.