foreman_statistics 1.1.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/foreman_statistics/api/v2/statistics_controller.rb +8 -6
- data/app/helpers/foreman_statistics/trends_helper.rb +30 -20
- data/app/models/concerns/foreman_statistics/has_many_trends.rb +9 -0
- data/app/models/foreman_statistics/trend.rb +3 -1
- data/app/services/foreman_statistics/statistics/count_hosts.rb +26 -1
- data/app/services/foreman_statistics/statistics/count_puppet_classes.rb +1 -1
- data/app/services/foreman_statistics/statistics.rb +4 -2
- data/app/views/foreman_statistics/trends/_hosts.html.erb +1 -1
- data/app/views/foreman_statistics/trends/index.html.erb +0 -1
- data/app/views/foreman_statistics/trends/show.html.erb +6 -6
- data/config/jest.config.js +21 -0
- data/db/migrate/20210523143005_migrate_environments.rb +13 -0
- data/lib/foreman_statistics/engine.rb +17 -13
- data/lib/foreman_statistics/version.rb +1 -1
- data/locale/ca/LC_MESSAGES/foreman_statistics.mo +0 -0
- data/locale/ca/foreman_statistics.edit.po +263 -0
- data/locale/ca/foreman_statistics.po +202 -0
- data/locale/ca/foreman_statistics.po.time_stamp +0 -0
- data/locale/cs_CZ/LC_MESSAGES/foreman_statistics.mo +0 -0
- data/locale/cs_CZ/foreman_statistics.edit.po +267 -0
- data/locale/cs_CZ/foreman_statistics.po +206 -0
- data/locale/cs_CZ/foreman_statistics.po.time_stamp +0 -0
- data/locale/de/LC_MESSAGES/foreman_statistics.mo +0 -0
- data/locale/de/foreman_statistics.edit.po +271 -0
- data/locale/de/foreman_statistics.po +210 -0
- data/locale/de/foreman_statistics.po.time_stamp +0 -0
- data/locale/en/LC_MESSAGES/foreman_statistics.mo +0 -0
- data/locale/en/foreman_statistics.edit.po +1 -1
- data/locale/en/foreman_statistics.po +1 -1
- data/locale/en_GB/LC_MESSAGES/foreman_statistics.mo +0 -0
- data/locale/en_GB/foreman_statistics.edit.po +265 -0
- data/locale/en_GB/foreman_statistics.po +204 -0
- data/locale/en_GB/foreman_statistics.po.time_stamp +0 -0
- data/locale/es/LC_MESSAGES/foreman_statistics.mo +0 -0
- data/locale/es/foreman_statistics.edit.po +269 -0
- data/locale/es/foreman_statistics.po +208 -0
- data/locale/es/foreman_statistics.po.time_stamp +0 -0
- data/locale/foreman_statistics.pot +2 -2
- data/locale/fr/LC_MESSAGES/foreman_statistics.mo +0 -0
- data/locale/fr/foreman_statistics.edit.po +269 -0
- data/locale/fr/foreman_statistics.po +208 -0
- data/locale/fr/foreman_statistics.po.time_stamp +0 -0
- data/locale/gl/LC_MESSAGES/foreman_statistics.mo +0 -0
- data/locale/gl/foreman_statistics.edit.po +263 -0
- data/locale/gl/foreman_statistics.po +202 -0
- data/locale/gl/foreman_statistics.po.time_stamp +0 -0
- data/locale/it/LC_MESSAGES/foreman_statistics.mo +0 -0
- data/locale/it/foreman_statistics.edit.po +265 -0
- data/locale/it/foreman_statistics.po +204 -0
- data/locale/it/foreman_statistics.po.time_stamp +0 -0
- data/locale/ja/LC_MESSAGES/foreman_statistics.mo +0 -0
- data/locale/ja/foreman_statistics.edit.po +266 -0
- data/locale/ja/foreman_statistics.po +205 -0
- data/locale/ja/foreman_statistics.po.time_stamp +0 -0
- data/locale/ko/LC_MESSAGES/foreman_statistics.mo +0 -0
- data/locale/ko/foreman_statistics.edit.po +264 -0
- data/locale/ko/foreman_statistics.po +203 -0
- data/locale/ko/foreman_statistics.po.time_stamp +0 -0
- data/locale/nl_NL/LC_MESSAGES/foreman_statistics.mo +0 -0
- data/locale/nl_NL/foreman_statistics.edit.po +267 -0
- data/locale/nl_NL/foreman_statistics.po +206 -0
- data/locale/nl_NL/foreman_statistics.po.time_stamp +0 -0
- data/locale/pl/LC_MESSAGES/foreman_statistics.mo +0 -0
- data/locale/pl/foreman_statistics.edit.po +266 -0
- data/locale/pl/foreman_statistics.po +205 -0
- data/locale/pl/foreman_statistics.po.time_stamp +0 -0
- data/locale/pt_BR/LC_MESSAGES/foreman_statistics.mo +0 -0
- data/locale/pt_BR/foreman_statistics.edit.po +269 -0
- data/locale/pt_BR/foreman_statistics.po +208 -0
- data/locale/pt_BR/foreman_statistics.po.time_stamp +0 -0
- data/locale/ru/LC_MESSAGES/foreman_statistics.mo +0 -0
- data/locale/ru/foreman_statistics.edit.po +270 -0
- data/locale/ru/foreman_statistics.po +209 -0
- data/locale/ru/foreman_statistics.po.time_stamp +0 -0
- data/locale/sv_SE/LC_MESSAGES/foreman_statistics.mo +0 -0
- data/locale/sv_SE/foreman_statistics.edit.po +265 -0
- data/locale/sv_SE/foreman_statistics.po +204 -0
- data/locale/sv_SE/foreman_statistics.po.time_stamp +0 -0
- data/locale/zh_CN/LC_MESSAGES/foreman_statistics.mo +0 -0
- data/locale/zh_CN/foreman_statistics.edit.po +267 -0
- data/locale/zh_CN/foreman_statistics.po +206 -0
- data/locale/zh_CN/foreman_statistics.po.time_stamp +0 -0
- data/locale/zh_TW/LC_MESSAGES/foreman_statistics.mo +0 -0
- data/locale/zh_TW/foreman_statistics.edit.po +266 -0
- data/locale/zh_TW/foreman_statistics.po +205 -0
- data/locale/zh_TW/foreman_statistics.po.time_stamp +0 -0
- data/package.json +25 -24
- data/test/functional/foreman_statistics/api/v2/trends_controller_test.rb +1 -1
- data/test/functional/foreman_statistics/trends_controller_test.rb +0 -7
- data/test/unit/foreman_statistics/statistics_test.rb +24 -10
- data/webpack/src/Components/StatisticsChartsList/__snapshots__/StatisticsChartsList.test.js.snap +6 -0
- data/webpack/src/Router/StatisticsPage/__tests__/__snapshots__/StatisticsPage.test.js.snap +10 -0
- metadata +77 -92
- data/app/models/concerns/foreman_statistics/compute_resource_decorations.rb +0 -9
- data/app/models/concerns/foreman_statistics/environment_decorations.rb +0 -9
- data/app/models/concerns/foreman_statistics/general_setting_decorations.rb +0 -17
- data/app/models/concerns/foreman_statistics/hostgroup_decorations.rb +0 -9
- data/app/models/concerns/foreman_statistics/model_decorations.rb +0 -9
- data/app/models/concerns/foreman_statistics/operatingsystem_decorations.rb +0 -9
- data/app/models/concerns/foreman_statistics/setting_decorations.rb +0 -9
- data/webpack/__mocks__/foremanReact/API.js +0 -7
- data/webpack/__mocks__/foremanReact/common/HOC.js +0 -24
- data/webpack/__mocks__/foremanReact/common/I18n.js +0 -3
- data/webpack/__mocks__/foremanReact/common/helpers.js +0 -1
- data/webpack/__mocks__/foremanReact/common/urlHelpers.js +0 -1
- data/webpack/__mocks__/foremanReact/components/ChartBox/index.js +0 -2
- data/webpack/__mocks__/foremanReact/components/ForemanModal/ForemanModalActions.js +0 -2
- data/webpack/__mocks__/foremanReact/components/ForemanModal/ForemanModalHooks.js +0 -10
- data/webpack/__mocks__/foremanReact/components/ForemanModal/index.js +0 -4
- data/webpack/__mocks__/foremanReact/components/Layout/LayoutActions.js +0 -2
- data/webpack/__mocks__/foremanReact/components/Pagination/PaginationWrapper.js +0 -2
- data/webpack/__mocks__/foremanReact/components/common/EmptyState.js +0 -5
- data/webpack/__mocks__/foremanReact/components/common/MessageBox.js +0 -4
- data/webpack/__mocks__/foremanReact/components/common/dates/LongDateTime.js +0 -5
- data/webpack/__mocks__/foremanReact/components/common/dates/RelativeDateTime.js +0 -3
- data/webpack/__mocks__/foremanReact/components/common/table/actionsHelpers/actionTypeCreator.js +0 -7
- data/webpack/__mocks__/foremanReact/components/common/table.js +0 -5
- data/webpack/__mocks__/foremanReact/constants.js +0 -24
- data/webpack/__mocks__/foremanReact/readme.md +0 -11
- data/webpack/__mocks__/foremanReact/redux/actions/toasts.js +0 -8
- data/webpack/__mocks__/foremanReact/routes/common/PageLayout/PageLayout.js +0 -10
- data/webpack/__mocks__/foremanReact/routes/common/PageLayout/components/ExportButton/ExportButton.js +0 -5
- data/webpack/__mocks__/foremanReact/routes/common/reducerHOC/withDataReducer.js +0 -35
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_statistics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ondrej Ezr
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-02-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rdoc
|
@@ -24,62 +24,6 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rubocop
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: 0.87.0
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: 0.87.0
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: rubocop-minitest
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: 0.9.0
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: 0.9.0
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rubocop-performance
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: 1.5.2
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: 1.5.2
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: rubocop-rails
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - "~>"
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: 2.5.2
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - "~>"
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: 2.5.2
|
83
27
|
description: Statistics and Trends for Foreman gives users overview of their infrastructure.
|
84
28
|
email:
|
85
29
|
- oezr@redhat.com
|
@@ -98,13 +42,7 @@ files:
|
|
98
42
|
- app/controllers/foreman_statistics/trends_controller.rb
|
99
43
|
- app/helpers/foreman_statistics/trends_helper.rb
|
100
44
|
- app/jobs/foreman_statistics/trend_counter_job.rb
|
101
|
-
- app/models/concerns/foreman_statistics/
|
102
|
-
- app/models/concerns/foreman_statistics/environment_decorations.rb
|
103
|
-
- app/models/concerns/foreman_statistics/general_setting_decorations.rb
|
104
|
-
- app/models/concerns/foreman_statistics/hostgroup_decorations.rb
|
105
|
-
- app/models/concerns/foreman_statistics/model_decorations.rb
|
106
|
-
- app/models/concerns/foreman_statistics/operatingsystem_decorations.rb
|
107
|
-
- app/models/concerns/foreman_statistics/setting_decorations.rb
|
45
|
+
- app/models/concerns/foreman_statistics/has_many_trends.rb
|
108
46
|
- app/models/foreman_statistics/fact_trend.rb
|
109
47
|
- app/models/foreman_statistics/foreman_trend.rb
|
110
48
|
- app/models/foreman_statistics/trend.rb
|
@@ -132,8 +70,10 @@ files:
|
|
132
70
|
- app/views/foreman_statistics/trends/new.html.erb
|
133
71
|
- app/views/foreman_statistics/trends/show.html.erb
|
134
72
|
- app/views/foreman_statistics/trends/welcome.html.erb
|
73
|
+
- config/jest.config.js
|
135
74
|
- config/routes.rb
|
136
75
|
- db/migrate/20200605153005_migrate_core_types.rb
|
76
|
+
- db/migrate/20210523143005_migrate_environments.rb
|
137
77
|
- db/migrate_foreman/20121012170851_create_trends.rb
|
138
78
|
- db/migrate_foreman/20121012170936_create_trend_counters.rb
|
139
79
|
- db/migrate_foreman/20150202094307_add_range_to_trend_counters.rb
|
@@ -144,12 +84,80 @@ files:
|
|
144
84
|
- lib/tasks/foreman_statistics_tasks.rake
|
145
85
|
- locale/Makefile
|
146
86
|
- locale/action_names.rb
|
87
|
+
- locale/ca/LC_MESSAGES/foreman_statistics.mo
|
88
|
+
- locale/ca/foreman_statistics.edit.po
|
89
|
+
- locale/ca/foreman_statistics.po
|
90
|
+
- locale/ca/foreman_statistics.po.time_stamp
|
91
|
+
- locale/cs_CZ/LC_MESSAGES/foreman_statistics.mo
|
92
|
+
- locale/cs_CZ/foreman_statistics.edit.po
|
93
|
+
- locale/cs_CZ/foreman_statistics.po
|
94
|
+
- locale/cs_CZ/foreman_statistics.po.time_stamp
|
95
|
+
- locale/de/LC_MESSAGES/foreman_statistics.mo
|
96
|
+
- locale/de/foreman_statistics.edit.po
|
97
|
+
- locale/de/foreman_statistics.po
|
98
|
+
- locale/de/foreman_statistics.po.time_stamp
|
147
99
|
- locale/en/LC_MESSAGES/foreman_statistics.mo
|
148
100
|
- locale/en/foreman_statistics.edit.po
|
149
101
|
- locale/en/foreman_statistics.po
|
150
102
|
- locale/en/foreman_statistics.po.time_stamp
|
103
|
+
- locale/en_GB/LC_MESSAGES/foreman_statistics.mo
|
104
|
+
- locale/en_GB/foreman_statistics.edit.po
|
105
|
+
- locale/en_GB/foreman_statistics.po
|
106
|
+
- locale/en_GB/foreman_statistics.po.time_stamp
|
107
|
+
- locale/es/LC_MESSAGES/foreman_statistics.mo
|
108
|
+
- locale/es/foreman_statistics.edit.po
|
109
|
+
- locale/es/foreman_statistics.po
|
110
|
+
- locale/es/foreman_statistics.po.time_stamp
|
151
111
|
- locale/foreman_statistics.pot
|
112
|
+
- locale/fr/LC_MESSAGES/foreman_statistics.mo
|
113
|
+
- locale/fr/foreman_statistics.edit.po
|
114
|
+
- locale/fr/foreman_statistics.po
|
115
|
+
- locale/fr/foreman_statistics.po.time_stamp
|
152
116
|
- locale/gemspec.rb
|
117
|
+
- locale/gl/LC_MESSAGES/foreman_statistics.mo
|
118
|
+
- locale/gl/foreman_statistics.edit.po
|
119
|
+
- locale/gl/foreman_statistics.po
|
120
|
+
- locale/gl/foreman_statistics.po.time_stamp
|
121
|
+
- locale/it/LC_MESSAGES/foreman_statistics.mo
|
122
|
+
- locale/it/foreman_statistics.edit.po
|
123
|
+
- locale/it/foreman_statistics.po
|
124
|
+
- locale/it/foreman_statistics.po.time_stamp
|
125
|
+
- locale/ja/LC_MESSAGES/foreman_statistics.mo
|
126
|
+
- locale/ja/foreman_statistics.edit.po
|
127
|
+
- locale/ja/foreman_statistics.po
|
128
|
+
- locale/ja/foreman_statistics.po.time_stamp
|
129
|
+
- locale/ko/LC_MESSAGES/foreman_statistics.mo
|
130
|
+
- locale/ko/foreman_statistics.edit.po
|
131
|
+
- locale/ko/foreman_statistics.po
|
132
|
+
- locale/ko/foreman_statistics.po.time_stamp
|
133
|
+
- locale/nl_NL/LC_MESSAGES/foreman_statistics.mo
|
134
|
+
- locale/nl_NL/foreman_statistics.edit.po
|
135
|
+
- locale/nl_NL/foreman_statistics.po
|
136
|
+
- locale/nl_NL/foreman_statistics.po.time_stamp
|
137
|
+
- locale/pl/LC_MESSAGES/foreman_statistics.mo
|
138
|
+
- locale/pl/foreman_statistics.edit.po
|
139
|
+
- locale/pl/foreman_statistics.po
|
140
|
+
- locale/pl/foreman_statistics.po.time_stamp
|
141
|
+
- locale/pt_BR/LC_MESSAGES/foreman_statistics.mo
|
142
|
+
- locale/pt_BR/foreman_statistics.edit.po
|
143
|
+
- locale/pt_BR/foreman_statistics.po
|
144
|
+
- locale/pt_BR/foreman_statistics.po.time_stamp
|
145
|
+
- locale/ru/LC_MESSAGES/foreman_statistics.mo
|
146
|
+
- locale/ru/foreman_statistics.edit.po
|
147
|
+
- locale/ru/foreman_statistics.po
|
148
|
+
- locale/ru/foreman_statistics.po.time_stamp
|
149
|
+
- locale/sv_SE/LC_MESSAGES/foreman_statistics.mo
|
150
|
+
- locale/sv_SE/foreman_statistics.edit.po
|
151
|
+
- locale/sv_SE/foreman_statistics.po
|
152
|
+
- locale/sv_SE/foreman_statistics.po.time_stamp
|
153
|
+
- locale/zh_CN/LC_MESSAGES/foreman_statistics.mo
|
154
|
+
- locale/zh_CN/foreman_statistics.edit.po
|
155
|
+
- locale/zh_CN/foreman_statistics.po
|
156
|
+
- locale/zh_CN/foreman_statistics.po.time_stamp
|
157
|
+
- locale/zh_TW/LC_MESSAGES/foreman_statistics.mo
|
158
|
+
- locale/zh_TW/foreman_statistics.edit.po
|
159
|
+
- locale/zh_TW/foreman_statistics.po
|
160
|
+
- locale/zh_TW/foreman_statistics.po.time_stamp
|
153
161
|
- package.json
|
154
162
|
- test/factories/foreman_statistics_factories.rb
|
155
163
|
- test/fixtures/permissions.yml
|
@@ -165,29 +173,6 @@ files:
|
|
165
173
|
- test/unit/foreman_statistics/statistics_test.rb
|
166
174
|
- test/unit/foreman_statistics_test.rb
|
167
175
|
- test/unit/tasks/foreman_statistics_tasks_test.rb
|
168
|
-
- webpack/__mocks__/foremanReact/API.js
|
169
|
-
- webpack/__mocks__/foremanReact/common/HOC.js
|
170
|
-
- webpack/__mocks__/foremanReact/common/I18n.js
|
171
|
-
- webpack/__mocks__/foremanReact/common/helpers.js
|
172
|
-
- webpack/__mocks__/foremanReact/common/urlHelpers.js
|
173
|
-
- webpack/__mocks__/foremanReact/components/ChartBox/index.js
|
174
|
-
- webpack/__mocks__/foremanReact/components/ForemanModal/ForemanModalActions.js
|
175
|
-
- webpack/__mocks__/foremanReact/components/ForemanModal/ForemanModalHooks.js
|
176
|
-
- webpack/__mocks__/foremanReact/components/ForemanModal/index.js
|
177
|
-
- webpack/__mocks__/foremanReact/components/Layout/LayoutActions.js
|
178
|
-
- webpack/__mocks__/foremanReact/components/Pagination/PaginationWrapper.js
|
179
|
-
- webpack/__mocks__/foremanReact/components/common/EmptyState.js
|
180
|
-
- webpack/__mocks__/foremanReact/components/common/MessageBox.js
|
181
|
-
- webpack/__mocks__/foremanReact/components/common/dates/LongDateTime.js
|
182
|
-
- webpack/__mocks__/foremanReact/components/common/dates/RelativeDateTime.js
|
183
|
-
- webpack/__mocks__/foremanReact/components/common/table.js
|
184
|
-
- webpack/__mocks__/foremanReact/components/common/table/actionsHelpers/actionTypeCreator.js
|
185
|
-
- webpack/__mocks__/foremanReact/constants.js
|
186
|
-
- webpack/__mocks__/foremanReact/readme.md
|
187
|
-
- webpack/__mocks__/foremanReact/redux/actions/toasts.js
|
188
|
-
- webpack/__mocks__/foremanReact/routes/common/PageLayout/PageLayout.js
|
189
|
-
- webpack/__mocks__/foremanReact/routes/common/PageLayout/components/ExportButton/ExportButton.js
|
190
|
-
- webpack/__mocks__/foremanReact/routes/common/reducerHOC/withDataReducer.js
|
191
176
|
- webpack/fills_index.js
|
192
177
|
- webpack/index.js
|
193
178
|
- webpack/src/Components/StatisticsChartsList/StatisticsChartsList.fixtures.js
|
@@ -221,7 +206,7 @@ homepage: https://theforeman.org
|
|
221
206
|
licenses:
|
222
207
|
- GPL-3.0
|
223
208
|
metadata: {}
|
224
|
-
post_install_message:
|
209
|
+
post_install_message:
|
225
210
|
rdoc_options: []
|
226
211
|
require_paths:
|
227
212
|
- lib
|
@@ -236,8 +221,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
236
221
|
- !ruby/object:Gem::Version
|
237
222
|
version: '0'
|
238
223
|
requirements: []
|
239
|
-
rubygems_version: 3.
|
240
|
-
signing_key:
|
224
|
+
rubygems_version: 3.3.4
|
225
|
+
signing_key:
|
241
226
|
specification_version: 4
|
242
227
|
summary: Add Statistics and Trends.
|
243
228
|
test_files:
|
@@ -1,17 +0,0 @@
|
|
1
|
-
module ForemanStatistics
|
2
|
-
module GeneralSettingDecorations
|
3
|
-
def self.prepended(base)
|
4
|
-
class << base
|
5
|
-
prepend ClassMethodsPrepend
|
6
|
-
end
|
7
|
-
end
|
8
|
-
|
9
|
-
module ClassMethodsPrepend
|
10
|
-
def default_settings
|
11
|
-
super.concat([
|
12
|
-
set('max_trend', N_('Max days for Trends graphs'), 30, N_('Max trends'))
|
13
|
-
])
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
import React, { useEffect } from 'react';
|
2
|
-
|
3
|
-
export const callOnMount = callback => WrappedComponent => componentProps => {
|
4
|
-
// fires callback onMount, [] means don't listen to any props change
|
5
|
-
useEffect(() => {
|
6
|
-
callback(componentProps);
|
7
|
-
}, [componentProps]);
|
8
|
-
|
9
|
-
return <WrappedComponent {...componentProps} />;
|
10
|
-
};
|
11
|
-
|
12
|
-
export const withRenderHandler = ({
|
13
|
-
Component,
|
14
|
-
LoadingComponent = () => jest.fn(),
|
15
|
-
ErrorComponent = () => jest.fn(),
|
16
|
-
EmptyComponent = () => jest.fn(),
|
17
|
-
}) => componentProps => {
|
18
|
-
const { isLoading, hasData, hasError } = componentProps;
|
19
|
-
|
20
|
-
if (isLoading && !hasData) return <LoadingComponent {...componentProps} />;
|
21
|
-
if (hasError) return <ErrorComponent {...componentProps} />;
|
22
|
-
if (hasData) return <Component {...componentProps} />;
|
23
|
-
return <EmptyComponent {...componentProps} />;
|
24
|
-
};
|
@@ -1 +0,0 @@
|
|
1
|
-
export const noop = Function.prototype;
|
@@ -1 +0,0 @@
|
|
1
|
-
export const getURIsearch = () => 'a=b';
|
@@ -1,24 +0,0 @@
|
|
1
|
-
export const STATUS = {
|
2
|
-
PENDING: 'PENDING',
|
3
|
-
RESOLVED: 'RESOLVED',
|
4
|
-
ERROR: 'ERROR',
|
5
|
-
};
|
6
|
-
|
7
|
-
export const getControllerSearchProps = (
|
8
|
-
controller,
|
9
|
-
id = 'searchBar',
|
10
|
-
canCreateBookmarks = true
|
11
|
-
) => ({
|
12
|
-
controller,
|
13
|
-
autocomplete: {
|
14
|
-
id,
|
15
|
-
searchQuery: '',
|
16
|
-
url: `${controller}/auto_complete_search`,
|
17
|
-
useKeyShortcuts: true,
|
18
|
-
},
|
19
|
-
bookmarks: {
|
20
|
-
url: '/api/bookmarks',
|
21
|
-
canCreateBookmarks,
|
22
|
-
documentationUrl: `4.1.5Searching`,
|
23
|
-
},
|
24
|
-
});
|
@@ -1,11 +0,0 @@
|
|
1
|
-
For testing components which have imported foreman-core components,
|
2
|
-
a mock file is required in this folder.
|
3
|
-
|
4
|
-
### Example: Mocking ForemanModal component
|
5
|
-
```js
|
6
|
-
// __mocks__/foremanReact/components/ForemanModal/index.js
|
7
|
-
const ForemanModal = () => jest.fn();
|
8
|
-
ForemanModal.Header = () => jest.fn();
|
9
|
-
ForemanModal.Footer = () => jest.fn();
|
10
|
-
export default ForemanModal;
|
11
|
-
```
|
@@ -1,35 +0,0 @@
|
|
1
|
-
import Immutable from 'seamless-immutable';
|
2
|
-
|
3
|
-
const initialState = Immutable({
|
4
|
-
isLoading: true,
|
5
|
-
hasError: false,
|
6
|
-
hasData: false,
|
7
|
-
message: { type: 'empty', text: '' },
|
8
|
-
});
|
9
|
-
|
10
|
-
const withDataReducer = controller => (
|
11
|
-
state = initialState,
|
12
|
-
{ type, payload }
|
13
|
-
) => {
|
14
|
-
switch (type) {
|
15
|
-
case `${controller}_DATA_RESOLVED`:
|
16
|
-
return state.merge({ ...payload, isLoading: false });
|
17
|
-
|
18
|
-
case `${controller}_DATA_FAILED`:
|
19
|
-
return state.merge({ ...payload, isLoading: false, hasError: true });
|
20
|
-
|
21
|
-
case `${controller}_CLEAR_ERROR`:
|
22
|
-
return state.set('hasError', false);
|
23
|
-
|
24
|
-
case `${controller}_SHOW_LOADING`:
|
25
|
-
return state.set('isLoading', true);
|
26
|
-
|
27
|
-
case `${controller}_HIDE_LOADING`:
|
28
|
-
return state.set('isLoading', false);
|
29
|
-
|
30
|
-
default:
|
31
|
-
return state;
|
32
|
-
}
|
33
|
-
};
|
34
|
-
|
35
|
-
export default withDataReducer;
|