Commit 194b91fd authored by Justin Ho's avatar Justin Ho

Remove disable_fields_service? completely

Since it always returned `false`, we can safely remove it.

Also removes all `disabled` attributes from form fields
which are now redundant.
parent 2dbad45e
...@@ -12,10 +12,6 @@ export default { ...@@ -12,10 +12,6 @@ export default {
type: Boolean, type: Boolean,
required: true, required: true,
}, },
disabled: {
type: Boolean,
required: true,
},
}, },
data() { data() {
return { return {
...@@ -41,12 +37,7 @@ export default { ...@@ -41,12 +37,7 @@ export default {
<div class="form-group row" role="group"> <div class="form-group row" role="group">
<label for="service[active]" class="col-form-label col-sm-2">{{ __('Active') }}</label> <label for="service[active]" class="col-form-label col-sm-2">{{ __('Active') }}</label>
<div class="col-sm-10 pt-1"> <div class="col-sm-10 pt-1">
<gl-toggle <gl-toggle v-model="activated" name="service[active]" @change="onToggle" />
v-model="activated"
:disabled="disabled"
name="service[active]"
@change="onToggle"
/>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -7,10 +7,9 @@ export default el => { ...@@ -7,10 +7,9 @@ export default el => {
return null; return null;
} }
const { showActive: showActiveStr, activated: activatedStr, disabled: disabledStr } = el.dataset; const { showActive: showActiveStr, activated: activatedStr } = el.dataset;
const showActive = parseBoolean(showActiveStr); const showActive = parseBoolean(showActiveStr);
const activated = parseBoolean(activatedStr); const activated = parseBoolean(activatedStr);
const disabled = parseBoolean(disabledStr);
if (!showActive) { if (!showActive) {
return null; return null;
...@@ -22,7 +21,6 @@ export default el => { ...@@ -22,7 +21,6 @@ export default el => {
return createElement(ActiveToggle, { return createElement(ActiveToggle, {
props: { props: {
initialActivated: activated, initialActivated: activated,
disabled,
}, },
}); });
}, },
......
...@@ -58,10 +58,6 @@ module ServicesHelper ...@@ -58,10 +58,6 @@ module ServicesHelper
end end
end end
def disable_fields_service?(service)
!current_controller?('admin/services')
end
def scoped_integrations_path def scoped_integrations_path
if @project.present? if @project.present?
project_settings_integrations_path(@project) project_settings_integrations_path(@project)
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
- choices = field[:choices] - choices = field[:choices]
- default_choice = field[:default_choice] - default_choice = field[:default_choice]
- help = field[:help] - help = field[:help]
- disabled = disable_fields_service?(@service)
.form-group.row .form-group.row
- if type == "password" && value.present? - if type == "password" && value.present?
...@@ -16,14 +15,14 @@ ...@@ -16,14 +15,14 @@
= form.label name, title, class: "col-form-label col-sm-2" = form.label name, title, class: "col-form-label col-sm-2"
.col-sm-10 .col-sm-10
- if type == 'text' - if type == 'text'
= form.text_field name, class: "form-control", placeholder: placeholder, required: required, disabled: disabled, data: { qa_selector: "#{name.downcase.gsub('\s', '')}_field" } = form.text_field name, class: "form-control", placeholder: placeholder, required: required, data: { qa_selector: "#{name.downcase.gsub('\s', '')}_field" }
- elsif type == 'textarea' - elsif type == 'textarea'
= form.text_area name, rows: 5, class: "form-control", placeholder: placeholder, required: required, disabled: disabled = form.text_area name, rows: 5, class: "form-control", placeholder: placeholder, required: required
- elsif type == 'checkbox' - elsif type == 'checkbox'
= form.check_box name, disabled: disabled = form.check_box name
- elsif type == 'select' - elsif type == 'select'
= form.select name, options_for_select(choices, value ? value : default_choice), {}, { class: "form-control", disabled: disabled} = form.select name, options_for_select(choices, value ? value : default_choice), {}, { class: "form-control"}
- elsif type == 'password' - elsif type == 'password'
= form.password_field name, autocomplete: "new-password", placeholder: placeholder, class: "form-control", required: value.blank? && required, disabled: disabled, data: { qa_selector: "#{name.downcase.gsub('\s', '')}_field" } = form.password_field name, autocomplete: "new-password", placeholder: placeholder, class: "form-control", required: value.blank? && required, data: { qa_selector: "#{name.downcase.gsub('\s', '')}_field" }
- if help - if help
%span.form-text.text-muted= help %span.form-text.text-muted= help
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
= markdown @service.help = markdown @service.help
.service-settings .service-settings
.js-vue-integration-settings{ data: { show_active: @service.show_active_box?.to_s, activated: (@service.active || @service.new_record?).to_s, disabled: disable_fields_service?(@service).to_s } } .js-vue-integration-settings{ data: { show_active: @service.show_active_box?.to_s, activated: (@service.active || @service.new_record?).to_s } }
- if @service.configurable_events.present? - if @service.configurable_events.present?
.form-group.row .form-group.row
......
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