katello 4.5.0.rc1 → 4.5.0.rc2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of katello might be problematic. Click here for more details.

Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/katello/hosts/activation_key_edit.js +9 -2
  3. data/app/controllers/katello/api/registry/registry_proxies_controller.rb +3 -0
  4. data/app/controllers/katello/api/v2/alternate_content_sources_bulk_actions_controller.rb +44 -0
  5. data/app/controllers/katello/api/v2/alternate_content_sources_controller.rb +29 -6
  6. data/app/controllers/katello/api/v2/content_view_components_controller.rb +1 -1
  7. data/app/controllers/katello/api/v2/content_view_repositories_controller.rb +1 -1
  8. data/app/controllers/katello/api/v2/repositories_controller.rb +2 -8
  9. data/app/lib/actions/katello/alternate_content_source/refresh.rb +27 -0
  10. data/app/lib/actions/katello/cdn_configuration/update.rb +1 -1
  11. data/app/lib/actions/katello/content_view/publish.rb +1 -1
  12. data/app/lib/actions/katello/organization/manifest_refresh.rb +1 -1
  13. data/app/lib/actions/pulp3/alternate_content_source/delete.rb +2 -2
  14. data/app/lib/actions/pulp3/alternate_content_source/delete_remote.rb +2 -2
  15. data/app/lib/actions/pulp3/alternate_content_source/refresh.rb +23 -0
  16. data/app/lib/actions/pulp3/alternate_content_source/update.rb +2 -2
  17. data/app/lib/actions/pulp3/alternate_content_source/update_remote.rb +2 -2
  18. data/app/lib/actions/pulp3/orchestration/alternate_content_source/create.rb +0 -2
  19. data/app/lib/actions/pulp3/orchestration/alternate_content_source/refresh.rb +15 -0
  20. data/app/lib/actions/pulp3/orchestration/alternate_content_source/update.rb +0 -2
  21. data/app/lib/actions/pulp3/repository/refresh_distribution.rb +1 -4
  22. data/app/lib/actions/pulp3/repository/save_artifact.rb +1 -1
  23. data/app/lib/actions/pulp3/repository/save_distribution_references.rb +0 -2
  24. data/app/models/katello/alternate_content_source.rb +5 -0
  25. data/app/services/katello/pulp3/alternate_content_source.rb +6 -0
  26. data/app/services/katello/pulp3/content_view_version/metadata_map.rb +1 -1
  27. data/app/services/katello/pulp3/repository.rb +29 -1
  28. data/app/views/katello/api/v2/alternate_content_sources/base.json.rabl +10 -1
  29. data/app/views/katello/api/v2/content_facet/show.json.rabl +12 -0
  30. data/app/views/katello/api/v2/repository_sets/show.json.rabl +4 -0
  31. data/config/routes/api/v2.rb +16 -4
  32. data/db/migrate/20220303160220_remove_duplicate_errata.rb +1 -1
  33. data/db/migrate/20220428203334_add_last_refreshed_to_katello_alternate_content_sources.rb +5 -0
  34. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/capsule-content/capsule-content.controller.js +1 -1
  35. data/lib/katello/permission_creator.rb +4 -2
  36. data/lib/katello/tasks/refresh_alternate_content_sources.rake +10 -0
  37. data/lib/katello/version.rb +1 -1
  38. data/webpack/components/Bookmark/index.js +22 -14
  39. data/webpack/components/Search/Search.js +4 -0
  40. data/webpack/components/Table/MainTable.scss +5 -1
  41. data/webpack/components/Table/TableWrapper.js +5 -1
  42. data/webpack/components/TypeAhead/TypeAhead.js +4 -0
  43. data/webpack/components/TypeAhead/pf4Search/TypeAheadSearch.js +2 -0
  44. data/webpack/components/extensions/HostDetails/Cards/ContentViewDetailsCard/ChangeHostCVModal.js +2 -8
  45. data/webpack/components/extensions/HostDetails/Cards/ContentViewDetailsCard/ContentViewDetailsCard.js +41 -11
  46. data/webpack/components/extensions/HostDetails/Cards/HostCollectionsCard/HostCollectionsActions.js +2 -2
  47. data/webpack/components/extensions/HostDetails/Cards/HostCollectionsCard/HostCollectionsCard.js +32 -13
  48. data/webpack/components/extensions/HostDetails/Cards/HostCollectionsCard/__tests__/hostCollectionsCard.test.js +8 -0
  49. data/webpack/components/extensions/HostDetails/DetailsTabCards/RecentCommunicationCardExtensions.js +37 -0
  50. data/webpack/components/extensions/HostDetails/HostDetailsActions.js +11 -0
  51. data/webpack/components/extensions/HostDetails/Tabs/ContentTab/SecondaryTabsRoutes.js +4 -0
  52. data/webpack/components/extensions/HostDetails/Tabs/ContentTab/constants.js +2 -0
  53. data/webpack/components/extensions/HostDetails/Tabs/ContentTab/index.js +6 -1
  54. data/webpack/components/extensions/HostDetails/Tabs/ErrataTab/ErrataTab.js +120 -51
  55. data/webpack/components/extensions/HostDetails/Tabs/ModuleStreamsTab/ModuleStreamsTab.js +71 -37
  56. data/webpack/components/extensions/HostDetails/Tabs/PackagesTab/PackageInstallModal.js +4 -3
  57. data/webpack/components/extensions/HostDetails/Tabs/PackagesTab/PackagesTab.js +117 -40
  58. data/webpack/components/extensions/HostDetails/Tabs/RemoteExecutionActions.js +25 -3
  59. data/webpack/components/extensions/HostDetails/Tabs/RemoteExecutionHooks.js +85 -0
  60. data/webpack/components/extensions/HostDetails/Tabs/RepositorySetsTab/RepositorySetsTab.js +87 -33
  61. data/webpack/components/extensions/HostDetails/Tabs/TracesTab/EnableTracerModal.js +14 -7
  62. data/webpack/components/extensions/HostDetails/Tabs/TracesTab/HostTracesActions.js +2 -1
  63. data/webpack/components/extensions/HostDetails/Tabs/TracesTab/TracesEnabler.js +104 -0
  64. data/webpack/components/extensions/HostDetails/Tabs/TracesTab/TracesTab.js +92 -51
  65. data/webpack/components/extensions/HostDetails/Tabs/__tests__/errataTab.test.js +13 -23
  66. data/webpack/components/extensions/HostDetails/Tabs/{ModuleStreamsTab/__tests__/modules.fixtures.json → __tests__/moduleStreams.fixtures.json} +0 -0
  67. data/webpack/components/extensions/HostDetails/Tabs/{ModuleStreamsTab/__tests__ → __tests__}/moduleStreamsTab.test.js +13 -6
  68. data/webpack/components/extensions/HostDetails/Tabs/__tests__/packageInstallModal.test.js +21 -15
  69. data/webpack/components/extensions/HostDetails/Tabs/__tests__/packagesTab.test.js +8 -0
  70. data/webpack/components/extensions/HostDetails/Tabs/__tests__/repositorySets.fixtures.json +4 -1
  71. data/webpack/components/extensions/HostDetails/Tabs/__tests__/repositorySetsTab.test.js +26 -0
  72. data/webpack/components/extensions/HostDetails/Tabs/__tests__/tracesTab.test.js +7 -4
  73. data/webpack/components/extensions/HostDetails/hostDetailsHelpers.js +18 -0
  74. data/webpack/global_index.js +2 -2
  75. data/webpack/redux/actions/RedHatRepositories/helpers.js +5 -1
  76. data/webpack/scenes/AlternateContentSources/ACSActions.js +13 -1
  77. data/webpack/scenes/AlternateContentSources/ACSConstants.js +14 -0
  78. data/webpack/scenes/AlternateContentSources/ACSSelectors.js +10 -1
  79. data/webpack/scenes/AlternateContentSources/Create/ACSCreateContext.js +4 -0
  80. data/webpack/scenes/AlternateContentSources/Create/ACSCreateWizard.js +160 -0
  81. data/webpack/scenes/AlternateContentSources/Create/Steps/ACSCreateFinish.js +79 -0
  82. data/webpack/scenes/AlternateContentSources/Create/Steps/ACSCredentials.js +199 -0
  83. data/webpack/scenes/AlternateContentSources/Create/Steps/ACSReview.js +104 -0
  84. data/webpack/scenes/AlternateContentSources/Create/Steps/ACSSmartProxies.js +41 -0
  85. data/webpack/scenes/AlternateContentSources/Create/Steps/AcsUrlPaths.js +71 -0
  86. data/webpack/scenes/AlternateContentSources/Create/Steps/NameACS.js +57 -0
  87. data/webpack/scenes/AlternateContentSources/Create/Steps/SelectSource.js +77 -0
  88. data/webpack/scenes/AlternateContentSources/Create/__tests__/acsCreate.test.js +149 -0
  89. data/webpack/scenes/AlternateContentSources/Create/__tests__/acsCreateData.fixtures.json +3 -0
  90. data/webpack/scenes/AlternateContentSources/Create/__tests__/contentCredentials.fixtures.json +69 -0
  91. data/webpack/scenes/AlternateContentSources/Create/__tests__/smartProxy.fixtures.json +65 -0
  92. data/webpack/scenes/AlternateContentSources/MainTable/ACSTable.js +33 -23
  93. data/webpack/scenes/ContentCredentials/ContentCredentialSelectors.js +4 -1
  94. data/webpack/scenes/ContentViews/Create/CreateContentViewForm.js +2 -2
  95. data/webpack/scenes/ContentViews/Create/__tests__/createContentView.test.js +1 -1
  96. data/webpack/scenes/ContentViews/Details/ComponentContentViews/ComponentContentViewAddModal.js +1 -1
  97. data/webpack/scenes/ContentViews/Details/ComponentContentViews/ComponentContentViewBulkAddModal.js +2 -2
  98. data/webpack/scenes/ContentViews/Details/ComponentContentViews/__tests__/contentViewComponents.test.js +4 -4
  99. data/webpack/scenes/ContentViews/Details/ContentViewInfo.js +1 -1
  100. data/webpack/scenes/ContentViews/__tests__/contentViewPage.test.js +4 -4
  101. data/webpack/scenes/ContentViews/components/ContentViewIcon.js +1 -1
  102. data/webpack/scenes/ContentViews/components/ContentViewsCounter.js +1 -1
  103. data/webpack/scenes/ContentViews/components/EnvironmentPaths/EnvironmentPaths.js +1 -1
  104. data/webpack/scenes/ContentViews/expansions/DetailsExpansion.js +2 -2
  105. data/webpack/scenes/ContentViews/expansions/RelatedContentViewComponentsModal.js +2 -2
  106. data/webpack/scenes/ContentViews/expansions/__tests__/contentViewComponentsModal.test.js +1 -1
  107. data/webpack/scenes/RedHatRepositories/components/Search.js +4 -4
  108. data/webpack/scenes/SmartProxy/SmartProxyContentActions.js +9 -2
  109. data/webpack/scenes/SmartProxy/SmartProxyContentConstants.js +1 -1
  110. data/webpack/scenes/SmartProxy/SmartProxyContentSelectors.js +10 -1
  111. data/webpack/scenes/Tasks/helpers.js +30 -3
  112. metadata +34 -14
  113. data/db/seeds.d/107-enable_dynflow.rb +0 -8
  114. data/webpack/components/extensions/HostDetails/Tabs/TracesTab/EnableTracerEmptyState.js +0 -42
