From 7a100f7e2ac2ec31c8cebd196f7bfb39b28d4650 Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Sat, 27 Jul 2024 15:05:08 +0200 Subject: [PATCH] Fix name of background job to calculate visits --- .app_version | 2 +- CHANGELOG.md | 8 ++ app/controllers/visits_controller.rb | 2 +- app/jobs/area_visits_calculating_job.rb | 2 +- app/views/imports/index.html.erb | 2 +- app/views/visits/index.html.erb | 97 ++++++++++++++----------- 6 files changed, 67 insertions(+), 46 deletions(-) diff --git a/.app_version b/.app_version index 85b7c695..c81aa44a 100644 --- a/.app_version +++ b/.app_version @@ -1 +1 @@ -0.9.6 +0.9.7 diff --git a/CHANGELOG.md b/CHANGELOG.md index 38948f58..77d2a856 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [0.9.7] — 2024-07-27 + +### Fixed + +- Name of backgroun job to calculate visits + +--- + ## [0.9.6] — 2024-07-27 ### Fixed diff --git a/app/controllers/visits_controller.rb b/app/controllers/visits_controller.rb index 02a9009d..01d443f8 100644 --- a/app/controllers/visits_controller.rb +++ b/app/controllers/visits_controller.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true class VisitsController < ApplicationController - before_action + before_action :authenticate_user! before_action :set_visit, only: %i[update] def index diff --git a/app/jobs/area_visits_calculating_job.rb b/app/jobs/area_visits_calculating_job.rb index 9ad5f314..adb6ec53 100644 --- a/app/jobs/area_visits_calculating_job.rb +++ b/app/jobs/area_visits_calculating_job.rb @@ -7,6 +7,6 @@ class AreaVisitsCalculatingJob < ApplicationJob user = User.find(user_id) areas = user.areas - Visits::Areas::Calculate(user, areas).call + Areas::Visits::Create(user, areas).call end end diff --git a/app/views/imports/index.html.erb b/app/views/imports/index.html.erb index b37f69b6..dd4ebfe7 100644 --- a/app/views/imports/index.html.erb +++ b/app/views/imports/index.html.erb @@ -13,7 +13,7 @@

Hello there!

- Here you'll find your imports, But now there are none. Let's <%= link_to 'create one', new_import_path, class: 'link' %>! + Here you'll find your imports, but now there are none. Let's <%= link_to 'create one', new_import_path, class: 'link' %>!

diff --git a/app/views/visits/index.html.erb b/app/views/visits/index.html.erb index aac9526e..449b993a 100644 --- a/app/views/visits/index.html.erb +++ b/app/views/visits/index.html.erb @@ -5,52 +5,65 @@

Visits

-
-
- <%= paginate @visits %> + <% if @visits.empty? %> +
+
+
+

Hello there!

+

+ Here you'll find your visits, but now there are none. Create some areas on your map and pretty soon you'll see visit suggestions on this page! +

+
+
+
+ <% else %> +
+
+ <%= paginate @visits %> +
-
- + <% end %> +
+
+ + <% end %> + + <% end %>