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

Implement Ads Conversion ID Field in Ads Module SettingsView and SettingsEdit Components #8251

Closed
4 of 8 tasks
10upsimon opened this issue Feb 14, 2024 · 13 comments
Closed
4 of 8 tasks
Labels
Good First Issue Good first issue for new engineers javascript Pull requests that update Javascript code Module: Ads Google Ads module related issues P0 High priority Sp Wk 2 Issues to be completed in the second week of the assigned sprint Type: Feature New feature

Comments

@10upsimon
Copy link
Collaborator

10upsimon commented Feb 14, 2024

Feature Description

As part of the newly created Ads module infrastructure (see issue #8225), comes the need to add the Ads Conversion ID field to the Ads module settings screen. This will need to be visible in the SettingsView and SettingsEdit, along with the required SettingsForm component. This is, however, reliant on the completion of the Ads module datastore, see issue #8226.

See the relevant Figma designs here (series of designs to the right of the linked view):
https://www.figma.com/file/THG1FJw5SaUxmiq38Mkf1x/Ads?type=design&node-id=62-2205&mode=design&t=pqxmsz2Yu9IxNuMt-0

See the relevant area of the Ads Module Design Doc here:
https://docs.google.com/document/d/1APuSv95bf62uhzlaFlW6jPrzPKy1avpRYd9W1MSAAJo/edit?resourcekey=0-UuynlcUz9CoubgldR6Z5sg#heading=h.lzbos67ly9f6


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

Acceptance criteria

  • The Ads Conversion ID field should be implemented for View & Edit views within the Ads Module Settings section. These consist of the following component (and files):
    • assets/js/modules/ads/components/settings/SettingsEdit.js (for edit view)
    • assets/js/modules/ads/components/settings/SettingsForm.js (for edit view form field controls and saving logic etc)
    • assets/js/modules/ads/components/settings/SettingsView.js (for generic settings view)
  • Within the SettingsView component of the Ads module settings, the applicable label and textual value should be implemented. The value of the saved Ads Conversion ID field should show, if saved, or be blank.
  • Within the SettingsEdit, the necessary SettingsForm component should be created and rendered during edit. This should render the applicable input field that accepts a value for the Ads Conversion ID field value. Upon saving, this value should be correctly updated in the Ads datastore, and be retrievable as needed by associated logic.
  • The necessary helper text/description should be rendered below the text input field, as per the Figma design, see https://www.figma.com/file/THG1FJw5SaUxmiq38Mkf1x/Ads?type=design&node-id=13-5713&mode=design&t=eV3r3gmTh4hXjm7K-0

Implementation Brief

  • Settings components listed in AC, have been added in Create new Ads module codebase structure in assets/js/modules #8225
  • Update assets/js/modules/ads/components/settings/SettingsForm.js
  • In assets/js/modules/ads/components/common/AdsConversionIDTextField.js
    • Adapt the field to pull/save data into the MODULE_ADS datastore
    • Adapt the content to match the one in figma design linked in AC, and some styling if any is needed
    • Add local state, say [isEmptyID, setIsEmptyID], to control displaying the empty value error
    • In onChange callback :
      • Check if value is empty
      • If it is empty, use useDebounce hook to update setEmptyValue after 500ms
      • Either way update the the value of the adsConversionID setting to the store
    • In helperText prop of TextField component, use isEmptyID to determine if error should be displayed, using the content from figma
  • SettingsView component already implements the logic to render ads conversion ID field, update label if needed
  • Note, for save/update button we are currently using label Apply changes
    buttonText = __( 'Apply changes', 'google-site-kit' );
    and in the figma design, it is now Confirm changes, so update the referenced line with new label

Test Coverage

  • Add stories for the SettingsForm component

QA Brief

  • Enable the adsModule feature flag.
  • Connect the Ads module
  • Visit the settings and save and update the Ad Conversion ID. Note from the AC: The error/notice does not need to prevent the user from saving the empty value, and is informatory only

Changelog entry

  • Add the Conversion Tracking ID field to the Ads module's Setup and Settings screens.
@10upsimon 10upsimon added javascript Pull requests that update Javascript code Module: Ads Google Ads module related issues P0 High priority Type: Feature New feature labels Feb 14, 2024
@ivonac4 ivonac4 added the Next Up Issues to prioritize for definition label Feb 16, 2024
@eugene-manuilov eugene-manuilov self-assigned this Feb 16, 2024
@eugene-manuilov
Copy link
Collaborator

AC 🌶️

@eugene-manuilov eugene-manuilov removed their assignment Feb 16, 2024
@zutigrm zutigrm self-assigned this Feb 19, 2024
@bethanylang bethanylang added the Sp Wk 2 Issues to be completed in the second week of the assigned sprint label Feb 19, 2024
@10upsimon
Copy link
Collaborator Author

@zutigrm I have updated the AC as per internal comms, the last point and it's sub points have been added to reflect the requirement for an inline error/warning notice should the user clear the field of the ads conversion ID entirely.

@zutigrm zutigrm removed their assignment Feb 22, 2024
@tofumatt tofumatt self-assigned this Feb 26, 2024
@tofumatt
Copy link
Collaborator

useInterval will run a function every 500ms, but not actually 500ms after the user has updated the text. I think you probably want some kind of useDebounce or similar, to update only 500ms after the final change event.

Otherwise you could change the content and if it's running every 500ms you might actually trigger it immediately, which would be jarring.

Add js tests and stories for the Settings components

Can you outline the JS tests you would add here? What should we be testing for?

@tofumatt tofumatt assigned zutigrm and unassigned tofumatt Feb 26, 2024
@zutigrm
Copy link
Collaborator

zutigrm commented Feb 27, 2024

Thanks @tofumatt for the feedback

useInterval will run a function every 500ms, but not actually 500ms after the user has updated the text. I think you probably want some kind of useDebounce or similar, to update only 500ms after the final change event.

Ah yes, good point! Thanks, switched to the useDebounce

Can you outline the JS tests you would add here? What should we be testing for?

Originally I though including js test for the error state, but as I can see we don't do tests for SettingsForm component, only stories, so I removed tests suggestion

@zutigrm zutigrm assigned tofumatt and unassigned zutigrm Feb 27, 2024
@tofumatt tofumatt removed their assignment Feb 28, 2024
@tofumatt tofumatt removed the Next Up Issues to prioritize for definition label Feb 28, 2024
@tofumatt
Copy link
Collaborator

IB ✅

@benbowler benbowler self-assigned this Feb 28, 2024
@benbowler benbowler removed their assignment Mar 12, 2024
@samr874
Copy link

samr874 commented Mar 13, 2024

@tofumatt what is the status of this issue tell me does it need to get worked upon?

@techanvil techanvil self-assigned this Mar 13, 2024
@bethanylang
Copy link
Collaborator

Hi @samr874 ! This is currently in progress with our internal team, so it does not need any work right now. If you're interested in working on Site Kit issues, please check out our wiki to get started. Thanks!

@techanvil techanvil removed their assignment Mar 13, 2024
@samr874
Copy link

samr874 commented Mar 13, 2024

@bethanylang will start working on the issues are those issues currently worked upon by internal team?

@bethanylang
Copy link
Collaborator

@samr874 As a general rule, any issue that is assigned to someone is already being worked on.

@kelvinballoo
Copy link
Collaborator

kelvinballoo commented Apr 1, 2024

QA Update ❌

  • Tested on WP 6.4.3 and PHP 8.0 on dev branch
  • Tested on MacOS Ventura Chrome, Firefox and safari, Edge (Windows 11).
  • Also tested Mobile and Tablet breakpoint on Chrome Emulator.
  • Issues identified are referenced below:

ISSUE 1:
AC states that:
The applicable inline error/warning message should be displayed when the user clears the field of a value entirely, as per the Figma design...

However, the message also appears when the field is not entirely blank. e.g. 3 characters as per the screenshot

Screenshot

Screenshot 2024-04-01 at 23 00 46
____________________________________________________________________________________

ISSUE 2:
For the following AC:
This error/warning should be delayed by a suitable amount of time (~500ms) in case the user is clearing the value in a bid to add a new value

Is there a way to test this? I tried to put the network on 3G but even then, that is hard to validate.


ISSUE 3:
When I save 'AW-123', it will show as '123' only in View mode.

Screenshot

Screenshot 2024-04-01 at 23 06 42
____________________________________________________________________________________

ISSUE 4:
There are some designs adjustments based on figma for the edit mode.
Details are in the attached screenshot.

Screenshot

Screenshot 2024-04-01 at 22 48 23
____________________________________________________________________________________

ISSUE 5:
In edit mode, there should be a 6px gap (not 8px) between the input field and the warning msg.
Refer to the attached figma image.

Screenshot

Screenshot 2024-04-01 at 22 33 31

@benbowler
Copy link
Collaborator

Thanks @kelvinballoo, I've addressed all comments except point 4:

There are some designs adjustments based on figma for the edit mode.

My thoughts is that pixel perfect changes to the standard MUI text area would make the input here inconsistent with all other MUI text areas in the app, @aaemnnosttv can you confirm if you would like the pixel perfect changes to the MUI text area here or that we are good to go as it.

@benbowler benbowler removed their assignment Apr 2, 2024
@tofumatt tofumatt self-assigned this Apr 2, 2024
@tofumatt
Copy link
Collaborator

tofumatt commented Apr 2, 2024

The design here is good-to-go as-is, just for the record 🙂

@tofumatt tofumatt assigned kelvinballoo and unassigned tofumatt Apr 2, 2024
@kelvinballoo
Copy link
Collaborator

QA Update ✅

Thanks @benbowler .

Retested as follows:

ISSUE 1:
Now, the error message doesn't appear on the 2nd or 3rd character.
This is as expected.

Screenshots Screenshot 2024-04-03 at 15 39 30
__________________________________________________________________________________________________

ISSUE 2:
Although I can't measure this accurately to 500ms, I can now feel there is a delay before the error message appears.
This is as expected

Screencast
500ms.mov
__________________________________________________________________________________________________

ISSUE 3:
When I save 'AW-123', it now shows as 'AW-123' only in View mode and not '123' only.

Screenshot Screenshot 2024-04-03 at 15 45 27
__________________________________________________________________________________________________

ISSUE 4:
Noted that we won't be applying changes for this as it's being consistent with other areas of the app, even though figma says otherwise.


ISSUE 5:
The padding is now 6px

Screenshots

Implementation

Screenshot 2024-04-03 at 15 49 11

Marking this ticket as Pass and moving to 'Approval'

@kelvinballoo kelvinballoo removed their assignment Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Issue Good first issue for new engineers javascript Pull requests that update Javascript code Module: Ads Google Ads module related issues P0 High priority Sp Wk 2 Issues to be completed in the second week of the assigned sprint Type: Feature New feature
Projects
None yet
Development

No branches or pull requests