foreman_snapshot_management 1.7.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -1
- data/Rakefile +7 -2
- data/app/controllers/api/v2/snapshots_controller.rb +22 -6
- data/app/models/foreman_snapshot_management/proxmox_extensions.rb +1 -1
- data/app/models/foreman_snapshot_management/snapshot.rb +4 -0
- data/app/views/api/v2/snapshots/base.json.rabl +2 -0
- data/app/views/foreman_snapshot_management/snapshots/_index.html.erb +12 -80
- data/app/views/hosts/_snapshots_tab.html.erb +8 -0
- data/lib/foreman_snapshot_management/engine.rb +22 -21
- data/lib/foreman_snapshot_management/version.rb +1 -1
- data/lib/tasks/foreman_snapshot_management_tasks.rake +2 -2
- data/locale/de/LC_MESSAGES/foreman_snapshot_management.mo +0 -0
- data/locale/de/foreman_snapshot_management.po +52 -19
- data/locale/en/LC_MESSAGES/foreman_snapshot_management.mo +0 -0
- data/locale/en/foreman_snapshot_management.po +44 -11
- data/locale/foreman_snapshot_management.pot +87 -25
- data/package.json +46 -0
- data/test/controllers/api/v2/snapshots_test.rb +232 -109
- data/test/controllers/foreman_snapshot_management/snapshots_controller_test.rb +1 -1
- data/test/factories/proxmox_factory.rb +1 -1
- data/webpack/components/SnapshotManagement/SnapshotManagement.js +84 -0
- data/webpack/components/SnapshotManagement/SnapshotManagementActions.js +212 -0
- data/webpack/components/SnapshotManagement/SnapshotManagementConstants.js +9 -0
- data/webpack/components/SnapshotManagement/SnapshotManagementReducer.js +100 -0
- data/webpack/components/SnapshotManagement/SnapshotManagementSelectors.js +8 -0
- data/webpack/components/SnapshotManagement/__tests__/SnapshotManagementActions.test.js +123 -0
- data/webpack/components/SnapshotManagement/__tests__/SnapshotManagementReducer.test.js +157 -0
- data/webpack/components/SnapshotManagement/__tests__/__snapshots__/SnapshotManagementActions.test.js.snap +314 -0
- data/webpack/components/SnapshotManagement/__tests__/__snapshots__/SnapshotManagementReducer.test.js.snap +214 -0
- data/webpack/components/SnapshotManagement/components/SnapshotForm/SnapshotForm.js +118 -0
- data/webpack/components/SnapshotManagement/components/SnapshotForm/SnapshotFormConstants.js +5 -0
- data/webpack/components/SnapshotManagement/components/SnapshotForm/__tests__/SnapshotForm.test.js +26 -0
- data/webpack/components/SnapshotManagement/components/SnapshotForm/__tests__/__snapshots__/SnapshotForm.test.js.snap +476 -0
- data/webpack/components/SnapshotManagement/components/SnapshotForm/index.js +19 -0
- data/webpack/components/SnapshotManagement/components/SnapshotForm/snapshotForm.scss +3 -0
- data/webpack/components/SnapshotManagement/components/SnapshotFormModal/SnapshotFormModal.js +37 -0
- data/webpack/components/SnapshotManagement/components/SnapshotFormModal/SnapshotFormModalConstants.js +1 -0
- data/webpack/components/SnapshotManagement/components/SnapshotFormModal/__tests__/SnapshotFormModal.test.js +19 -0
- data/webpack/components/SnapshotManagement/components/SnapshotFormModal/__tests__/__snapshots__/SnapshotFormModal.test.js.snap +19 -0
- data/webpack/components/SnapshotManagement/components/SnapshotFormModal/index.js +12 -0
- data/webpack/components/SnapshotManagement/components/SnapshotFormModal/useSnapshotFormModal.js +7 -0
- data/webpack/components/SnapshotManagement/components/SnapshotList/SnapshotList.js +314 -0
- data/webpack/components/SnapshotManagement/components/SnapshotList/SnapshotListHelper.js +70 -0
- data/webpack/components/SnapshotManagement/components/SnapshotList/__tests__/SnapshotList.test.js +88 -0
- data/webpack/components/SnapshotManagement/components/SnapshotList/__tests__/__snapshots__/SnapshotList.test.js.snap +1081 -0
- data/webpack/components/SnapshotManagement/components/SnapshotList/snapshotList.scss +13 -0
- data/webpack/components/SnapshotManagement/index.js +33 -0
- data/webpack/components/SnapshotManagement/snapshotManagement.scss +5 -0
- data/webpack/global_index.js +7 -0
- data/webpack/global_test_setup.js +11 -0
- data/webpack/index.js +8 -0
- data/webpack/reducers.js +7 -0
- data/webpack/test_setup.js +17 -0
- metadata +39 -33
@@ -0,0 +1,33 @@
|
|
1
|
+
import { connect } from 'react-redux';
|
2
|
+
|
3
|
+
import {
|
4
|
+
loadSnapshotList,
|
5
|
+
snapshotDeleteAction,
|
6
|
+
snapshotUpdateAction,
|
7
|
+
snapshotRollbackAction,
|
8
|
+
} from './SnapshotManagementActions';
|
9
|
+
import SnapshotManagement from './SnapshotManagement';
|
10
|
+
import * as Selector from './SnapshotManagementSelectors';
|
11
|
+
|
12
|
+
// process state from redux store
|
13
|
+
const mapStateToProps = state => ({
|
14
|
+
snapshots: Selector.selectSnapshots(state),
|
15
|
+
isLoading: Selector.selectIsLoading(state),
|
16
|
+
isWorking: Selector.selectIsWorking(state),
|
17
|
+
hasError: Selector.selectHasError(state),
|
18
|
+
error: Selector.selectError(state),
|
19
|
+
needsReload: Selector.selectNeedsReload(state),
|
20
|
+
});
|
21
|
+
|
22
|
+
// dispatch actions from Component to Store
|
23
|
+
const mapDispatchToProps = dispatch => ({
|
24
|
+
loadSnapshots: host => dispatch(loadSnapshotList(host)),
|
25
|
+
deleteAction: (hostId, rowData) =>
|
26
|
+
dispatch(snapshotDeleteAction(hostId, rowData)),
|
27
|
+
updateAction: (hostId, rowData) =>
|
28
|
+
dispatch(snapshotUpdateAction(hostId, rowData)),
|
29
|
+
rollbackAction: (hostId, rowData) =>
|
30
|
+
dispatch(snapshotRollbackAction(hostId, rowData)),
|
31
|
+
});
|
32
|
+
|
33
|
+
export default connect(mapStateToProps, mapDispatchToProps)(SnapshotManagement);
|
@@ -0,0 +1,11 @@
|
|
1
|
+
// runs before each test to make sure console.error output will
|
2
|
+
// fail a test (i.e. default PropType missing). Check the error
|
3
|
+
// output and traceback for actual error.
|
4
|
+
global.console.error = (error, stack) => {
|
5
|
+
/* eslint-disable-next-line no-console */
|
6
|
+
if (stack) console.log(stack); // Prints out original stack trace
|
7
|
+
throw new Error(error);
|
8
|
+
};
|
9
|
+
|
10
|
+
// Increase jest timeout as some tests using multiple http mocks can time out on CI systems.
|
11
|
+
jest.setTimeout(10000);
|
data/webpack/index.js
ADDED
data/webpack/reducers.js
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
import 'core-js/shim';
|
2
|
+
import 'regenerator-runtime/runtime';
|
3
|
+
import MutationObserver from '@sheerun/mutationobserver-shim';
|
4
|
+
|
5
|
+
import { configure } from 'enzyme';
|
6
|
+
import Adapter from 'enzyme-adapter-react-16';
|
7
|
+
|
8
|
+
configure({ adapter: new Adapter() });
|
9
|
+
|
10
|
+
// Mocking translation function
|
11
|
+
global.__ = text => text; // eslint-disable-line
|
12
|
+
|
13
|
+
// Mocking locales to prevent unnecessary fallback messages
|
14
|
+
window.locales = { en: { domain: 'app', locale_data: { app: { '': {} } } } };
|
15
|
+
|
16
|
+
// see https://github.com/testing-library/dom-testing-library/releases/tag/v7.0.0
|
17
|
+
window.MutationObserver = MutationObserver;
|
metadata
CHANGED
@@ -1,43 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_snapshot_management
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ATIX AG
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
12
|
-
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: rdoc
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '5.1'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '5.1'
|
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.75.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.75.0
|
11
|
+
date: 2021-05-10 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
41
13
|
description: Foreman-plugin to manage snapshots in a virtual-hardware environments.
|
42
14
|
email:
|
43
15
|
- info@atix.de
|
@@ -83,10 +55,44 @@ files:
|
|
83
55
|
- locale/en/foreman_snapshot_management.po
|
84
56
|
- locale/foreman_snapshot_management.pot
|
85
57
|
- locale/gemspec.rb
|
58
|
+
- package.json
|
86
59
|
- test/controllers/api/v2/snapshots_test.rb
|
87
60
|
- test/controllers/foreman_snapshot_management/snapshots_controller_test.rb
|
88
61
|
- test/factories/proxmox_factory.rb
|
89
62
|
- test/test_plugin_helper.rb
|
63
|
+
- webpack/components/SnapshotManagement/SnapshotManagement.js
|
64
|
+
- webpack/components/SnapshotManagement/SnapshotManagementActions.js
|
65
|
+
- webpack/components/SnapshotManagement/SnapshotManagementConstants.js
|
66
|
+
- webpack/components/SnapshotManagement/SnapshotManagementReducer.js
|
67
|
+
- webpack/components/SnapshotManagement/SnapshotManagementSelectors.js
|
68
|
+
- webpack/components/SnapshotManagement/__tests__/SnapshotManagementActions.test.js
|
69
|
+
- webpack/components/SnapshotManagement/__tests__/SnapshotManagementReducer.test.js
|
70
|
+
- webpack/components/SnapshotManagement/__tests__/__snapshots__/SnapshotManagementActions.test.js.snap
|
71
|
+
- webpack/components/SnapshotManagement/__tests__/__snapshots__/SnapshotManagementReducer.test.js.snap
|
72
|
+
- webpack/components/SnapshotManagement/components/SnapshotForm/SnapshotForm.js
|
73
|
+
- webpack/components/SnapshotManagement/components/SnapshotForm/SnapshotFormConstants.js
|
74
|
+
- webpack/components/SnapshotManagement/components/SnapshotForm/__tests__/SnapshotForm.test.js
|
75
|
+
- webpack/components/SnapshotManagement/components/SnapshotForm/__tests__/__snapshots__/SnapshotForm.test.js.snap
|
76
|
+
- webpack/components/SnapshotManagement/components/SnapshotForm/index.js
|
77
|
+
- webpack/components/SnapshotManagement/components/SnapshotForm/snapshotForm.scss
|
78
|
+
- webpack/components/SnapshotManagement/components/SnapshotFormModal/SnapshotFormModal.js
|
79
|
+
- webpack/components/SnapshotManagement/components/SnapshotFormModal/SnapshotFormModalConstants.js
|
80
|
+
- webpack/components/SnapshotManagement/components/SnapshotFormModal/__tests__/SnapshotFormModal.test.js
|
81
|
+
- webpack/components/SnapshotManagement/components/SnapshotFormModal/__tests__/__snapshots__/SnapshotFormModal.test.js.snap
|
82
|
+
- webpack/components/SnapshotManagement/components/SnapshotFormModal/index.js
|
83
|
+
- webpack/components/SnapshotManagement/components/SnapshotFormModal/useSnapshotFormModal.js
|
84
|
+
- webpack/components/SnapshotManagement/components/SnapshotList/SnapshotList.js
|
85
|
+
- webpack/components/SnapshotManagement/components/SnapshotList/SnapshotListHelper.js
|
86
|
+
- webpack/components/SnapshotManagement/components/SnapshotList/__tests__/SnapshotList.test.js
|
87
|
+
- webpack/components/SnapshotManagement/components/SnapshotList/__tests__/__snapshots__/SnapshotList.test.js.snap
|
88
|
+
- webpack/components/SnapshotManagement/components/SnapshotList/snapshotList.scss
|
89
|
+
- webpack/components/SnapshotManagement/index.js
|
90
|
+
- webpack/components/SnapshotManagement/snapshotManagement.scss
|
91
|
+
- webpack/global_index.js
|
92
|
+
- webpack/global_test_setup.js
|
93
|
+
- webpack/index.js
|
94
|
+
- webpack/reducers.js
|
95
|
+
- webpack/test_setup.js
|
90
96
|
homepage: https://www.orcharhino.com
|
91
97
|
licenses:
|
92
98
|
- GPL-3.0-only
|
@@ -99,14 +105,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
99
105
|
requirements:
|
100
106
|
- - ">="
|
101
107
|
- !ruby/object:Gem::Version
|
102
|
-
version: '
|
108
|
+
version: '2.5'
|
103
109
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
104
110
|
requirements:
|
105
111
|
- - ">="
|
106
112
|
- !ruby/object:Gem::Version
|
107
113
|
version: '0'
|
108
114
|
requirements: []
|
109
|
-
rubygems_version: 3.0.
|
115
|
+
rubygems_version: 3.0.8
|
110
116
|
signing_key:
|
111
117
|
specification_version: 4
|
112
118
|
summary: Snapshot Management for machines on virtualization-platforms
|