lato 0.1.31 → 0.1.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 487938754164a63167d2b0a8e40d40dbf08fc73a8f527024ceab4d1ab5415fce
4
- data.tar.gz: 38dad86f2a9aaf5e57453315e8f7d5698cc782b34edb9cfa2fe660a02b073297
3
+ metadata.gz: d80f200ab351b66a3fb875550a75df337fe39484dd97e64089fb69e71ad24380
4
+ data.tar.gz: bac614240a6d9147177c0a84ed56ccb173a8628de46d8e6212a1bc29c8d9b4c7
5
5
  SHA512:
6
- metadata.gz: bcd262be49775a227276acf297e3e034bd40ca5e68e24fc0fd2e6035b6a45cc30ffd97a40df575a7f7adcbf840747d2cbc801ffd57543a2581911db48b19f4ce
7
- data.tar.gz: 910142d9daee21343739a80f7040dc42deb2c15a507247beadcc38567dfebc2e8c23da21c566a73691f2054e27d287c4d9c879c853df0577aab33c05f9750634
6
+ metadata.gz: f7c2e3bd766ad2e48197d889d75debb425077bfdfde9b7e70153c22fbc37b6e0eaec9c27f1c3776d2417d90625e8778ab6d7e4115f36bc1e142c242510e5b933
7
+ data.tar.gz: f6ae26961ccbca3f0b83747f4527d2995722b3e700cecc2c228df8cb5a344301bffc840cb65423f1f4b030c0ff9818b21474859fd84ab004fe9e57be233d98f9
data/README.md CHANGED
@@ -95,6 +95,3 @@ $ ruby ./bin/publish.rb
95
95
 
96
96
  ## License
97
97
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
98
-
99
- ## To do
100
- - Gestione abbonamenti e acquisti singoli con integrazione Stripe
@@ -2,7 +2,7 @@ module Lato
2
2
  class AuthenticationController < ApplicationController
3
3
  before_action :not_authenticate_session, only: %i[signin signin_action signup signup_action accept_invitation accept_invitation_action]
4
4
  before_action :authenticate_session, only: %i[signout signout_action]
5
-
5
+
6
6
  before_action :find_user, only: %i[verify_email verify_email_action update_password update_password_action]
7
7
  before_action :find_invitation, only: %i[accept_invitation accept_invitation_action]
8
8
 
@@ -7,6 +7,12 @@ module Lato
7
7
  return unless validate_user_access_to_operation
8
8
  end
9
9
 
10
+ def show_legacy
11
+ Rails.logger.warn('🚨 Legacy route used: operations/show/:id. Please replace operation_show_path with operation_path.')
12
+
13
+ redirect_to lato.operation_path(params[:id])
14
+ end
15
+
10
16
  private
11
17
 
12
18
  def validate_user_access_to_operation
@@ -16,6 +16,7 @@ module Lato
16
16
  ##
17
17
 
18
18
  belongs_to :lato_user, class_name: 'Lato::User', foreign_key: :lato_user_id, optional: true
19
+ belongs_to :inviter_lato_user, class_name: 'Lato::User', foreign_key: :inviter_lato_user_id, optional: true
19
20
 
20
21
  # Hooks
21
22
  ##
@@ -25,6 +25,7 @@ module Lato
25
25
 
26
26
  has_many :lato_operations, class_name: 'Lato::Operation', foreign_key: :lato_user_id, dependent: :nullify
27
27
  has_many :lato_invitations, class_name: 'Lato::Invitation', foreign_key: :lato_user_id, dependent: :nullify
28
+ has_many :lato_invitations_as_inviter, class_name: 'Lato::Invitation', foreign_key: :inviter_lato_user_id, dependent: :nullify
28
29
 
29
30
  has_many :lato_log_user_signins, class_name: 'Lato::Log::UserSignin', foreign_key: :lato_user_id, dependent: :nullify
30
31
 
@@ -208,7 +209,7 @@ module Lato
208
209
  raise ActiveRecord::Rollback unless save && invitation.update(
209
210
  accepted_at: Time.now,
210
211
  lato_user_id: id
211
- )
212
+ )
212
213
 
213
214
  true
214
215
  end
@@ -62,7 +62,7 @@
62
62
  <% end %>
