productive 0.6.59 → 0.6.61
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/json_api_paginator.rb +6 -58
- data/lib/productive/resources/reports/salary_report.rb +9 -0
- data/lib/productive/resources/reports/time_report.rb +9 -0
- data/lib/productive/version.rb +1 -1
- data/lib/productive.rb +2 -4
- data/productive.gemspec +1 -2
- metadata +12 -22
- data/lib/productive/resources/event_report.rb +0 -6
- data/lib/productive/resources/profitability_report.rb +0 -8
- data/lib/productive/resources/salary_report.rb +0 -5
- data/lib/productive/resources/sales_report.rb +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a1fa7dbc3f6b6b926bbd59707a36c45bcc6b59016f1bc5ce7eec6d71955fb344
|
4
|
+
data.tar.gz: 5be468ef591d98b86d7b4e6c5fde8c89e185b1cb50a6bf9b19fb86b6872db77c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1338b329648fa312f37e5cd7e62b479b863c4840ddaaaa2aadff72229bc890002674e61698dcd6d082ca2068c16cdd84b2c96ba4e04b7d7f0cf9dfdf4e335e21
|
7
|
+
data.tar.gz: 2319384f1ea30d0e0d4ce3885a1a27867d17946ffe531a638d83f1b489ba0187347b96883abb52aeb757a1e24c2e60ae528170a9b86f294bb74856667f8b6e24
|
data/lib/json_api_paginator.rb
CHANGED
@@ -1,67 +1,15 @@
|
|
1
|
-
|
1
|
+
class JsonApiPaginator < JsonApiClient::Paginating::NestedParamPaginator
|
2
|
+
self.page_param = 'number'
|
3
|
+
self.per_page_param = 'size'
|
2
4
|
|
3
|
-
|
4
|
-
attr_reader :params, :result_set, :links, :meta
|
5
|
+
attr_reader :meta
|
5
6
|
|
6
7
|
def initialize(result_set, data)
|
7
|
-
|
8
|
-
@result_set = result_set
|
9
|
-
@links = data['links'] || {}
|
8
|
+
super
|
10
9
|
@meta = data['meta'] || {}
|
11
10
|
end
|
12
11
|
|
13
|
-
def next
|
14
|
-
links['next'] ? result_set.links.fetch_link('next') : nil
|
15
|
-
end
|
16
|
-
|
17
|
-
def prev
|
18
|
-
links['prev'] ? result_set.links.fetch_link('prev') : nil
|
19
|
-
end
|
20
|
-
|
21
|
-
def first
|
22
|
-
links['first'] ? result_set.links.fetch_link('first') : nil
|
23
|
-
end
|
24
|
-
|
25
|
-
def last
|
26
|
-
links['last'] ? result_set.links.fetch_link('last') : nil
|
27
|
-
end
|
28
|
-
|
29
|
-
def total_pages
|
30
|
-
if links['last']
|
31
|
-
uri = result_set.links.link_url_for('last')
|
32
|
-
last_params = params_for_uri(uri)
|
33
|
-
last_params['page']['number'].to_i
|
34
|
-
else
|
35
|
-
current_page
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
12
|
def total_entries
|
40
|
-
meta['total_count'].to_i ||
|
41
|
-
end
|
42
|
-
alias_method :total_count, :total_entries
|
43
|
-
|
44
|
-
def per_page
|
45
|
-
params['page']['size'].to_i
|
46
|
-
end
|
47
|
-
|
48
|
-
def current_page
|
49
|
-
(params['page']['number'] || 1).to_i
|
50
|
-
end
|
51
|
-
|
52
|
-
def previous_page
|
53
|
-
current_page > 1 ? (current_page - 1) : nil
|
54
|
-
end
|
55
|
-
|
56
|
-
def next_page
|
57
|
-
current_page < total_pages ? (current_page + 1) : nil
|
58
|
-
end
|
59
|
-
|
60
|
-
private
|
61
|
-
|
62
|
-
def params_for_uri(uri)
|
63
|
-
return {} unless uri
|
64
|
-
uri = Addressable::URI.parse(uri)
|
65
|
-
Rack::Utils.parse_nested_query(uri.query || '')
|
13
|
+
meta['total_count'].to_i || super
|
66
14
|
end
|
67
15
|
end
|
data/lib/productive/version.rb
CHANGED
data/lib/productive.rb
CHANGED
@@ -26,7 +26,6 @@ require 'productive/resources/document_type'
|
|
26
26
|
require 'productive/resources/email'
|
27
27
|
require 'productive/resources/entitlement'
|
28
28
|
require 'productive/resources/event'
|
29
|
-
require 'productive/resources/event_report'
|
30
29
|
require 'productive/resources/expense'
|
31
30
|
require 'productive/resources/filter'
|
32
31
|
require 'productive/resources/holiday_calendar'
|
@@ -46,7 +45,6 @@ require 'productive/resources/payment'
|
|
46
45
|
require 'productive/resources/person'
|
47
46
|
require 'productive/resources/pipeline'
|
48
47
|
require 'productive/resources/price'
|
49
|
-
require 'productive/resources/profitability_report'
|
50
48
|
require 'productive/resources/project'
|
51
49
|
require 'productive/resources/project_assignment'
|
52
50
|
require 'productive/resources/pulse'
|
@@ -69,13 +67,13 @@ require 'productive/resources/reports/payroll_item_report'
|
|
69
67
|
require 'productive/resources/reports/person_report'
|
70
68
|
require 'productive/resources/reports/price_report'
|
71
69
|
require 'productive/resources/reports/project_report'
|
70
|
+
require 'productive/resources/reports/salary_report'
|
72
71
|
require 'productive/resources/reports/service_report'
|
73
72
|
require 'productive/resources/reports/task_report'
|
74
73
|
require 'productive/resources/reports/time_entry_report'
|
74
|
+
require 'productive/resources/reports/time_report'
|
75
75
|
require 'productive/resources/role'
|
76
76
|
require 'productive/resources/salary'
|
77
|
-
require 'productive/resources/salary_report'
|
78
|
-
require 'productive/resources/sales_report'
|
79
77
|
require 'productive/resources/section'
|
80
78
|
require 'productive/resources/service'
|
81
79
|
require 'productive/resources/subsidiary'
|
data/productive.gemspec
CHANGED
@@ -13,7 +13,6 @@ Gem::Specification.new do |s|
|
|
13
13
|
s.license = 'MIT'
|
14
14
|
s.files = `git ls-files`.split("\n")
|
15
15
|
|
16
|
-
s.add_dependency '
|
17
|
-
s.add_dependency 'json_api_client', '>= 1.5.2'
|
16
|
+
s.add_dependency 'json_api_client', '>= 1.13.0', "<= 1.21.0"
|
18
17
|
s.add_dependency 'request_store', '~> 1.3'
|
19
18
|
end
|
metadata
CHANGED
@@ -1,43 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: productive
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.61
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josip Bišćan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-12-
|
11
|
+
date: 2022-12-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: rack
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: json_api_client
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
30
16
|
requirements:
|
31
17
|
- - ">="
|
32
18
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.
|
19
|
+
version: 1.13.0
|
20
|
+
- - "<="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 1.21.0
|
34
23
|
type: :runtime
|
35
24
|
prerelease: false
|
36
25
|
version_requirements: !ruby/object:Gem::Requirement
|
37
26
|
requirements:
|
38
27
|
- - ">="
|
39
28
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.
|
29
|
+
version: 1.13.0
|
30
|
+
- - "<="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 1.21.0
|
41
33
|
- !ruby/object:Gem::Dependency
|
42
34
|
name: request_store
|
43
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -93,7 +85,6 @@ files:
|
|
93
85
|
- lib/productive/resources/email.rb
|
94
86
|
- lib/productive/resources/entitlement.rb
|
95
87
|
- lib/productive/resources/event.rb
|
96
|
-
- lib/productive/resources/event_report.rb
|
97
88
|
- lib/productive/resources/expense.rb
|
98
89
|
- lib/productive/resources/filter.rb
|
99
90
|
- lib/productive/resources/holiday_calendar.rb
|
@@ -113,7 +104,6 @@ files:
|
|
113
104
|
- lib/productive/resources/person.rb
|
114
105
|
- lib/productive/resources/pipeline.rb
|
115
106
|
- lib/productive/resources/price.rb
|
116
|
-
- lib/productive/resources/profitability_report.rb
|
117
107
|
- lib/productive/resources/project.rb
|
118
108
|
- lib/productive/resources/project_assignment.rb
|
119
109
|
- lib/productive/resources/pulse.rb
|
@@ -136,13 +126,13 @@ files:
|
|
136
126
|
- lib/productive/resources/reports/person_report.rb
|
137
127
|
- lib/productive/resources/reports/price_report.rb
|
138
128
|
- lib/productive/resources/reports/project_report.rb
|
129
|
+
- lib/productive/resources/reports/salary_report.rb
|
139
130
|
- lib/productive/resources/reports/service_report.rb
|
140
131
|
- lib/productive/resources/reports/task_report.rb
|
141
132
|
- lib/productive/resources/reports/time_entry_report.rb
|
133
|
+
- lib/productive/resources/reports/time_report.rb
|
142
134
|
- lib/productive/resources/role.rb
|
143
135
|
- lib/productive/resources/salary.rb
|
144
|
-
- lib/productive/resources/salary_report.rb
|
145
|
-
- lib/productive/resources/sales_report.rb
|
146
136
|
- lib/productive/resources/section.rb
|
147
137
|
- lib/productive/resources/service.rb
|
148
138
|
- lib/productive/resources/service_assignment.rb
|