Commit cc5a31d9 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Merge branch 'justin_ho-remove-unused-deprecated-message' into 'master'

Remove deprecation_message from service

See merge request gitlab-org/gitlab!29885
parents a070e11b fe1c293b
......@@ -12,10 +12,6 @@ export default {
type: Boolean,
required: true,
},
disabled: {
type: Boolean,
required: true,
},
},
data() {
return {
......@@ -41,12 +37,7 @@ export default {
<div class="form-group row" role="group">
<label for="service[active]" class="col-form-label col-sm-2">{{ __('Active') }}</label>
<div class="col-sm-10 pt-1">
<gl-toggle
v-model="activated"
:disabled="disabled"
name="service[active]"
@change="onToggle"
/>
<gl-toggle v-model="activated" name="service[active]" @change="onToggle" />
</div>
</div>
</div>
......
......@@ -7,10 +7,9 @@ export default el => {
return null;
}
const { showActive: showActiveStr, activated: activatedStr, disabled: disabledStr } = el.dataset;
const { showActive: showActiveStr, activated: activatedStr } = el.dataset;
const showActive = parseBoolean(showActiveStr);
const activated = parseBoolean(activatedStr);
const disabled = parseBoolean(disabledStr);
if (!showActive) {
return null;
......@@ -22,7 +21,6 @@ export default el => {
return createElement(ActiveToggle, {
props: {
initialActivated: activated,
disabled,
},
});
},
......
......@@ -335,15 +335,6 @@
}
}
.deprecated-service {
cursor: default;
a {
font-weight: $gl-font-weight-bold;
color: $white;
}
}
.personal-access-tokens-never-expires-label {
color: $note-disabled-comment-color;
}
......@@ -401,4 +392,3 @@
}
}
}
......@@ -51,17 +51,13 @@ module ServicesHelper
end
end
def service_save_button(service)
button_tag(class: 'btn btn-success', type: 'submit', disabled: service.deprecated?, data: { qa_selector: 'save_changes_button' }) do
def service_save_button
button_tag(class: 'btn btn-success', type: 'submit', data: { qa_selector: 'save_changes_button' }) do
icon('spinner spin', class: 'hidden js-btn-spinner') +
content_tag(:span, 'Save changes', class: 'js-btn-label')
end
end
def disable_fields_service?(service)
!current_controller?("admin/services") && service.deprecated?
end
def scoped_integrations_path
if @project.present?
project_settings_integrations_path(@project)
......
......@@ -345,14 +345,6 @@ class Service < ApplicationRecord
service
end
def deprecated?
false
end
def deprecation_message
nil
end
# override if needed
def supports_data_fields?
false
......
.flash-container.flash-container-page
.flash-alert.deprecated-service
%span= @service.deprecation_message
......@@ -2,6 +2,4 @@
- breadcrumb_title @service.title
- page_title @service.title, "Service Templates"
= render 'deprecated_message' if @service.deprecation_message
= render 'form'
.flash-container.flash-container-page
.flash-alert.deprecated-service
%span= @service.deprecation_message
......@@ -13,7 +13,7 @@
= form_for(@service, as: :service, url: scoped_integration_path(@service), method: :put, html: { class: 'gl-show-field-errors integration-settings-form js-integration-settings-form', data: { 'can-test' => @service.can_test?, 'test-url' => test_project_service_path(@project, @service) } }) do |form|
= render 'shared/service_settings', form: form, service: @service
.footer-block.row-content-block
= service_save_button(@service)
= service_save_button
&nbsp;
= link_to _('Cancel'), project_settings_integrations_path(@project), class: 'btn btn-cancel'
......
......@@ -2,8 +2,6 @@
- add_to_breadcrumbs _('Integration Settings'), project_settings_integrations_path(@project)
- page_title @service.title, _('Integrations')
= render 'deprecated_message' if @service.deprecation_message
= render 'form'
- if @web_hook_logs
= render partial: 'projects/hook_logs/index', locals: { hook: @service.service_hook, hook_logs: @web_hook_logs, project: @project }
......@@ -7,7 +7,6 @@
- choices = field[:choices]
- default_choice = field[:default_choice]
- help = field[:help]
- disabled = disable_fields_service?(@service)
.form-group.row
- if type == "password" && value.present?
......@@ -16,14 +15,14 @@
= 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, 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'
= 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'
= form.check_box name, disabled: disabled
= form.check_box name
- 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'
= 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
%span.form-text.text-muted= help
......@@ -8,7 +8,7 @@
= markdown @service.help
.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?
.form-group.row
......
......@@ -10,5 +10,5 @@
- if integration.editable?
.footer-block.row-content-block
= service_save_button(integration)
= service_save_button
= link_to _('Cancel'), scoped_integration_path(integration), class: 'btn btn-cancel'
......@@ -2768,10 +2768,6 @@ Service
updates the has_external_issue_tracker boolean
on update
updates the has_external_issue_tracker boolean
#deprecated?
should return false by default
#deprecation_message
should be empty by default
#api_field_names
filters out sensitive fields
......
......@@ -523,24 +523,6 @@ describe Service do
end
end
describe "#deprecated?" do
let(:project) { create(:project, :repository) }
it 'returns false by default' do
service = create(:service, project: project)
expect(service.deprecated?).to be_falsy
end
end
describe "#deprecation_message" do
let(:project) { create(:project, :repository) }
it 'is empty by default' do
service = create(:service, project: project)
expect(service.deprecation_message).to be_nil
end
end
describe '#api_field_names' do
let(:fake_service) do
Class.new(Service) do
......
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