foreman_acd 0.0.3 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/foreman_acd/ansible_playbooks_controller.rb +122 -0
  3. data/app/controllers/foreman_acd/api/v2/ansible_playbooks_controller.rb +54 -0
  4. data/app/controllers/foreman_acd/api/v2/app_definitions_controller.rb +1 -2
  5. data/app/controllers/foreman_acd/api/v2/app_instances_controller.rb +54 -0
  6. data/app/controllers/foreman_acd/api/v2/app_playbooks_controller.rb +0 -0
  7. data/app/controllers/foreman_acd/app_definitions_controller.rb +35 -4
  8. data/app/controllers/foreman_acd/app_instances_controller.rb +43 -87
  9. data/app/controllers/foreman_acd/concerns/ansible_playbook_parameters.rb +23 -0
  10. data/app/controllers/foreman_acd/concerns/app_definition_parameters.rb +1 -1
  11. data/app/controllers/foreman_acd/concerns/app_instance_parameters.rb +1 -1
  12. data/app/controllers/ui_acd_controller.rb +11 -4
  13. data/app/models/foreman_acd/ansible_playbook.rb +50 -0
  14. data/app/models/foreman_acd/app_definition.rb +2 -1
  15. data/app/models/foreman_acd/app_instance.rb +7 -0
  16. data/app/services/foreman_acd/app_configurator.rb +70 -0
  17. data/app/services/foreman_acd/app_deployer.rb +143 -0
  18. data/app/services/foreman_acd/inventory_creator.rb +67 -0
  19. data/app/views/foreman_acd/ansible_playbooks/_form.html.erb +21 -0
  20. data/app/views/foreman_acd/ansible_playbooks/edit.html.erb +3 -0
  21. data/app/views/foreman_acd/ansible_playbooks/index.html.erb +30 -0
  22. data/app/views/foreman_acd/ansible_playbooks/new.html.erb +3 -0
  23. data/app/views/foreman_acd/api/v2/ansible_playbooks/base.json.rabl +3 -0
  24. data/app/views/foreman_acd/api/v2/ansible_playbooks/index.json.rabl +3 -0
  25. data/app/views/foreman_acd/api/v2/ansible_playbooks/show.json.rabl +3 -0
  26. data/app/views/foreman_acd/api/v2/app_definitions/base.json.rabl +3 -0
  27. data/app/views/foreman_acd/api/v2/app_definitions/index.json.rabl +3 -0
  28. data/app/views/foreman_acd/api/v2/app_definitions/show.json.rabl +3 -0
  29. data/app/views/foreman_acd/api/v2/app_instances/base.json.rabl +3 -0
  30. data/app/views/foreman_acd/api/v2/app_instances/index.json.rabl +3 -0
  31. data/app/views/foreman_acd/api/v2/app_instances/show.json.rabl +3 -0
  32. data/app/views/foreman_acd/app_definitions/_form.html.erb +25 -19
  33. data/app/views/foreman_acd/app_definitions/edit.html.erb +5 -0
  34. data/app/views/foreman_acd/app_definitions/import.html.erb +18 -0
  35. data/app/views/foreman_acd/app_definitions/index.html.erb +9 -5
  36. data/app/views/foreman_acd/app_instances/_form.html.erb +10 -8
  37. data/app/views/foreman_acd/app_instances/deploy.html.erb +19 -0
  38. data/app/views/foreman_acd/app_instances/index.html.erb +10 -5
  39. data/app/views/foreman_acd/app_instances/report.html.erb +19 -0
  40. data/app/views/templates/job/run_acd_ansible_playbook.erb +49 -0
  41. data/app/views/ui_acd/ansible_data.json.rabl +6 -0
  42. data/app/views/ui_acd/app.json.rabl +6 -2
  43. data/app/views/ui_acd/app_definition.json.rabl +1 -1
  44. data/app/views/ui_acd/{fdata.json.rabl → foreman_data.json.rabl} +1 -1
  45. data/config/routes.rb +31 -1
  46. data/db/migrate/20190610202252_create_app_definitions.rb +1 -3
  47. data/db/migrate/20190625140305_create_app_instances.rb +1 -1
  48. data/db/migrate/20200916091018_create_ansible_playbooks.rb +20 -0
  49. data/db/migrate/20200917120220_add_ansible_playbook_id.rb +14 -0
  50. data/db/migrate/20201016002819_add_ansible_vars_all_to_app_definitions.rb +5 -0
  51. data/db/migrate/20201016104338_add_ansible_vars_all_to_app_instances.rb +5 -0
  52. data/db/seeds.d/75-job_templates.rb +8 -0
  53. data/lib/foreman_acd/engine.rb +3 -0
  54. data/lib/foreman_acd/plugin.rb +72 -4
  55. data/lib/foreman_acd/version.rb +1 -1
  56. data/package.json +2 -1
  57. data/webpack/components/ApplicationDefinition/ApplicationDefinition.js +376 -0
  58. data/webpack/components/ApplicationDefinition/ApplicationDefinition.scss +1 -0
  59. data/webpack/components/ApplicationDefinition/ApplicationDefinitionActions.js +295 -0
  60. data/webpack/components/ApplicationDefinition/ApplicationDefinitionConstants.js +14 -0
  61. data/webpack/components/ApplicationDefinition/ApplicationDefinitionHelper.js +26 -0
  62. data/webpack/components/ApplicationDefinition/ApplicationDefinitionReducer.js +243 -0
  63. data/webpack/components/ApplicationDefinition/ApplicationDefinitionSelectors.js +8 -0
  64. data/webpack/components/ApplicationDefinition/components/AnsiblePlaybookSelector.js +49 -0
  65. data/webpack/components/ApplicationDefinition/index.js +33 -0
  66. data/webpack/components/ApplicationInstance/ApplicationInstance.js +412 -0
  67. data/webpack/components/ApplicationInstance/ApplicationInstance.scss +11 -0
  68. data/webpack/components/ApplicationInstance/ApplicationInstanceActions.js +239 -0
  69. data/webpack/components/ApplicationInstance/ApplicationInstanceConstants.js +14 -0
  70. data/webpack/components/ApplicationInstance/ApplicationInstanceReducer.js +295 -0
  71. data/webpack/components/ApplicationInstance/ApplicationInstanceSelectors.js +9 -0
  72. data/webpack/components/ApplicationInstance/components/AppDefinitionSelector.js +49 -0
  73. data/webpack/components/ApplicationInstance/components/Service.js +30 -0
  74. data/webpack/components/ApplicationInstance/components/ServiceCounter.js +37 -0
  75. data/webpack/components/ApplicationInstance/index.js +35 -0
  76. data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReport.js +155 -0
  77. data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReport.scss +27 -0
  78. data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportActions.js +86 -0
  79. data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportConstants.js +4 -0
  80. data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportReducer.js +52 -0
  81. data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportSelectors.js +5 -0
  82. data/webpack/components/ApplicationInstanceReport/components/ReportViewer.js +26 -0
  83. data/webpack/components/ApplicationInstanceReport/index.js +27 -0
  84. data/webpack/components/ParameterSelection/ParameterSelection.js +96 -183
  85. data/webpack/components/ParameterSelection/ParameterSelection.scss +10 -3
  86. data/webpack/components/ParameterSelection/ParameterSelectionActions.js +72 -104
  87. data/webpack/components/ParameterSelection/ParameterSelectionConstants.js +14 -19
  88. data/webpack/components/ParameterSelection/ParameterSelectionHelper.js +3 -35
  89. data/webpack/components/ParameterSelection/ParameterSelectionReducer.js +100 -83
  90. data/webpack/components/ParameterSelection/ParameterSelectionSelectors.js +3 -7
  91. data/webpack/components/ParameterSelection/__fixtures__/parameterSelection.fixtures.js +12 -21
  92. data/webpack/components/ParameterSelection/__fixtures__/parameterSelectionData_1.fixtures.js +1 -1
  93. data/webpack/components/ParameterSelection/__fixtures__/parameterSelectionReducer.fixtures.js +3 -45
  94. data/webpack/components/ParameterSelection/__tests__/ParameterSelection.test.js +20 -0
  95. data/webpack/components/ParameterSelection/__tests__/ParameterSelectionReducer.test.js +22 -46
  96. data/webpack/components/ParameterSelection/__tests__/ParameterSelectionSelectors.test.js +6 -6
  97. data/webpack/components/ParameterSelection/__tests__/__snapshots__/ParameterSelection.test.js.snap +40 -265
  98. data/webpack/components/ParameterSelection/__tests__/__snapshots__/ParameterSelectionReducer.test.js.snap +11 -96
  99. data/webpack/components/ParameterSelection/__tests__/__snapshots__/ParameterSelectionSelectors.test.js.snap +3 -9
  100. data/webpack/components/ParameterSelection/index.js +6 -8
  101. data/webpack/components/common/AddTableEntry.js +30 -0
  102. data/webpack/components/common/DeleteTableEntry.js +39 -0
  103. data/webpack/components/common/ExtSelect.js +43 -0
  104. data/webpack/components/common/RailsData.js +27 -0
  105. data/webpack/components/common/__tests__/AddTableEntry.test.js +26 -0
  106. data/webpack/components/common/__tests__/DeleteTableEntry.test.js +29 -0
  107. data/webpack/components/common/__tests__/ExtSelect.test.js +38 -0
  108. data/webpack/components/common/__tests__/RailsData.test.js +16 -0
  109. data/webpack/components/common/__tests__/__snapshots__/AddParameter.test.js.snap +35 -0
  110. data/webpack/components/common/__tests__/__snapshots__/AddTableEntry.test.js.snap +35 -0
  111. data/webpack/components/common/__tests__/__snapshots__/DeleteParameter.test.js.snap +41 -0
  112. data/webpack/components/common/__tests__/__snapshots__/DeleteTableEntry.test.js.snap +41 -0
  113. data/webpack/components/common/__tests__/__snapshots__/ExtSelect.test.js.snap +18 -0
  114. data/webpack/components/common/__tests__/__snapshots__/RailsData.test.js.snap +10 -0
  115. data/webpack/helper.js +20 -0
  116. data/webpack/index.js +6 -0
  117. data/webpack/reducer.js +43 -3
  118. metadata +85 -39
