Once new events have been detected the new metric tiles associated with them should be highlighted in selection panel by displaying "new" badge next to them. Also their respective groups should display "dot" notification.
Figma designs showing these changes can be found here
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Following the implementation done in 9378, the chip groups and metric items in the selection panel should display "dot" or "new" badges in following way:
If new events have been detected, metrics associated with these events should have "new" badge next to them, and their associated group should display "dot" notification.
This works for both initial events that are detected, and then for any new events afterwards.
Note to IB writer, new events can be retrieved from hasNewConversionReportingEvents selector implemented in #9379, as this will retrieve both initial events, and then newly detected events difference after initial events are detected. Mapping of detected events with their ACR widgets counterpart is suggested in implementation of #9371, but can be implemented here instead, whichever issue comes first for execution.
Get the list of new events using the getConversionReportingEventsChange selector.
Use the .some Array prototype to check the list of changed events that match the selected metric, using the CONVERSION_EVENTS_WIDGETS map (to be implemented in #9371), to find if this event has changed.
Get the list of new events using the getConversionReportingEventsChange selector.
Use the .some Array prototype to check the list of changed events that match the current group, using the CONVERSION_EVENTS_WIDGETS map (to be implemented in #9371), to find out of the events that have changed, if at least one is in the current group using the GROUP prop in the KEY_METRICS_WIDGETS const (implemented in #9376):
If newConversionEvent is true, render a new div with a clear class (eg. googlesitekit-chip-tab-group__chip-item-active-dot) and style this dot to match the figma design in the assets/sass/components/key-metrics/_googlesitekit-chip-tab-group.scss file.
Test Coverage
Update the stories for the SelectionPanel adding a story for items with new badges.
Update the new chip tab stores (to be implemented in #9378) to cover the new "new dot" cases.
Feature Description
Once new events have been detected the new metric tiles associated with them should be highlighted in selection panel by displaying "new" badge next to them. Also their respective groups should display "dot" notification.
Figma designs showing these changes can be found here
Check Showing “New” badges for the newly detected events section of the design doc
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation Brief
Note to IB writer, new events can be retrieved from
hasNewConversionReportingEvents
selector implemented in #9379, as this will retrieve both initial events, and then newly detected events difference after initial events are detected. Mapping of detected events with their ACR widgets counterpart is suggested in implementation of #9371, but can be implemented here instead, whichever issue comes first for execution.Metric Level New badges
[ ] Update
assets/js/components/SelectionPanel/SelectionPanelItem.js
:hasNewBadge
, default to false.NewBadge
component after theSelectionBox
before thesuffix
.assets/sass/components/global/_googlesitekit-selection-panel.scss
.[ ] Update
assets/js/components/KeyMetrics/MetricsSelectionPanel/MetricItem.js
:getConversionReportingEventsChange
selector..some
Array prototype to check the list of changed events that match the selected metric, using theCONVERSION_EVENTS_WIDGETS
map (to be implemented in #9371), to find if this event has changed.newConversionEvent
to the newhasNewBadge
prop on theSelectionPanelItem
component.Group Chip dots
assets/js/components/KeyMetrics/ChipTabGroup/Chip.js
:getConversionReportingEventsChange
selector..some
Array prototype to check the list of changed events that match the current group, using theCONVERSION_EVENTS_WIDGETS
map (to be implemented in #9371), to find out of the events that have changed, if at least one is in the current group using theGROUP
prop in theKEY_METRICS_WIDGETS
const (implemented in #9376):newConversionEvent
is true, render a new div with a clear class (eg.googlesitekit-chip-tab-group__chip-item-active-dot
) and style this dot to match the figma design in theassets/sass/components/key-metrics/_googlesitekit-chip-tab-group.scss
file.Test Coverage
SelectionPanel
adding a story for items with new badges.QA Brief
Changelog entry