-
Notifications
You must be signed in to change notification settings - Fork 286
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
Can't toggle "Display key metrics in dashboard" when user-defined key metrics are not set. #7441
Comments
18 tasks
IB ✅ |
18 tasks
tofumatt
added a commit
that referenced
this issue
Aug 29, 2023
Fix Key Metrics toggle in SK Settings when answer based matrices are used
QA Update: ✅Verified:
Additional QA:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug Description
This is an issue raised in the KM bug bash, see https://app.asana.com/0/1204713925711993/1205270012034069/f.
The "Display key metrics in dashboard" toggle doesn't work unless the user has defined their own set of widgets via "I'll pick metrics myself", or "Change Metrics".
This is a result of a change in the PR for #7349.
Steps to reproduce
userInput
feature flag enabled and GA4 connected./wp-json/google-site-kit/v1/core/user/data/key-metrics
will have failed with a400
status code and "Selected metrics cannot be empty" error message.Screenshots
cant_toggle_isWidgetHidden_with_empty_km_array.mp4
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
/wp-json/google-site-kit/v1/core/user/data/key-metrics
endpoint should continue to validate that there is at least one key metric slug defined, but only in the case where the user has customized the selection.Implementation Brief
includes/Core/Key_Metrics/REST_Key_Metrics_Controller.php
:POST:core/user/data/key-metrics
route:widgetSlugs
arg optional by changing the'required' => true
to'required' => false
.$num_widgets
whenwidgetSlugs
is set in$data['settings']
.$this->key_metrics_setup_completed
totrue
whenwidgetSlugs
is set in$data['settings']
.assets/js/googlesitekit/datastore/user/key-metrics.js
:saveKeyMetricsSettings
action:setKeyMetricsSetupCompleted
whensettings.widgetSlugs
is not falsey.assets/js/components/settings/SettingsKeyMetrics.js
:handleKeyMetricsToggle
callback:{ widgetSlugs: undefined }
parameter to thesaveKeyMetricsSettings
call.Test Coverage
QA Brief
Changelog entry
The text was updated successfully, but these errors were encountered: