foreman_templates 7.0.7 → 8.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/api/v2/template_controller.rb +6 -1
  3. data/app/controllers/concerns/foreman/controller/parameters/template_params.rb +22 -2
  4. data/app/models/setting/template_sync.rb +12 -2
  5. data/app/services/foreman_templates/template_exporter.rb +2 -2
  6. data/app/services/foreman_templates/template_importer.rb +20 -4
  7. data/app/views/template_syncs/index.html.erb +2 -6
  8. data/db/migrate/20180627134929_change_lock_setting.rb +5 -0
  9. data/lib/foreman_templates/engine.rb +6 -0
  10. data/lib/foreman_templates/version.rb +1 -1
  11. data/package.json +15 -21
  12. data/webpack/__mocks__/foremanReact/components/common/forms/ForemanForm.js +2 -0
  13. data/webpack/components/NewTemplateSync/__fixtures__/templateSyncSettings.fixtures.js +4 -4
  14. data/webpack/components/NewTemplateSync/__tests__/__snapshots__/NewTemplateSync.test.js.snap +2 -2
  15. data/webpack/components/NewTemplateSync/components/NewTemplateSyncForm/NewTemplateSyncForm.js +68 -71
  16. data/webpack/components/NewTemplateSync/components/NewTemplateSyncForm/NewTemplateSyncFormSelectors.js +10 -13
  17. data/webpack/components/NewTemplateSync/components/NewTemplateSyncForm/__tests__/NewTemplateSyncFormSelectors.test.js +1 -19
  18. data/webpack/components/NewTemplateSync/components/NewTemplateSyncForm/__tests__/__snapshots__/NewTemplateSyncFormSelectors.test.js.snap +7 -36
  19. data/webpack/components/NewTemplateSync/components/NewTemplateSyncForm/index.js +3 -20
  20. data/webpack/components/NewTemplateSync/components/SyncSettingField.js +5 -11
  21. data/webpack/components/NewTemplateSync/components/SyncSettingFields.js +8 -25
  22. data/webpack/components/NewTemplateSync/components/TextButtonField/index.js +27 -20
  23. data/webpack/components/NewTemplateSync/components/__tests__/SyncSettingField.test.js +2 -1
  24. data/webpack/components/NewTemplateSync/components/__tests__/SyncSettingFields.test.js +1 -0
  25. data/webpack/components/NewTemplateSync/components/__tests__/TextButtonField.test.js +4 -4
  26. data/webpack/components/NewTemplateSync/components/__tests__/__snapshots__/SyncSettingField.test.js.snap +18 -27
  27. data/webpack/components/NewTemplateSync/components/__tests__/__snapshots__/SyncSettingFields.test.js.snap +5 -3
  28. data/webpack/components/NewTemplateSync/components/__tests__/__snapshots__/TextButtonField.test.js.snap +8 -91
  29. data/webpack/components/TemplateSyncResult/__fixtures__/templateSyncResult.fixtures.js +2 -2
  30. data/webpack/components/TemplateSyncResult/__tests__/__snapshots__/TemplateSyncResult.test.js.snap +3 -1
  31. data/webpack/components/TemplateSyncResult/__tests__/__snapshots__/TemplateSyncResultReducer.test.js.snap +3 -1
  32. data/webpack/components/TemplateSyncResult/components/SyncedTemplate/helpers.js +19 -9
  33. data/webpack/components/TemplateSyncResult/components/__tests__/__snapshots__/SyncResultList.test.js.snap +3 -1
  34. data/webpack/components/TemplateSyncResult/components/__tests__/__snapshots__/SyncedTemplate.test.js.snap +39 -15
  35. data/webpack/testSetup.js +2 -1
  36. metadata +4 -7
  37. data/webpack/__mocks__/foremanReact/components/Layout/LayoutSelectors.js +0 -4
  38. data/webpack/__mocks__/foremanReact/components/common/forms/Form.js +0 -2
  39. data/webpack/components/NewTemplateSync/components/NewTemplateSyncForm/NewTemplateSyncFormConstants.js +0 -1
  40. data/webpack/components/NewTemplateSync/components/NewTemplateSyncForm/__tests__/NewTemplateSyncForm.test.js +0 -42
  41. data/webpack/components/NewTemplateSync/components/NewTemplateSyncForm/__tests__/__snapshots__/NewTemplateSyncForm.test.js.snap +0 -186
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9583ee6b0f88f013c5a26f23dd90a22cf7bdcdeebbb8052c3fdffaf11960fb3d
4
- data.tar.gz: 5b54607bfe06ca7cdd359d371afbb497e343310ae48d29c2f359bb4d43a6a38d
3
+ metadata.gz: b0dbc6a618a7c30af0547757f78e6548ae69c5b61112d14ae51dcdad8195d3ae
4
+ data.tar.gz: 8660614fbc2a7ba17f5f778bf9e6f65a2f3ce5fe3a01bbb83212762d6c07afa3
5
5
  SHA512:
6
- metadata.gz: d6826d8bdd2c9bbc47d09cfe8a9cfeddb169a6aa65933fd670144921091267d20814b5cf4cf37e93629a81fa2b1b81120ce796dd53194d4740b02b7e10c04720
7
- data.tar.gz: 2e019ce44797e7c28648f8b8913d224441a514fad0e75c977502c1c79c4bab09dbcb4b538a584c28fc8049c60df5ff3c270dfe2de2df97564c5a5af3125ebce5
6
+ metadata.gz: d1f7dabefd106226e7a11fa7bcf0d7314945c7955b50476c466d7cd21fdb5d562f2b4eff1977cb418d0f0e2a86c10889a4c2df81aedd8919b948558ad080aef1
7
+ data.tar.gz: 0bdb20444ed985d3862de5785d14a542cd294fe2365d137f9c4030be725db6642aee70f4e0c60df091bcb37599a2c956bf828e85f431994d4169c37d9a325729
@@ -3,6 +3,10 @@ module Api
3
3
  class TemplateController < ::Api::V2::BaseController
4
4
  include ::Foreman::Controller::Parameters::TemplateParams
5
5
 
6
+ resource_description do
7
+ resource_id 'templates'
8
+ end
9
+
6
10
  def_param_group :foreman_template_sync_params do
7
11
  param :branch, String, :required => false, :desc => N_("Branch in Git repo.")
8
12
  param :repo, String, :required => false, :desc => N_("Override the default repo from settings.")
@@ -15,7 +19,7 @@ module Api
15
19
  param :prefix, String, :required => false, :desc => N_("The string all imported templates should begin with.")
16
20
  param :associate, Setting::TemplateSync.associate_types.keys, :required => false, :desc => N_("Associate to OS's, Locations & Organizations. Options are: always, new or never.")
17
21
  param :force, :bool, :required => false, :desc => N_("Update templates that are locked")
18
- param :lock, :bool, :required => false, :desc => N_("Lock imported templates")
22
+ param :lock, Setting::TemplateSync.lock_types.keys + ["true", "false", "0", "1"], :required => false, :desc => N_("Lock imported templates")
19
23
  param :verbose, :bool, :required => false, :desc => N_("Show template diff in response")
20
24
  param_group :foreman_template_sync_params
21
25
  param_group :taxonomies, ::Api::V2::BaseController
@@ -29,6 +33,7 @@ module Api
29
33
 
30
34
  api :POST, "/templates/export", N_("Initiate Export")
31
35
  param :metadata_export_mode, Setting::TemplateSync.metadata_export_mode_types.keys, :required => false, :desc => N_("Specify how to handle metadata")
36
+ param :commit_msg, String, :desc => N_("Custom commit message for templates export")
32
37
  param_group :foreman_template_sync_params
33
38
  param_group :taxonomies, ::Api::V2::BaseController
34
39
  def export
@@ -15,7 +15,7 @@ module Foreman
15
15
  end
16
16
 
17
17
  def extra_export_params
18
- [:metadata_export_mode]
18
+ %i(metadata_export_mode commit_msg)
19
19
  end
20
20
 
21
21
  def template_params_filter(extra_params = [])
@@ -34,7 +34,27 @@ module Foreman
34
34
  end
35
35
 
36
36
  def template_import_params
37
- add_taxonomy_params(base_import_params(:none))
37
+ transform_lock_param add_taxonomy_params(base_import_params(:none))
38
+ end
39
+
40
+ def transform_lock_param(params)
41
+ lock = params[:lock]
42
+ return params if lock.nil?
43
+
44
+ if lock == "true" || lock.is_a?(TrueClass) || lock.to_s == "1"
45
+ log_deprecated_param(lock)
46
+ params[:lock] = "lock"
47
+ end
48
+
49
+ if lock == "false" || lock.is_a?(FalseClass) || lock.to_s == "0"
50
+ log_deprecated_param(lock)
51
+ params[:lock] = "unlock"
52
+ end
53
+ params
54
+ end
55
+
56
+ def log_deprecated_param(value)
57
+ Logging.logger('app').warn "Using '#{value}' as a value for lock when syncing templates is deprecated and will be removed in the future."
38
58
  end
39
59
 
40
60
  def template_export_params
@@ -11,7 +11,7 @@ class Setting
11
11
  end
12
12
 
13
13
  def self.export_stripped_names
14
- %w(metadata_export_mode)
14
+ %w(metadata_export_mode commit_msg)
15
15
  end
16
16
 
17
17
  def self.import_setting_names(except = [])
@@ -38,6 +38,15 @@ class Setting
38
38
  }
39
39
  end
40
40
 
41
+ def self.lock_types
42
+ {
43
+ 'lock' => _('Lock'),
44
+ 'keep_lock_new' => _('Keep, lock new'),
45
+ 'keep' => _('Keep, do not lock new'),
46
+ 'unlock' => _('Unlock')
47
+ }
48
+ end
49
+
41
50
  def self.metadata_export_mode_types
42
51
  {
43
52
  'refresh' => _('Refresh'),
@@ -75,7 +84,8 @@ class Setting
75
84
  self.set('template_sync_branch', N_('Default branch in Git repo'), '', N_('Branch')),
76
85
  self.set('template_sync_metadata_export_mode', N_('Default metadata export mode, refresh re-renders metadata, keep will keep existing metadata, remove exports template without metadata'), 'refresh', N_('Metadata export mode'), nil, { :collection => Proc.new { self.metadata_export_mode_types } }),
77
86
  self.set('template_sync_force', N_('Should importing overwrite locked templates?'), false, N_('Force import')),
78
- self.set('template_sync_lock', N_('Should importing lock templates?'), false, N_('Lock templates')),
87
+ self.set('template_sync_lock', N_('How to handle lock for imported templates?'), 'keep', N_('Lock templates'), nil, { :collection => Proc.new { self.lock_types } }),
88
+ self.set('template_sync_commit_msg', N_('Custom commit message for templates export'), 'Templates export made by a Foreman user', N_('Commit message'))
79
89
  ].compact.each { |s| self.create! s.update(:category => "Setting::TemplateSync") }
80
90
  end
81
91
 
@@ -1,7 +1,7 @@
1
1
  module ForemanTemplates
2
2
  class TemplateExporter < Action
3
3
  def self.setting_overrides
4
- super + %i(metadata_export_mode)
4
+ super + %i(metadata_export_mode commit_msg)
5
5
  end
6
6
 
7
7
  def initialize(args = {})
@@ -42,7 +42,7 @@ module ForemanTemplates
42
42
  new_repo = true
43
43
  end
44
44
  if new_repo || status.added.any? || status.changed.any? || status.deleted.any? || status.untracked.any?
45
- git_repo.commit "Templates export made by Foreman user #{foreman_git_user}"
45
+ git_repo.commit commit_msg
46
46
  git_repo.push 'origin', branch
47
47
  else
48
48
  @warning = 'No change detected, skipping the commit and push'
@@ -10,7 +10,6 @@ module ForemanTemplates
10
10
  super args
11
11
  @verbose = parse_bool(@verbose)
12
12
  @force = parse_bool(@force)
13
- @lock = parse_bool(@lock)
14
13
  @result_lines = []
15
14
  end
16
15
 
@@ -79,11 +78,28 @@ module ForemanTemplates
79
78
  end
80
79
 
81
80
  def import_options
82
- { :force => @force,
81
+ lock_predicate = lambda do |template|
82
+ case @lock
83
+ when 'lock'
84
+ return true
85
+ when 'unlock'
86
+ return false
87
+ when 'keep'
88
+ return template.new_record? ? false : template.locked
89
+ when 'keep_lock_new'
90
+ return template.new_record? ? true : template.locked
91
+ else
92
+ raise ::Foreman::Exception.new("Unknown lock option type, expected one of #{::Setting::TemplateSync.lock_types.keys}, got #{@lock}")
93
+ end
94
+ end
95
+
96
+ {
97
+ :force => @force,
83
98
  :associate => @associate,
84
- :lock => @lock,
99
+ :lock => lock_predicate,
85
100
  :organization_params => @taxonomies[:organizations],
86
- :location_params => @taxonomies[:locations] }
101
+ :location_params => @taxonomies[:locations]
102
+ }
87
103
  end
88
104
 
89
105
  def template_model(metadata, parse_result)
