-
Notifications
You must be signed in to change notification settings - Fork 293
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
Provide link in Analytics settings panel to update GA4 configuration and improve UI for related UA link #3766
Provide link in Analytics settings panel to update GA4 configuration and improve UI for related UA link #3766
Conversation
Size Change: -2.01 kB (0%) Total Size: 1.08 MB
ℹ️ View Unchanged
|
@@ -42,6 +42,7 @@ export default function SettingsView() { | |||
const isGA4Enabled = useFeature( 'ga4setup' ); | |||
const ga4PropertyID = useSelect( ( select ) => isGA4Enabled ? select( MODULES_ANALYTICS_4 ).getPropertyID() : '' ); | |||
const ga4MeasurementID = useSelect( ( select ) => isGA4Enabled ? select( MODULES_ANALYTICS_4 ).getMeasurementID() : '' ); | |||
const webDataStreamID = useSelect( ( select ) => isGA4Enabled ? select( MODULES_ANALYTICS_4 ).getWebDataStreamID() : '' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this needs double checking. For me it was opening a web data stream for a totally different property (which makes no sense given the Url includes the correct property!)
<div className="googlesitekit-settings-module__meta-item"> | ||
<h5 className="googlesitekit-settings-module__meta-item-type"> | ||
| ||
</h5> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Easiest and safest way to make the Links vertically aligned as per the AC (but this always feels a bit hacky!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs hiding on mobile (as per updated AC)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should make the links sibling elements of their respective DisplaySetting
s instead. We want the link to be clearly associated with the value and putting it in a separate element like this spaces it in the grid like a separate thing. This also has the potential to wrap on smaller screens where it would lose the positional context as to what it is referring to. Keeping them in the same parent also has the benefit of not requiring a hack to preserve the alignment 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does look a little tight but also makes it more clear what the link refers to. I don't think we should get into adding
s or another class to add space as this seems a bit arbitrary and makes the link a bit more ambiguous.
What do you think about this?
This is how it looks if we also passed the small
prop to the Link
s? I realize the ACs specifically say that it should be the same size but I think it might look a bit better with a reduced size and we have an existing prop to do this. Seeing the options side-by-side would also help make the case for changing that in case we feel it looks better 🙂 We'd have to ask about changing it but I think prefer the smaller link. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's keep it as it is in the ACs for now, we can always follow-up with a super simple PR if we decide to tweak the Link size later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there's anything actionable here for me now @aaemnnosttv ?
<Link | ||
href={ editViewSettingsURL } | ||
external | ||
className="googlesitekit-settings-module__inline-link" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seemed the safest way to override using CSS without making cascading changes through the whole site
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change of plan: remove this className
and instead wrap the links with <p className="googlesitekit-settings-module__meta-item-data">
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my previous comment about placement. If needed, I think the inherit
prop of the Link
component should be all we need to match the surrounding text.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assets/sass/components/settings/_googlesitekit-settings-module.scss
Outdated
Show resolved
Hide resolved
assets/js/modules/analytics/components/settings/SettingsView.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @danielgent – this looks good overall. I've left a few comments here as well as replies to some of your annotations. Let me know if you have any questions 👍
assets/js/modules/analytics/components/settings/SettingsView.js
Outdated
Show resolved
Hide resolved
<div className="googlesitekit-settings-module__meta-item"> | ||
<h5 className="googlesitekit-settings-module__meta-item-type"> | ||
| ||
</h5> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should make the links sibling elements of their respective DisplaySetting
s instead. We want the link to be clearly associated with the value and putting it in a separate element like this spaces it in the grid like a separate thing. This also has the potential to wrap on smaller screens where it would lose the positional context as to what it is referring to. Keeping them in the same parent also has the benefit of not requiring a hack to preserve the alignment 👍
<Link | ||
href={ editViewSettingsURL } | ||
external | ||
className="googlesitekit-settings-module__inline-link" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my previous comment about placement. If needed, I think the inherit
prop of the Link
component should be all we need to match the surrounding text.
assets/js/modules/analytics/components/settings/SettingsView.js
Outdated
Show resolved
Hide resolved
Conflicts: assets/js/modules/analytics/components/settings/SettingsView.js
assets/js/modules/analytics/components/settings/SettingsView.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @danielgent – this looks good as defined. See my question about the size of the link, but otherwise this looks good to go.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like I missed an important detail in the last review!
<DisplaySetting value={ ga4MeasurementID } /> | ||
</p> | ||
</div> | ||
<div className="googlesitekit-settings-module__meta-item"> | ||
<h5 className="googlesitekit-settings-module__meta-item-type"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary
Addresses issue #3702
Relevant technical choices
Checklist