tranzito_utils 1.0.0 → 1.0.3

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: c4045a5fec9bb07e94ee83a17aafb7f7e58b1c228de4a5562116a9982a362d12
4
- data.tar.gz: dc1d4c81f7f71079c0b66e5b7c6b8e23b88d3fbde4372eef0c50a3ff50569ff6
3
+ metadata.gz: a6516dd9d39fe6ad64de9b010625861da771f1d2727778448192681229e97f51
4
+ data.tar.gz: 78e25c61c6542958f486d7108428505db65b03addb44a41fbca5c14807f689f0
5
5
  SHA512:
6
- metadata.gz: 501bde401f008a5d0ae611539dec533d448d4d75e40ad23b262a1030818a9785201ff75429435cb4fc78c3b4f59e67b5d41d037d10a8a3a21588bb37d13c4282
7
- data.tar.gz: 9ec818c62b80d08cba34103ef490bb6339f431ed835e1d9584428ada2270f4a80bb54e34216577e4cf3ec86e9822b93fb0aae01b5cf7d9783a0e9349ed46c61a
6
+ metadata.gz: a636eaea774add3a7397be4639aa4963b1c091766c8db5225c3468a49e7c98db08a44d69731472c491b57af7aa029216e1527307e55bebe0ffa4d423015fd09e
7
+ data.tar.gz: 5f5099d219334b8d62345fa43f2dc644993e5d9261946680b5b52ae825a23c57a1ff978bf04bd8feadc43f2e9e58109769a170e606daeb0c02a6f8904a0f1136
data/README.md CHANGED
@@ -117,7 +117,7 @@ window.timeParser.localize()
117
117
 
118
118
  As for `PeriodSelector`, you can use it by initializing like this
119
119
  ```
120
- if ($('#timeSelectionBtnGroup').length) {
120
+ if (document.getElementById('timeSelectionBtnGroup')) {
121
121
  const periodSelector = new PeriodSelector()
122
122
  periodSelector.init()
123
123
  }
@@ -2,7 +2,7 @@
2
2
  - include_future ||= false
3
3
  - prepend_text ||= nil
4
4
 
5
- #timeSelectionBtnGroup.text-right{ role: "group", class: @period == "custom" ? "custom-period-selected" : "", "data-nosubmit" => "#{skip_submission}" }
5
+ #timeSelectionBtnGroup.text-right{ role: "group", class: (@period == "custom" ? "custom-period-selected" : ""), "data-nosubmit" => "#{skip_submission}" }
6
6
  - if prepend_text.present?
7
7
  %span.mr-2.less-strong.d-block.d-lg-inline-block
8
8
  = prepend_text
@@ -57,10 +57,7 @@ module TranzitoUtils
57
57
  @start_time = Time.current
58
58
  @end_time = Time.current.beginning_of_day + 1.week
59
59
  when "all"
60
- @start_time = TranzitoUtils::DEFAULT[:earliest_period_time]
61
- else
62
- @period = default_period
63
- @start_time = TranzitoUtils::DEFAULT[:earliest_period_time]
60
+ @start_time = earliest_period_date
64
61
  end
65
62
  @end_time ||= latest_period_date
66
63
  end
@@ -93,5 +90,9 @@ module TranzitoUtils
93
90
 
94
91
  @timezone ||= TranzitoUtils::DEFAULT[:time_zone]
95
92
  end
93
+
94
+ def earliest_period_date
95
+ TranzitoUtils::DEFAULT[:earliest_period_time]
96
+ end
96
97
  end
97
98
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  module TranzitoUtils
4
4
  module SortableHelper
5
- DEFAULT_SEARCH_KEYS = [:direction, :sort, :user_id, :period, :start_time, :end_time, :per_page].freeze
5
+ DEFAULT_SEARCH_KEYS = %i[direction sort period start_time end_time per_page user_id query].freeze
6
6
 
7
7
  def sortable(column, title = nil, html_options = {})
8
8
  if title.is_a?(Hash) # If title is a hash, it wasn't passed
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TranzitoUtils
4
- module ParamsNormalizer
4
+ module Normalize
5
5
  def self.boolean(param = nil)
6
6
  return false if param.blank?
7
7
  ActiveRecord::Type::Boolean.new.cast(param.to_s.strip)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TranzitoUtils
4
- VERSION = "1.0.0"
4
+ VERSION = "1.0.3"
5
5
  end
@@ -17,5 +17,5 @@ require "tranzito_utils/concerns/sortable_table"
17
17
  require "tranzito_utils/helpers/graphing_helper"
18
18
  require "tranzito_utils/helpers/sortable_helper"
19
19
  require "tranzito_utils/services/time_parser"
20
- require "tranzito_utils/services/params_normalizer"
20
+ require "tranzito_utils/services/normalize"
21
21
  require "tranzito_utils/gem"
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tranzito_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
- - willbarrett
7
+ - willbarrettdev
8
8
  - sethherr
9
9
  - hafiz-ahmed
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2022-09-26 00:00:00.000000000 Z
13
+ date: 2022-09-29 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -47,7 +47,7 @@ files:
47
47
  - lib/tranzito_utils/gem.rb
48
48
  - lib/tranzito_utils/helpers/graphing_helper.rb
49
49
  - lib/tranzito_utils/helpers/sortable_helper.rb
50
- - lib/tranzito_utils/services/params_normalizer.rb
50
+ - lib/tranzito_utils/services/normalize.rb
51
51
  - lib/tranzito_utils/services/time_parser.rb
52
52
  - lib/tranzito_utils/version.rb
53
53
  homepage: https://github.com/Tranzito/tranzito_utils