@@ -1,9 +1,5 @@
1
- <% content_for(:javascripts) do %>
2
- <%= webpacked_plugins_js_for :foreman_templates %>
3
- <% end %>
4
- <% content_for(:stylesheets) do %>
5
- <%= webpacked_plugins_css_for :foreman_templates %>
6
- <% end %>
1
+ <%= webpacked_plugins_js_for :foreman_templates %>
2
+ <%= webpacked_plugins_css_for :foreman_templates %>
7
3
 
8
4
  <div id="foreman-templates"/>
9
5
 
@@ -0,0 +1,5 @@
1
+ class ChangeLockSetting < ActiveRecord::Migration[5.1]
2
+ def up
3
+ Setting.find_by(:name => 'template_sync_lock')&.destroy
4
+ end
5
+ end
@@ -20,6 +20,12 @@ module ForemanTemplates
20
20
  end
21
21
  end
22
22
 
23
+ initializer "foreman_templates.load_app_instance_data" do |app|
24
+ ForemanTemplates::Engine.paths['db/migrate'].existent.each do |path|
25
+ app.config.paths['db/migrate'] << path
26
+ end
27
+ end
28
+
23
29
  initializer 'foreman_templates.register_plugin', :before => :finisher_hook do
24
30
  Foreman::Plugin.register :foreman_templates do
25
31
  requires_foreman '>= 1.24'
@@ -1,3 +1,3 @@
1
1
  module ForemanTemplates
2
- VERSION = '7.0.7'.freeze
2
+ VERSION = '8.0.0'.freeze
3
3
  end
data/package.json CHANGED
@@ -20,33 +20,24 @@
20
20
  "url": "https://projects.theforeman.org"
21
21
  },
22
22
  "homepage": "https://github.com/theforeman/foreman_templates",
