Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into infrastructure/848…
Browse files Browse the repository at this point in the history
…3-reference-date-eslint-rule.
  • Loading branch information
eugene-manuilov committed Jun 13, 2024
2 parents 0ade87c + 10ff84c commit 088af68
Show file tree
Hide file tree
Showing 71 changed files with 1,150 additions and 176 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/browserslist-db-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Node.js (.nvmrc)
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/check-issue-has-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ jobs:
timeout-minutes: 20
if: false == ( ( github.event_name == 'pull_request' && ( github.event.action == 'closed' || github.event.pull_request.draft == true || contains( github.head_ref, 'dependabot/' ) ) ) || github.event.pull_request.head.repo.fork ) && github.event.review.state == 'approved'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
# Use modern Node for native fetch in script.
node-version: '18.x'

- name: Check issue for release tag
run: ./bin/check-issue-has-release.js
env:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/compressed-size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ jobs:
timeout-minutes: 20
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup Node.js (.nvmrc)
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ jobs:
timeout-minutes: 30
if: github.event_name == 'push' || github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup Node.js (.nvmrc)
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/js-css-lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Node.js (.nvmrc)
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/php-lint-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: shivammathur/setup-php@v2
with:
Expand Down Expand Up @@ -103,7 +103,7 @@ jobs:
WP_MULTISITE: ${{ matrix.wp_multisite }}
WP_VERSION: ${{ matrix.wp_version }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: shivammathur/setup-php@v2
with:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ jobs:
timeout-minutes: 20
if: false == ( ( github.event_name == 'pull_request' && ( github.event.action == 'closed' || github.event.pull_request.draft == true || contains( github.head_ref, 'dependabot/' ) ) ) || github.event.pull_request.head.repo.fork )
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Node.js (.nvmrc)
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
Expand All @@ -79,7 +79,7 @@ jobs:
runs-on: ubuntu-latest
needs: build-storybook
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: gh-pages
token: ${{ secrets.GH_BOT_TOKEN }}
Expand Down Expand Up @@ -122,7 +122,7 @@ jobs:
timeout-minutes: 20
if: ( github.event_name == 'pull_request' && github.event.action == 'closed' && contains( github.head_ref, 'dependabot/' ) == false ) && github.event.pull_request.head.repo.fork == false
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: gh-pages
token: ${{ secrets.GH_BOT_TOKEN }}
Expand All @@ -148,14 +148,14 @@ jobs:
timeout-minutes: 20
if: false == ( ( github.event_name == 'pull_request' && ( github.event.action == 'closed' || github.event.pull_request.draft == true || contains( github.head_ref, 'dependabot/' ) ) ) || github.event.pull_request.head.repo.fork )
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: storybook-files
path: dist
- name: Setup Node.js (.nvmrc)
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/visual-regression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ jobs:
timeout-minutes: 30
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Node.js (.nvmrc)
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/workflow-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 1
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: reviewdog/action-actionlint@v1
18 changes: 9 additions & 9 deletions .github/workflows/zips.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
timeout-minutes: 20
if: false == ( ( github.event_name == 'pull_request' && ( github.event.action == 'closed' || github.event.pull_request.draft == true || contains( github.head_ref, 'dependabot/' ) ) ) || github.event.pull_request.head.repo.fork )
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
Expand All @@ -104,7 +104,7 @@ jobs:
- name: Composer Install
run: composer install --no-interaction --no-progress --no-dev
- name: Setup Node.js (.nvmrc)
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
Expand Down Expand Up @@ -139,7 +139,7 @@ jobs:
with:
name: zip-files
path: ${{ github.ref }}
- uses: google-github-actions/auth@v1
- uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_CREDENTIALS }}
- name: Upload PR files
Expand All @@ -158,7 +158,7 @@ jobs:
steps:
- name: Check the comment exists
id: find-comment
uses: peter-evans/find-comment@v2
uses: peter-evans/find-comment@v3
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: github-actions[bot]
Expand All @@ -176,13 +176,13 @@ jobs:
echo "${delimiter}" >> $GITHUB_OUTPUT
- name: Create comment on PR with links to build files
if: ${{ steps.find-comment.outputs.comment-id == '' }}
uses: peter-evans/create-or-update-comment@v2
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.pull_request.number }}
body: ${{ steps.get-comment-body.outputs.body }}
- name: Update comment on PR with links to build files
if: ${{ steps.find-comment.outputs.comment-id != '' }}
uses: peter-evans/create-or-update-comment@v2
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.find-comment.outputs.comment-id }}
edit-mode: replace
Expand All @@ -194,7 +194,7 @@ jobs:
timeout-minutes: 20
if: ( github.event_name == 'pull_request' && github.event.action == 'closed' && contains( github.head_ref, 'dependabot/' ) == false ) && github.event.pull_request.head.repo.fork == false
steps:
- uses: google-github-actions/auth@v1
- uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_CREDENTIALS }}
- uses: google-github-actions/setup-gcloud@v1
Expand All @@ -209,14 +209,14 @@ jobs:
steps:
- name: Check the comment exists
id: find-comment
uses: peter-evans/find-comment@v2
uses: peter-evans/find-comment@v3
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: github-actions[bot]
body-includes: Build files for
- name: Update comment on PR with links to plugin builds
if: ${{ steps.find-comment.outputs.comment-id != '' }}
uses: peter-evans/create-or-update-comment@v2
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.find-comment.outputs.comment-id }}
edit-mode: replace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@
/**
* WordPress dependencies
*/
import {
createInterpolateElement,
useState,
Fragment,
} from '@wordpress/element';
import { useState, Fragment } from '@wordpress/element';
import { __ } from '@wordpress/i18n';

