foreman_scc_manager 5.0.3 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/app/assets/javascripts/foreman_scc_manager/locale/de/foreman_scc_manager.js +55 -256
- data/app/assets/javascripts/foreman_scc_manager/locale/el/foreman_scc_manager.js +43 -244
- data/app/assets/javascripts/foreman_scc_manager/locale/en/foreman_scc_manager.js +381 -2
- data/app/assets/javascripts/foreman_scc_manager/locale/fr/foreman_scc_manager.js +58 -259
- data/app/assets/javascripts/foreman_scc_manager/locale/ja/foreman_scc_manager.js +58 -259
- data/app/assets/javascripts/foreman_scc_manager/locale/ka/foreman_scc_manager.js +58 -259
- data/app/assets/javascripts/foreman_scc_manager/locale/ko/foreman_scc_manager.js +55 -256
- data/app/assets/javascripts/foreman_scc_manager/locale/zh_CN/foreman_scc_manager.js +58 -259
- data/app/controllers/api/v2/scc_accounts_controller.rb +4 -2
- data/app/models/scc_account.rb +1 -1
- data/app/views/scc_accounts/edit.html.erb +24 -2
- data/app/views/scc_accounts/new.html.erb +12 -1
- data/lib/foreman_scc_manager/version.rb +1 -1
- data/locale/de/LC_MESSAGES/foreman_scc_manager.mo +0 -0
- data/locale/de/foreman_scc_manager.po +55 -257
- data/locale/el/LC_MESSAGES/foreman_scc_manager.mo +0 -0
- data/locale/el/foreman_scc_manager.po +44 -246
- data/locale/en/LC_MESSAGES/foreman_scc_manager.mo +0 -0
- data/locale/en/foreman_scc_manager.po +392 -0
- data/locale/foreman_scc_manager.pot +195 -461
- data/locale/fr/LC_MESSAGES/foreman_scc_manager.mo +0 -0
- data/locale/fr/foreman_scc_manager.po +58 -260
- data/locale/ja/LC_MESSAGES/foreman_scc_manager.mo +0 -0
- data/locale/ja/foreman_scc_manager.po +58 -260
- data/locale/ka/LC_MESSAGES/foreman_scc_manager.mo +0 -0
- data/locale/ka/foreman_scc_manager.po +58 -260
- data/locale/ko/LC_MESSAGES/foreman_scc_manager.mo +0 -0
- data/locale/ko/foreman_scc_manager.po +55 -257
- data/locale/zh_CN/LC_MESSAGES/foreman_scc_manager.mo +0 -0
- data/locale/zh_CN/foreman_scc_manager.po +58 -260
- data/package.json +0 -1
- data/test/controllers/api/v2/scc_accounts_test.rb +5 -5
- data/webpack/components/SCCAccountForm/SCCAccountForm.scss +49 -0
- data/webpack/components/SCCAccountForm/SCCAccountFormActions.js +74 -0
- data/webpack/components/SCCAccountForm/components/DateTimeField.js +72 -0
- data/webpack/components/SCCAccountForm/components/SCCCredentialsCard.js +150 -0
- data/webpack/components/SCCAccountForm/components/SCCSyncSettingsCard.js +256 -0
- data/webpack/components/SCCAccountForm/components/SCCTokenRefreshCard.js +133 -0
- data/webpack/components/SCCAccountForm/index.js +306 -0
- data/webpack/components/SCCProductPage/components/SCCProductPicker/components/SCCGenericPicker/index.js +1 -1
- data/webpack/components/SCCProductPage/components/common/SCCGenericExpander/SCCGenericExpander.test.js +1 -1
- data/webpack/index.js +6 -0
- metadata +9 -18
- data/app/assets/javascripts/foreman_scc_manager/scc_accounts.js.coffee +0 -46
- data/app/views/scc_accounts/_form.html.erb +0 -51
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { useDispatch } from 'react-redux';
|
|
3
|
+
import { translate as __ } from 'foremanReact/common/I18n';
|
|
4
|
+
import { foremanUrl } from 'foremanReact/common/helpers';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import {
|
|
7
|
+
PageSection,
|
|
8
|
+
Title,
|
|
9
|
+
Form,
|
|
10
|
+
Button,
|
|
11
|
+
Stack,
|
|
12
|
+
StackItem,
|
|
13
|
+
} from '@patternfly/react-core';
|
|
14
|
+
|
|
15
|
+
import { formatDateTime } from './components/DateTimeField';
|
|
16
|
+
import SCCCredentialsCard from './components/SCCCredentialsCard';
|
|
17
|
+
import SCCTokenRefreshCard from './components/SCCTokenRefreshCard';
|
|
18
|
+
import SCCSyncSettingsCard from './components/SCCSyncSettingsCard';
|
|
19
|
+
import {
|
|
20
|
+
testSccConnectionAction,
|
|
21
|
+
submitSccAccountAction,
|
|
22
|
+
} from './SCCAccountFormActions';
|
|
23
|
+
import './SCCAccountForm.scss';
|
|
24
|
+
|
|
25
|
+
const SCCAccountForm = ({
|
|
26
|
+
organizationId,
|
|
27
|
+
intervalOptions,
|
|
28
|
+
downloadPolicyOptions,
|
|
29
|
+
mirroringPolicyOptions,
|
|
30
|
+
gpgKeyOptions,
|
|
31
|
+
selectedGpgKeyId,
|
|
32
|
+
initial,
|
|
33
|
+
}) => {
|
|
34
|
+
const isEdit = Boolean(initial?.id);
|
|
35
|
+
const dispatch = useDispatch();
|
|
36
|
+
|
|
37
|
+
const [openInterval, setOpenInterval] = useState(false);
|
|
38
|
+
const [openGpg, setOpenGpg] = useState(false);
|
|
39
|
+
const [openDownload, setOpenDownload] = useState(false);
|
|
40
|
+
const [openMirroring, setOpenMirroring] = useState(false);
|
|
41
|
+
|
|
42
|
+
const [name, setName] = useState(initial?.name ?? '');
|
|
43
|
+
const [login, setLogin] = useState(initial?.login ?? '');
|
|
44
|
+
const [password, setPassword] = useState(isEdit ? '********' : '');
|
|
45
|
+
|
|
46
|
+
const [baseUrl, setBaseUrl] = useState(
|
|
47
|
+
initial?.baseUrl ?? 'https://scc.suse.com'
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
const [refreshDate, setRefreshDate] = useState(initial?.refreshDate ?? '');
|
|
51
|
+
const [refreshTime, setRefreshTime] = useState(initial?.refreshTime ?? '');
|
|
52
|
+
|
|
53
|
+
const [testing, setTesting] = useState(false);
|
|
54
|
+
const [submitting, setSubmitting] = useState(false);
|
|
55
|
+
|
|
56
|
+
const [interval, setInterval] = useState(
|
|
57
|
+
initial?.interval ?? intervalOptions?.[0] ?? ''
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
const [gpgKey, setGpgKey] = useState(
|
|
61
|
+
initial?.gpgKey ?? selectedGpgKeyId ?? gpgKeyOptions?.[0]?.[0] ?? ''
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
const [downloadPolicy, setDownloadPolicy] = useState(
|
|
65
|
+
initial?.downloadPolicy ?? downloadPolicyOptions?.[0]?.[0] ?? ''
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
const [mirroringPolicy, setMirroringPolicy] = useState(
|
|
69
|
+
initial?.mirroringPolicy ?? mirroringPolicyOptions?.[0]?.[0] ?? ''
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
const handleUrl = (url) => {
|
|
73
|
+
if (!url) return;
|
|
74
|
+
try {
|
|
75
|
+
const parsed = new URL(url);
|
|
76
|
+
if (parsed.protocol === 'http:' || parsed.protocol === 'https:') {
|
|
77
|
+
setBaseUrl(url);
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
} catch {
|
|
81
|
+
// ignore parse errors
|
|
82
|
+
}
|
|
83
|
+
setBaseUrl(url);
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const buildPayload = () => {
|
|
87
|
+
const downloadPolicyValue =
|
|
88
|
+
downloadPolicyOptions.find(([label]) => label === downloadPolicy)?.[1] ??
|
|
89
|
+
downloadPolicy;
|
|
90
|
+
|
|
91
|
+
const mirroringPolicyValue =
|
|
92
|
+
mirroringPolicyOptions.find(
|
|
93
|
+
([label]) => label === mirroringPolicy
|
|
94
|
+
)?.[1] ?? mirroringPolicy;
|
|
95
|
+
|
|
96
|
+
const katelloGpgKeyId = !gpgKey
|
|
97
|
+
? null
|
|
98
|
+
: gpgKeyOptions.find(([label]) => label === gpgKey)?.[1] ?? null;
|
|
99
|
+
|
|
100
|
+
const payload = {
|
|
101
|
+
name,
|
|
102
|
+
login,
|
|
103
|
+
password: isEdit && password === '********' ? null : password,
|
|
104
|
+
base_url: baseUrl,
|
|
105
|
+
interval,
|
|
106
|
+
download_policy: downloadPolicyValue,
|
|
107
|
+
mirroring_policy: mirroringPolicyValue,
|
|
108
|
+
organization_id: organizationId,
|
|
109
|
+
katello_gpg_key_id: katelloGpgKeyId,
|
|
110
|
+
};
|
|
111
|
+
const sync = formatDateTime(refreshDate, refreshTime);
|
|
112
|
+
if (sync) payload.sync_date = sync;
|
|
113
|
+
|
|
114
|
+
return payload;
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
const handleSubmit = (e) => {
|
|
118
|
+
e.preventDefault();
|
|
119
|
+
if (submitting) return;
|
|
120
|
+
|
|
121
|
+
setSubmitting(true);
|
|
122
|
+
const payload = buildPayload();
|
|
123
|
+
|
|
124
|
+
const action = submitSccAccountAction({
|
|
125
|
+
isEdit,
|
|
126
|
+
organizationId,
|
|
127
|
+
updateUrl: `/api/v2/scc_accounts/${initial?.id}`,
|
|
128
|
+
payload,
|
|
129
|
+
onSuccess: (redirect) => {
|
|
130
|
+
setSubmitting(false);
|
|
131
|
+
window.location.href = redirect;
|
|
132
|
+
},
|
|
133
|
+
onError: () => setSubmitting(false),
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
dispatch(action);
|
|
137
|
+
};
|
|
138
|
+
const handleTestConnection = () => {
|
|
139
|
+
setTesting(true);
|
|
140
|
+
|
|
141
|
+
const action = testSccConnectionAction({
|
|
142
|
+
login: isEdit && login === initial?.login ? '' : login,
|
|
143
|
+
password: isEdit && password === '********' ? '' : password,
|
|
144
|
+
baseUrl: isEdit && baseUrl === initial?.baseUrl ? '' : baseUrl,
|
|
145
|
+
isEdit,
|
|
146
|
+
id: initial?.id,
|
|
147
|
+
onFinally: () => setTesting(false),
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
const dispatchedAction = dispatch(action);
|
|
151
|
+
if (dispatchedAction?.finally)
|
|
152
|
+
dispatchedAction.finally(() => setTesting(false));
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
return (
|
|
156
|
+
<PageSection
|
|
157
|
+
isFilled
|
|
158
|
+
className="scc-account-form-section"
|
|
159
|
+
ouiaId="scc-account-form-page-section"
|
|
160
|
+
>
|
|
161
|
+
<Title
|
|
162
|
+
headingLevel="h1"
|
|
163
|
+
className="scc-account-form-title"
|
|
164
|
+
ouiaId="scc-account-form-title"
|
|
165
|
+
>
|
|
166
|
+
SUSE Customer Center Account
|
|
167
|
+
</Title>
|
|
168
|
+
|
|
169
|
+
<Form
|
|
170
|
+
isWidthLimited
|
|
171
|
+
className="scc-account-form"
|
|
172
|
+
onSubmit={handleSubmit}
|
|
173
|
+
ouiaId="scc-account-form"
|
|
174
|
+
>
|
|
175
|
+
<Stack hasGutter ouiaId="scc-account-form-stack">
|
|
176
|
+
<StackItem ouiaId="scc-credentials-stack-item">
|
|
177
|
+
<SCCCredentialsCard
|
|
178
|
+
name={name}
|
|
179
|
+
login={login}
|
|
180
|
+
password={password}
|
|
181
|
+
baseUrl={baseUrl}
|
|
182
|
+
testing={testing}
|
|
183
|
+
onNameChange={setName}
|
|
184
|
+
onLoginChange={setLogin}
|
|
185
|
+
onPasswordChange={setPassword}
|
|
186
|
+
onBaseUrlChange={handleUrl}
|
|
187
|
+
onTestConnection={handleTestConnection}
|
|
188
|
+
/>
|
|
189
|
+
</StackItem>
|
|
190
|
+
|
|
191
|
+
<StackItem ouiaId="scc-token-refresh-stack-item">
|
|
192
|
+
<SCCTokenRefreshCard
|
|
193
|
+
interval={interval}
|
|
194
|
+
intervalOptions={intervalOptions}
|
|
195
|
+
openInterval={openInterval}
|
|
196
|
+
refreshDate={refreshDate}
|
|
197
|
+
refreshTime={refreshTime}
|
|
198
|
+
onIntervalChange={setInterval}
|
|
199
|
+
onIntervalOpenChange={setOpenInterval}
|
|
200
|
+
onRefreshDateChange={setRefreshDate}
|
|
201
|
+
onRefreshTimeChange={setRefreshTime}
|
|
202
|
+
/>
|
|
203
|
+
</StackItem>
|
|
204
|
+
|
|
205
|
+
<StackItem ouiaId="scc-sync-settings-stack-item">
|
|
206
|
+
<SCCSyncSettingsCard
|
|
207
|
+
gpgKey={gpgKey}
|
|
208
|
+
gpgKeyOptions={gpgKeyOptions}
|
|
209
|
+
openGpg={openGpg}
|
|
210
|
+
downloadPolicy={downloadPolicy}
|
|
211
|
+
downloadPolicyOptions={downloadPolicyOptions}
|
|
212
|
+
openDownload={openDownload}
|
|
213
|
+
mirroringPolicy={mirroringPolicy}
|
|
214
|
+
mirroringPolicyOptions={mirroringPolicyOptions}
|
|
215
|
+
openMirroring={openMirroring}
|
|
216
|
+
onGpgKeyChange={setGpgKey}
|
|
217
|
+
onGpgOpenChange={setOpenGpg}
|
|
218
|
+
onDownloadPolicyChange={setDownloadPolicy}
|
|
219
|
+
onDownloadOpenChange={setOpenDownload}
|
|
220
|
+
onMirroringPolicyChange={setMirroringPolicy}
|
|
221
|
+
onMirroringOpenChange={setOpenMirroring}
|
|
222
|
+
/>
|
|
223
|
+
</StackItem>
|
|
224
|
+
|
|
225
|
+
<StackItem ouiaId="scc-form-actions-stack-item">
|
|
226
|
+
<Button
|
|
227
|
+
variant="primary"
|
|
228
|
+
type="submit"
|
|
229
|
+
isDisabled={submitting}
|
|
230
|
+
ouiaId="scc-form-submit-button"
|
|
231
|
+
>
|
|
232
|
+
{__('Submit')}
|
|
233
|
+
</Button>{' '}
|
|
234
|
+
<Button
|
|
235
|
+
variant="link"
|
|
236
|
+
component="a"
|
|
237
|
+
href={foremanUrl('/scc_accounts')}
|
|
238
|
+
isDisabled={submitting}
|
|
239
|
+
ouiaId="scc-form-cancel-button"
|
|
240
|
+
>
|
|
241
|
+
{__('Cancel')}
|
|
242
|
+
</Button>
|
|
243
|
+
</StackItem>
|
|
244
|
+
</Stack>
|
|
245
|
+
</Form>
|
|
246
|
+
</PageSection>
|
|
247
|
+
);
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
SCCAccountForm.propTypes = {
|
|
251
|
+
organizationId: PropTypes.number.isRequired,
|
|
252
|
+
intervalOptions: PropTypes.arrayOf(PropTypes.string),
|
|
253
|
+
downloadPolicyOptions: PropTypes.arrayOf(
|
|
254
|
+
PropTypes.oneOfType([
|
|
255
|
+
PropTypes.exact({
|
|
256
|
+
label: PropTypes.string.isRequired,
|
|
257
|
+
value: PropTypes.string.isRequired,
|
|
258
|
+
}),
|
|
259
|
+
PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string])),
|
|
260
|
+
])
|
|
261
|
+
),
|
|
262
|
+
mirroringPolicyOptions: PropTypes.arrayOf(
|
|
263
|
+
PropTypes.oneOfType([
|
|
264
|
+
PropTypes.exact({
|
|
265
|
+
label: PropTypes.string.isRequired,
|
|
266
|
+
value: PropTypes.string.isRequired,
|
|
267
|
+
}),
|
|
268
|
+
PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string])),
|
|
269
|
+
])
|
|
270
|
+
),
|
|
271
|
+
gpgKeyOptions: PropTypes.arrayOf(
|
|
272
|
+
PropTypes.arrayOf(
|
|
273
|
+
PropTypes.oneOfType([
|
|
274
|
+
PropTypes.string,
|
|
275
|
+
PropTypes.number,
|
|
276
|
+
PropTypes.oneOf([null]),
|
|
277
|
+
])
|
|
278
|
+
)
|
|
279
|
+
),
|
|
280
|
+
selectedGpgKeyId: PropTypes.oneOfType([
|
|
281
|
+
PropTypes.number,
|
|
282
|
+
PropTypes.oneOf(['', null]),
|
|
283
|
+
]),
|
|
284
|
+
initial: PropTypes.shape({
|
|
285
|
+
id: PropTypes.number,
|
|
286
|
+
name: PropTypes.string,
|
|
287
|
+
login: PropTypes.string,
|
|
288
|
+
baseUrl: PropTypes.string,
|
|
289
|
+
interval: PropTypes.string,
|
|
290
|
+
downloadPolicy: PropTypes.string,
|
|
291
|
+
mirroringPolicy: PropTypes.string,
|
|
292
|
+
gpgKey: PropTypes.oneOfType([PropTypes.number, PropTypes.oneOf(['None'])]),
|
|
293
|
+
refreshDate: PropTypes.string,
|
|
294
|
+
refreshTime: PropTypes.string,
|
|
295
|
+
}),
|
|
296
|
+
};
|
|
297
|
+
|
|
298
|
+
SCCAccountForm.defaultProps = {
|
|
299
|
+
intervalOptions: [],
|
|
300
|
+
downloadPolicyOptions: [],
|
|
301
|
+
mirroringPolicyOptions: [],
|
|
302
|
+
gpgKeyOptions: [],
|
|
303
|
+
selectedGpgKeyId: '',
|
|
304
|
+
initial: {},
|
|
305
|
+
};
|
|
306
|
+
export default SCCAccountForm;
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
TextInputGroupUtilities,
|
|
13
13
|
Button,
|
|
14
14
|
} from '@patternfly/react-core';
|
|
15
|
-
import TimesIcon from '@patternfly/react-icons';
|
|
15
|
+
import { TimesIcon } from '@patternfly/react-icons';
|
|
16
16
|
import { translate as __ } from 'foremanReact/common/I18n';
|
|
17
17
|
|
|
18
18
|
const GenericSelector = ({
|
data/webpack/index.js
CHANGED
|
@@ -2,6 +2,12 @@ import componentRegistry from 'foremanReact/components/componentRegistry';
|
|
|
2
2
|
import injectReducer from 'foremanReact/redux/reducers/registerReducer';
|
|
3
3
|
import SCCProductPage from './components/SCCProductPage';
|
|
4
4
|
import reducer from './reducer';
|
|
5
|
+
import SCCAccountForm from './components/SCCAccountForm';
|
|
6
|
+
|
|
7
|
+
componentRegistry.register({
|
|
8
|
+
name: 'SCCAccountForm',
|
|
9
|
+
type: SCCAccountForm,
|
|
10
|
+
});
|
|
5
11
|
|
|
6
12
|
componentRegistry.register({
|
|
7
13
|
name: 'SCCProductPage',
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: foreman_scc_manager
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 5.0
|
|
4
|
+
version: 5.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- ATIX AG
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2025-
|
|
10
|
+
date: 2025-10-15 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: rdoc
|
|
@@ -57,20 +57,6 @@ dependencies:
|
|
|
57
57
|
- - ">="
|
|
58
58
|
- !ruby/object:Gem::Version
|
|
59
59
|
version: '0'
|
|
60
|
-
- !ruby/object:Gem::Dependency
|
|
61
|
-
name: coffee-rails
|
|
62
|
-
requirement: !ruby/object:Gem::Requirement
|
|
63
|
-
requirements:
|
|
64
|
-
- - "~>"
|
|
65
|
-
- !ruby/object:Gem::Version
|
|
66
|
-
version: 5.0.0
|
|
67
|
-
type: :runtime
|
|
68
|
-
prerelease: false
|
|
69
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
70
|
-
requirements:
|
|
71
|
-
- - "~>"
|
|
72
|
-
- !ruby/object:Gem::Version
|
|
73
|
-
version: 5.0.0
|
|
74
60
|
- !ruby/object:Gem::Dependency
|
|
75
61
|
name: katello
|
|
76
62
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -104,7 +90,6 @@ files:
|
|
|
104
90
|
- app/assets/javascripts/foreman_scc_manager/locale/ka/foreman_scc_manager.js
|
|
105
91
|
- app/assets/javascripts/foreman_scc_manager/locale/ko/foreman_scc_manager.js
|
|
106
92
|
- app/assets/javascripts/foreman_scc_manager/locale/zh_CN/foreman_scc_manager.js
|
|
107
|
-
- app/assets/javascripts/foreman_scc_manager/scc_accounts.js.coffee
|
|
108
93
|
- app/controllers/api/v2/scc_accounts_controller.rb
|
|
109
94
|
- app/controllers/api/v2/scc_products_controller.rb
|
|
110
95
|
- app/controllers/scc_accounts_controller.rb
|
|
@@ -133,7 +118,6 @@ files:
|
|
|
133
118
|
- app/views/api/v2/scc_products/main.json.rabl
|
|
134
119
|
- app/views/api/v2/scc_products/show.json.rabl
|
|
135
120
|
- app/views/scc_account_sync_plan_task_groups/_scc_account_sync_plan_task_groups.html.erb
|
|
136
|
-
- app/views/scc_accounts/_form.html.erb
|
|
137
121
|
- app/views/scc_accounts/edit.html.erb
|
|
138
122
|
- app/views/scc_accounts/index.html.erb
|
|
139
123
|
- app/views/scc_accounts/new.html.erb
|
|
@@ -212,6 +196,13 @@ files:
|
|
|
212
196
|
- test/support/fixtures_support.rb
|
|
213
197
|
- test/test_plugin_helper.rb
|
|
214
198
|
- test/unit/foreman_scc_manager_test.rb
|
|
199
|
+
- webpack/components/SCCAccountForm/SCCAccountForm.scss
|
|
200
|
+
- webpack/components/SCCAccountForm/SCCAccountFormActions.js
|
|
201
|
+
- webpack/components/SCCAccountForm/components/DateTimeField.js
|
|
202
|
+
- webpack/components/SCCAccountForm/components/SCCCredentialsCard.js
|
|
203
|
+
- webpack/components/SCCAccountForm/components/SCCSyncSettingsCard.js
|
|
204
|
+
- webpack/components/SCCAccountForm/components/SCCTokenRefreshCard.js
|
|
205
|
+
- webpack/components/SCCAccountForm/index.js
|
|
215
206
|
- webpack/components/SCCProductPage/EmptySccProducts.js
|
|
216
207
|
- webpack/components/SCCProductPage/SCCProductPage.js
|
|
217
208
|
- webpack/components/SCCProductPage/SCCProductPageActions.js
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
scc_products_after_checked = (target) ->
|
|
2
|
-
if target.parentNode.dataset.parent
|
|
3
|
-
parent = $("#" + target.parentNode.dataset.parent + " input")[0]
|
|
4
|
-
if !parent.checked && !parent.disabled
|
|
5
|
-
parent.checked = true
|
|
6
|
-
scc_products_after_checked(parent)
|
|
7
|
-
|
|
8
|
-
scc_products_after_unchecked = (target) ->
|
|
9
|
-
$("span.scc_product_checkbox input", target.parentNode.parentNode).each (index, child) ->
|
|
10
|
-
if child.checked && !child.disabled
|
|
11
|
-
child.checked = false
|
|
12
|
-
scc_products_after_unchecked(child)
|
|
13
|
-
|
|
14
|
-
$ ->
|
|
15
|
-
$("body").on "change", "span.scc_product_checkbox input", (event) ->
|
|
16
|
-
target = event.target
|
|
17
|
-
if target.checked
|
|
18
|
-
scc_products_after_checked target
|
|
19
|
-
else
|
|
20
|
-
scc_products_after_unchecked target
|
|
21
|
-
$("body").on "click", "a.edit_deferrer", (event) ->
|
|
22
|
-
event.preventDefault()
|
|
23
|
-
$("a.edit_deferree", $(event.target).closest("tr"))[0].click()
|
|
24
|
-
$("body").on "click", "#test_scc_connection_btn", (event) ->
|
|
25
|
-
$('.tab-error').removeClass('tab-error')
|
|
26
|
-
$('#connection_test_result')[0].innerHTML = ''
|
|
27
|
-
$('#test_scc_connection_indicator').show()
|
|
28
|
-
$.ajax event.target.parentNode.dataset['url'],
|
|
29
|
-
type: 'POST'
|
|
30
|
-
dataType: 'JSON'
|
|
31
|
-
data: $('form').serialize()
|
|
32
|
-
success: (result) ->
|
|
33
|
-
$('#test_scc_connection_btn').addClass('btn-success')
|
|
34
|
-
$('#test_scc_connection_btn').removeClass('btn-default')
|
|
35
|
-
$('#test_scc_connection_btn').removeClass('btn-danger')
|
|
36
|
-
error: (result) ->
|
|
37
|
-
$('#test_scc_connection_btn').addClass('btn-danger')
|
|
38
|
-
$('#test_scc_connection_btn').removeClass('btn-default')
|
|
39
|
-
$('#test_scc_connection_btn').removeClass('btn-success')
|
|
40
|
-
$('#scc_account_login').closest('.form-group').addClass('tab-error')
|
|
41
|
-
$('#scc_account_password').closest('.form-group').addClass('tab-error')
|
|
42
|
-
$('#scc_account_base_url').closest('.form-group').addClass('tab-error')
|
|
43
|
-
$('#connection_test_result')[0].innerHTML = 'Connection test failed!'
|
|
44
|
-
$('#scc_account_login').focus()
|
|
45
|
-
complete: (result) ->
|
|
46
|
-
$('#test_scc_connection_indicator').hide()
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
<!-- see foreman/app/helper/form_helper.rb -->
|
|
2
|
-
<% javascript 'foreman_scc_manager/scc_accounts' %>
|
|
3
|
-
|
|
4
|
-
<%= form_for(@scc_account) do |f| %>
|
|
5
|
-
<%= base_errors_for @scc_account %>
|
|
6
|
-
<ul class="nav nav-tabs" data-tabs="tabs">
|
|
7
|
-
<li class="active"><a href="#primary" data-toggle="tab"><%= _("SUSE Customer Center account") %></a></li>
|
|
8
|
-
</ul>
|
|
9
|
-
|
|
10
|
-
<div class="tab-content">
|
|
11
|
-
<div class="tab-pane active" id="primary">
|
|
12
|
-
<div>
|
|
13
|
-
<%= text_f f, :name %>
|
|
14
|
-
<%= text_f f, :login, :help_block => _("Use your 'Organization credentials' obtained from the SUSE Customer Center.") %>
|
|
15
|
-
<%= password_f f, :password %>
|
|
16
|
-
<%= text_f f, :base_url, label: _('Base URL') %>
|
|
17
|
-
<%= selectable_f f, :interval, SccAccount::TYPES, {},
|
|
18
|
-
{ :label => _('Token refresh interval'), :help_block => _("The token refresh interval is used to periodically update the SCC authentication tokens of any imported products.") } %>
|
|
19
|
-
<%= field f, :sync_date, label: _('Token refresh time'), :help_block => _("Specifies the daily time when the SCC authentication token refresh process starts. Set this to a time outside of business hours (e.g., during the night) to minimize disruption.") do
|
|
20
|
-
f.datetime_field :sync_date, placeholder: Time.now
|
|
21
|
-
end %>
|
|
22
|
-
<%= selectable_f f, :katello_gpg_key_id, @selectable_gpg_keys, {},
|
|
23
|
-
{ :include_blank => _("None"),
|
|
24
|
-
:label => _('Use GPG key for SUSE products'),
|
|
25
|
-
:selected => @scc_account.katello_gpg_key_id,
|
|
26
|
-
:help_block => _("Use this setting if you want to automatically add a GPG key to your SUSE products upon subscription. You can change this setting in the 'Content' > 'Products' menu, later.") } %>
|
|
27
|
-
<%= selectable_f f, :download_policy, SccAccount::download_policy_selection_values,
|
|
28
|
-
{ :label => _('Download Policy'), :help_block => _("The default download policy for repositories which were created using this SCC Account.") } %>
|
|
29
|
-
<%= selectable_f f, :mirroring_policy, SccAccount::mirroring_policy_selection_values,
|
|
30
|
-
{ :label => _('Mirroring Policy'), :help_block => _("The default mirroring policy for repositories which were created using this SCC Account.") } %>
|
|
31
|
-
<div class='clearfix'>
|
|
32
|
-
<div class='form-group'>
|
|
33
|
-
<div class='col-md-2'></div>
|
|
34
|
-
<div class='col-md-4'>
|
|
35
|
-
<%= spinner_button_f(f, _('Test Connection'), '',
|
|
36
|
-
id: 'test_scc_connection_btn',
|
|
37
|
-
spinner_id: 'test_scc_connection_indicator',
|
|
38
|
-
class: 'btn-default',
|
|
39
|
-
'data-url': @scc_account.id ? test_connection_scc_account_path : test_connection_scc_accounts_path ) %>
|
|
40
|
-
</div>
|
|
41
|
-
<div class='col-md-2'>
|
|
42
|
-
<span id='connection_test_result'></span>
|
|
43
|
-
</div>
|
|
44
|
-
</div>
|
|
45
|
-
</div>
|
|
46
|
-
<%= f.hidden_field :organization_id %>
|
|
47
|
-
<%= submit_or_cancel f %>
|
|
48
|
-
</div>
|
|
49
|
-
</div>
|
|
50
|
-
</div>
|
|
51
|
-
<% end %>
|