strongmind-auth 1.1.58 → 1.1.62

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9d339f7f3de97bf9d66d4016e9c6df2b5f42c690c64e951907789ff2ae2d785b
4
- data.tar.gz: 5a428449da9ca208c4946c4f377a942b6b4374847489cc5124131b04c217d965
3
+ metadata.gz: fbda7597b68d3fc40e7e2e345931da771bd337347bcb400b41f6c25ac9d0af4e
4
+ data.tar.gz: 9145c6eca8ef8b2f83cc89a40f6acec1505a832b7f1c0c527f7a63b0d31b5e02
5
5
  SHA512:
6
- metadata.gz: fea2b8e89c58d9efd34ec21b908ae3e026ec2cafa7d4ccb53621337a8e3d8539561e1c0cfffcdeff0290f92ab9cb1f858a2a7ab1a8db74a0e0be697b55d578d9
7
- data.tar.gz: 483a18db083fc299359338e1035853aab594a1beabf2473bfa0b1a84c8846a7d13ec716dc0e0f8257b83374e82285214e88f9eb226651cd444c4c251060488d7
6
+ metadata.gz: 847ea8b84ec737bfe71a8ae87101a40d2554e14c62571807e85d21811784d22c68c89dd4e858fb1b6e019bc8dea6151abe73fa72e7a2ec0397fc2dceded19780
7
+ data.tar.gz: 568f3d402bf0aeed5be2d2751e0ce2649d530547b4289b7b32a57c356230a997fd62a32e24e6083b1737c746154a4b832a2e1a8aba2436086f513e3334fe06ca
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- return if defined? Rails::Generators
3
+ # return if defined? Rails::Generators # This line needs to be commented out to allow tailwindcss watch to run linked ticket: https://strongmind.atlassian.net/browse/BEL-2645
4
4
 
5
5
  # if Devise is not present in Gemfile
6
6
  unless File.read('Gemfile').include?('devise')
@@ -1,5 +1,5 @@
1
1
  module Strongmind
2
2
  module Auth
3
- VERSION = "1.1.58"
3
+ VERSION = "1.1.62"
4
4
  end
5
5
  end
@@ -35,7 +35,16 @@ module Strongmind
35
35
  private
36
36
 
37
37
  def current_page?(url)
38
- request.fullpath == URI.parse(url).path
38
+ request.fullpath == URI.parse(url).path || path_in_request?(url)
39
+ end
40
+
41
+ def path_in_request?(path)
42
+ sanitized_path = path.gsub('/', '')
43
+
44
+ path_to_compare = request.fullpath.split('?').first
45
+
46
+ return path_to_compare == '/' if sanitized_path.empty?
47
+ path_to_compare.include?(sanitized_path) || path_to_compare.include?(sanitized_path.pluralize)
39
48
  end
40
49
 
41
50
  def fetch_navbar_data(nav_items)
@@ -91,7 +100,9 @@ module Strongmind
91
100
  end
92
101
 
93
102
  def build_nav_items(menu_items)
94
- { nav_items: menu_items.map { |item| nav_item_data(item) } }
103
+ items = { nav_items: menu_items.map { |item| nav_item_data(item) } }
104
+ items[:nav_items].first[:is_active] = true unless items[:nav_items].any? { |item| item[:is_active] }
105
+ items
95
106
  end
96
107
 
97
108
  def nav_item_data(item)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: strongmind-auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.58
4
+ version: 1.1.62
5
5
  platform: ruby
6
6
  authors:
7
7
  - Team Belding
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-22 00:00:00.000000000 Z
11
+ date: 2024-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails