Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AudienceSegmentation/InfoNotice #8388

Merged
merged 8 commits into from
Mar 15, 2024

Conversation

derweili
Copy link
Collaborator

@derweili derweili commented Mar 12, 2024

Summary

Addresses issue:

Relevant technical choices

The figma designs did not include any responsive designs. So I verified the responsive behavior of existing, similar components and implemented a similar behavior.

PR Author Checklist

  • My code is tested and passes existing unit tests.
  • My code has an appropriate set of unit tests which all pass.
  • My code is backward-compatible with WordPress 5.2 and PHP 5.6.
  • My code follows the WordPress coding standards.
  • My code has proper inline documentation.
  • I have added a QA Brief on the issue linked above.
  • I have signed the Contributor License Agreement (see https://cla.developers.google.com/).

Do not alter or remove anything below. The following sections will be managed by moderators only.

Code Reviewer Checklist

  • Run the code.
  • Ensure the acceptance criteria are satisfied.
  • Reassess the implementation with the IB.
  • Ensure no unrelated changes are included.
  • Ensure CI checks pass.
  • Check Storybook where applicable.
  • Ensure there is a QA Brief.

Merge Reviewer Checklist

  • Ensure the PR has the correct target branch.
  • Double-check that the PR is okay to be merged.
  • Ensure the corresponding issue has a ZenHub release assigned.
  • Add a changelog message to the issue.

Copy link

github-actions bot commented Mar 12, 2024

Build files for c85262b have been deleted.

Copy link

github-actions bot commented Mar 12, 2024

Size Change: +6.12 kB (0%)

Total Size: 1.55 MB

Filename Size Change
./dist/assets/css/googlesitekit-admin-css-********************.min.css 52.2 kB +212 B (0%)
./dist/assets/js/30-********************.js 2.8 kB -1 B (0%)
./dist/assets/js/31-********************.js 2.28 kB +1 B (0%)
./dist/assets/js/32-********************.js 3.72 kB +1 B (0%)
./dist/assets/js/35-********************.js 3.12 kB -2 B (0%)
./dist/assets/js/googlesitekit-activation-********************.js 23.8 kB +1 B (0%)
./dist/assets/js/googlesitekit-ad-blocking-recovery-********************.js 57.3 kB -3 B (0%)
./dist/assets/js/googlesitekit-adminbar-********************.js 34.1 kB +10 B (0%)
./dist/assets/js/googlesitekit-api-********************.js 10 kB +2 B (0%)
./dist/assets/js/googlesitekit-components-gm2-********************.js 5.76 kB -5 B (0%)
./dist/assets/js/googlesitekit-components-gm3-********************.js 10 kB -1 B (0%)
./dist/assets/js/googlesitekit-data-********************.js 2.18 kB -2 B (0%)
./dist/assets/js/googlesitekit-datastore-ui-********************.js 10 kB +814 B (+9%) 🔍
./dist/assets/js/googlesitekit-datastore-user-********************.js 24.2 kB -26 B (0%)
./dist/assets/js/googlesitekit-entity-dashboard-********************.js 101 kB +2.23 kB (+2%)
./dist/assets/js/googlesitekit-main-dashboard-********************.js 118 kB +2.65 kB (+2%)
./dist/assets/js/googlesitekit-modules-ads-********************.js 15.4 kB +5 B (0%)
./dist/assets/js/googlesitekit-modules-adsense-********************.js 114 kB +5 B (0%)
./dist/assets/js/googlesitekit-modules-analytics-4-********************.js 91.8 kB +5 B (0%)
./dist/assets/js/googlesitekit-modules-analytics-********************.js 91.1 kB +104 B (0%)
./dist/assets/js/googlesitekit-modules-********************.js 22 kB -1 B (0%)
./dist/assets/js/googlesitekit-modules-pagespeed-insights-********************.js 22.3 kB -17 B (0%)
./dist/assets/js/googlesitekit-modules-search-console-********************.js 59.9 kB +227 B (0%)
./dist/assets/js/googlesitekit-modules-tagmanager-********************.js 30 kB +30 B (0%)
./dist/assets/js/googlesitekit-settings-********************.js 59.1 kB -49 B (0%)
./dist/assets/js/googlesitekit-splash-********************.js 71.5 kB +4 B (0%)
./dist/assets/js/googlesitekit-user-input-********************.js 46.7 kB -4 B (0%)
./dist/assets/js/googlesitekit-vendor-********************.js 316 kB -49 B (0%)
./dist/assets/js/googlesitekit-widgets-********************.js 33.5 kB -19 B (0%)
./dist/assets/js/googlesitekit-wp-dashboard-********************.js 61.6 kB -8 B (0%)
./dist/assets/js/runtime-********************.js 1.3 kB +2 B (0%)
ℹ️ View Unchanged
Filename Size
./dist/assets/css/googlesitekit-adminbar-css-********************.min.css 11.2 kB
./dist/assets/css/googlesitekit-wp-dashboard-css-********************.min.css 7.39 kB
./dist/assets/js/33-********************.js 929 B
./dist/assets/js/34-********************.js 889 B
./dist/assets/js/analytics-advanced-tracking-********************.js 778 B
./dist/assets/js/googlesitekit-datastore-forms-********************.js 9.12 kB
./dist/assets/js/googlesitekit-datastore-location-********************.js 2.09 kB
./dist/assets/js/googlesitekit-datastore-site-********************.js 18.4 kB
./dist/assets/js/googlesitekit-i18n-********************.js 3.92 kB
./dist/assets/js/googlesitekit-polyfills-********************.js 380 B

compressed-size-action

Copy link
Collaborator

@techanvil techanvil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @derweili, this is looking good. Just a few minor comments from me to address.

describe( 'InfoNotice', () => {
it( 'should render correctly in the default state', () => {
const { container, getByText } = render(
<InfoNotice { ...InfoNoticeStory.args } />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an interesting approach, but using story definitions in tests like this is not something we've done so far elsewhere, as far as I can see.

Tbh, I'm a bit hesitant on the basis that it makes the test a bit harder to read - it's not entirely clear what it's doing without referring to the story. While DRY is generally a good principle to aim for in production code, it's not as important in tests which tend to benefit more from a DAMP approach.

I'm not entirely averse to the idea of sharing definition code between them but at the least, I don't think we should introduce it in an ad-hoc manner like this, and we should instead discuss it within the team before deciding whether to proceed with it.

For now, please can you remove the use of the story definition and instead inline the relevant values in the test?

display: flex;
gap: 20px;
justify-content: space-between;
padding: $grid-gap-phone 40px;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the horizontal padding will need an adjustment at mobile viewports. Note how the icon aligns with those above it:

image

We don't have explicit mobile designs for the Info Notice component, but it's evident the icons have less horizontal padding (see in Figma):

image

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... I realise the IB specifies this component should be placed in assets/js/modules/analytics-4/components/common/, but it's only going to be shown on the dashboard so I think it should in fact go in assets/js/modules/analytics-4/components/dashboard/.

Copy link
Collaborator

@techanvil techanvil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, nice one @derweili!

@techanvil techanvil merged commit a0ea3d1 into develop Mar 15, 2024
21 checks passed
@techanvil techanvil deleted the enhancement/8137-add-info-notice branch March 15, 2024 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants