foreman_acd 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +619 -0
  3. data/README.md +87 -0
  4. data/Rakefile +49 -0
  5. data/app/assets/javascripts/foreman_acd/acd_dummy.js +3 -0
  6. data/app/controllers/foreman_acd/api/v2/app_definitions_controller.rb +55 -0
  7. data/app/controllers/foreman_acd/api/v2/base_controller.rb +16 -0
  8. data/app/controllers/foreman_acd/app_definitions_controller.rb +53 -0
  9. data/app/controllers/foreman_acd/app_instances_controller.rb +158 -0
  10. data/app/controllers/foreman_acd/application_controller.rb +10 -0
  11. data/app/controllers/foreman_acd/concerns/app_definition_parameters.rb +23 -0
  12. data/app/controllers/foreman_acd/concerns/app_instance_parameters.rb +23 -0
  13. data/app/controllers/ui_acd_controller.rb +30 -0
  14. data/app/models/foreman_acd/app_definition.rb +23 -0
  15. data/app/models/foreman_acd/app_instance.rb +21 -0
  16. data/app/views/foreman_acd/app_definitions/_form.html.erb +40 -0
  17. data/app/views/foreman_acd/app_definitions/edit.html.erb +11 -0
  18. data/app/views/foreman_acd/app_definitions/index.html.erb +27 -0
  19. data/app/views/foreman_acd/app_definitions/new.html.erb +10 -0
  20. data/app/views/foreman_acd/app_instances/_form.html.erb +46 -0
  21. data/app/views/foreman_acd/app_instances/edit.html.erb +11 -0
  22. data/app/views/foreman_acd/app_instances/index.html.erb +30 -0
  23. data/app/views/foreman_acd/app_instances/new.html.erb +11 -0
  24. data/app/views/ui_acd/app.json.rabl +9 -0
  25. data/app/views/ui_acd/app_definition.json.rabl +5 -0
  26. data/app/views/ui_acd/computeprofile.json.rabl +4 -0
  27. data/app/views/ui_acd/domain.json.rabl +4 -0
  28. data/app/views/ui_acd/environment.json.rabl +4 -0
  29. data/app/views/ui_acd/fdata.json.rabl +24 -0
  30. data/app/views/ui_acd/lifecycle_environment.json.rabl +4 -0
  31. data/app/views/ui_acd/ptable.json.rabl +4 -0
  32. data/config/routes.rb +24 -0
  33. data/db/migrate/20190610202252_create_app_definitions.rb +19 -0
  34. data/db/migrate/20190625140305_create_app_instances.rb +19 -0
  35. data/lib/foreman_acd/engine.rb +43 -0
  36. data/lib/foreman_acd/plugin.rb +80 -0
  37. data/lib/foreman_acd/version.rb +5 -0
  38. data/lib/foreman_acd.rb +7 -0
  39. data/lib/tasks/foreman_acd_tasks.rake +47 -0
  40. data/locale/Makefile +60 -0
  41. data/locale/en/foreman_acd.po +19 -0
  42. data/locale/foreman_acd.pot +19 -0
  43. data/locale/gemspec.rb +2 -0
  44. data/package.json +121 -0
  45. data/test/controllers/app_definitions_controller_test.rb +24 -0
  46. data/test/controllers/app_instances_controller_test.rb +24 -0
  47. data/test/controllers/ui_acd_controller_test.rb +26 -0
  48. data/test/factories/foreman_acd_factories.rb +17 -0
  49. data/test/models/app_definition_test.rb +11 -0
  50. data/test/models/app_instance_test.rb +8 -0
  51. data/test/test_plugin_helper.rb +8 -0
  52. data/webpack/__mocks__/foremanReact/components/common/forms/Select.js +2 -0
  53. data/webpack/components/ParameterSelection/ParameterSelection.js +468 -0
  54. data/webpack/components/ParameterSelection/ParameterSelection.scss +3 -0
  55. data/webpack/components/ParameterSelection/ParameterSelectionActions.js +294 -0
  56. data/webpack/components/ParameterSelection/ParameterSelectionConstants.js +31 -0
  57. data/webpack/components/ParameterSelection/ParameterSelectionHelper.js +52 -0
  58. data/webpack/components/ParameterSelection/ParameterSelectionReducer.js +175 -0
  59. data/webpack/components/ParameterSelection/ParameterSelectionSelectors.js +15 -0
  60. data/webpack/components/ParameterSelection/__fixtures__/parameterSelection.fixtures.js +162 -0
  61. data/webpack/components/ParameterSelection/__fixtures__/parameterSelectionData_1.fixtures.js +194 -0
  62. data/webpack/components/ParameterSelection/__fixtures__/parameterSelectionReducer.fixtures.js +127 -0
  63. data/webpack/components/ParameterSelection/__tests__/ParameterSelection.test.js +48 -0
  64. data/webpack/components/ParameterSelection/__tests__/ParameterSelectionReducer.test.js +150 -0
  65. data/webpack/components/ParameterSelection/__tests__/ParameterSelectionSelectors.test.js +47 -0
  66. data/webpack/components/ParameterSelection/__tests__/__snapshots__/ParameterSelection.test.js.snap +454 -0
  67. data/webpack/components/ParameterSelection/__tests__/__snapshots__/ParameterSelectionReducer.test.js.snap +2265 -0
  68. data/webpack/components/ParameterSelection/__tests__/__snapshots__/ParameterSelectionSelectors.test.js.snap +209 -0
  69. data/webpack/components/ParameterSelection/index.js +39 -0
  70. data/webpack/index.js +8 -0
  71. data/webpack/reducer.js +7 -0
  72. data/webpack/test_setup.js +11 -0
  73. metadata +206 -0
@@ -0,0 +1,209 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`ParameterSelectionSelectors should return appDefinition from parameterSelectionData_1 fixtures 1`] = `
4
+ Object {
5
+ "hostgroup_id": 1,
6
+ "id": 1,
7
+ "name": "Test123",
8
+ }
9
+ `;
10
+
11
+ exports[`ParameterSelectionSelectors should return columns from parameterSelectionData_1 fixtures 1`] = `
12
+ Array [
13
+ Object {
14
+ "header": Object {
15
+ "label": "Name",
16
+ "props": Object {
17
+ "index": 0,
18
+ "sort": true,
19
+ "style": Object {
20
+ "width": "20%",
21
+ },
22
+ },
23
+ },
24
+ "property": "name",
25
+ },
26
+ Object {
27
+ "cell": Object {
28
+ "props": Object {
29
+ "index": 1,
30
+ },
31
+ },
32
+ "header": Object {
33
+ "label": "Description",
34
+ "props": Object {
35
+ "index": 1,
36
+ "sort": true,
37
+ "style": Object {
38
+ "width": "25%",
39
+ },
40
+ },
41
+ },
42
+ "property": "description",
43
+ },
44
+ Object {
45
+ "cell": Object {
46
+ "props": Object {
47
+ "index": 2,
48
+ },
49
+ },
50
+ "header": Object {
51
+ "label": "Type",
52
+ "props": Object {
53
+ "index": 2,
54
+ "sort": true,
55
+ "style": Object {
56
+ "width": "20%",
57
+ },
58
+ },
59
+ },
60
+ "property": "type",
61
+ },
62
+ Object {
63
+ "cell": Object {
64
+ "props": Object {
65
+ "index": 3,
66
+ },
67
+ },
68
+ "header": Object {
69
+ "label": "Default value",
70
+ "props": Object {
71
+ "index": 3,
72
+ "sort": true,
73
+ "style": Object {
74
+ "width": "25%",
75
+ },
76
+ },
77
+ },
78
+ "property": "value",
79
+ },
80
+ Object {
81
+ "cell": Object {
82
+ "props": Object {
83
+ "index": 4,
84
+ },
85
+ },
86
+ "header": Object {
87
+ "label": "Actions",
88
+ "props": Object {
89
+ "index": 4,
90
+ },
91
+ },
92
+ "property": "actions",
93
+ },
94
+ ]
95
+ `;
96
+
97
+ exports[`ParameterSelectionSelectors should return editMode from parameterSelectionData_1 fixtures 1`] = `false`;
98
+
99
+ exports[`ParameterSelectionSelectors should return foremanData from parameterSelectionData_1 fixtures 1`] = `
100
+ Object {
101
+ "computeprofiles": Array [],
102
+ "domains": Array [],
103
+ "environments": Array [
104
+ Object {
105
+ "id": 1,
106
+ "name": "production",
107
+ },
108
+ Object {
109
+ "id": 2,
110
+ "name": "test",
111
+ },
112
+ ],
113
+ "hostgroup_id": 1,
114
+ "lifecycle_environments": Array [],
115
+ "ptables": Array [
116
+ Object {
117
+ "id": 105,
118
+ "name": "Kickstart default",
119
+ },
120
+ Object {
121
+ "id": 104,
122
+ "name": "Kickstart default thin",
123
+ },
124
+ ],
125
+ }
126
+ `;
127
+
128
+ exports[`ParameterSelectionSelectors should return hostgroupId from parameterSelectionData_1 fixtures 1`] = `1`;
129
+
130
+ exports[`ParameterSelectionSelectors should return loading from parameterSelectionData_1 fixtures 1`] = `false`;
131
+
132
+ exports[`ParameterSelectionSelectors should return parameterTypes from parameterSelectionData_1 fixtures 1`] = `
133
+ Object {
134
+ "computeprofile": "Compute profile",
135
+ "domain": "Domain",
136
+ "hostparam": "Host parameter",
137
+ "lifecycleenv": "Lifecycle environment",
138
+ }
139
+ `;
140
+
141
+ exports[`ParameterSelectionSelectors should return rows from parameterSelectionData_1 fixtures 1`] = `
142
+ Array [
143
+ Object {
144
+ "description": "",
145
+ "id": 1,
146
+ "name": "PuppetEnv",
147
+ "type": "puppetenv",
148
+ "value": "2",
149
+ },
150
+ Object {
151
+ "description": "",
152
+ "id": 2,
153
+ "name": "PW",
154
+ "type": "password",
155
+ "value": "rooot",
156
+ },
157
+ Object {
158
+ "description": "",
159
+ "id": 3,
160
+ "name": "Blub",
161
+ "type": "hostparam",
162
+ "value": "awesome",
163
+ },
164
+ Object {
165
+ "description": "",
166
+ "id": 4,
167
+ "name": "111allo",
168
+ "type": "ip",
169
+ "value": "1.1.1.1",
170
+ },
171
+ Object {
172
+ "description": "",
173
+ "id": 5,
174
+ "name": "1111aasdfasf",
175
+ "type": "hostname",
176
+ "value": "dername",
177
+ },
178
+ Object {
179
+ "description": "",
180
+ "id": 6,
181
+ "name": "222nocheiner",
182
+ "type": "hostparam",
183
+ "value": "",
184
+ },
185
+ Object {
186
+ "description": "aa",
187
+ "id": 7,
188
+ "name": "aaaaa",
189
+ "type": "ptable",
190
+ "value": "",
191
+ },
192
+ Object {
193
+ "description": "",
194
+ "id": 8,
195
+ "name": "aaa",
196
+ "type": "hostparam",
197
+ "value": "2134234",
198
+ },
199
+ ]
200
+ `;
201
+
202
+ exports[`ParameterSelectionSelectors should return sortingColumns from parameterSelectionData_1 fixtures 1`] = `
203
+ Object {
204
+ "name": Object {
205
+ "direction": "asc",
206
+ "position": 0,
207
+ },
208
+ }
209
+ `;
@@ -0,0 +1,39 @@
1
+ import { bindActionCreators } from 'redux';
2
+ import { connect } from 'react-redux';
3
+
4
+ import './ParameterSelection.scss';
5
+ import ParameterSelection from './ParameterSelection';
6
+ import * as ParameterSelectionActions from './ParameterSelectionActions';
7
+
8
+ import {
9
+ selectLoading,
10
+ selectEditMode,
11
+ selectForemanData,
12
+ selectParameterTypes,
13
+ selectRows,
14
+ selectSortingColumns,
15
+ selectColumns,
16
+ selectAppDefinition,
17
+ selectHostgroupId,
18
+ } from './ParameterSelectionSelectors';
19
+
20
+ const mapStateToProps = state => ({
21
+ loading: selectLoading(state),
22
+ editMode: selectEditMode(state),
23
+ foremanData: selectForemanData(state),
24
+ parameterTypes: selectParameterTypes(state),
25
+ rows: selectRows(state),
26
+ sortingColumns: selectSortingColumns(state),
27
+ columns: selectColumns(state),
28
+ appDefinition: selectAppDefinition(state),
29
+ hostgroupId: selectHostgroupId(state),
30
+ });
31
+
32
+ const mapDispatchToProps = dispatch =>
33
+ bindActionCreators(ParameterSelectionActions, dispatch);
34
+
35
+ export default connect(
36
+ mapStateToProps,
37
+ mapDispatchToProps
38
+ )(ParameterSelection);
39
+
data/webpack/index.js ADDED
@@ -0,0 +1,8 @@
1
+ import componentRegistry from 'foremanReact/components/componentRegistry';
2
+ import injectReducer from 'foremanReact/redux/reducers/registerReducer';
3
+ import ParameterSelection from './components/ParameterSelection';
4
+ import reducer from './reducer';
5
+
6
+ injectReducer('foremanAcd', reducer);
7
+
8
+ componentRegistry.register({ name: 'ParameterSelection', type: ParameterSelection, });
@@ -0,0 +1,7 @@
1
+ import { combineReducers } from 'redux';
2
+
3
+ import parameterSelectionParameters from './components/ParameterSelection/ParameterSelectionReducer';
4
+
5
+ export default combineReducers({
6
+ parameterSelectionParameters,
7
+ });
@@ -0,0 +1,11 @@
1
+ import 'babel-polyfill';
2
+
3
+ import { configure } from 'enzyme';
4
+ import Adapter from 'enzyme-adapter-react-16';
5
+
6
+ configure({ adapter: new Adapter() });
7
+
8
+ // Mocking translation function
9
+ global.__ = str => str;
10
+ global.n__ = str => str;
11
+ global.Jed = { sprintf: str => str };
metadata ADDED
@@ -0,0 +1,206 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: foreman_acd
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - ATIX AG
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-11-22 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rubocop
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 0.71.0
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.71.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: rubocop-checkstyle_formatter
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '0.2'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '0.2'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rubocop-performance
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 1.4.0
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 1.4.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: rubocop-rails
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 2.0.1
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 2.0.1
69
+ - !ruby/object:Gem::Dependency
70
+ name: foreman-tasks
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '0.10'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '0.10'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rails
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '5.1'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '5.1'
97
+ description: Application Centric Deployment.
98
+ email:
99
+ - info@atix.de
100
+ executables: []
101
+ extensions: []
102
+ extra_rdoc_files: []
103
+ files:
104
+ - LICENSE
105
+ - README.md
106
+ - Rakefile
107
+ - app/assets/javascripts/foreman_acd/acd_dummy.js
108
+ - app/controllers/foreman_acd/api/v2/app_definitions_controller.rb
109
+ - app/controllers/foreman_acd/api/v2/base_controller.rb
110
+ - app/controllers/foreman_acd/app_definitions_controller.rb
111
+ - app/controllers/foreman_acd/app_instances_controller.rb
112
+ - app/controllers/foreman_acd/application_controller.rb
113
+ - app/controllers/foreman_acd/concerns/app_definition_parameters.rb
114
+ - app/controllers/foreman_acd/concerns/app_instance_parameters.rb
115
+ - app/controllers/ui_acd_controller.rb
116
+ - app/models/foreman_acd/app_definition.rb
117
+ - app/models/foreman_acd/app_instance.rb
118
+ - app/views/foreman_acd/app_definitions/_form.html.erb
119
+ - app/views/foreman_acd/app_definitions/edit.html.erb
120
+ - app/views/foreman_acd/app_definitions/index.html.erb
121
+ - app/views/foreman_acd/app_definitions/new.html.erb
122
+ - app/views/foreman_acd/app_instances/_form.html.erb
123
+ - app/views/foreman_acd/app_instances/edit.html.erb
124
+ - app/views/foreman_acd/app_instances/index.html.erb
125
+ - app/views/foreman_acd/app_instances/new.html.erb
126
+ - app/views/ui_acd/app.json.rabl
127
+ - app/views/ui_acd/app_definition.json.rabl
128
+ - app/views/ui_acd/computeprofile.json.rabl
129
+ - app/views/ui_acd/domain.json.rabl
130
+ - app/views/ui_acd/environment.json.rabl
131
+ - app/views/ui_acd/fdata.json.rabl
132
+ - app/views/ui_acd/lifecycle_environment.json.rabl
133
+ - app/views/ui_acd/ptable.json.rabl
134
+ - config/routes.rb
135
+ - db/migrate/20190610202252_create_app_definitions.rb
136
+ - db/migrate/20190625140305_create_app_instances.rb
137
+ - lib/foreman_acd.rb
138
+ - lib/foreman_acd/engine.rb
139
+ - lib/foreman_acd/plugin.rb
140
+ - lib/foreman_acd/version.rb
141
+ - lib/tasks/foreman_acd_tasks.rake
142
+ - locale/Makefile
143
+ - locale/en/foreman_acd.po
144
+ - locale/foreman_acd.pot
145
+ - locale/gemspec.rb
146
+ - package.json
147
+ - test/controllers/app_definitions_controller_test.rb
148
+ - test/controllers/app_instances_controller_test.rb
149
+ - test/controllers/ui_acd_controller_test.rb
150
+ - test/factories/foreman_acd_factories.rb
151
+ - test/models/app_definition_test.rb
152
+ - test/models/app_instance_test.rb
153
+ - test/test_plugin_helper.rb
154
+ - webpack/__mocks__/foremanReact/components/common/forms/Select.js
155
+ - webpack/components/ParameterSelection/ParameterSelection.js
156
+ - webpack/components/ParameterSelection/ParameterSelection.scss
157
+ - webpack/components/ParameterSelection/ParameterSelectionActions.js
158
+ - webpack/components/ParameterSelection/ParameterSelectionConstants.js
159
+ - webpack/components/ParameterSelection/ParameterSelectionHelper.js
160
+ - webpack/components/ParameterSelection/ParameterSelectionReducer.js
161
+ - webpack/components/ParameterSelection/ParameterSelectionSelectors.js
162
+ - webpack/components/ParameterSelection/__fixtures__/parameterSelection.fixtures.js
163
+ - webpack/components/ParameterSelection/__fixtures__/parameterSelectionData_1.fixtures.js
164
+ - webpack/components/ParameterSelection/__fixtures__/parameterSelectionReducer.fixtures.js
165
+ - webpack/components/ParameterSelection/__tests__/ParameterSelection.test.js
166
+ - webpack/components/ParameterSelection/__tests__/ParameterSelectionReducer.test.js
167
+ - webpack/components/ParameterSelection/__tests__/ParameterSelectionSelectors.test.js
168
+ - webpack/components/ParameterSelection/__tests__/__snapshots__/ParameterSelection.test.js.snap
169
+ - webpack/components/ParameterSelection/__tests__/__snapshots__/ParameterSelectionReducer.test.js.snap
170
+ - webpack/components/ParameterSelection/__tests__/__snapshots__/ParameterSelectionSelectors.test.js.snap
171
+ - webpack/components/ParameterSelection/index.js
172
+ - webpack/index.js
173
+ - webpack/reducer.js
174
+ - webpack/test_setup.js
175
+ homepage: https://www.orcharhino.com
176
+ licenses:
177
+ - GPL-3.0
178
+ metadata: {}
179
+ post_install_message:
180
+ rdoc_options: []
181
+ require_paths:
182
+ - lib
183
+ required_ruby_version: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - ">="
186
+ - !ruby/object:Gem::Version
187
+ version: '0'
188
+ required_rubygems_version: !ruby/object:Gem::Requirement
189
+ requirements:
190
+ - - ">="
191
+ - !ruby/object:Gem::Version
192
+ version: '0'
193
+ requirements: []
194
+ rubyforge_project:
195
+ rubygems_version: 2.7.6
196
+ signing_key:
197
+ specification_version: 4
198
+ summary: Application Centric Deployment for Foreman
199
+ test_files:
200
+ - test/factories/foreman_acd_factories.rb
201
+ - test/test_plugin_helper.rb
202
+ - test/models/app_instance_test.rb
203
+ - test/models/app_definition_test.rb
204
+ - test/controllers/ui_acd_controller_test.rb
205
+ - test/controllers/app_definitions_controller_test.rb
206
+ - test/controllers/app_instances_controller_test.rb