23
- "dependencies": {
24
- "@theforeman/vendor": "^1.7.0"
23
+ "peerDependencies": {
24
+ "@theforeman/vendor": ">= 3.3.2"
25
25
  },
26
26
  "devDependencies": {
27
- "@theforeman/vendor-dev": "^1.7.0",
28
- "babel-cli": "^6.10.1",
29
- "babel-core": "^6.26.3",
30
- "babel-eslint": "^8.2.1",
31
- "babel-loader": "^7.1.1",
32
- "babel-plugin-transform-class-properties": "^6.24.1",
33
- "babel-plugin-transform-object-assign": "^6.22.0",
34
- "babel-plugin-transform-object-rest-spread": "^6.26.0",
35
- "babel-preset-env": "^1.6.0",
36
- "babel-preset-react": "^6.24.1",
27
+ "@babel/core": "^7.7.0",
28
+ "@theforeman/env": "^3.3.2",
29
+ "@theforeman/builder": "^4.0.2",
30
+ "@theforeman/vendor-dev": "^3.3.2",
31
+ "babel-eslint": "^10.0.0",
32
+ "babel-jest": "^24.9.0",
37
33
  "enzyme": "^3.7.0",
38
34
  "enzyme-adapter-react-16": "^1.7.0",
39
35
  "enzyme-to-json": "^3.3.5",
40
- "eslint": "^4.18.1",
41
- "eslint-config-airbnb": "^16.0.0",
42
- "eslint-plugin-import": "^2.8.0",
43
- "eslint-plugin-jest": "^21.2.0",
44
- "eslint-plugin-jsx-a11y": "^6.0.2",
45
- "eslint-plugin-patternfly-react": "^0.2.1",
46
- "eslint-plugin-react": "^7.4.0",
36
+ "eslint": "^6.8.0",
37
+ "eslint-plugin-patternfly-react": "^0.3.0",
47
38
  "identity-obj-proxy": "^3.0.0",
48
- "jest": "^23.6.0",
49
- "prettier": "^1.16.4",
39
+ "jest": "^24.9.0",
40
+ "prettier": "^1.19.1",
50
41
  "react-redux-test-utils": "^0.1.1"
51
42
  },
52
43
  "jest": {
@@ -56,6 +47,9 @@
56
47
  "node_modules",
57
48
  "webpack"
58
49
  ],
50
+ "transform": {
51
+ "^.+\\.js$": "babel-jest"
52
+ },
59
53
  "setupFiles": [
60
54
  "raf/polyfill",
61
55
  "./webpack/testSetup.js"
@@ -0,0 +1,2 @@
1
+ const ForemanForm = () => jest.fn();
2
+ export default ForemanForm;
@@ -1,5 +1,7 @@
1
1
  import Immutable from 'seamless-immutable';
2
2
 
3
+ import { transformInitialValues } from '../components/NewTemplateSyncForm/NewTemplateSyncFormSelectors';
4
+
3
5
  export const associateSetting = Immutable({
4
6
  id: 45,
5
7
  value: 'new',
@@ -65,10 +67,8 @@ export const registeredExportSettings = {
65
67
  };
66
68
 
67
69
  export const initialValues = {
68
- initial: importSettings.concat(exportSettings).reduce((memo, item) => {
69
- memo[item.name] = item.value;
70
- return memo;
71
- }, {}),
70
+ import: transformInitialValues(importSettings),
71
+ export: transformInitialValues(exportSettings),
72
72
  };
73
73
 
74
74
  export const stateFactory = obj => ({
@@ -12,7 +12,7 @@ exports[`NewTemplateSync should render when loaded 1`] = `
12
12
  header="Import or Export Templates"
13
13
  searchable={false}
14
14
  >
15
- <Connect(ReduxForm)
15
+ <Connect(NewTemplateSyncForm)
16
16
  history={Object {}}
17
17
  userPermissions={
18
18
  Object {
@@ -38,7 +38,7 @@ exports[`NewTemplateSync should render when loading 1`] = `
38
38
  header="Import or Export Templates"
39
39
  searchable={false}
40
40
  >
41
- <Connect(ReduxForm)
41
+ <Connect(NewTemplateSyncForm)
42
42
  history={Object {}}
43
43
  userPermissions={
44
44
  Object {
@@ -1,58 +1,53 @@
1
1
  import React from 'react';
2
- import { change } from 'redux-form';
3
2
  import PropTypes from 'prop-types';
4
3
 
5
- import Form from 'foremanReact/components/common/forms/Form';
6
-
4
+ import ForemanForm from 'foremanReact/components/common/forms/ForemanForm';
5
+ import * as Yup from 'yup';
7
6
  import SyncSettingsFields from '../SyncSettingFields';
8
7
  import SyncTypeRadios from '../SyncTypeRadios';
9
- import { NEW_TEMPLATE_SYNC_FORM_NAME } from './NewTemplateSyncFormConstants';
10
8
 
11
- const addTaxParams = key => (params, currentTax) => {
12
- if (currentTax.id) {
13
- params[key] = [currentTax.id];
9
+ const redirectToResult = history => () =>
10
+ history.push({ pathname: '/template_syncs/result' });
11
+
12
+ const repoFormat = formatAry => value => {
13
+ if (value === undefined) {
14
+ return true;
14
15
  }
15
- return params;
16
+
17
+ const valid = formatAry
18
+ .map(item => value.startsWith(item))
19
+ .reduce((memo, item) => item || memo, false);
20
+
21
+ return value && valid;
16
22
  };
17
23
 
18
- const addOrgParams = addTaxParams('organization_ids');
19
- const addLocParams = addTaxParams('location_ids');
20
-
21
- const submit = syncType => (formValues, dispatch, props) => {
22
- const {
23
- submitForm,
24
- importUrl,
25
- exportUrl,
26
- history,
27
- currentFields,
28
- currentLocation,
29
- currentOrganization,
30
- } = props;
31
- const url = syncType === 'import' ? importUrl : exportUrl;
32
- const currentFieldNames = Object.keys(currentFields);
33
- const postValues = Object.keys(formValues).reduce((memo, key) => {
34
- if (currentFieldNames.includes(key)) {
35
- memo[key] = formValues[key];
36
- }
37
- return memo;
38
- }, {});
39
-
40
- return submitForm({
41
- url,
42
- values: addOrgParams(
43
- addLocParams(postValues, currentLocation),
44
- currentOrganization
45
- ),
46
- message: `Templates were ${syncType}ed.`,
47
- item: 'TemplateSync',
48
- }).then(args => {
49
- history.replace({ pathname: '/template_syncs/result' });
24
+ const syncFormSchema = (syncType, settingsObj, validationData) => {
25
+ const schema = (settingsObj[syncType].asMutable() || []).reduce(
26
+ (memo, setting) => {
27
+ if (setting.name === 'repo') {
28
+ return {
29
+ ...memo,
30
+ repo: Yup.string()
31
+ .test(
32
+ 'repo-format',
33
+ `Invalid repo format, must start with one of: ${validationData.repo.join(
34
+ ', '
35
+ )}`,
36
+ repoFormat(validationData.repo)
37
+ )
38
+ .required("can't be blank"),
39
+ };
40
+ }
41
+ return memo;
42
+ },
43
+ {}
44
+ );
45
+
46
+ return Yup.object().shape({
47
+ [syncType]: Yup.object().shape(schema),
50
48
  });
51
49
  };
52
50
 
53
- const redirectToResult = history => () =>
54
- history.push({ pathname: '/template_syncs/result' });
55
-
56
51
  class NewTemplateSyncForm extends React.Component {
57
52
  allowedSyncType = (userPermissions, radioAttrs) =>
58
53
  this.props.userPermissions[radioAttrs.permission];
@@ -92,50 +87,54 @@ class NewTemplateSyncForm extends React.Component {
92
87
 
93
88
  render() {
94
89
  const {
95
- submitting,
96
90
  error,
97
- handleSubmit,
91
+ submitForm,
98
92
  importSettings,
99
93
  exportSettings,
100
- dispatch,
101
94
  history,
102
95
  validationData,
103
- valid,
96
+ importUrl,
97
+ exportUrl,
98
+ initialValues,
104
99
  } = this.props;
105
100
 
106
- const resetToDefault = ((dispatchFn, changeFn, nameOfForm) => (
107
- fieldName,
108
- value
109
- ) => {
110
- dispatchFn(changeFn(nameOfForm, fieldName, value));
111
- })(dispatch, change, NEW_TEMPLATE_SYNC_FORM_NAME);
101
+ const resetToDefault = (fieldName, fieldValue) => resetFn =>
102
+ resetFn(fieldName, fieldValue);
112
103
 
113
104
  return (
114
- <Form
115
- onSubmit={handleSubmit(submit(this.state.syncType))}
116
- disabled={submitting || (!valid && !error)}
117
- submitting={submitting}
118
- error={error}
105
+ <ForemanForm
106
+ onSubmit={(values, actions) => {
107
+ const url = this.state.syncType === 'import' ? importUrl : exportUrl;
108
+ return submitForm({
109
+ url,
110
+ values: values[this.state.syncType],
111
+ message: `Templates were ${this.state.syncType}ed.`,
112
+ item: 'TemplateSync',
113
+ }).then(args => {
114
+ history.replace({ pathname: '/template_syncs/result' });
115
+ });
116
+ }}
117
+ initialValues={initialValues}
118
+ validationSchema={syncFormSchema(
119
+ this.state.syncType,
120
+ { import: importSettings, export: exportSettings },
121
+ validationData
122
+ )}
119
123
  onCancel={redirectToResult(history)}
120
- errorTitle={
121
- error && error.severity === 'danger' ? __('Error! ') : __('Warning! ')
122
- }
124
+ error={error}
123
125
  >
124
126
  <SyncTypeRadios
125
127
  name="syncType"
126
128
  controlLabel="Action type"
127
129
  radios={this.initRadioButtons(this.state.syncType)}
128
- disabled={submitting}
129
130
  />
130
131
  <SyncSettingsFields
131
132
  importSettings={importSettings}
132
133
  exportSettings={exportSettings}
133
134
  syncType={this.state.syncType}
134
135
  resetField={resetToDefault}
135
- disabled={submitting}
136
- validationData={validationData}
137
136
  />
138
- </Form>
137
+ </ForemanForm>
139
138
  );
140
139
  }
141
140
  }
@@ -144,13 +143,13 @@ NewTemplateSyncForm.propTypes = {
144
143
  importSettings: PropTypes.array,
145
144
  exportSettings: PropTypes.array,
146
145
  userPermissions: PropTypes.object.isRequired,
147
- submitting: PropTypes.bool,
148
146
  error: PropTypes.object,
149
- handleSubmit: PropTypes.func.isRequired,
150
- dispatch: PropTypes.func,
151
147
  history: PropTypes.object,
152
148
  validationData: PropTypes.object,
153
- valid: PropTypes.bool.isRequired,
149
+ initialValues: PropTypes.object.isRequired,
150
+ exportUrl: PropTypes.string.isRequired,
151
+ importUrl: PropTypes.string.isRequired,
152
+ submitForm: PropTypes.func.isRequired,
154
153
  };
155
154
 
156
155
  NewTemplateSyncForm.defaultProps = {
@@ -158,8 +157,6 @@ NewTemplateSyncForm.defaultProps = {
158
157
  exportSettings: [],
159
158
  validationData: {},
160
159
  error: undefined,
161
- dispatch: () => {},
162
- submitting: false,
163
160
  history: {},
164
161
  };
165
162