Render 'how to enable' when the related feature setting is disabled
Add 'how to enable' information on SDG configuration tab when related sdg feature setting is disabled.
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
<h2><%= t("admin.settings.index.sdg.title") %></h2>
|
<% if feature?(:sdg) %>
|
||||||
|
<h2><%= t("admin.settings.index.sdg.title") %></h2>
|
||||||
|
|
||||||
<%= render "featured_settings_table", features: @sdg_settings, tab: "#tab-sdg-configuration" %>
|
<%= render "featured_settings_table", features: @sdg_settings, tab: "#tab-sdg-configuration" %>
|
||||||
|
<% else %>
|
||||||
|
<div class="callout primary">
|
||||||
|
<%= t("admin.settings.index.sdg.how_to_enable") %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
|||||||
@@ -1242,6 +1242,7 @@ en:
|
|||||||
how_to_enable: 'To configure remote census (SOAP) you must enable "Configure connection to remote census (SOAP)" on "Features" tab.'
|
how_to_enable: 'To configure remote census (SOAP) you must enable "Configure connection to remote census (SOAP)" on "Features" tab.'
|
||||||
sdg:
|
sdg:
|
||||||
title: SDG configuration
|
title: SDG configuration
|
||||||
|
how_to_enable: 'To show the configuration options from Sustainable Development Goals you must enable "SDG" on "Features" tab.'
|
||||||
remote_census_general_name: General Information
|
remote_census_general_name: General Information
|
||||||
remote_census_request_name: Request Data
|
remote_census_request_name: Request Data
|
||||||
remote_census_response_name: Response Data
|
remote_census_response_name: Response Data
|
||||||
|
|||||||
@@ -1241,6 +1241,7 @@ es:
|
|||||||
how_to_enable: 'Para configurar la conexión con el Censo Remoto (SOAP) se debe activar "Configurar la conexión al censo remoto (SOAP)" en la pestaña "Funcionalidades".'
|
how_to_enable: 'Para configurar la conexión con el Censo Remoto (SOAP) se debe activar "Configurar la conexión al censo remoto (SOAP)" en la pestaña "Funcionalidades".'
|
||||||
sdg:
|
sdg:
|
||||||
title: Configuración ODS
|
title: Configuración ODS
|
||||||
|
how_to_enable: 'Para mostrar las opciones de configuración de los Objetivos de Desarrollo Sostenible se debe activar "ODS" en la pestaña "Funcionalidades".'
|
||||||
remote_census_general_name: Datos Generales
|
remote_census_general_name: Datos Generales
|
||||||
remote_census_request_name: Datos Petición
|
remote_census_request_name: Datos Petición
|
||||||
remote_census_response_name: Datos Respuesta
|
remote_census_response_name: Datos Respuesta
|
||||||
|
|||||||
@@ -267,6 +267,7 @@ describe "Admin settings", :admin do
|
|||||||
end
|
end
|
||||||
|
|
||||||
scenario "On #tab-sdg-configuration", :js do
|
scenario "On #tab-sdg-configuration", :js do
|
||||||
|
Setting["feature.sdg"] = true
|
||||||
Setting.create!(key: "sdg.whatever")
|
Setting.create!(key: "sdg.whatever")
|
||||||
login_as(create(:administrator).user)
|
login_as(create(:administrator).user)
|
||||||
|
|
||||||
@@ -313,4 +314,28 @@ describe "Admin settings", :admin do
|
|||||||
Setting["feature.user.skip_verification"] = nil
|
Setting["feature.user.skip_verification"] = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe "SDG configuration tab", :js do
|
||||||
|
scenario "is enabled when the sdg feature is enabled" do
|
||||||
|
Setting["feature.sdg"] = true
|
||||||
|
login_as(create(:administrator).user)
|
||||||
|
|
||||||
|
visit admin_settings_path
|
||||||
|
click_link "SDG configuration"
|
||||||
|
|
||||||
|
expect(page).to have_css "h2", exact_text: "SDG configuration"
|
||||||
|
end
|
||||||
|
|
||||||
|
scenario "is disabled when the sdg feature is disabled" do
|
||||||
|
Setting["feature.sdg"] = false
|
||||||
|
login_as(create(:administrator).user)
|
||||||
|
|
||||||
|
visit admin_settings_path
|
||||||
|
click_link "SDG configuration"
|
||||||
|
|
||||||
|
expect(page).to have_content "To show the configuration options from " \
|
||||||
|
"Sustainable Development Goals you must " \
|
||||||
|
'enable "SDG" on "Features" tab.'
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user