diff options
author | Reuben Pereira <rpereira@gitlab.com> | 2019-04-26 17:23:26 +0000 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2019-04-26 17:23:26 +0000 |
commit | 4376167a04aaeed084ad93aab2e65550109235c6 (patch) | |
tree | 99fa950932bf6ea5c0d453c9d4494a0adb0c16f3 /app/services/projects/operations | |
parent | bb6908cd5bcb14d70dfadbc2a16d7310bfa65445 (diff) | |
download | gitlab-ce-4376167a04aaeed084ad93aab2e65550109235c6.tar.gz |
Add ProjectMetricsDashboardSetting model and table
This new table will be used to store the external_dashboard_url which
allows users to add a link to their external dashboards (ex Grafana)
to the Metrics dashboard.
Diffstat (limited to 'app/services/projects/operations')
-rw-r--r-- | app/services/projects/operations/update_service.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/app/services/projects/operations/update_service.rb b/app/services/projects/operations/update_service.rb index aedf79c86d7..48eddb0e8d0 100644 --- a/app/services/projects/operations/update_service.rb +++ b/app/services/projects/operations/update_service.rb @@ -12,7 +12,16 @@ module Projects private def project_update_params - error_tracking_params + error_tracking_params.merge(metrics_setting_params) + end + + def metrics_setting_params + attribs = params[:metrics_setting_attributes] + return {} unless attribs + + destroy = attribs[:external_dashboard_url].blank? + + { metrics_setting_attributes: attribs.merge(_destroy: destroy) } end def error_tracking_params |