diff options
author | Mayra Cabrera <mcabrera@gitlab.com> | 2018-01-03 14:46:51 -0600 |
---|---|---|
committer | Mayra Cabrera <mcabrera@gitlab.com> | 2018-01-03 18:38:12 -0600 |
commit | 932b66fe1f3a25d7af2c6fa4b104e33f6f7c47d4 (patch) | |
tree | 2c0db3e5db2efe9d55cb8892fde642aaeb5ff245 | |
parent | 7ec434c7a4cb50ffb0ec1f19454d15644aaca0c7 (diff) | |
download | gitlab-ce-41054-disable-creation-of-new-kubernetes-integrations.tar.gz |
Reused flash html structure and fix failing service specs41054-disable-creation-of-new-kubernetes-integrations
Also fixes typo for required attribute
-rw-r--r-- | app/assets/stylesheets/pages/settings.scss | 14 | ||||
-rw-r--r-- | app/views/projects/services/_deprecated_message.html.haml | 5 | ||||
-rw-r--r-- | app/views/shared/_field.html.haml | 2 | ||||
-rw-r--r-- | spec/requests/api/services_spec.rb | 10 | ||||
-rw-r--r-- | spec/requests/api/v3/services_spec.rb | 4 | ||||
-rw-r--r-- | spec/support/services_shared_context.rb | 8 |
6 files changed, 20 insertions, 23 deletions
diff --git a/app/assets/stylesheets/pages/settings.scss b/app/assets/stylesheets/pages/settings.scss index 00ab6a091b8..6353482ede7 100644 --- a/app/assets/stylesheets/pages/settings.scss +++ b/app/assets/stylesheets/pages/settings.scss @@ -269,16 +269,6 @@ } } -.service-deprecated-message { - background-color: $red-500; - border-color: $red-500; - border: 1px solid transparent; - color: $white-normal; - padding: 16px; - - a { - color: $white-normal; - font-weight: bold; - text-decoration: underline; - } +.deprecated-service { + cursor: default; } diff --git a/app/views/projects/services/_deprecated_message.html.haml b/app/views/projects/services/_deprecated_message.html.haml index d17b72b11ea..fea9506a4bb 100644 --- a/app/views/projects/services/_deprecated_message.html.haml +++ b/app/views/projects/services/_deprecated_message.html.haml @@ -1,2 +1,3 @@ -.service-deprecated-message - = @service.deprecation_message +.flash-container.flash-container-page + .flash-alert.deprecated-service + %span= @service.deprecation_message diff --git a/app/views/shared/_field.html.haml b/app/views/shared/_field.html.haml index 2da4aa25435..aea0a8fd8e0 100644 --- a/app/views/shared/_field.html.haml +++ b/app/views/shared/_field.html.haml @@ -24,6 +24,6 @@ - elsif type == 'select' = form.select name, options_for_select(choices, value ? value : default_choice), {}, { class: "form-control", disabled: disabled} - elsif type == 'password' - = form.password_field name, autocomplete: "new-password", class: "form-control", required: value.blank? && :required, disabled: disabled + = form.password_field name, autocomplete: "new-password", class: "form-control", required: value.blank? && required, disabled: disabled - if help %span.help-block= help diff --git a/spec/requests/api/services_spec.rb b/spec/requests/api/services_spec.rb index 86bf47fd2bc..26d56c04862 100644 --- a/spec/requests/api/services_spec.rb +++ b/spec/requests/api/services_spec.rb @@ -54,10 +54,7 @@ describe API::Services do include_context service before do - service_object = project.find_or_initialize_service(service) - service_object.properties = service_attrs - service_object.active = true if service == "kubernetes" - service_object.save + initialize_service(service) end it "deletes #{service}" do @@ -74,10 +71,7 @@ describe API::Services do # inject some properties into the service before do - service_object = project.find_or_initialize_service(service) - service_object.properties = service_attrs - service_object.active = true if service == "kubernetes" - service_object.save + initialize_service(service) end it 'returns authentication error when unauthenticated' do diff --git a/spec/requests/api/v3/services_spec.rb b/spec/requests/api/v3/services_spec.rb index 8f212ab6be6..c69a7d58ca6 100644 --- a/spec/requests/api/v3/services_spec.rb +++ b/spec/requests/api/v3/services_spec.rb @@ -10,6 +10,10 @@ describe API::V3::Services do describe "DELETE /projects/:id/services/#{service.dasherize}" do include_context service + before do + initialize_service(service) + end + it "deletes #{service}" do delete v3_api("/projects/#{project.id}/services/#{dashed_service}", user) diff --git a/spec/support/services_shared_context.rb b/spec/support/services_shared_context.rb index 7457484a932..3f1fd169b72 100644 --- a/spec/support/services_shared_context.rb +++ b/spec/support/services_shared_context.rb @@ -29,5 +29,13 @@ Service.available_services_names.each do |service| end end end + + def initialize_service(service) + service_item = project.find_or_initialize_service(service) + service_item.properties = service_attrs + service_item.active = true if service == "kubernetes" + service_item.save + service_item + end end end |