diff --git a/CHANGELOG.md b/CHANGELOG.md index 2037ad3..1a719b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,124 @@ ### This is a list detailing changes for the Jetpack RNA Connection Component releases. +## [0.36.0] - 2024-12-04 +### Changed +- Changed text domain from 'jetpack' to 'jetpack-connection-js'. [#40368] +- Updated package dependencies. [#40363] + +## [0.35.20] - 2024-11-26 +### Changed +- Update dependencies. + +## [0.35.19] - 2024-11-25 +### Changed +- Updated package dependencies. [#40288] + +## [0.35.18] - 2024-11-18 +### Changed +- Update dependencies. + +## [0.35.17] - 2024-11-14 +### Changed +- Update dependencies. + +## [0.35.16] - 2024-11-11 +### Changed +- Updated package dependencies. [#39999] [#40000] [#40060] + +## [0.35.15] - 2024-11-04 +### Added +- Enable test coverage. [#39961] + +### Changed +- Skip pricing page when connecting via block editor. [#39865] + +## [0.35.14] - 2024-10-15 +### Changed +- Update dependencies. + +## [0.35.13] - 2024-10-14 +### Changed +- Internal updates. + +## [0.35.12] - 2024-10-10 +### Changed +- Updated package dependencies. + +## [0.35.11] - 2024-10-07 +### Changed +- Updated package dependencies. [#39594] + +## [0.35.10] - 2024-09-30 +### Changed +- Fetch adminUrl current value on function run [#39578] + +## [0.35.9] - 2024-09-25 +### Changed +- Update dependencies. + +## [0.35.8] - 2024-09-16 +### Changed +- Updated package dependencies. [#39332] + +## [0.35.7] - 2024-09-10 +### Changed +- Updated package dependencies. [#39302] + +## [0.35.6] - 2024-09-09 +### Changed +- Updated package dependencies. [#39278] + +## [0.35.5] - 2024-09-05 +### Changed +- Internal updates. + +## [0.35.4] - 2024-09-05 +### Changed +- Updated package dependencies. [#39176] + +## [0.35.3] - 2024-08-21 +### Changed +- Internal updates. + +## [0.35.2] - 2024-08-19 +### Changed +- Updated package dependencies. [#38893] + +### Fixed +- Lossless image optimization for images (should improve performance with no visible changes). [#38750] + +## [0.35.1] - 2024-08-15 +### Changed +- Updated package dependencies. [#38665] + +## [0.35.0] - 2024-08-13 +### Added +- Updated the connection initial state to fallback on the new consolidated Jetpack script data [#38825] + +## [0.34.2] - 2024-08-09 +### Added +- React 19 compatibility: Making sure useRef includes an argument. [#38765] + +### Removed +- Tests: Removed react-test-renderer. [#38755] + +## [0.34.1] - 2024-07-22 +### Added +- Display the proper error message for suspended sites on site registration. [#38359] + +## [0.34.0] - 2024-07-18 +### Changed +- Connection Screen: remove mention of Stats from the list of available free features. [#38328] + +## [0.33.19] - 2024-07-03 +### Changed +- Updated package dependencies. [#38132] + +## [0.33.18] - 2024-06-21 +### Changed +- Update dependencies. + ## [0.33.17] - 2024-06-17 ### Changed - Update type to enable JSX use [#37802] @@ -169,8 +287,7 @@ ## [0.29.9] - 2023-09-04 ### Changed -- Updated package dependencies. [#32803] -- Updated package dependencies. [#32804] +- Updated package dependencies. [#32803] [#32804] ## [0.29.8] - 2023-08-21 ### Added @@ -789,6 +906,33 @@ - `Main` and `ConnectUser` components added. - `JetpackRestApiClient` API client added. +[0.36.0]: https://github.com/Automattic/jetpack-connection-js/compare/v0.35.20...v0.36.0 +[0.35.20]: https://github.com/Automattic/jetpack-connection-js/compare/v0.35.19...v0.35.20 +[0.35.19]: https://github.com/Automattic/jetpack-connection-js/compare/v0.35.18...v0.35.19 +[0.35.18]: https://github.com/Automattic/jetpack-connection-js/compare/v0.35.17...v0.35.18 +[0.35.17]: https://github.com/Automattic/jetpack-connection-js/compare/v0.35.16...v0.35.17 +[0.35.16]: https://github.com/Automattic/jetpack-connection-js/compare/v0.35.15...v0.35.16 +[0.35.15]: https://github.com/Automattic/jetpack-connection-js/compare/v0.35.14...v0.35.15 +[0.35.14]: https://github.com/Automattic/jetpack-connection-js/compare/v0.35.13...v0.35.14 +[0.35.13]: https://github.com/Automattic/jetpack-connection-js/compare/v0.35.12...v0.35.13 +[0.35.12]: https://github.com/Automattic/jetpack-connection-js/compare/v0.35.11...v0.35.12 +[0.35.11]: https://github.com/Automattic/jetpack-connection-js/compare/v0.35.10...v0.35.11 +[0.35.10]: https://github.com/Automattic/jetpack-connection-js/compare/v0.35.9...v0.35.10 +[0.35.9]: https://github.com/Automattic/jetpack-connection-js/compare/v0.35.8...v0.35.9 +[0.35.8]: https://github.com/Automattic/jetpack-connection-js/compare/v0.35.7...v0.35.8 +[0.35.7]: https://github.com/Automattic/jetpack-connection-js/compare/v0.35.6...v0.35.7 +[0.35.6]: https://github.com/Automattic/jetpack-connection-js/compare/v0.35.5...v0.35.6 +[0.35.5]: https://github.com/Automattic/jetpack-connection-js/compare/v0.35.4...v0.35.5 +[0.35.4]: https://github.com/Automattic/jetpack-connection-js/compare/v0.35.3...v0.35.4 +[0.35.3]: https://github.com/Automattic/jetpack-connection-js/compare/v0.35.2...v0.35.3 +[0.35.2]: https://github.com/Automattic/jetpack-connection-js/compare/v0.35.1...v0.35.2 +[0.35.1]: https://github.com/Automattic/jetpack-connection-js/compare/v0.35.0...v0.35.1 +[0.35.0]: https://github.com/Automattic/jetpack-connection-js/compare/v0.34.2...v0.35.0 +[0.34.2]: https://github.com/Automattic/jetpack-connection-js/compare/v0.34.1...v0.34.2 +[0.34.1]: https://github.com/Automattic/jetpack-connection-js/compare/v0.34.0...v0.34.1 +[0.34.0]: https://github.com/Automattic/jetpack-connection-js/compare/v0.33.19...v0.34.0 +[0.33.19]: https://github.com/Automattic/jetpack-connection-js/compare/v0.33.18...v0.33.19 +[0.33.18]: https://github.com/Automattic/jetpack-connection-js/compare/v0.33.17...v0.33.18 [0.33.17]: https://github.com/Automattic/jetpack-connection-js/compare/v0.33.16...v0.33.17 [0.33.16]: https://github.com/Automattic/jetpack-connection-js/compare/v0.33.15...v0.33.16 [0.33.15]: https://github.com/Automattic/jetpack-connection-js/compare/v0.33.14...v0.33.15 diff --git a/components/connect-button/index.jsx b/components/connect-button/index.jsx index d9744f7..d1ab715 100644 --- a/components/connect-button/index.jsx +++ b/components/connect-button/index.jsx @@ -8,13 +8,13 @@ import useConnection from '../use-connection'; * The RNA connection component. * * @param {object} props -- The properties. - * @returns {React.Component} The RNA connection component. + * @return {React.Component} The RNA connection component. */ const ConnectButton = props => { const { apiRoot, apiNonce, - connectLabel = __( 'Connect', 'jetpack' ), + connectLabel = __( 'Connect', 'jetpack-connection-js' ), registrationNonce, redirectUri = null, from, diff --git a/components/connect-screen/basic/index.tsx b/components/connect-screen/basic/index.tsx index 0b454ba..4a57351 100644 --- a/components/connect-screen/basic/index.tsx +++ b/components/connect-screen/basic/index.tsx @@ -30,6 +30,8 @@ export type Props = { assetBaseUrl?: string; // Whether to not require a user connection and just redirect after site connection skipUserConnection?: boolean; + // Whether to skip the pricing page after the connection screen + skipPricingPage?: boolean; // Additional page elements to show after the call to action footer?: React.ReactNode; // The logo to display at the top of the component @@ -54,6 +56,7 @@ const ConnectScreen: React.FC< Props > = ( { autoTrigger, footer, skipUserConnection, + skipPricingPage, logo, } ) => { const { @@ -70,6 +73,7 @@ const ConnectScreen: React.FC< Props > = ( { autoTrigger, from, skipUserConnection, + skipPricingPage, } ); const displayButtonError = Boolean( registrationError ); @@ -79,11 +83,12 @@ const ConnectScreen: React.FC< Props > = ( { return ( { case 'siteurl_private_ip': return __( 'Your site host is on a private network. Jetpack can only connect to public sites.', - 'jetpack' + 'jetpack-connection-js' ); + case 'connection_disabled': + return __( 'This site has been suspended.', 'jetpack-connection-js' ); } if ( isOfflineMode ) { - return createInterpolateElement( __( 'Unavailable in Offline Mode', 'jetpack' ), { - a: ( - - ), - } ); + return createInterpolateElement( + __( 'Unavailable in Offline Mode', 'jetpack-connection-js' ), + { + a: ( + + ), + } + ); } }; @@ -107,7 +112,7 @@ const ConnectScreenVisual: React.FC< Props > = ( { isDisabled={ isOfflineMode } /> - { buttonIsLoading ? loadingLabel || __( 'Loading', 'jetpack' ) : '' } + { buttonIsLoading ? loadingLabel || __( 'Loading', 'jetpack-connection-js' ) : '' } { footer &&
{ footer }
} diff --git a/components/connect-screen/required-plan/index.jsx b/components/connect-screen/required-plan/index.jsx index d25f8c4..1d9614f 100644 --- a/components/connect-screen/required-plan/index.jsx +++ b/components/connect-screen/required-plan/index.jsx @@ -9,13 +9,16 @@ import ConnectScreenRequiredPlanVisual from './visual'; * The Connection Screen Visual component for consumers that require a Plan. * * @param {object} props -- The properties. - * @returns {React.Component} The `ConnectScreenForRequiredPlan` component. + * @return {React.Component} The `ConnectScreenForRequiredPlan` component. */ const ConnectScreenRequiredPlan = props => { const { - title = __( 'Over 5 million WordPress sites are faster and more secure', 'jetpack' ), + title = __( + 'Over 5 million WordPress sites are faster and more secure', + 'jetpack-connection-js' + ), autoTrigger = false, - buttonLabel = __( 'Set up Jetpack', 'jetpack' ), + buttonLabel = __( 'Set up Jetpack', 'jetpack-connection-js' ), apiRoot, apiNonce, registrationNonce, diff --git a/components/connect-screen/required-plan/visual.jsx b/components/connect-screen/required-plan/visual.jsx index 5710142..99c117c 100644 --- a/components/connect-screen/required-plan/visual.jsx +++ b/components/connect-screen/required-plan/visual.jsx @@ -19,7 +19,7 @@ const debug = debugFactory( 'jetpack:connection:ConnectScreenRequiredPlanVisual' * The Connection Screen Visual component for consumers that require a Plan. * * @param {object} props -- The properties. - * @returns {React.Component} The `ConnectScreenRequiredPlanVisual` component. + * @return {React.Component} The `ConnectScreenRequiredPlanVisual` component. */ const ConnectScreenRequiredPlanVisual = props => { const { @@ -43,11 +43,11 @@ const ConnectScreenRequiredPlanVisual = props => { debug( 'props are %o', props ); const withSubscription = createInterpolateElement( - __( 'Already have a subscription? ', 'jetpack' ), + __( 'Already have a subscription? ', 'jetpack-connection-js' ), { connectButton: ( @@ -56,15 +56,18 @@ const ConnectScreenRequiredPlanVisual = props => { ); const errorMessage = isOfflineMode - ? createInterpolateElement( __( 'Unavailable in
Offline Mode', 'jetpack' ), { - a: ( - - ), - } ) + ? createInterpolateElement( + __( 'Unavailable in Offline Mode', 'jetpack-connection-js' ), + { + a: ( + + ), + } + ) : undefined; return ( diff --git a/components/connect-user/index.jsx b/components/connect-user/index.jsx index 72062b0..f1c84d3 100644 --- a/components/connect-user/index.jsx +++ b/components/connect-user/index.jsx @@ -5,12 +5,12 @@ import { useState, useEffect } from 'react'; /** * The user connection component. * - * @param {object} props -- The properties. + * @param {object} props -- The properties. * @param {Function} props.redirectFunc -- The redirect function (`window.location.assign()` by default). - * @param {string} props.connectUrl -- The authorization URL (no-iframe). - * @param {string} props.redirectUri -- The redirect admin URI. - * @param {string} props.from -- Where the connection request is coming from. - * @returns {null} -- Nothing to return. + * @param {string} props.connectUrl -- The authorization URL (no-iframe). + * @param {string} props.redirectUri -- The redirect admin URI. + * @param {string} props.from -- Where the connection request is coming from. + * @return {null} -- Nothing to return. */ const ConnectUser = props => { const { diff --git a/components/connected-plugins/index.jsx b/components/connected-plugins/index.jsx index 043f191..84aac16 100644 --- a/components/connected-plugins/index.jsx +++ b/components/connected-plugins/index.jsx @@ -7,7 +7,7 @@ import DisconnectCard from '../disconnect-card'; * Render a list of connected plugins. * * @param {object} props - The properties - * @returns {React.Component} - The ConnectedPlugins React component + * @return {React.Component} - The ConnectedPlugins React component */ const ConnectedPlugins = props => { @@ -40,7 +40,7 @@ const ConnectedPlugins = props => {

{ __( 'Jetpack is powering other plugins on your site. If you disconnect, these plugins will no longer work.', - 'jetpack' + 'jetpack-connection-js' ) }

diff --git a/components/connection-error-notice/index.jsx b/components/connection-error-notice/index.jsx index 5e3acc8..bf9dfb0 100644 --- a/components/connection-error-notice/index.jsx +++ b/components/connection-error-notice/index.jsx @@ -9,7 +9,7 @@ import styles from './styles.module.scss'; * The RNA Connection Error Notice component. * * @param {object} props -- The properties. - * @returns {React.Component} The `ConnectionErrorNotice` component. + * @return {React.Component} The `ConnectionErrorNotice` component. */ const ConnectionErrorNotice = props => { const { message, isRestoringConnection, restoreConnectionCallback, restoreConnectionError } = @@ -50,7 +50,7 @@ const ConnectionErrorNotice = props => {
- { __( 'Reconnecting Jetpack', 'jetpack' ) } + { __( 'Reconnecting Jetpack', 'jetpack-connection-js' ) }
); @@ -66,7 +66,7 @@ const ConnectionErrorNotice = props => { { icon } { sprintf( /* translators: placeholder is the error. */ - __( 'There was an error reconnecting Jetpack. Error: %s', 'jetpack' ), + __( 'There was an error reconnecting Jetpack. Error: %s', 'jetpack-connection-js' ), restoreConnectionError ) } @@ -88,7 +88,7 @@ const ConnectionErrorNotice = props => { className={ styles.button } href="#" > - { __( 'Restore Connection', 'jetpack' ) } + { __( 'Restore Connection', 'jetpack-connection-js' ) }
) } diff --git a/components/disconnect-card/index.jsx b/components/disconnect-card/index.jsx index 8ceedd6..580462b 100644 --- a/components/disconnect-card/index.jsx +++ b/components/disconnect-card/index.jsx @@ -8,7 +8,7 @@ import './style.scss'; * Used in the disconnection flow. * * @param {object} props - The Properties. - * @returns {React.Component} DisconnectCard - The disconnect card component. + * @return {React.Component} DisconnectCard - The disconnect card component. */ const DisconnectCard = props => { const { title, value, description } = props; diff --git a/components/disconnect-dialog/index.jsx b/components/disconnect-dialog/index.jsx index 61e2f49..c8c82e6 100644 --- a/components/disconnect-dialog/index.jsx +++ b/components/disconnect-dialog/index.jsx @@ -15,7 +15,7 @@ import StepThankYou from './steps/step-thank-you'; * The RNA Disconnect Dialog component. * * @param {object} props -- The properties. - * @returns {React.Component} The `DisconnectDialog` component. + * @return {React.Component} The `DisconnectDialog` component. */ const DisconnectDialog = props => { const [ isDisconnecting, setIsDisconnecting ] = useState( false ); @@ -29,7 +29,7 @@ const DisconnectDialog = props => { apiRoot, apiNonce, connectedPlugins, - title = __( 'Are you sure you want to disconnect?', 'jetpack' ), + title = __( 'Are you sure you want to disconnect?', 'jetpack-connection-js' ), pluginScreenDisconnectCallback, onDisconnected, onError, @@ -302,7 +302,7 @@ const DisconnectDialog = props => { /** * Determine what step to show based on the current state * - * @returns { React.Component|undefined } - component for current step + * @return { React.Component|undefined } - component for current step */ const getCurrentStep = () => { if ( ! isDisconnected ) { diff --git a/components/disconnect-dialog/steps/step-disconnect-confirm.jsx b/components/disconnect-dialog/steps/step-disconnect-confirm.jsx index 1e89a88..16b05d1 100644 --- a/components/disconnect-dialog/steps/step-disconnect-confirm.jsx +++ b/components/disconnect-dialog/steps/step-disconnect-confirm.jsx @@ -11,7 +11,7 @@ import disconnectImage from '../images/disconnect-confirm.jpg'; * Will only show option to provide feedback if the canProvideFeedback prop is true. * * @param {object} props - The properties. - * @returns {React.Component} - StepDisconnectConfirm Component + * @return {React.Component} - StepDisconnectConfirm Component */ const StepDisconnectConfirm = props => { const { onExit, canProvideFeedback, onProvideFeedback } = props; @@ -23,7 +23,7 @@ const StepDisconnectConfirm = props => {

{ createInterpolateElement( - __( 'Jetpack has been
successfully disconnected.', 'jetpack' ), + __( 'Jetpack has been
successfully disconnected.', 'jetpack-connection-js' ), { br:
, } @@ -35,7 +35,7 @@ const StepDisconnectConfirm = props => {

{ __( 'We’re sorry to see you go. Here at Jetpack, we’re always striving to provide the best experience for our customers. Please take our short survey (2 minutes, promise).', - 'jetpack' + 'jetpack-connection-js' ) }

@@ -44,7 +44,7 @@ const StepDisconnectConfirm = props => { onClick={ onProvideFeedback } className="jp-connection__disconnect-dialog__btn-back-to-wp" > - { __( 'Help us improve', 'jetpack' ) } + { __( 'Help us improve', 'jetpack-connection-js' ) }

{ href="#" onClick={ onExit } > - { __( 'No thank you', 'jetpack' ) } + { __( 'No thank you', 'jetpack-connection-js' ) } ) } @@ -65,7 +65,7 @@ const StepDisconnectConfirm = props => { onClick={ onExit } className="jp-connection__disconnect-dialog__btn-back-to-wp" > - { __( 'Back to my website', 'jetpack' ) } + { __( 'Back to my website', 'jetpack-connection-js' ) }

diff --git a/components/disconnect-dialog/steps/step-disconnect.jsx b/components/disconnect-dialog/steps/step-disconnect.jsx index 4bbbe95..0cdc9ab 100644 --- a/components/disconnect-dialog/steps/step-disconnect.jsx +++ b/components/disconnect-dialog/steps/step-disconnect.jsx @@ -10,7 +10,7 @@ import ConnectedPlugins from '../../connected-plugins'; * Disconnect step in disconnection flow. * * @param {object} props - The properties. - * @returns {React.Component} - The StepDisconnect component + * @return {React.Component} - The StepDisconnect component */ const StepDisconnect = props => { const { @@ -66,15 +66,15 @@ const StepDisconnect = props => { /** * Render the disconnect button, allows for some variance based on context. * - * @returns {React.Component} - Button used for disconnect. + * @return {React.Component} - Button used for disconnect. */ const renderDisconnectButton = () => { - let buttonText = __( 'Disconnect', 'jetpack' ); + let buttonText = __( 'Disconnect', 'jetpack-connection-js' ); // When showing on the plugins page, this button should deactivate the plugin as well. if ( isDisconnecting ) { - buttonText = __( 'Disconnecting…', 'jetpack' ); + buttonText = __( 'Disconnecting…', 'jetpack-connection-js' ); } else if ( context === 'plugins' ) { - buttonText = __( 'Deactivate', 'jetpack' ); + buttonText = __( 'Deactivate', 'jetpack-connection-js' ); } return ( @@ -93,7 +93,7 @@ const StepDisconnect = props => { * Show some fallback output if there are no connected plugins to show and no passed disconnect component. * This is a more generic message about disconnecting Jetpack. * - * @returns {React.ElementType|undefined} - Fallback message for when there are no connected plugins or passed components to show. + * @return {React.ElementType|undefined} - Fallback message for when there are no connected plugins or passed components to show. */ const renderFallbackOutput = () => { const hasOtherConnectedPlugins = @@ -104,9 +104,15 @@ const StepDisconnect = props => { return (

- { __( 'Jetpack is currently powering multiple products on your site.', 'jetpack' ) } + { __( + 'Jetpack is currently powering multiple products on your site.', + 'jetpack-connection-js' + ) }
- { __( 'Once you disconnect Jetpack, these will no longer work.', 'jetpack' ) } + { __( + 'Once you disconnect Jetpack, these will no longer work.', + 'jetpack-connection-js' + ) }

); @@ -134,7 +140,7 @@ const StepDisconnect = props => { { createInterpolateElement( __( 'Need help? Learn more about the Jetpack connection or contact Jetpack support.', - 'jetpack' + 'jetpack-connection-js' ), { strong: , @@ -166,8 +172,12 @@ const StepDisconnect = props => { className="jp-connection__disconnect-dialog__btn-dismiss" > { context === 'plugins' - ? __( 'Cancel', 'jetpack' ) - : __( 'Stay connected', 'jetpack', /* dummy arg to avoid bad minification */ 0 ) } + ? __( 'Cancel', 'jetpack-connection-js' ) + : __( + 'Stay connected', + 'jetpack-connection-js', + /* dummy arg to avoid bad minification */ 0 + ) } { renderDisconnectButton() }

diff --git a/components/disconnect-dialog/steps/step-survey.jsx b/components/disconnect-dialog/steps/step-survey.jsx index 4c88f86..2d71885 100644 --- a/components/disconnect-dialog/steps/step-survey.jsx +++ b/components/disconnect-dialog/steps/step-survey.jsx @@ -10,16 +10,16 @@ import DisconnectSurvey from '../../disconnect-survey'; * Show the survey step and allow the user to select a response. * * @param {object} props - The properties. - * @returns {React.Component} The StepSurvey Component + * @return {React.Component} The StepSurvey Component */ const StepSurvey = props => { const { onExit, onFeedBackProvided, isSubmittingFeedback } = props; return (
-

{ __( 'Before you go, help us improve Jetpack', 'jetpack' ) }

+

{ __( 'Before you go, help us improve Jetpack', 'jetpack-connection-js' ) }

- { __( 'Let us know what didn‘t work for you', 'jetpack' ) } + { __( 'Let us know what didn‘t work for you', 'jetpack-connection-js' ) }

{ href="#" onClick={ onExit } > - { __( 'Skip for now', 'jetpack' ) } + { __( 'Skip for now', 'jetpack-connection-js' ) }
); diff --git a/components/disconnect-dialog/steps/step-thank-you.jsx b/components/disconnect-dialog/steps/step-thank-you.jsx index 229342c..4f661d2 100644 --- a/components/disconnect-dialog/steps/step-thank-you.jsx +++ b/components/disconnect-dialog/steps/step-thank-you.jsx @@ -10,7 +10,7 @@ import disconnectImage from '../images/disconnect-thanks.jpg'; * Show the "thank you" step following survey submission * * @param {object} props - The properties. - * @returns {React.Component} - The StepThankYou Component + * @return {React.Component} - The StepThankYou Component */ const StepThankYou = props => { const { onExit } = props; @@ -20,12 +20,12 @@ const StepThankYou = props => {
-

{ __( 'Thank you!', 'jetpack' ) }

+

{ __( 'Thank you!', 'jetpack-connection-js' ) }

{ createInterpolateElement( __( 'Your answer has been submitted.
Thanks for your input on how we can improve Jetpack.', - 'jetpack' + 'jetpack-connection-js' ), { br:
, @@ -37,7 +37,7 @@ const StepThankYou = props => { onClick={ onExit } className="jp-connection__disconnect-dialog__btn-back-to-wp" > - { __( 'Back to my website', 'jetpack' ) } + { __( 'Back to my website', 'jetpack-connection-js' ) }

diff --git a/components/disconnect-survey/index.jsx b/components/disconnect-survey/index.jsx index 413bf11..ee75ad1 100644 --- a/components/disconnect-survey/index.jsx +++ b/components/disconnect-survey/index.jsx @@ -8,7 +8,7 @@ import SurveyChoice from './survey-choice'; * Handles showing the disconnect survey. * * @param {object} props - The component props. - * @returns {React.Component} - DisconnectSurvey component. + * @return {React.Component} - DisconnectSurvey component. */ const DisconnectSurvey = props => { const { onSubmit, isSubmittingFeedback } = props; @@ -18,23 +18,26 @@ const DisconnectSurvey = props => { const options = [ { id: 'troubleshooting', - answerText: __( "Troubleshooting - I'll be reconnecting afterwards.", 'jetpack' ), + answerText: __( + "Troubleshooting - I'll be reconnecting afterwards.", + 'jetpack-connection-js' + ), }, { id: 'not-working', - answerText: __( "I can't get it to work.", 'jetpack' ), + answerText: __( "I can't get it to work.", 'jetpack-connection-js' ), }, { id: 'slowed-down-site', - answerText: __( 'It slowed down my site.', 'jetpack' ), + answerText: __( 'It slowed down my site.', 'jetpack-connection-js' ), }, { id: 'buggy', - answerText: __( "It's buggy.", 'jetpack' ), + answerText: __( "It's buggy.", 'jetpack-connection-js' ), }, { id: 'what-does-it-do', - answerText: __( "I don't know what it does.", 'jetpack' ), + answerText: __( "I don't know what it does.", 'jetpack-connection-js' ), }, ]; @@ -68,8 +71,8 @@ const DisconnectSurvey = props => { /** * Checks to see if an option is the currently selected option, returns a css class name if it matches. * - * @param {string} optionId - ID of the option to check for. - * @returns {string} - The "selected" class if this option is currently selected. + * @param {string} optionId - ID of the option to check for. + * @return {string} - The "selected" class if this option is currently selected. */ const selectedClass = optionId => { if ( optionId === selectedAnswer ) { @@ -83,7 +86,7 @@ const DisconnectSurvey = props => { * Event handler for keyboard events on the answer blocks. * * @param {string} answerId - The slug of the answer that has been selected. - * @param {object} e - Keydown event. + * @param {object} e - Keydown event. */ const handleAnswerKeyDown = useCallback( ( answerId, e ) => { @@ -102,12 +105,13 @@ const DisconnectSurvey = props => { /** * Show all the survey options from the options array. * - * @returns {React.ElementType []} - Mapped array of rendered survey options. + * @return {React.ElementType []} - Mapped array of rendered survey options. */ const renderOptions = () => { return options.map( option => { return ( { * Show the custom input survey option. * Contains an input field for a custom response. * - * @returns {React.ElementType} - The custom survey option with an input field. + * @return {React.ElementType} - The custom survey option with an input field. */ const renderCustomOption = () => { return ( @@ -135,9 +139,9 @@ const DisconnectSurvey = props => { className={ 'card jp-connect__disconnect-survey-card ' + selectedClass( customOption.id ) } >

- { __( 'Other:', 'jetpack' ) }{ ' ' } + { __( 'Other:', 'jetpack-connection-js' ) }{ ' ' } { className="jp-connection__disconnect-dialog__btn-back-to-wp" > { isSubmittingFeedback - ? __( 'Submitting…', 'jetpack' ) - : __( 'Submit Feedback', 'jetpack', /* dummy arg to avoid bad minification */ 0 ) } + ? __( 'Submitting…', 'jetpack-connection-js' ) + : __( + 'Submit Feedback', + 'jetpack-connection-js', + /* dummy arg to avoid bad minification */ 0 + ) }

diff --git a/components/disconnect-survey/survey-choice.jsx b/components/disconnect-survey/survey-choice.jsx index 21ed143..1a4d3cf 100644 --- a/components/disconnect-survey/survey-choice.jsx +++ b/components/disconnect-survey/survey-choice.jsx @@ -5,12 +5,12 @@ import './_jp-connect_disconnect-survey-card.scss'; /** * SurveyChoice - Present one choice in the survey. * - * @param {string} props.id - The ID/slug string of the survey option - * @param {Function} props.onClick - Event handler for clicking on the survey option. - * @param {Function} props.onKeydown - Event handler for pressing a key on the survey option. - * @param {React.ElementType} props.children - Any passed elements as children to this component. - * @param {string} props.className - A class name to apply to the survey choice. - * @returns {React.Component} SurveyChoice - The SurveyChoice component. + * @param {string} props.id - The ID/slug string of the survey option + * @param {Function} props.onClick - Event handler for clicking on the survey option. + * @param {Function} props.onKeydown - Event handler for pressing a key on the survey option. + * @param {React.ElementType} props.children - Any passed elements as children to this component. + * @param {string} props.className - A class name to apply to the survey choice. + * @return {React.Component} SurveyChoice - The SurveyChoice component. */ const SurveyChoice = props => { diff --git a/components/in-place-connection/index.jsx b/components/in-place-connection/index.jsx index 48b6a54..060c7aa 100644 --- a/components/in-place-connection/index.jsx +++ b/components/in-place-connection/index.jsx @@ -7,18 +7,18 @@ import './style.scss'; /** * The in-place connection component. * - * @param {object} props -- The properties. - * @param {string} props.title -- Element title. - * @param {boolean} props.isLoading -- Whether the element is still loading. - * @param {string|number} props.width -- Iframe width. - * @param {string|number} props.height -- Iframe height. - * @param {boolean} props.displayTOS -- Whether the site has connection owner connected. - * @param {boolean} props.scrollToIframe -- Whether we need to auto-scroll the window upon element rendering. - * @param {string} props.connectUrl -- The connection URL. - * @param {Function} props.onComplete -- The callback to be called upon complete of the connection process. - * @param {Function} props.onThirdPartyCookiesBlocked -- The callback to be called if third-party cookies are disabled. - * @param {string} props.location -- Component location identifier passed to WP.com. - * @returns {React.Component} The in-place connection component. + * @param {object} props -- The properties. + * @param {string} props.title -- Element title. + * @param {boolean} props.isLoading -- Whether the element is still loading. + * @param {string|number} props.width -- Iframe width. + * @param {string|number} props.height -- Iframe height. + * @param {boolean} props.displayTOS -- Whether the site has connection owner connected. + * @param {boolean} props.scrollToIframe -- Whether we need to auto-scroll the window upon element rendering. + * @param {string} props.connectUrl -- The connection URL. + * @param {Function} props.onComplete -- The callback to be called upon complete of the connection process. + * @param {Function} props.onThirdPartyCookiesBlocked -- The callback to be called if third-party cookies are disabled. + * @param {string} props.location -- Component location identifier passed to WP.com. + * @return {React.Component} The in-place connection component. */ const InPlaceConnection = props => { const { @@ -34,8 +34,8 @@ const InPlaceConnection = props => { } = props; let { height = '300' } = props; - const iframeWrapRef = useRef(); - const iframeRef = useRef(); + const iframeWrapRef = useRef( undefined ); + const iframeRef = useRef( undefined ); /** * Handles messages received from inside the iframe. @@ -103,7 +103,7 @@ const InPlaceConnection = props => {

{ title }

{ isLoading ? ( -

{ __( 'Loading…', 'jetpack' ) }

+

{ __( 'Loading…', 'jetpack-connection-js' ) }

) : (