@@ -1,15 +1,11 @@
1
- import { differenceBy, slice, includes, uniq } from 'lodash';
2
- import Immutable from 'seamless-immutable';
3
- import { createSelector } from 'reselect';
4
-
5
1
  const parameterState = state => state.foremanAcd.parameterSelectionParameters;
6
2
 
7
3
  export const selectLoading = state => parameterState(state).loading;
8
4
  export const selectEditMode = state => parameterState(state).editMode;
9
- export const selectForemanData = state => parameterState(state).foremanData;
5
+ export const selectParamData = state => parameterState(state).paramData;
10
6
  export const selectParameterTypes = state => parameterState(state).parameterTypes;
11
- export const selectRows = state => parameterState(state).rows;
7
+ export const selectParameters = state => parameterState(state).parameters;
12
8
  export const selectSortingColumns = state => parameterState(state).sortingColumns;
13
9
  export const selectColumns = state => parameterState(state).columns;
14
- export const selectAppDefinition = state => parameterState(state).appDefinition;
10
+ export const selectParamDefinition = state => parameterState(state).paramDefinition;
15
11
  export const selectHostgroupId = state => parameterState(state).hostgroupId;
@@ -1,21 +1,14 @@
1
1
  export const newDefinition = {
2
- organization: "Default Organization",
3
- location: "Default Location",
4
- hostgroups: {
5
- "1": "centos7"
2
+ mode: "newDefinition",
3
+ serviceDefinition: {
4
+ id: 1,
5
+ name: "Test123",
6
+ hostgroup_id: 1
6
7
  },
7
- loadForemanDataUrl: "/acd/ui_acd_fdata/__id__",
8
- mode: "newDefinition"
9
8
  };
10
9
  export const editDefinition = {
11
- organization: "Default Organization",
12
- location: "Default Location",
13
- hostgroups: {
14
- "1": "centos7"
15
- },
16
- loadForemanDataUrl: "/acd/ui_acd_fdata/__id__",
17
10
  mode: "editDefinition",
18
- appDefinition: {
11
+ serviceDefinition: {
19
12
  id: 1,
20
13
  name: "Test123",
21
14
  hostgroup_id: 1
@@ -82,21 +75,19 @@ export const editDefinition = {
82
75
 
83
76
  export const newInstance = {
84
77
  mode: "newInstance",
85
- organization: "Default Organization",
86
- location: "Default Location",
87
78
  applications: {
88
79
  "1": "Test123",
89
80
  "2": "sowasvonneu"
90
81
  },
91
- loadParameterSelectionUrl: "/acd/ui_acd_app/__id__",
92
- loadForemanDataUrl: "/acd/ui_acd_fdata/__id__"
82
+ serviceDefinition: {
83
+ id: 1,
84
+ name: "Test123",
85
+ hostgroup_id: 1
86
+ },
93
87
  };
94
88
  export const editInstance = {
95
89
  mode: "editInstance",
96
- organization: "Default Organization",
97
- location: "Default Location",
98
- loadForemanDataUrl: "/acd/ui_acd_fdata/__id__",
99
- appDefinition: {
90
+ serviceDefinition: {
100
91
  id: 1,
101
92
  name: "Test123",
102
93
  hostgroup_id: 1
@@ -127,7 +127,7 @@ export const parameterSelectionData_1 = {
127
127
  }
128
128
  }
129
129
  ],
130
- rows: [
130
+ parameters: [
131
131
  {
132
132
  id: 1,
133
133
  name: 'PuppetEnv',
@@ -13,9 +13,9 @@ export const successState = Immutable(parameterSelectionData_1);
13
13
 
14
14
  const EDIT_ROW_ID = 5;
15
15
 
16
- var editClone = parameterSelectionData_1;
17
- var editIndex = findIndex(editClone.rows, { id: EDIT_ROW_ID })
18
- editClone["rows"][editIndex].backup = cloneDeep(editClone["rows"][editIndex]);
16
+ const editClone = parameterSelectionData_1;
17
+ const editIndex = findIndex(editClone.parameters, { id: EDIT_ROW_ID })
18
+ editClone["parameters"][editIndex].backup = cloneDeep(editClone["parameters"][editIndex]);
19
19
  export const editState = Immutable(editClone);
20
20
 
21
21
  export const initParameterSelectionPayload = parameterSelectionData_1;
@@ -83,45 +83,3 @@ export const loadForemanDataSuccessPayload = {
83
83
  export const loadForemanDataFailurePayload = {
84
84
  error: "Something really bad happend",
85
85
  };
86
-
87
- export const loadParameterSelectionRequestPayload = { };
88
- export const loadParameterSelectionSuccessPayload = {
89
- app_definition: {
90
- id: 2,
91
- name: "sowasvonneu",
92
- description: "",
93
- hostgroup_id: 1,
94
- parameters: "[{\"id\":0,\"name\":\"richtigneu\",\"description\":\"\",\"type\":\"puppetenv\",\"value\":\"1\"},{\"id\":1,\"name\":\"ganzgut\",\"description\":\"\",\"type\":\"ip\",\"value\":\"1.1.1.2\"}]",
95
- created_at: "2019-11-13 17:47:27 +0100",
96
- updated_at: "2019-11-13 17:47:27 +0100"
97
- },
98
- fdata: {
99
- hostgroup_id: 1,
100
- environments: [
101
- {
102
- id: 1,
103
- name: "production"
104
- },
105
- {
106
- id: 2,
107
- name: "test"
108
- }
109
- ],
110
- lifecycle_environments: [],
111
- domains: [],
112
- computeprofiles: [],
113
- ptables: [
114
- {
115
- id: 105,
116
- name: "Kickstart default"
117
- },
118
- {
119
- id: 104,
120
- name: "Kickstart default thin"
121
- }
122
- ]
123
- }
124
- };
125
- export const loadParameterSelectionFailurePayload = {
126
- error: "Something really bad happend",
127
- };
@@ -15,32 +15,52 @@ const noop = () => {};
15
15
 
16
16
  const fixtures = {
17
17
  'should render newDefinition': {
18
+ location: "Default Location",
19
+ organization: "Default Organization",
20
+ loadForemanDataUrl: "/acd/ui_acd_fdata/__id__",
18
21
  loading: false,
19
22
  data: newDefinition,
20
23
  error: { statusText: '', errorMsg: '' },
21
24
  initParameterSelection: noop,
22
25
  loadForemanData: noop,
26
+ addParameter: noop,
27
+ deleteParameter: noop,
23
28
  },
24
29
  'should render editDefinition': {
30
+ location: "Default Location",
31
+ organization: "Default Organization",
32
+ loadForemanDataUrl: "/acd/ui_acd_fdata/__id__",
25
33
  loading: false,
26
34
  data: editDefinition,
27
35
  error: { statusText: '', errorMsg: '' },
28
36
  initParameterSelection: noop,
29
37
  loadForemanData: noop,
38
+ addParameter: noop,
39
+ deleteParameter: noop,
30
40
  },
31
41
  'should render newInstance': {
42
+ location: "Default Location",
43
+ organization: "Default Organization",
32
44
  loading: false,
45
+ loadForemanDataUrl: "/acd/ui_acd_fdata/__id__",
33
46
  data: newInstance,
34
47
  error: { statusText: '', errorMsg: '' },
35
48
  initParameterSelection: noop,
36
49
  loadForemanData: noop,
50
+ addParameter: noop,
51
+ deleteParameter: noop,
37
52
  },
38
53
  'should render editInstance': {
54
+ location: "Default Location",
55
+ organization: "Default Organization",
39
56
  loading: false,
57
+ loadForemanDataUrl: "/acd/ui_acd_fdata/__id__",
40
58
  data: editInstance,
41
59
  error: { statusText: '', errorMsg: '' },
42
60
  initParameterSelection: noop,
43
61
  loadForemanData: noop,
62
+ addParameter: noop,
63
+ deleteParameter: noop,
44
64
  },
45
65
  };
46
66
 
@@ -21,20 +21,17 @@ import {
21
21
  } from '../__fixtures__/parameterSelectionReducer.fixtures';
22
22
 
23
23
  import {
24
- INIT_PARAMETER_SELECTION,
25
- PARAMETER_DELETE,
26
- PARAMETER_ADD,
27
- PARAMETER_EDIT_ACTIVATE,
28
- PARAMETER_EDIT_CONFIRM,
29
- PARAMETER_EDIT_CHANGE,
30
- PARAMETER_EDIT_CANCEL,
31
- PARAMETER_SORT,
32
- LOAD_FOREMAN_DATA_REQUEST,
33
- LOAD_FOREMAN_DATA_SUCCESS,
34
- LOAD_FOREMAN_DATA_FAILURE,
35
- LOAD_PARAMETER_SELECTION_REQUEST,
36
- LOAD_PARAMETER_SELECTION_SUCCESS,
37
- LOAD_PARAMETER_SELECTION_FAILURE,
24
+ PARAMETER_SELECTION_INIT,
25
+ PARAMETER_SELECTION_DELETE,
26
+ PARAMETER_SELECTION_ADD,
27
+ PARAMETER_SELECTION_EDIT_ACTIVATE,
28
+ PARAMETER_SELECTION_EDIT_CONFIRM,
29
+ PARAMETER_SELECTION_EDIT_CHANGE,
30
+ PARAMETER_SELECTION_EDIT_CANCEL,
31
+ PARAMETER_SELECTION_SORT,
32
+ PARAMETER_SELECTION_LOAD_FOREMAN_DATA_REQUEST,
33
+ PARAMETER_SELECTION_LOAD_FOREMAN_DATA_SUCCESS,
34
+ PARAMETER_SELECTION_LOAD_FOREMAN_DATA_FAILURE,
38
35
  } from '../ParameterSelectionConstants';
39
36
 
40
37
  const fixtures = {
@@ -49,101 +46,80 @@ const fixtures = {
49
46
  'should initialize component': {
50
47
  state: initialState,
51
48
  action: {
52
- type: INIT_PARAMETER_SELECTION,
49
+ type: PARAMETER_SELECTION_INIT,
53
50
  payload: initParameterSelectionPayload,
54
51
  },
55
52
  },
56
53
  'should add a parameter': {
57
54
  state: successState,
58
55
  action: {
59
- type: PARAMETER_ADD,
56
+ type: PARAMETER_SELECTION_ADD,
60
57
  payload: addParameterPayload,
61
58
  },
62
59
  },
63
60
  'should delete a parameter': {
64
61
  state: successState,
65
62
  action: {
66
- type: PARAMETER_DELETE,
63
+ type: PARAMETER_SELECTION_DELETE,
67
64
  payload: deleteParameterPayload,
68
65
  },
69
66
  },
70
67
  'should activate edit parameter': {
71
68
  state: successState,
72
69
  action: {
73
- type: PARAMETER_EDIT_ACTIVATE,
70
+ type: PARAMETER_SELECTION_EDIT_ACTIVATE,
74
71
  payload: activateEditParameterPayload,
75
72
  },
76
73
  },
77
74
  'should confirm edit parameter': {
78
75
  state: editState,
79
76
  action: {
80
- type: PARAMETER_EDIT_CONFIRM,
77
+ type: PARAMETER_SELECTION_EDIT_CONFIRM,
81
78
  payload: confirmEditParameterPayload,
82
79
  },
83
80
  },
84
81
  'should cancel edit parameter': {
85
82
  state: editState,
86
83
  action: {
87
- type: PARAMETER_EDIT_CANCEL,
84
+ type: PARAMETER_SELECTION_EDIT_CANCEL,
88
85
  payload: cancelEditParameterPayload,
89
86
  },
90
87
  },
91
88
  'should change edit parameter': {
92
89
  state: editState,
93
90
  action: {
94
- type: PARAMETER_EDIT_CHANGE,
91
+ type: PARAMETER_SELECTION_EDIT_CHANGE,
95
92
  payload: changeEditParameterPayload,
96
93
  },
97
94
  },
98
95
  'should sort parameter': {
99
96
  state: successState,
100
97
  action: {
101
- type: PARAMETER_SORT,
98
+ type: PARAMETER_SELECTION_SORT,
102
99
  payload: sortParameterPayload,
103
100
  },
104
101
  },
105
102
  'should request load foreman data': {
106
103
  state: successState,
107
104
  action: {
108
- type: LOAD_FOREMAN_DATA_REQUEST,
105
+ type: PARAMETER_SELECTION_LOAD_FOREMAN_DATA_REQUEST,
109
106
  payload: loadForemanDataRequestPayload,
110
107
  },
111
108
  },
112
109
  'should load foreman data be successful': {
113
110
  state: successState,
114
111
  action: {
115
- type: LOAD_FOREMAN_DATA_SUCCESS,
112
+ type: PARAMETER_SELECTION_LOAD_FOREMAN_DATA_SUCCESS,
116
113
  payload: loadForemanDataSuccessPayload,
117
114
  },
118
115
  },
119
116
  'should load foreman data be erroneous': {
120
117
  state: successState,
121
118
  action: {
122
- type: LOAD_FOREMAN_DATA_FAILURE,
119
+ type: PARAMETER_SELECTION_LOAD_FOREMAN_DATA_FAILURE,
123
120
  payload: loadForemanDataFailurePayload,
124
121
  },
125
122
  },
126
- 'should request parameter selection': {
127
- state: initialState,
128
- action: {
129
- type: LOAD_PARAMETER_SELECTION_REQUEST,
130
- payload: loadParameterSelectionRequestPayload,
131
- },
132
- },
133
- 'should load parameter selection be successful': {
134
- state: initialState,
135
- action: {
136
- type: LOAD_PARAMETER_SELECTION_SUCCESS,
137
- payload: loadParameterSelectionSuccessPayload,
138
- },
139
- },
140
- 'should load parameter selection be erroneous': {
141
- state: initialState,
142
- action: {
143
- type: LOAD_PARAMETER_SELECTION_FAILURE,
144
- payload: loadParameterSelectionFailurePayload,
145
- },
146
- },
147
123
  };
148
124
 
149
125
  describe('ParameterSelectionReducer', () =>
@@ -5,10 +5,10 @@ import {
5
5
  selectEditMode,
6
6
  selectForemanData,
7
7
  selectParameterTypes,
8
- selectRows,
8
+ selectParameters,
9
9
  selectSortingColumns,
10
10
  selectColumns,
11
- selectAppDefinition,
11
+ selectServiceDefinition,
12
12
  selectHostgroupId,
13
13
  } from '../ParameterSelectionSelectors';
14
14
 
@@ -31,14 +31,14 @@ const fixtures = {
31
31
  selectForemanData(stateFactory(parameterSelectionData_1)),
32
32
  'should return parameterTypes from parameterSelectionData_1 fixtures': () =>
33
33
  selectParameterTypes(stateFactory(parameterSelectionData_1)),
34
- 'should return rows from parameterSelectionData_1 fixtures': () =>
35
- selectRows(stateFactory(parameterSelectionData_1)),
34
+ 'should return parameters from parameterSelectionData_1 fixtures': () =>
35
+ selectParameters(stateFactory(parameterSelectionData_1)),
36
36
  'should return sortingColumns from parameterSelectionData_1 fixtures': () =>
37
37
  selectSortingColumns(stateFactory(parameterSelectionData_1)),
38
38
  'should return columns from parameterSelectionData_1 fixtures': () =>
39
39
  selectColumns(stateFactory(parameterSelectionData_1)),
40
- 'should return appDefinition from parameterSelectionData_1 fixtures': () =>
41
- selectAppDefinition(stateFactory(parameterSelectionData_1)),
40
+ 'should return serviceDefinition from parameterSelectionData_1 fixtures': () =>
41
+ selectServiceDefinition(stateFactory(parameterSelectionData_1)),
42
42
  'should return hostgroupId from parameterSelectionData_1 fixtures': () =>
43
43
  selectHostgroupId(stateFactory(parameterSelectionData_1)),
44
44
  };
@@ -8,61 +8,11 @@ exports[`ParameterSelection should render editDefinition 1`] = `
8
8
  <div
9
9
  className="form-group"
10
10
  >
11
- <label
12
- className="col-md-2 control-label"
13
- >
14
- Host Group
15
- </label>
16
- <div
17
- className="col-md-4"
18
- >
19
- <div />
20
- <input
21
- id="foreman_acd_app_definition_hostgroup_id"
22
- name="foreman_acd_app_definition[hostgroup_id]"
23
- type="hidden"
24
- value={-1}
25
- />
26
- </div>
27
- </div>
28
- </div>
29
- <div
30
- className="clearfix"
31
- >
32
- <div
33
- className="form-group"
34
- >
35
- <label
36
- className="col-md-1 control-label"
37
- >
38
- Application parameters
39
- </label>
40
- <div
41
- className="col-md-5"
42
- >
43
-  
44
- </div>
45
- </div>
46
- </div>
47
- <div
48
- className="clearfix"
49
- >
50
- <div
51
- className="form-group"
52
- >
53
- <Button
54
- active={false}
55
- block={false}
56
- bsClass="btn"
57
- bsStyle="default"
58
- disabled={true}
59
- onClick={[Function]}
60
- >
61
- <Icon
62
- name="plus"
63
- type="fa"
64
- />
65
- </Button>
11
+ <AddTableEntry
12
+ disabled={false}
13
+ hidden={false}
14
+ onAddTableEntry={[Function]}
15
+ />
66
16
  <TablePfProvider
67
17
  bordered={true}
68
18
  className=""
@@ -97,26 +47,12 @@ exports[`ParameterSelection should render editDefinition 1`] = `
97
47
  rows={Array []}
98
48
  />
99
49
  </TablePfProvider>
100
- <Button
101
- active={false}
102
- block={false}
103
- bsClass="btn"
104
- bsStyle="default"
105
- disabled={true}
106
- onClick={[Function]}
107
- >
108
- <Icon
109
- name="plus"
110
- type="fa"
111
- />
112
- </Button>
50
+ <AddTableEntry
51
+ disabled={false}
52
+ hidden={false}
53
+ onAddTableEntry={[Function]}
54
+ />
113
55
  </div>
114
- <input
115
- id="foreman_acd_app_definition_parameters"
116
- name="foreman_acd_app_definition[parameters]"
117
- type="hidden"
118
- value="[]"
119
- />
120
56
  </div>
121
57
  </div>
122
58
  `;
@@ -129,48 +65,11 @@ exports[`ParameterSelection should render editInstance 1`] = `
129
65
  <div
130
66
  className="form-group"
131
67
  >
132
- <label
133
- className="col-md-2 control-label"
134
- >
135
- Application Definition
136
- </label>
137
- <div
138
- className="col-md-4"
139
- >
140
- <div />
141
- <input
142
- id="foreman_acd_app_instance_app_definition_id"
143
- name="foreman_acd_app_instance[app_definition_id]"
144
- type="hidden"
145
- value=""
146
- />
147
- </div>
148
- </div>
149
- </div>
150
- <div
151
- className="clearfix"
152
- >
153
- <div
154
- className="form-group"
155
- >
156
- <label
157
- className="col-md-1 control-label"
158
- >
159
- Application parameters
160
- </label>
161
- <div
162
- className="col-md-5"
163
- >
164
-  
165
- </div>
166
- </div>
167
- </div>
168
- <div
169
- className="clearfix"
170
- >
171
- <div
172
- className="form-group"
173
- >
68
+ <AddTableEntry
69
+ disabled={false}
70
+ hidden={true}
71
+ onAddTableEntry={[Function]}
72
+ />
174
73
  <TablePfProvider
175
74
  bordered={true}
176
75
  className=""
@@ -205,13 +104,12 @@ exports[`ParameterSelection should render editInstance 1`] = `
205
104
  rows={Array []}
206
105
  />
207
106
  </TablePfProvider>
107
+ <AddTableEntry
108
+ disabled={false}
109
+ hidden={true}
110
+ onAddTableEntry={[Function]}
111
+ />
208
112
  </div>
209
- <input
210
- id="foreman_acd_app_instance_parameters"
211
- name="foreman_acd_app_instance[parameters]"
212
- type="hidden"
213
- value="[]"
214
- />
215
113
  </div>
216
114
  </div>
217
115
  `;
@@ -224,71 +122,11 @@ exports[`ParameterSelection should render newDefinition 1`] = `
224
122
  <div
225
123
  className="form-group"
226
124
  >
227
- <label
228
- className="col-md-2 control-label"
229
- >
230
- Host Group
231
- </label>
232
- <div
233
- className="col-md-4"
234
- >
235
- <Select
236
- allowClear={true}
237
- key="key"
238
- onChange={[Function]}
239
- options={
240
- Object {
241
- "1": "centos7",
242
- }
243
- }
244
- value="-1"
245
- />
246
- <input
247
- id="foreman_acd_app_definition_hostgroup_id"
248
- name="foreman_acd_app_definition[hostgroup_id]"
249
- type="hidden"
250
- value={-1}
251
- />
252
- </div>
253
- </div>
254
- </div>
255
- <div
256
- className="clearfix"
257
- >
258
- <div
259
- className="form-group"
260
- >
261
- <label
262
- className="col-md-1 control-label"
263
- >
264
- Application parameters
265
- </label>
266
- <div
267
- className="col-md-5"
268
- >
269
-  
270
- </div>
271
- </div>
272
- </div>
273
- <div
274
- className="clearfix"
275
- >
276
- <div
277
- className="form-group"
278
- >
279
- <Button
280
- active={false}
281
- block={false}
282
- bsClass="btn"
283
- bsStyle="default"
284
- disabled={true}
285
- onClick={[Function]}
286
- >
287
- <Icon
288
- name="plus"
289
- type="fa"
290
- />
291
- </Button>
125
+ <AddTableEntry
126
+ disabled={false}
127
+ hidden={false}
128
+ onAddTableEntry={[Function]}
129
+ />
292
130
  <TablePfProvider
293
131
  bordered={true}
294
132
  className=""
@@ -323,26 +161,12 @@ exports[`ParameterSelection should render newDefinition 1`] = `
323
161
  rows={Array []}
324
162
  />
325
163
  </TablePfProvider>
326
- <Button
327
- active={false}
328
- block={false}
329
- bsClass="btn"
330
- bsStyle="default"
331
- disabled={true}
332
- onClick={[Function]}
333
- >
334
- <Icon
335
- name="plus"
336
- type="fa"
337
- />
338
- </Button>
164
+ <AddTableEntry
165
+ disabled={false}
166
+ hidden={false}
167
+ onAddTableEntry={[Function]}
168
+ />
339
169
  </div>
340
- <input
341
- id="foreman_acd_app_definition_parameters"
342
- name="foreman_acd_app_definition[parameters]"
343
- type="hidden"
344
- value="[]"
345
- />
346
170
  </div>
347
171
  </div>
348
172
  `;
@@ -355,59 +179,11 @@ exports[`ParameterSelection should render newInstance 1`] = `
355
179
  <div
356
180
  className="form-group"
357
181
  >
358
- <label
359
- className="col-md-2 control-label"
360
- >
361
- Application Definition
362
- </label>
363
- <div
364
- className="col-md-4"
365
- >
366
- <Select
367
- allowClear={true}
368
- key="key"
369
- onChange={[Function]}
370
- options={
371
- Object {
372
- "1": "Test123",
373
- "2": "sowasvonneu",
374
- }
375
- }
376
- value=""
377
- />
378
- <input
379
- id="foreman_acd_app_instance_app_definition_id"
380
- name="foreman_acd_app_instance[app_definition_id]"
381
- type="hidden"
382
- value=""
383
- />
384
- </div>
385
- </div>
386
- </div>
387
- <div
388
- className="clearfix"
389
- >
390
- <div
391
- className="form-group"
392
- >
393
- <label
394
- className="col-md-1 control-label"
395
- >
396
- Application parameters
397
- </label>
398
- <div
399
- className="col-md-5"
400
- >
401
-  
402
- </div>
403
- </div>
404
- </div>
405
- <div
406
- className="clearfix"
407
- >
408
- <div
409
- className="form-group"
410
- >
182
+ <AddTableEntry
183
+ disabled={false}
184
+ hidden={true}
185
+ onAddTableEntry={[Function]}
186
+ />
411
187
  <TablePfProvider
412
188
  bordered={true}
413
189
  className=""
@@ -442,13 +218,12 @@ exports[`ParameterSelection should render newInstance 1`] = `
442
218
  rows={Array []}
443
219
  />
444
220
  </TablePfProvider>
221
+ <AddTableEntry
222
+ disabled={false}
223
+ hidden={true}
224
+ onAddTableEntry={[Function]}
225
+ />
445
226
  </div>
446
- <input
447
- id="foreman_acd_app_instance_parameters"
448
- name="foreman_acd_app_instance[parameters]"
449
- type="hidden"
450
- value="[]"
451
- />
452
227
  </div>
453
228
  </div>
454
229
  `;