/**
Expand All @@ -31,15 +27,14 @@ import { Switch } from 'googlesitekit-components';
import Data from 'googlesitekit-data';
import { CORE_SITE } from '../../googlesitekit/datastore/site/constants';
import ErrorText from '../../components/ErrorText';
import Link from '../Link';
import LoadingWrapper from '../LoadingWrapper';
import ConfirmDisableConversionTrackingDialog from './ConfirmDisableConversionTrackingDialog';
import { useFeature } from '../../hooks/useFeature';
import PropTypes from 'prop-types';

const { useDispatch, useSelect } = Data;

export default function ConversionTrackingToggle( { loading } ) {
export default function ConversionTrackingToggle( { children, loading } ) {
const iceEnabled = useFeature( 'conversionInfra' );
const [ saveError ] = useState( null );
const [ showConfirmDialog, setShowConfirmDialog ] = useState( false );
Expand All @@ -48,12 +43,6 @@ export default function ConversionTrackingToggle( { loading } ) {
select( CORE_SITE ).isConversionTrackingEnabled()
);

const conversionTrackingDocumentationURL = useSelect( ( select ) =>
select( CORE_SITE ).getDocumentationLinkURL(
'enhanced-conversion-tracking'
)
);

const isSaving = useSelect( ( select ) =>
select( CORE_SITE ).isFetchingSaveConversionTrackingSettings()
);
Expand Down Expand Up @@ -100,24 +89,7 @@ export default function ConversionTrackingToggle( { loading } ) {
tabletHeight="84px"
>
<p className="googlesitekit-settings-module__fields-group-helper-text">
{ createInterpolateElement(
__(
'Conversion tracking allows you to measure additional events on your site from other plugins that Site Kit integrates with to optimize your campaign performance. <a>Learn more</a>',
'google-site-kit'
),
{
a: (
<Link
href={ conversionTrackingDocumentationURL }
external
aria-label={ __(
'Learn more about conversion tracking',
'google-site-kit'
) }
/>
),
}
) }
{ children }
</p>
</LoadingWrapper>
{ showConfirmDialog && (
Expand All @@ -136,5 +108,6 @@ export default function ConversionTrackingToggle( { loading } ) {
}

ConversionTrackingToggle.propTypes = {
children: PropTypes.node.isRequired,
loading: PropTypes.bool,
};
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ import { CORE_SITE } from '../../googlesitekit/datastore/site/constants';
import fetchMock from 'fetch-mock';

function Template() {
return <ConversionTrackingToggle />;
return (
<ConversionTrackingToggle>
Example text for enhanced conversion tracking
</ConversionTrackingToggle>
);
}

export const Enabled = Template.bind( {} );
Expand Down
Loading

0 comments on commit 088af68

Please sign in to comment.