63
63
 
64
64
  <% unless operation.finished? %>
65
- <%= link_to '', lato.operations_show_path(operation), class: 'd-none', data: { lato_operation_target: 'update', turbo_frame: '_self' } %>
65
+ <%= link_to '', lato.operation_path(operation), class: 'd-none', data: { lato_operation_target: 'update', turbo_frame: '_self' } %>
66
66
  <% end %>
67
67
  </div>
68
68
  <% end %>
@@ -2,7 +2,7 @@
2
2
  <html>
3
3
  <head>
4
4
  <meta charset="utf-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
5
+ <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no,shrink-to-fit=no">
6
6
  <title><%= Lato.config.application_title %></title>
7
7
  <%= csrf_meta_tags %>
8
8
  <%= csp_meta_tag %>
data/config/routes.rb CHANGED
@@ -23,6 +23,9 @@ Lato::Engine.routes.draw do
23
23
  post 'accept_invitation_action', to: 'authentication#accept_invitation_action', as: :authentication_accept_invitation_action
24
24
  end
25
25
 
26
+ # Account
27
+ ##
28
+
26
29
  scope :account do
27
30
  get '', to: 'account#index', as: :account
28
31
  patch 'update_user_action', to: 'account#update_user_action', as: :account_update_user_action
@@ -33,7 +36,11 @@ Lato::Engine.routes.draw do
33
36
  patch 'update_accepted_terms_and_conditions_version_action', to: 'account#update_accepted_terms_and_conditions_version_action', as: :account_update_accepted_terms_and_conditions_version_action
34
37
  end
35
38
 
36
- scope :operations do
37
- get 'show/:id', to: 'operations#show', as: :operations_show
38
- end
39
+ # Operations
40
+ ##
41
+
42
+ get 'operation/:id', to: 'operations#show', as: :operation
43
+
44
+ # NOTE: Legacy route
45
+ get 'operations/show/:id', to: 'operations#show_legacy', as: :operations_show
39
46
  end
@@ -0,0 +1,5 @@
1
+ class AddInviterLatoUserIdToInvitations < ActiveRecord::Migration[7.0]
2
+ def change
3
+ add_reference :lato_invitations, :inviter_lato_user, foreign_key: { to_table: :lato_users }
4
+ end
5
+ end
data/lib/lato/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lato
2
- VERSION = "0.1.31"
2
+ VERSION = "0.1.33"
3
3
  end
@@ -35,26 +35,4 @@ namespace :lato do
35
35
  FileUtils.copy(gem_concern_path, app_concern_path) unless File.exist? app_concern_path
36
36
  end
37
37
  end
38
-
39
- namespace :bootstrap do
40
- desc 'Generate SCSS variables for grays starting from a light color'
41
- # Usage: rails lato:bootstrap:grays light=ffffff
42
- task :grays do
43
- light = ENV['light']
44
- raise 'Light color not set' if light.blank?
45
-
46
- rgb = light.match(/(..)(..)(..)$/).captures.map(&:hex)
47
- r_range = rgb[0] / 9
48
- g_range = rgb[1] / 9
49
- b_range = rgb[2] / 9
50
-
51
- puts rgb
52
- (1..9).each do |level|
53
- r_value = rgb[0] - r_range * (level - 1)
54
- g_value = rgb[1] - g_range * (level - 1)
55
- b_value = rgb[2] - b_range * (level - 1)
56
- puts "$gray-#{level}00: rgb(#{r_value}, #{g_value}, #{b_value});"
57
- end
58
- end
59
- end
60
38
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lato
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.31
4
+ version: 0.1.33
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregorio Galante
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-11 00:00:00.000000000 Z
11
+ date: 2023-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -193,6 +193,7 @@ files:
193
193
  - db/migrate/20221229233844_add_locale_to_lato_user.rb
194
194
  - db/migrate/20230109054412_create_lato_log_user_signins.rb
195
195
  - db/migrate/20230109061533_create_lato_invitations.rb
196
+ - db/migrate/20230212211748_add_inviter_lato_user_id_to_invitations.rb
196
197
  - lib/lato.rb
197
198
  - lib/lato/btstrap.rb
198
199
  - lib/lato/config.rb