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 { ...@@ -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,
}, },
}); });
}, },
......
...@@ -335,15 +335,6 @@ ...@@ -335,15 +335,6 @@
} }
} }
.deprecated-service {
cursor: default;
a {
font-weight: $gl-font-weight-bold;
color: $white;
}
}
.personal-access-tokens-never-expires-label { .personal-access-tokens-never-expires-label {
color: $note-disabled-comment-color; color: $note-disabled-comment-color;
} }
...@@ -401,4 +392,3 @@ ...@@ -401,4 +392,3 @@
} }
} }
} }
...@@ -51,17 +51,13 @@ module ServicesHelper ...@@ -51,17 +51,13 @@ module ServicesHelper
end end
end end
def service_save_button(service) def service_save_button
button_tag(class: 'btn btn-success', type: 'submit', disabled: service.deprecated?, data: { qa_selector: 'save_changes_button' }) do button_tag(class: 'btn btn-success', type: 'submit', data: { qa_selector: 'save_changes_button' }) do
icon('spinner spin', class: 'hidden js-btn-spinner') + icon('spinner spin', class: 'hidden js-btn-spinner') +
content_tag(:span, 'Save changes', class: 'js-btn-label') content_tag(:span, 'Save changes', class: 'js-btn-label')
end end
end end
def disable_fields_service?(service)
!current_controller?("admin/services") && service.deprecated?
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)
......
...@@ -345,14 +345,6 @@ class Service < ApplicationRecord ...@@ -345,14 +345,6 @@ class Service < ApplicationRecord
service service
end end
def deprecated?
false
end
def deprecation_message
nil
end
# override if needed # override if needed
def supports_data_fields? def supports_data_fields?
false false
......
.flash-container.flash-container-page
.flash-alert.deprecated-service
%span= @service.deprecation_message
...@@ -2,6 +2,4 @@ ...@@ -2,6 +2,4 @@
- breadcrumb_title @service.title - breadcrumb_title @service.title
- page_title @service.title, "Service Templates" - page_title @service.title, "Service Templates"
= render 'deprecated_message' if @service.deprecation_message
= render 'form' = render 'form'
.flash-container.flash-container-page
.flash-alert.deprecated-service
%span= @service.deprecation_message
...@@ -13,7 +13,7 @@ ...@@ -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| = 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 = render 'shared/service_settings', form: form, service: @service
.footer-block.row-content-block .footer-block.row-content-block
= service_save_button(@service) = service_save_button
&nbsp; &nbsp;
= link_to _('Cancel'), project_settings_integrations_path(@project), class: 'btn btn-cancel' = link_to _('Cancel'), project_settings_integrations_path(@project), class: 'btn btn-cancel'
......
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
- add_to_breadcrumbs _('Integration Settings'), project_settings_integrations_path(@project) - add_to_breadcrumbs _('Integration Settings'), project_settings_integrations_path(@project)
- page_title @service.title, _('Integrations') - page_title @service.title, _('Integrations')
= render 'deprecated_message' if @service.deprecation_message
= render 'form' = render 'form'
- if @web_hook_logs - if @web_hook_logs
= render partial: 'projects/hook_logs/index', locals: { hook: @service.service_hook, hook_logs: @web_hook_logs, project: @project } = render partial: 'projects/hook_logs/index', locals: { hook: @service.service_hook, hook_logs: @web_hook_logs, project: @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
......
...@@ -10,5 +10,5 @@ ...@@ -10,5 +10,5 @@
- if integration.editable? - if integration.editable?
.footer-block.row-content-block .footer-block.row-content-block
= service_save_button(integration) = service_save_button
= link_to _('Cancel'), scoped_integration_path(integration), class: 'btn btn-cancel' = link_to _('Cancel'), scoped_integration_path(integration), class: 'btn btn-cancel'
...@@ -2768,10 +2768,6 @@ Service ...@@ -2768,10 +2768,6 @@ Service
updates the has_external_issue_tracker boolean updates the has_external_issue_tracker boolean
on update on update
updates the has_external_issue_tracker boolean updates the has_external_issue_tracker boolean
#deprecated?
should return false by default
#deprecation_message
should be empty by default
#api_field_names #api_field_names
filters out sensitive fields filters out sensitive fields
......
...@@ -523,24 +523,6 @@ describe Service do ...@@ -523,24 +523,6 @@ describe Service do
end end
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 describe '#api_field_names' do
let(:fake_service) do let(:fake_service) do
Class.new(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