@@ -0,0 +1,199 @@
1
+ import React, { useContext } from 'react';
2
+ import { useSelector } from 'react-redux';
3
+ import { translate as __ } from 'foremanReact/common/I18n';
4
+ import {
5
+ Form,
6
+ FormGroup,
7
+ FormSelect,
8
+ FormSelectOption,
9
+ TextInput,
10
+ Radio,
11
+ } from '@patternfly/react-core';
12
+ import { STATUS } from 'foremanReact/constants';
13
+ import ACSCreateContext from '../ACSCreateContext';
14
+ import WizardHeader from '../../../ContentViews/components/WizardHeader';
15
+ import { selectContentCredentials, selectContentCredentialsStatus } from '../../../ContentCredentials/ContentCredentialSelectors';
16
+ import Loading from '../../../../components/Loading';
17
+
18
+ const ACSCredentials = () => {
19
+ const {
20
+ authentication, setAuthentication, username, setUsername, password, setPassword,
21
+ sslCert, setSslCert, sslKey, setSslKey, caCert, setCACert,
22
+ setSslCertName, setSslKeyName, setCACertName,
23
+ } = useContext(ACSCreateContext);
24
+
25
+ const contentCredentials = useSelector(selectContentCredentials);
26
+ const contentCredentialsStatus = useSelector(selectContentCredentialsStatus);
27
+
28
+ if (contentCredentialsStatus === STATUS.PENDING) {
29
+ return <Loading loadingText={__('Fetching content credentials')} />;
30
+ }
31
+
32
+ const getCertName = id => contentCredentials?.filter(cc => Number(cc.id) === Number(id))[0]?.name;
33
+
34
+ return (
35
+ <>
36
+ <WizardHeader
37
+ title={__('Credentials')}
38
+ description={__('Enter basic authentication information or choose content credentials if required for this source.')}
39
+ />
40
+ <Form>
41
+ <Radio
42
+ label={__('Manual authentication')}
43
+ id="manual_auth"
44
+ name="manual_auth"
45
+ aria-label="manual_auth"
46
+ isChecked={authentication === 'manual'}
47
+ onChange={() => {
48
+ setAuthentication('manual');
49
+ setSslCert('');
50
+ setSslKey('');
51
+ setSslCertName('');
52
+ setSslKeyName('');
53
+ }}
54
+ />
55
+ {(authentication === 'manual') &&
56
+ <>
57
+ <FormGroup
58
+ label={__('Username')}
59
+ type="string"
60
+ fieldId="acs_username"
61
+ isRequired
62
+ >
63
+ <TextInput
64
+ isRequired
65
+ type="text"
66
+ id="acs_username_field"
67
+ name="acs_username_field"
68
+ aria-label="acs_username_field"
69
+ value={username}
70
+ onChange={(value) => { setUsername(value); }}
71
+ />
72
+
73
+ </FormGroup>
74
+ <FormGroup
75
+ label={__('Password')}
76
+ type="password"
77
+ fieldId="acs_password"
78
+ >
79
+ <TextInput
80
+ isRequired
81
+ type="password"
82
+ id="acs_password_field"
83
+ name="acs_password_field"
84
+ aria-label="acs_password_field"
85
+ value={password}
86
+ onChange={(value) => { setPassword(value); }}
87
+ />
88
+ </FormGroup>
89
+ </>
90
+ }
91
+ <Radio
92
+ label={__('Content credentials')}
93
+ id="content_credentials"
94
+ aria-label="content_credentials"
95
+ name="content_cred_auth"
96
+ isChecked={authentication === 'content_credentials'}
97
+ onChange={() => {
98
+ setAuthentication('content_credentials');
99
+ setUsername('');
100
+ setPassword('');
101
+ }}
102
+ />
103
+ {(authentication === 'content_credentials') &&
104
+ <>
105
+ <FormGroup
106
+ label={__('SSL client certificate')}
107
+ type="string"
108
+ fieldId="client_cert"
109
+ >
110
+ <FormSelect isRequired value={sslCert} onChange={(value) => { setSslCert(value); setSslCertName(getCertName(value)); }} aria-label="sslCert_select">
111
+ {
112
+ [
113
+ <FormSelectOption
114
+ key="placeholder"
115
+ value=""
116
+ label={__('Select a client certificate')}
117
+ isDisabled
118
+ />,
119
+ ].concat(contentCredentials?.map(cc => (
120
+ <FormSelectOption
121
+ key={cc.id}
122
+ value={cc.id}
123
+ label={cc.name}
124
+ />
125
+ )))
126
+ }
127
+ </FormSelect>
128
+ </FormGroup>
129
+ <FormGroup
130
+ label={__('SSL client key')}
131
+ type="string"
132
+ fieldId="client_key"
133
+ >
134
+ <FormSelect isRequired value={sslKey} onChange={(value) => { setSslKey(value); setSslKeyName(getCertName(value)); }} aria-label="sslKey_select">
135
+ {
136
+ [
137
+ <FormSelectOption
138
+ key="placeholder"
139
+ value=""
140
+ label={__('Select a client key')}
141
+ isDisabled
142
+ />,
143
+ ].concat(contentCredentials?.map(cc => (
144
+ <FormSelectOption
145
+ key={cc.id}
146
+ value={cc.id}
147
+ label={cc.name}
148
+ />
149
+ )))
150
+ }
151
+ </FormSelect>
152
+ </FormGroup>
153
+ </>
154
+ }
155
+ <Radio
156
+ label={__('None')}
157
+ id="none"
158
+ name="none"
159
+ aria-label="none"
160
+ isChecked={authentication === ''}
161
+ onChange={() => {
162
+ setAuthentication('');
163
+ setSslCert('');
164
+ setSslKey('');
165
+ setSslCertName('');
166
+ setSslKeyName('');
167
+ setUsername('');
168
+ setPassword('');
169
+ }}
170
+ />
171
+ <FormGroup
172
+ label={__('SSL CA certificate')}
173
+ type="string"
174
+ fieldId="ca_cert"
175
+ >
176
+ <FormSelect isRequired value={caCert} onChange={(value) => { setCACert(value); setCACertName(getCertName(value)); }} aria-label="sslCAcert_select">
177
+ {
178
+ [
179
+ <FormSelectOption
180
+ key="placeholder"
181
+ value=""
182
+ label={__('Select a CA certificate')}
183
+ />,
184
+ ].concat(contentCredentials?.map(cc => (
185
+ <FormSelectOption
186
+ key={cc.id}
187
+ value={cc.id}
188
+ label={cc.name}
189
+ />
190
+ )))
191
+ }
192
+ </FormSelect>
193
+ </FormGroup>
194
+ </Form>
195
+ </>
196
+ );
197
+ };
198
+
199
+ export default ACSCredentials;
@@ -0,0 +1,104 @@
1
+ import React, { useContext } from 'react';
2
+ import { translate as __ } from 'foremanReact/common/I18n';
3
+ import {
4
+ TextContent,
5
+ TextList,
6
+ TextListVariants,
7
+ TextListItem,
8
+ TextListItemVariants,
9
+ } from '@patternfly/react-core';
10
+ import ACSCreateContext from '../ACSCreateContext';
11
+ import WizardHeader from '../../../ContentViews/components/WizardHeader';
12
+
13
+ const ACSReview = () => {
14
+ const {
15
+ name, description, acsType, contentType,
16
+ smartProxies, url, subpaths, verifySSL,
17
+ authentication, sslCertName, sslKeyName, username,
18
+ password, caCertName,
19
+ } = useContext(ACSCreateContext);
20
+
21
+ return (
22
+ <>
23
+ <WizardHeader
24
+ title={__('Review Details')}
25
+ description={__('Review the information below and click Add to add your source. ' +
26
+ 'To edit details in previous steps, click Back or any step on the left.')}
27
+ />
28
+ <TextContent>
29
+ <TextList component={TextListVariants.dl}>
30
+ <TextListItem component={TextListItemVariants.dt}>{__('Name')}</TextListItem>
31
+ <TextListItem component={TextListItemVariants.dd}>
32
+ {name}
33
+ </TextListItem>
34
+ <TextListItem component={TextListItemVariants.dt}>{__('Source type')}</TextListItem>
35
+ <TextListItem component={TextListItemVariants.dd}>
36
+ {acsType}
37
+ </TextListItem>
38
+ <TextListItem component={TextListItemVariants.dt}>{__('Description')}</TextListItem>
39
+ <TextListItem component={TextListItemVariants.dd}>
40
+ {description}
41
+ </TextListItem>
42
+ <TextListItem component={TextListItemVariants.dt}>{__('Content type')}</TextListItem>
43
+ <TextListItem component={TextListItemVariants.dd}>
44
+ {contentType}
45
+ </TextListItem>
46
+ <TextListItem component={TextListItemVariants.dt}>{__('Smart proxies')}</TextListItem>
47
+ <TextListItem component={TextListItemVariants.dd}>
48
+ {smartProxies}
49
+ </TextListItem>
50
+ <TextListItem component={TextListItemVariants.dt}>{__('Base URL')}</TextListItem>
51
+ <TextListItem component={TextListItemVariants.dd}>
52
+ {url}
53
+ </TextListItem>
54
+ <TextListItem component={TextListItemVariants.dt}>{__('Subpaths')}</TextListItem>
55
+ <TextListItem component={TextListItemVariants.dd}>
56
+ {subpaths}
57
+ </TextListItem>
58
+ <TextListItem component={TextListItemVariants.dt}>{__('Verify SSL')}</TextListItem>
59
+ <TextListItem component={TextListItemVariants.dd}>
60
+ {verifySSL ? __('Yes') : __('No')}
61
+ </TextListItem>
62
+ <TextListItem component={TextListItemVariants.dt}>{__('CA Cert')}</TextListItem>
63
+ <TextListItem component={TextListItemVariants.dd}>
64
+ {caCertName}
65
+ </TextListItem>
66
+ {authentication === 'manual' && (
67
+ <>
68
+ <TextListItem component={TextListItemVariants.dt}>{__('Authentication type')}</TextListItem>
69
+ <TextListItem component={TextListItemVariants.dd}>
70
+ {__('Manual')}
71
+ </TextListItem>
72
+ <TextListItem component={TextListItemVariants.dt}>{__('Username')}</TextListItem>
73
+ <TextListItem component={TextListItemVariants.dd}>
74
+ {username}
75
+ </TextListItem>
76
+ <TextListItem component={TextListItemVariants.dt}>{__('Password')}</TextListItem>
77
+ <TextListItem component={TextListItemVariants.dd}>
78
+ {password}
79
+ </TextListItem>
80
+ </>
81
+ )}
82
+ {authentication === 'content_credentials' && (
83
+ <>
84
+ <TextListItem component={TextListItemVariants.dt}>{__('Authentication type')}</TextListItem>
85
+ <TextListItem component={TextListItemVariants.dd}>
86
+ {__('Content credential')}
87
+ </TextListItem>
88
+ <TextListItem component={TextListItemVariants.dt}>{__('SSL Cert')}</TextListItem>
89
+ <TextListItem component={TextListItemVariants.dd}>
90
+ {sslCertName}
91
+ </TextListItem>
92
+ <TextListItem component={TextListItemVariants.dt}>{__('Client key')}</TextListItem>
93
+ <TextListItem component={TextListItemVariants.dd}>
94
+ {sslKeyName}
95
+ </TextListItem>
96
+ </>
97
+ )}
98
+ </TextList>
99
+ </TextContent>
100
+ </>
101
+ );
102
+ };
103
+
104
+ export default ACSReview;
@@ -0,0 +1,41 @@
1
+ import React, { useContext, useState } from 'react';
2
+ import { useSelector } from 'react-redux';
3
+ import { translate as __ } from 'foremanReact/common/I18n';
4
+ import { DualListSelector } from '@patternfly/react-core';
5
+ import ACSCreateContext from '../ACSCreateContext';
6
+ import WizardHeader from '../../../ContentViews/components/WizardHeader';
7
+ import { selectSmartProxy } from '../../../SmartProxy/SmartProxyContentSelectors';
8
+
9
+ const ACSSmartProxies = () => {
10
+ const {
11
+ smartProxies, setSmartProxies,
12
+ } = useContext(ACSCreateContext);
13
+ const availableSmartProxies = useSelector(selectSmartProxy);
14
+ const { results } = availableSmartProxies;
15
+ const [availableOptions, setAvailableOptions] = useState(results?.map(proxy => proxy.name));
16
+ const onListChange = (newAvailableOptions, newChosenOptions) => {
17
+ setAvailableOptions(newAvailableOptions);
18
+ setSmartProxies(newChosenOptions);
19
+ };
20
+
21
+ return (
22
+ <>
23
+ <WizardHeader
24
+ title={__('Name source')}
25
+ description={__('Enter a name for your source.')}
26
+ />
27
+ <DualListSelector
28
+ isSearchable
29
+ availableOptions={availableOptions}
30
+ chosenOptions={smartProxies}
31
+ addAll={onListChange}
32
+ removeAll={onListChange}
33
+ addSelected={onListChange}
34
+ removeSelected={onListChange}
35
+ id="selector"
36
+ />
37
+ </>
38
+ );
39
+ };
40
+
41
+ export default ACSSmartProxies;
@@ -0,0 +1,71 @@
1
+ import React, { useContext } from 'react';
2
+ import { translate as __ } from 'foremanReact/common/I18n';
3
+ import {
4
+ Form,
5
+ FormGroup,
6
+ TextInput,
7
+ TextArea,
8
+ Switch,
9
+ } from '@patternfly/react-core';
10
+ import ACSCreateContext from '../ACSCreateContext';
11
+ import WizardHeader from '../../../ContentViews/components/WizardHeader';
12
+
13
+ const AcsUrlPaths = () => {
14
+ const {
15
+ url, setUrl, subpaths, setSubpaths, verifySSL, setVerifySSL,
16
+ } = useContext(ACSCreateContext);
17
+
18
+ return (
19
+ <>
20
+ <WizardHeader
21
+ title={__('URL and paths')}
22
+ description={__('Enter in the base path and any subpaths that should be searched for alternate content. ' +
23
+ 'The base path can be a web address or a filesystem location.')}
24
+ />
25
+ <Form>
26
+ <FormGroup
27
+ label={__('Base URL')}
28
+ type="string"
29
+ fieldId="acs_base_url"
30
+ isRequired
31
+ >
32
+ <TextInput
33
+ isRequired
34
+ type="text"
35
+ id="acs_base_url_field"
36
+ name="acs_base_url_field"
37
+ aria-label="acs_base_url_field"
38
+ placeholder="https:// or file://"
39
+ value={url}
40
+ onChange={(value) => { setUrl(value); }}
41
+ />
42
+ </FormGroup>
43
+ <FormGroup
44
+ label={__('Subpaths')}
45
+ type="string"
46
+ fieldId="acs_subpaths"
47
+ isRequired
48
+ >
49
+ <TextArea
50
+ placeholder="test/repo1/, test/repo2/,"
51
+ value={subpaths}
52
+ onChange={(value) => { setSubpaths(value); }}
53
+ name="acs_subpath_field"
54
+ id="acs_subpath_field"
55
+ aria-label="acs_subpath_field"
56
+ />
57
+ </FormGroup>
58
+ <FormGroup label={__('Verify SSL')} fieldId="verify_ssl">
59
+ <Switch
60
+ id="verify-ssl-switch"
61
+ aria-label="verify-ssl-switch"
62
+ isChecked={verifySSL}
63
+ onChange={checked => setVerifySSL(checked)}
64
+ />
65
+ </FormGroup>
66
+ </Form>
67
+ </>
68
+ );
69
+ };
70
+
71
+ export default AcsUrlPaths;
@@ -0,0 +1,57 @@
1
+ import React, { useContext } from 'react';
2
+ import { translate as __ } from 'foremanReact/common/I18n';
3
+ import {
4
+ Form,
5
+ FormGroup,
6
+ TextInput,
7
+ TextArea,
8
+ } from '@patternfly/react-core';
9
+ import ACSCreateContext from '../ACSCreateContext';
10
+ import WizardHeader from '../../../ContentViews/components/WizardHeader';
11
+
12
+ const NameACS = () => {
13
+ const {
14
+ name, setName, description, setDescription,
15
+ } = useContext(ACSCreateContext);
16
+
17
+ return (
18
+ <>
19
+ <WizardHeader
20
+ title={__('Name source')}
21
+ description={__('Enter a name for your source.')}
22
+ />
23
+ <Form>
24
+ <FormGroup
25
+ label={__('Name')}
26
+ type="string"
27
+ fieldId="acs_name"
28
+ isRequired
29
+ >
30
+ <TextInput
31
+ isRequired
32
+ type="text"
33
+ id="acs_name_field"
34
+ name="acs_name_field"
35
+ aria-label="acs_name_field"
36
+ value={name}
37
+ onChange={(value) => { setName(value); }}
38
+ />
39
+ </FormGroup>
40
+ <FormGroup
41
+ label={__('Description')}
42
+ type="string"
43
+ fieldId="acs_description"
44
+ >
45
+ <TextArea
46
+ value={description}
47
+ onChange={(value) => { setDescription(value); }}
48
+ name="acs_description_field"
49
+ id="acs_description_field"
50
+ />
51
+ </FormGroup>
52
+ </Form>
53
+ </>
54
+ );
55
+ };
56
+
57
+ export default NameACS;
@@ -0,0 +1,77 @@
1
+ import React, { useContext } from 'react';
2
+ import { translate as __ } from 'foremanReact/common/I18n';
3
+ import {
4
+ Tile,
5
+ Flex,
6
+ FlexItem,
7
+ Form,
8
+ FormGroup,
9
+ FormSelect,
10
+ FormSelectOption,
11
+ } from '@patternfly/react-core';
12
+ import ACSCreateContext from '../ACSCreateContext';
13
+ import WizardHeader from '../../../ContentViews/components/WizardHeader';
14
+
15
+ const SelectSource = () => {
16
+ const {
17
+ acsType, setAcsType, contentType, setContentType,
18
+ } = useContext(ACSCreateContext);
19
+
20
+ const onSelect = (event) => {
21
+ setAcsType(event.currentTarget.id);
22
+ };
23
+ const onKeyDown = (event) => {
24
+ if (event.key === ' ' || event.key === 'Enter') {
25
+ event.preventDefault();
26
+ setAcsType(event.currentTarget.id);
27
+ }
28
+ };
29
+
30
+ const typeOptions = [
31
+ { value: 'yum', label: __('Yum') },
32
+ { value: 'file', label: __('File') },
33
+ ];
34
+
35
+ return (
36
+ <>
37
+ <WizardHeader
38
+ title={__('Select source type')}
39
+ description={__('Indicate the source type.')}
40
+ />
41
+ <Form>
42
+ <FormGroup
43
+ label={__('Source type')}
44
+ type="string"
45
+ fieldId="source_type"
46
+ isRequired
47
+ >
48
+ <Flex>
49
+ <FlexItem>
50
+ <Tile title={__('Custom')} isStacked id="custom" onClick={onSelect} onKeyDown={onKeyDown} isSelected={acsType === 'custom'} />{' '}
51
+ </FlexItem>
52
+ </Flex>
53
+ </FormGroup>
54
+ <FormGroup
55
+ label={__('Content type')}
56
+ type="string"
57
+ fieldId="content_type"
58
+ isRequired
59
+ >
60
+ <FormSelect isRequired value={contentType} onChange={(value) => { setContentType(value); }} aria-label="FormSelect Input">
61
+ {
62
+ typeOptions.map(option => (
63
+ <FormSelectOption
64
+ key={option.value}
65
+ value={option.value}
66
+ label={option.label}
67
+ />
68
+ ))
69
+ }
70
+ </FormSelect>
71
+ </FormGroup>
72
+ </Form>
73
+ </>
74
+ );
75
+ };
76
+
77
+ export default SelectSource;