Skip to content

Commit

Permalink
Merge pull request 'Make the test suite green again' (#1) from green_…
Browse files Browse the repository at this point in the history
  • Loading branch information
masdemocraciaeu committed Feb 15, 2023
2 parents b96debe + 75e2740 commit 5f9f885
Show file tree
Hide file tree
Showing 45 changed files with 117 additions and 4,607 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ on:
branches-ignore:
- i18n_master

permissions:
contents: read

jobs:
tests:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
timeout-minutes: 60
services:
postgres:
Expand Down Expand Up @@ -60,7 +63,9 @@ jobs:
name: screenshots
path: tmp/screenshots
coveralls:
runs-on: ubuntu-18.04
permissions:
contents: none
runs-on: ubuntu-latest
needs: tests
env:
CI_BUILD_NUMBER: ${{ github.run_number }}
Expand Down
3 changes: 3 additions & 0 deletions app/components/custom/layout/consent_banner_component.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class Layout::ConsentBannerComponent < ApplicationComponent
delegate :cookies, to: :helpers
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
require_dependency Rails.root.join("app", "controllers", "management", "email_verifications_controller").to_s

class Management::EmailVerificationsController
def create
@email_verification = Verification::Management::Email.new(email_verification_params)

if @email_verification.save
@managed_user = nil
render :sent
else
render :new
end
end
end
11 changes: 11 additions & 0 deletions app/models/custom/geozone.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
require_dependency Rails.root.join("app", "models", "geozone").to_s

class Geozone
def safe_to_destroy?
Geozone.reflect_on_all_associations(:has_many).reject do |association|
association.name == :audits
end.all? do |association|
association.klass.where(geozone: self).empty?
end
end
end
1 change: 1 addition & 0 deletions app/models/custom/legislation/process.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class Legislation::Process < ApplicationRecord
audited on: [:create, :update, :destroy]

acts_as_paranoid column: :hidden_at
acts_as_taggable_on :customs

attribute :background_color, default: "#e7f2fc"
attribute :font_color, default: "#222222"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@
<div id="category_tags" class="tags">
<%= f.label :category_tag_list, t("proposals.form.tag_category_label") %>
<% @process.tag_list_on(:customs).each do |tag| %>
<a class="js-add-tag-link"><%= tag.name %></a>
<a class="js-add-tag-link"><%= tag %></a>
<% end %>
</div>

Expand Down
8 changes: 5 additions & 3 deletions app/views/custom/layouts/_header.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,16 @@
<div class="top-bar">

<span data-responsive-toggle="responsive-menu" data-hide-for="medium" class="float-right">
<button type="button" class="menu-icon" style="color: #FFF;" data-toggle></button>
<%= t("application.menu") %>
<button type="button" class="menu-button" data-toggle>
<span class="menu-icon"></span>
<%= t("application.menu") %>
</button>
</span>


<div class="left-section">
<%= link_to "https://www.tenerife.es/", target: "_blank", accesskey: "0" do %>
<%= image_tag(image_path_for("logo-cabildo-tenerife.png"), class: "float-left", alt: setting["org_name"]) %>
<%= image_tag(image_path_for("logo-cabildo-tenerife.png"), class: "float-left", alt: t("layouts.header.tenerife_logo")) %>
<% end %>
<%= link_to root_path, accesskey: "0", class: "hide-for-small-only top-bar-title" do %>
<h1>
Expand Down
2 changes: 1 addition & 1 deletion app/views/custom/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<body class="<%= yield (:body_class) %>">
<%= raw setting["html.per_page_code_body"] %>
<%= render "cookies_eu/consent_banner" %>
<%= render Layout::ConsentBannerComponent.new %>

<div class="wrapper <%= yield (:wrapper_class) %>">
<%= render "layouts/header", with_subnavigation: true %>
Expand Down
4 changes: 3 additions & 1 deletion config/i18n-tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ data:
# - config/locales/**/*.%{locale}.yml
## Another gem (replace %#= with %=):
# - "<%#= %x[bundle show vagrant].chomp %>/templates/locales/%{locale}.yml"
- config/locales/custom/%{locale}/*.yml
- config/locales/custom/%{locale}/**[^settings]*.yml
- config/locales/%{locale}/rails_date_order.yml
- config/locales/%{locale}/general.yml
- config/locales/%{locale}/activerecord.yml
Expand Down Expand Up @@ -123,6 +123,8 @@ ignore_missing:
- "devise.registrations.destroyed"
- "devise.password_expired.*"
- "seeds.settings.*"
- "cookies_eu.direction"
- "cookies_eu.learn_more"

## Consider these keys used:
ignore_unused:
Expand Down
4 changes: 2 additions & 2 deletions config/initializers/devise.rb
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,10 @@

# Number of authentication tries before locking an account if lock_strategy
# is failed attempts.
config.maximum_attempts = Setting["login_attempts_before_lock"].to_i || 2
config.maximum_attempts = 2 # Overwritten in User model

# Time interval to unlock the account if :time is enabled as unlock_strategy.
config.unlock_in = (Setting["time_to_unlock"].to_i || 2).minutes
config.unlock_in = 2.minutes # Overwritten in User model

# Warn on the last attempt before the account is locked.
config.last_attempt_warning = true
Expand Down
Loading

0 comments on commit 5f9f885

Please sign in to comment.