Commit 85402f75 authored by Dhiraj Bodicherla's avatar Dhiraj Bodicherla Committed by Kushal Pandya

Remove autocomplete for prometheus manual configs

Prometheus manual configuration form has inputs
that can have sensitive information. This MR sets
autocomplete to off for such inputs
parent ef878663
......@@ -74,6 +74,7 @@ class PrometheusService < MonitoringService
name: 'google_iap_audience_client_id',
title: 'Google IAP Audience Client ID',
placeholder: s_('PrometheusService|Client ID of the IAP secured resource (looks like IAP_CLIENT_ID.apps.googleusercontent.com)'),
autocomplete: 'off',
required: false
},
{
......
......@@ -3,6 +3,7 @@
- value = @service.send(name)
- type = field[:type]
- placeholder = field[:placeholder]
- autocomplete = field[:autocomplete]
- required = field[:required]
- choices = field[:choices]
- default_choice = field[:default_choice]
......@@ -15,7 +16,7 @@
= form.label name, title, class: "col-form-label col-sm-2"
.col-sm-10
- if type == 'text'
= form.text_field name, class: "form-control", placeholder: placeholder, required: required, data: { qa_selector: "#{name.downcase.gsub('\s', '')}_field" }
= form.text_field name, class: "form-control", autocomplete: autocomplete, placeholder: placeholder, required: required, data: { qa_selector: "#{name.downcase.gsub('\s', '')}_field" }
- elsif type == 'textarea'
= form.text_area name, rows: 5, class: "form-control", placeholder: placeholder, required: required
- elsif type == 'checkbox'
......
......@@ -484,6 +484,7 @@ describe PrometheusService, :use_clean_rails_memory_store_caching do
name: 'google_iap_audience_client_id',
title: 'Google IAP Audience Client ID',
placeholder: s_('PrometheusService|Client ID of the IAP secured resource (looks like IAP_CLIENT_ID.apps.googleusercontent.com)'),
autocomplete: 'off',
required: false
},
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment