katello 4.8.0.rc1 → 4.8.0

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 (92) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/katello/api/registry/registry_proxies_controller.rb +2 -18
  3. data/app/controllers/katello/api/v2/alternate_content_sources_controller.rb +7 -5
  4. data/app/controllers/katello/api/v2/repositories_controller.rb +3 -18
  5. data/app/helpers/katello/hosts_and_hostgroups_helper.rb +13 -8
  6. data/app/lib/actions/katello/alternate_content_source/create.rb +3 -1
  7. data/app/lib/actions/katello/alternate_content_source/update.rb +3 -1
  8. data/app/lib/actions/pulp3/orchestration/content_view_version/copy_version_units_to_library.rb +1 -1
  9. data/app/lib/actions/pulp3/orchestration/content_view_version/export.rb +11 -11
  10. data/app/lib/actions/pulp3/orchestration/content_view_version/syncable_export.rb +0 -2
  11. data/app/lib/actions/pulp3/repository/reclaim_space.rb +1 -1
  12. data/app/lib/katello/api/v2/error_handling.rb +12 -2
  13. data/app/lib/katello/concerns/base_template_scope_extensions.rb +7 -3
  14. data/app/models/katello/alternate_content_source.rb +54 -4
  15. data/app/models/katello/concerns/host_managed_extensions.rb +14 -0
  16. data/app/models/katello/glue/provider.rb +1 -1
  17. data/app/models/katello/host/content_facet.rb +2 -0
  18. data/app/services/katello/pulp3/content_view_version/export_validation_error.rb +1 -1
  19. data/app/services/katello/pulp3/content_view_version/export_validator.rb +16 -0
  20. data/app/views/foreman/smart_proxies/_content_sync.html.erb +1 -1
  21. data/db/migrate/20230203141353_set_new_acs_verify_ssl_default.rb +5 -0
  22. data/db/seeds.d/111-upgrade_tasks.rb +2 -1
  23. data/lib/katello/plugin.rb +0 -12
  24. data/lib/katello/tasks/upgrades/4.8/regenerate_imported_repository_metadata.rake +33 -0
  25. data/lib/katello/version.rb +1 -1
  26. data/webpack/components/Content/{ContentPage.js → GenericContentPage.js} +7 -4
  27. data/webpack/components/Content/__tests__/ContentTable.test.js +1 -1
  28. data/webpack/components/Content/__tests__/GenericContentPage.test.js +35 -0
  29. data/webpack/components/Search/SearchText.js +70 -0
  30. data/webpack/components/Table/EmptyStateMessage.js +2 -2
  31. data/webpack/components/Table/TableWrapper.js +4 -0
  32. data/webpack/components/extensions/HostDetails/Cards/ContentViewDetailsCard/ChangeHostCVModal.js +10 -72
  33. data/webpack/components/extensions/HostDetails/HostDetailsConstants.js +0 -1
  34. data/webpack/components/extensions/HostDetails/HostDetailsSelectors.js +0 -6
  35. data/webpack/components/extensions/HostDetails/Tabs/__tests__/moduleStreamsTab.test.js +76 -0
  36. data/webpack/components/extensions/SearchBar/SearchBarConstants.js +3 -0
  37. data/webpack/components/extensions/SearchBar/SearchBarHooks.js +50 -0
  38. data/webpack/components/extensions/SearchBar/SearchBarReducer.js +14 -0
  39. data/webpack/components/extensions/SearchBar/SearchBarSelectors.js +5 -0
  40. data/webpack/redux/actions/RedHatRepositories/helpers.js +5 -3
  41. data/webpack/redux/reducers/index.js +2 -2
  42. data/webpack/scenes/AlternateContentSources/Create/__tests__/acsCreate.test.js +1 -13
  43. data/webpack/scenes/AlternateContentSources/Details/ACSExpandableDetails.js +6 -5
  44. data/webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditCredentials.js +1 -0
  45. data/webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditDetails.js +3 -2
  46. data/webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditProducts.js +1 -0
  47. data/webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditSmartProxies.js +2 -0
  48. data/webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditURLPaths.js +1 -0
  49. data/webpack/scenes/AlternateContentSources/MainTable/ACSTable.js +1 -0
  50. data/webpack/scenes/Content/{ContentPage.js → GenericContentPage.js} +2 -2
  51. data/webpack/scenes/Content/__tests__/contentTable.test.js +2 -2
  52. data/webpack/scenes/Content/index.js +2 -2
  53. data/webpack/scenes/ContentViews/Details/ContentViewDetails.js +1 -0
  54. data/webpack/scenes/ContentViews/Details/Filters/Rules/ContainerTag/AddEditContainerTagRuleModal.js +14 -17
  55. data/webpack/scenes/ContentViews/Details/Filters/Rules/Package/AddEditPackageRuleModal.js +24 -28
  56. data/webpack/scenes/ContentViews/Details/Filters/__tests__/CVContainerImageFilterContent.test.js +11 -18
  57. data/webpack/scenes/ContentViews/Details/Filters/__tests__/CVRpmFilterContent.test.js +10 -23
  58. data/webpack/scenes/ContentViews/Details/Filters/__tests__/ContentViewPackageGroupFilter.test.js +0 -2
  59. data/webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.test.js +1 -7
  60. data/webpack/scenes/ContentViews/components/ContentViewSelect/ContentViewSelectOption.js +87 -0
  61. data/webpack/scenes/ContentViews/components/EnvironmentPaths/EnvironmentPaths.js +1 -1
  62. data/webpack/scenes/ContentViews/expansions/__tests__/contentViewComponentsModal.test.js +0 -2
  63. data/webpack/scenes/Hosts/ChangeContentSource/components/ContentSourceForm.js +153 -28
  64. data/webpack/scenes/Hosts/ChangeContentSource/index.js +14 -15
  65. data/webpack/scenes/Hosts/ChangeContentSource/selectors.js +4 -0
  66. data/webpack/scenes/Hosts/ChangeContentSource/styles.scss +4 -0
  67. data/webpack/scenes/ModuleStreams/ModuleStreamsPage.js +2 -2
  68. data/webpack/scenes/ModuleStreams/__tests__/ModuleStreamPage.test.js +2 -2
  69. data/webpack/scenes/ModuleStreams/__tests__/__snapshots__/ModuleStreamPage.test.js.snap +1 -1
  70. data/webpack/scenes/Settings/SettingsConstants.js +2 -3
  71. data/webpack/scenes/Settings/SettingsReducer.js +2 -16
  72. data/webpack/scenes/Settings/SettingsSelectors.js +2 -2
  73. data/webpack/test-utils/react-testing-lib-wrapper.js +0 -6
  74. metadata +16 -25
  75. data/webpack/components/Content/__tests__/ContentPage.test.js +0 -32
  76. data/webpack/components/Content/__tests__/__snapshots__/ContentPage.test.js.snap +0 -89
  77. data/webpack/components/Search/Search.js +0 -156
  78. data/webpack/components/Search/__tests__/search.test.js +0 -104
  79. data/webpack/components/Search/helpers.js +0 -6
  80. data/webpack/components/Search/index.js +0 -15
  81. data/webpack/components/TypeAhead/TypeAhead.js +0 -157
  82. data/webpack/components/TypeAhead/TypeAhead.scss +0 -7
  83. data/webpack/components/TypeAhead/helpers/commonPropTypes.js +0 -35
  84. data/webpack/components/TypeAhead/helpers/helpers.js +0 -32
  85. data/webpack/components/TypeAhead/index.js +0 -3
  86. data/webpack/components/TypeAhead/pf3Search/TypeAheadInput.js +0 -44
  87. data/webpack/components/TypeAhead/pf3Search/TypeAheadItems.js +0 -56
  88. data/webpack/components/TypeAhead/pf3Search/TypeAheadSearch.js +0 -53
  89. data/webpack/components/TypeAhead/pf4Search/TypeAheadInput.js +0 -66
  90. data/webpack/components/TypeAhead/pf4Search/TypeAheadInput.scss +0 -12
  91. data/webpack/components/TypeAhead/pf4Search/TypeAheadItems.js +0 -59
  92. data/webpack/components/TypeAhead/pf4Search/TypeAheadSearch.js +0 -81
@@ -1,4 +1,5 @@
1
- import React from 'react';
1
+ import React, { useState } from 'react';
2
+ import { useSelector } from 'react-redux';
2
3
  import {
3
4
  ActionGroup,
4
5
  Alert,
@@ -6,20 +7,87 @@ import {
6
7
  Form,
7
8
  Grid,
8
9
  GridItem,
10
+ Select,
11
+ SelectOption,
12
+ SelectVariant,
13
+ TextContent,
9
14
  } from '@patternfly/react-core';
10
15
  import { translate as __ } from 'foremanReact/common/I18n';
11
16
  import PropTypes from 'prop-types';
17
+ import { useAPI } from 'foremanReact/common/hooks/API/APIHooks';
18
+ import { STATUS } from 'foremanReact/constants';
19
+ import api, { orgId } from '../../../../services/api';
20
+ import { ENVIRONMENT_PATHS_KEY } from '../../../../scenes/ContentViews/components/EnvironmentPaths/EnvironmentPathConstants';
21
+ import EnvironmentPaths from '../../../../scenes/ContentViews/components/EnvironmentPaths/EnvironmentPaths';
22
+ import ContentViewSelect from '../../../../scenes/ContentViews/components/ContentViewSelect/ContentViewSelect';
23
+ import ContentViewSelectOption from '../../../../scenes/ContentViews/components/ContentViewSelect/ContentViewSelectOption';
24
+ import { selectContentViewsStatus } from '../selectors';
12
25
 
13
- import FormField from './FormField';
26
+ const ENV_PATH_OPTIONS = { key: ENVIRONMENT_PATHS_KEY };
27
+
28
+ const ContentSourceSelect = ({
29
+ contentSources,
30
+ selections,
31
+ onToggle,
32
+ onSelect,
33
+ isOpen,
34
+ isDisabled,
35
+ onClear,
36
+ }) => (
37
+ <div className="content_source_section">
38
+ <TextContent>{__('Content source')}</TextContent>
39
+ <Select
40
+ variant={SelectVariant.single}
41
+ aria-label="content-source-select"
42
+ ouiaId="content-source-select"
43
+ onToggle={onToggle}
44
+ onSelect={onSelect}
45
+ selections={selections}
46
+ isOpen={isOpen}
47
+ isDisabled={isDisabled}
48
+ onClear={onClear}
49
+ className="set-select-width"
50
+ placeholderText={__('Select a source')}
51
+ >
52
+ {contentSources.map(cs => (
53
+ <SelectOption
54
+ key={cs.id}
55
+ value={`${cs.id}`}
56
+ >
57
+ {cs.name}
58
+ </SelectOption>
59
+ ))}
60
+ </Select>
61
+ </div>
62
+ );
63
+
64
+ ContentSourceSelect.propTypes = {
65
+ contentSources: PropTypes.arrayOf(PropTypes.shape({})),
66
+ selections: PropTypes.string,
67
+ onToggle: PropTypes.func,
68
+ onSelect: PropTypes.func,
69
+ onClear: PropTypes.func,
70
+ isOpen: PropTypes.bool,
71
+ isDisabled: PropTypes.bool,
72
+ };
73
+
74
+ ContentSourceSelect.defaultProps = {
75
+ contentSources: [],
76
+ selections: null,
77
+ onToggle: undefined,
78
+ onSelect: undefined,
79
+ onClear: undefined,
80
+ isOpen: false,
81
+ isDisabled: false,
82
+ };
14
83
 
15
84
  const ContentSourceForm = ({
16
85
  handleSubmit,
17
86
  environments,
18
87
  handleEnvironment,
19
- environmentId,
20
88
  contentViews,
21
89
  handleContentView,
22
- contentViewId,
90
+ contentViewName,
23
91
  contentSources,
24
92
  handleContentSource,
25
93
  contentSourceId,
@@ -27,17 +95,36 @@ const ContentSourceForm = ({
27
95
  isLoading,
28
96
  hostsUpdated,
29
97
  }) => {
30
- const formIsValid = () => (!!environmentId &&
31
- !!contentViewId &&
98
+ useAPI( // No TableWrapper here, so we can useAPI from Foreman
99
+ 'get',
100
+ api.getApiUrl(`/organizations/${orgId()}/environments/paths?permission_type=promotable`),
101
+ ENV_PATH_OPTIONS,
102
+ );
103
+ const contentViewsStatus = useSelector(selectContentViewsStatus);
104
+ const [csSelectOpen, setCSSelectOpen] = useState(false);
105
+ const [cvSelectOpen, setCVSelectOpen] = useState(false);
106
+
107
+ const handleCSSelect = (_event, selection) => {
108
+ handleContentSource(selection);
109
+ setCSSelectOpen(false);
110
+ };
111
+
112
+ const handleCVSelect = (_event, selection) => {
113
+ handleContentView(selection);
114
+ setCVSelectOpen(false);
115
+ };
116
+
117
+ const formIsValid = () => (!!environments &&
118
+ !!contentViewName &&
32
119
  !!contentSourceId &&
33
120
  contentHosts.length !== 0);
34
121
 
35
122
  const contentSourcesIsDisabled = (isLoading || contentSources.length === 0 ||
36
123
  contentHosts.length === 0);
37
- const environmentIsDisabled = (isLoading || environments.length === 0 ||
124
+ const environmentIsDisabled = (isLoading || environments === [] ||
38
125
  contentSourceId === '');
39
126
  const viewIsDisabled = (isLoading || contentViews.length === 0 ||
40
- contentSourceId === '' || environmentId === '');
127
+ contentSourceId === '' || environments === []);
41
128
 
42
129
  return (
43
130
  <Form
@@ -56,24 +143,64 @@ const ContentSourceForm = ({
56
143
  />
57
144
  </GridItem>
58
145
  )}
59
- <FormField label={__('Content source')} id="change_cs_content_source" value={contentSourceId} items={contentSources} onChange={handleContentSource} isDisabled={contentSourcesIsDisabled} />
60
- <FormField label={__('Environment')} id="change_cs_environment" value={environmentId} items={environments} onChange={handleEnvironment} isDisabled={environmentIsDisabled} />
61
- <FormField label={__('Content view')} id="change_cs_content_view" value={contentViewId} items={contentViews} onChange={handleContentView} isDisabled={viewIsDisabled} />
62
-
63
- <GridItem>
64
- <ActionGroup>
65
- <Button
66
- variant="primary"
67
- id="generate_btn"
68
- onClick={e => handleSubmit(e)}
69
- isDisabled={isLoading || !formIsValid() || hostsUpdated}
70
- isLoading={isLoading}
146
+ {contentViewsStatus === STATUS.RESOLVED &&
147
+ !!environments.length && contentViews.length === 0 &&
148
+ <Alert
149
+ variant="warning"
150
+ className="margin-top-20"
151
+ title={__('No content views available for the selected environment')}
152
+ style={{ marginBottom: '1rem' }}
71
153
  >
72
- {__('Update')}
73
- </Button>
74
- </ActionGroup>
75
- </GridItem>
154
+ <a href="/content_views">{__('View the Content Views page')}</a>
155
+ {__(' to manage and promote content views, or select a different environment.')}
156
+ </Alert>
157
+ }
76
158
  </Grid>
159
+ <ContentSourceSelect
160
+ contentSources={contentSources}
161
+ selections={contentSourceId}
162
+ onToggle={isExpanded => setCSSelectOpen(isExpanded)}
163
+ onSelect={handleCSSelect}
164
+ onClear={() => handleContentSource(null)}
165
+ isOpen={csSelectOpen}
166
+ isDisabled={contentSourcesIsDisabled || hostsUpdated}
167
+ />
168
+ <EnvironmentPaths
169
+ style={{ display: 'block' }}
170
+ userCheckedItems={environments}
171
+ setUserCheckedItems={handleEnvironment}
172
+ publishing={false}
173
+ multiSelect={false}
174
+ headerText={__('Environment')}
175
+ isDisabled={environmentIsDisabled || hostsUpdated}
176
+ />
177
+ {environments.length > 0 && contentViewsStatus !== STATUS.PENDING &&
178
+ <ContentViewSelect
179
+ selections={contentViewName}
180
+ onClear={() => handleContentView(null)}
181
+ onSelect={handleCVSelect}
182
+ isOpen={cvSelectOpen}
183
+ isDisabled={viewIsDisabled || hostsUpdated}
184
+ onToggle={isExpanded => setCVSelectOpen(isExpanded)}
185
+ headerText={__('Content view')}
186
+ ouiaId="SelectContentView"
187
+ className="set-select-width"
188
+ placeholderText={(contentViews.length === 0) ? __('No content views available') : __('Select a content view')}
189
+ >
190
+ {contentViews?.map(cv => <ContentViewSelectOption key={`${cv.id}`} cv={cv} env={environments[0]} />)}
191
+ </ContentViewSelect>
192
+ }
193
+ <ActionGroup style={{ display: 'block' }}>
194
+ <Button
195
+ variant="primary"
196
+ id="generate_btn"
197
+ onClick={e => handleSubmit(e)}
198
+ isDisabled={isLoading || !formIsValid() || hostsUpdated}
199
+ isLoading={isLoading}
200
+ >
201
+ {__('Update')}
202
+ </Button>
203
+ </ActionGroup>
77
204
  </Form>);
78
205
  };
79
206
 
@@ -81,10 +208,9 @@ ContentSourceForm.propTypes = {
81
208
  handleSubmit: PropTypes.func.isRequired,
82
209
  environments: PropTypes.arrayOf(PropTypes.shape({})),
83
210
  handleEnvironment: PropTypes.func.isRequired,
84
- environmentId: PropTypes.string,
85
211
  contentViews: PropTypes.arrayOf(PropTypes.shape({})),
86
212
  handleContentView: PropTypes.func.isRequired,
87
- contentViewId: PropTypes.string,
213
+ contentViewName: PropTypes.string,
88
214
  contentSources: PropTypes.arrayOf(PropTypes.shape({})),
89
215
  handleContentSource: PropTypes.func.isRequired,
90
216
  contentSourceId: PropTypes.string,
@@ -95,9 +221,8 @@ ContentSourceForm.propTypes = {
95
221
 
96
222
  ContentSourceForm.defaultProps = {
97
223
  environments: [],
98
- environmentId: '',
99
224
  contentViews: [],
100
- contentViewId: '',
225
+ contentViewName: '',
101
226
  contentSources: [],
102
227
  contentSourceId: '',
103
228
  contentHosts: [],
@@ -14,7 +14,6 @@ import { selectApiDataStatus,
14
14
  selectApiChangeContentStatus,
15
15
  selectContentHosts,
16
16
  selectContentHostsWithoutContent,
17
- selectEnvironments,
18
17
  selectContentSources,
19
18
  selectJobInvocationPath,
20
19
  selectContentViews,
@@ -45,7 +44,6 @@ const ChangeContentSourcePage = () => {
45
44
 
46
45
  const contentHosts = useSelector(selectContentHosts);
47
46
  const hostsWithoutContent = useSelector(selectContentHostsWithoutContent);
48
- const environments = useSelector(selectEnvironments);
49
47
  const contentSources = useSelector(selectContentSources);
50
48
  const jobInvocationPath = useSelector(selectJobInvocationPath);
51
49
 
@@ -53,10 +51,12 @@ const ChangeContentSourcePage = () => {
53
51
  const contentViews = useSelector(selectContentViews);
54
52
 
55
53
  const [contentSourceId, setCapsuleId] = useState('');
56
- const [environmentId, setEnvironmentId] = useState('');
57
- const [contentViewId, setContentViewId] = useState('');
54
+ const [selectedEnvironment, setSelectedEnvironment] = useState([]);
55
+ const [contentViewName, setContentViewName] = useState('');
58
56
 
57
+ const contentViewId = contentViews?.find(cv => cv.name === contentViewName)?.id;
59
58
  const noHostSpecified = getHostIds(urlParams.host_id).length === 0 && urlParams.searchParam === '';
59
+ const environmentId = selectedEnvironment[0]?.id;
60
60
 
61
61
  const handleSubmit = (e) => {
62
62
  e.preventDefault();
@@ -72,8 +72,8 @@ const ChangeContentSourcePage = () => {
72
72
 
73
73
  const handleContentSource = (id) => {
74
74
  setCapsuleId(id);
75
- setEnvironmentId('');
76
- setContentViewId('');
75
+ setSelectedEnvironment([]);
76
+ setContentViewName('');
77
77
 
78
78
  if (id) {
79
79
  dispatch(getProxy(id));
@@ -93,12 +93,12 @@ const ChangeContentSourcePage = () => {
93
93
  return ([linkHosts, linkContent]);
94
94
  };
95
95
 
96
- const handleEnvironment = (envId) => {
97
- setEnvironmentId(envId);
98
- setContentViewId('');
96
+ const handleEnvironment = (selection) => {
97
+ setSelectedEnvironment(selection);
98
+ setContentViewName('');
99
99
 
100
- if (envId) {
101
- dispatch(getContentViews(envId));
100
+ if (selection[0].id) {
101
+ dispatch(getContentViews(selection[0].id));
102
102
  }
103
103
  };
104
104
  useEffect(() => {
@@ -146,12 +146,11 @@ const ChangeContentSourcePage = () => {
146
146
 
147
147
  <ContentSourceForm
148
148
  handleSubmit={handleSubmit}
149
- environments={environments}
150
149
  handleEnvironment={handleEnvironment}
151
- environmentId={environmentId}
150
+ environments={selectedEnvironment}
152
151
  contentViews={contentViews}
153
- handleContentView={setContentViewId}
154
- contentViewId={contentViewId}
152
+ handleContentView={setContentViewName}
153
+ contentViewName={contentViewName}
155
154
  contentSources={contentSources}
156
155
  contentSourceId={contentSourceId}
157
156
  handleContentSource={handleContentSource}
@@ -3,6 +3,7 @@ import {
3
3
  selectAPIResponse,
4
4
  selectAPIError,
5
5
  } from 'foremanReact/redux/API/APISelectors';
6
+ import { STATUS } from 'foremanReact/constants';
6
7
 
7
8
  import { CHANGE_CONTENT_SOURCE_DATA, CHANGE_CONTENT_SOURCE_PROXY, CHANGE_CONTENT_SOURCE, CHANGE_CONTENT_SOURCE_VIEWS } from './constants';
8
9
 
@@ -37,6 +38,9 @@ export const selectJobInvocationPath = state =>
37
38
  export const selectContentViews = state =>
38
39
  selectAPIResponse(state, CHANGE_CONTENT_SOURCE_VIEWS).results || [];
39
40
 
41
+ export const selectContentViewsStatus = state =>
42
+ selectAPIStatus(state, CHANGE_CONTENT_SOURCE_VIEWS) || STATUS.PENDING;
43
+
40
44
  export const selectTemplate = state =>
41
45
  selectAPIResponse(state, CHANGE_CONTENT_SOURCE) || '';
42
46
 
@@ -13,3 +13,7 @@
13
13
  .margin-top-20 {
14
14
  margin-top: 20px;
15
15
  }
16
+
17
+ .set-select-width {
18
+ width: 60%
19
+ }
@@ -4,7 +4,7 @@ import qs from 'query-string';
4
4
  import { translate as __ } from 'foremanReact/common/I18n';
5
5
  import { orgId } from '../../services/api';
6
6
  import TableSchema from '../ModuleStreams/ModuleStreamsTableSchema';
7
- import ContentPage from '../../components/Content/ContentPage';
7
+ import GenericContentPage from '../../components/Content/GenericContentPage';
8
8
 
9
9
  class ModuleStreamsPage extends Component {
10
10
  constructor(props) {
@@ -39,7 +39,7 @@ class ModuleStreamsPage extends Component {
39
39
  render() {
40
40
  const { moduleStreams } = this.props;
41
41
  return (
42
- <ContentPage
42
+ <GenericContentPage
43
43
  header={__('Module Streams')}
44
44
  content={moduleStreams}
45
45
  tableSchema={TableSchema}
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { shallow } from 'enzyme';
3
3
  import toJson from 'enzyme-to-json';
4
4
  import ModuleStreamsPage from '../ModuleStreamsPage';
5
- import ContentPage from '../../../components/Content/ContentPage';
5
+ import GenericContentPage from '../../../components/Content/GenericContentPage';
6
6
 
7
7
  describe('Module streams page', () => {
8
8
  it('should render and contain appropiate components', async () => {
@@ -17,7 +17,7 @@ describe('Module streams page', () => {
17
17
  />);
18
18
 
19
19
  expect(toJson(wrapper)).toMatchSnapshot();
20
- expect(wrapper.find(ContentPage)).toHaveLength(1);
20
+ expect(wrapper.find(GenericContentPage)).toHaveLength(1);
21
21
  });
22
22
  });
23
23
 
@@ -1,7 +1,7 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
3
  exports[`Module streams page should render and contain appropiate components 1`] = `
4
- <ContentPage
4
+ <GenericContentPage
5
5
  autocompleteEndpoint="/katello/api/v2/module_streams"
6
6
  autocompleteQueryParams={
7
7
  Object {
@@ -1,3 +1,2 @@
1
- export const AUTOSEARCH_DELAY = 'autosearch_delay';
2
- export const AUTOSEARCH_WHILE_TYPING = 'autosearch_while_typing';
3
- export const CONTENT_DISCONNECTED = 'content_disconnected';
1
+ const CONTENT_DISCONNECTED = 'content_disconnected';
2
+ export default CONTENT_DISCONNECTED;
@@ -1,25 +1,11 @@
1
- import Immutable from 'seamless-immutable';
2
1
  import { GET_SETTING_SUCCESS } from 'foremanReact/components/Settings/SettingsConstants';
3
- import {
4
- AUTOSEARCH_DELAY,
5
- AUTOSEARCH_WHILE_TYPING,
6
- CONTENT_DISCONNECTED,
7
- } from './SettingsConstants';
2
+ import { CONTENT_DISCONNECTED } from './SettingsConstants';
8
3
 
9
- export const initialSettingsState = Immutable({
10
- autoSearchEnabled: true,
11
- autoSearchDelay: 500,
12
- });
13
-
14
- export default (state = initialSettingsState, action) => {
4
+ export default (state, action) => {
15
5
  switch (action.type) {
16
6
  case GET_SETTING_SUCCESS: {
17
7
  const { name, value } = action.response;
18
8
  switch (name) {
19
- case AUTOSEARCH_DELAY:
20
- return state.set('autoSearchDelay', value);
21
- case AUTOSEARCH_WHILE_TYPING:
22
- return state.set('autoSearchEnabled', value);
23
9
  case CONTENT_DISCONNECTED:
24
10
  return state.set('disconnected', value);
25
11
  default:
@@ -1,4 +1,4 @@
1
- export const selectSettings = state => state.katello.settings.settings;
1
+ export const selectSettings = state => state.katello.settings?.settings;
2
2
 
3
3
  export const selectTableSettings = (state, tableName) =>
4
- state.katello.settings.tables[tableName] || undefined;
4
+ state.katello.settings?.tables[tableName] || undefined;
@@ -12,7 +12,6 @@ import { render, waitFor, waitForElementToBeRemoved } from '@testing-library/rea
12
12
  import { createStore, applyMiddleware, combineReducers } from 'redux';
13
13
  import { Provider } from 'react-redux';
14
14
  import { MemoryRouter, BrowserRouter } from 'react-router-dom';
15
- import { initialSettingsState } from '../scenes/Settings/SettingsReducer';
16
15
  import allKatelloReducers from '../redux/reducers/index.js';
17
16
 
18
17
  // r-t-lib's print limit for debug() is quite small, setting it to a much higher char max here.
@@ -43,11 +42,6 @@ function renderWithRedux(
43
42
  API: {
44
43
  [apiNamespace]: initialApiState,
45
44
  },
46
- katello: {
47
- settings: {
48
- settings: initialSettingsState,
49
- },
50
- },
51
45
  extendable: {},
52
46
  ...initialState,
53
47
  });
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: katello
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.8.0.rc1
4
+ version: 4.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - N/A
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-23 00:00:00.000000000 Z
11
+ date: 2023-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -2160,6 +2160,7 @@ files:
2160
2160
  - db/migrate/20221123212341_remove_pulp_docker_registry_port_setting.rb
2161
2161
  - db/migrate/20221206170122_update_ignore_srpm_to_false_for_mirror_complete.rb
2162
2162
  - db/migrate/20230119003859_ensure_repo_username_password_nil_not_blank.rb
2163
+ - db/migrate/20230203141353_set_new_acs_verify_ssl_default.rb
2163
2164
  - db/seeds.d/101-locations.rb
2164
2165
  - db/seeds.d/102-organizations.rb
2165
2166
  - db/seeds.d/104-proxy.rb
@@ -4412,6 +4413,7 @@ files:
4412
4413
  - lib/katello/tasks/upgrades/4.3/fix_url_auth.rake
4413
4414
  - lib/katello/tasks/upgrades/4.4/publish_import_cvvs.rake
4414
4415
  - lib/katello/tasks/upgrades/4.8/fix_incorrect_providers.rake
4416
+ - lib/katello/tasks/upgrades/4.8/regenerate_imported_repository_metadata.rake
4415
4417
  - lib/katello/tasks/virt_who_report.rake
4416
4418
  - lib/katello/url_constrained_cookie_store.rb
4417
4419
  - lib/katello/version.rb
@@ -4522,7 +4524,6 @@ files:
4522
4524
  - webpack/components/Bookmark/BookmarkConstants.js
4523
4525
  - webpack/components/Bookmark/BookmarkSelectors.js
4524
4526
  - webpack/components/Bookmark/index.js
4525
- - webpack/components/Content/ContentPage.js
4526
4527
  - webpack/components/Content/ContentTable.js
4527
4528
  - webpack/components/Content/Details/ContentDetailInfo.js
4528
4529
  - webpack/components/Content/Details/ContentDetailRepositories.js
@@ -4534,9 +4535,9 @@ files:
4534
4535
  - webpack/components/Content/Details/__tests__/__snapshots__/ContentDetailInfo.test.js.snap
4535
4536
  - webpack/components/Content/Details/__tests__/__snapshots__/ContentDetailRepositories.test.js.snap
4536
4537
  - webpack/components/Content/Details/__tests__/__snapshots__/ContentDetails.test.js.snap
4537
- - webpack/components/Content/__tests__/ContentPage.test.js
4538
+ - webpack/components/Content/GenericContentPage.js
4538
4539
  - webpack/components/Content/__tests__/ContentTable.test.js
4539
- - webpack/components/Content/__tests__/__snapshots__/ContentPage.test.js.snap
4540
+ - webpack/components/Content/__tests__/GenericContentPage.test.js
4540
4541
  - webpack/components/Content/__tests__/__snapshots__/ContentTable.test.js.snap
4541
4542
  - webpack/components/EditableSwitch.js
4542
4543
  - webpack/components/EditableTextInput/EditableTextInput.js
@@ -4561,10 +4562,7 @@ files:
4561
4562
  - webpack/components/Packages/index.js
4562
4563
  - webpack/components/RoutedTabs/__tests__/RoutedTabs.test.js
4563
4564
  - webpack/components/RoutedTabs/index.js
4564
- - webpack/components/Search/Search.js
4565
- - webpack/components/Search/__tests__/search.test.js
4566
- - webpack/components/Search/helpers.js
4567
- - webpack/components/Search/index.js
4565
+ - webpack/components/Search/SearchText.js
4568
4566
  - webpack/components/Select/Select.js
4569
4567
  - webpack/components/SelectAllCheckbox/SelectAllCheckbox.scss
4570
4568
  - webpack/components/SelectAllCheckbox/index.js
@@ -4591,18 +4589,6 @@ files:
4591
4589
  - webpack/components/TooltipButton/TooltipButton.test.js
4592
4590
  - webpack/components/TooltipButton/__snapshots__/TooltipButton.test.js.snap
4593
4591
  - webpack/components/TooltipButton/index.js
4594
- - webpack/components/TypeAhead/TypeAhead.js
4595
- - webpack/components/TypeAhead/TypeAhead.scss
4596
- - webpack/components/TypeAhead/helpers/commonPropTypes.js
4597
- - webpack/components/TypeAhead/helpers/helpers.js
4598
- - webpack/components/TypeAhead/index.js
4599
- - webpack/components/TypeAhead/pf3Search/TypeAheadInput.js
4600
- - webpack/components/TypeAhead/pf3Search/TypeAheadItems.js
4601
- - webpack/components/TypeAhead/pf3Search/TypeAheadSearch.js
4602
- - webpack/components/TypeAhead/pf4Search/TypeAheadInput.js
4603
- - webpack/components/TypeAhead/pf4Search/TypeAheadInput.scss
4604
- - webpack/components/TypeAhead/pf4Search/TypeAheadItems.js
4605
- - webpack/components/TypeAhead/pf4Search/TypeAheadSearch.js
4606
4592
  - webpack/components/WithOrganization/__snapshots__/withOrganization.test.js.snap
4607
4593
  - webpack/components/WithOrganization/withOrganization.js
4608
4594
  - webpack/components/WithOrganization/withOrganization.test.js
@@ -4722,6 +4708,10 @@ files:
4722
4708
  - webpack/components/extensions/RegistrationCommands/fields/IgnoreSubmanErrors.js
4723
4709
  - webpack/components/extensions/RegistrationCommands/fields/LifecycleEnvironment.js
4724
4710
  - webpack/components/extensions/RegistrationCommands/index.js
4711
+ - webpack/components/extensions/SearchBar/SearchBarConstants.js
4712
+ - webpack/components/extensions/SearchBar/SearchBarHooks.js
4713
+ - webpack/components/extensions/SearchBar/SearchBarReducer.js
4714
+ - webpack/components/extensions/SearchBar/SearchBarSelectors.js
4725
4715
  - webpack/components/extensions/about/SystemStatuses.js
4726
4716
  - webpack/components/extensions/about/SystemStatusesActions.js
4727
4717
  - webpack/components/extensions/about/SystemStatusesConsts.js
@@ -4848,7 +4838,6 @@ files:
4848
4838
  - webpack/scenes/Content/ContentActions.js
4849
4839
  - webpack/scenes/Content/ContentConfig.js
4850
4840
  - webpack/scenes/Content/ContentConstants.js
4851
- - webpack/scenes/Content/ContentPage.js
4852
4841
  - webpack/scenes/Content/ContentSelectors.js
4853
4842
  - webpack/scenes/Content/Details/ContentDetails.js
4854
4843
  - webpack/scenes/Content/Details/ContentInfo.js
@@ -4859,6 +4848,7 @@ files:
4859
4848
  - webpack/scenes/Content/Details/__tests__/pythonPackageDetails.fixtures.json
4860
4849
  - webpack/scenes/Content/Details/__tests__/pythonPackageRepositoryDetails.fixtures.json
4861
4850
  - webpack/scenes/Content/Details/index.js
4851
+ - webpack/scenes/Content/GenericContentPage.js
4862
4852
  - webpack/scenes/Content/Table/ContentTable.js
4863
4853
  - webpack/scenes/Content/Table/index.js
4864
4854
  - webpack/scenes/Content/__tests__/ansibleCollections.fixtures.json
@@ -5095,6 +5085,7 @@ files:
5095
5085
  - webpack/scenes/ContentViews/components/CVBreadCrumb.js
5096
5086
  - webpack/scenes/ContentViews/components/ContentViewIcon.js
5097
5087
  - webpack/scenes/ContentViews/components/ContentViewSelect/ContentViewSelect.js
5088
+ - webpack/scenes/ContentViews/components/ContentViewSelect/ContentViewSelectOption.js
5098
5089
  - webpack/scenes/ContentViews/components/ContentViewsCounter.js
5099
5090
  - webpack/scenes/ContentViews/components/EnvironmentLabels.js
5100
5091
  - webpack/scenes/ContentViews/components/EnvironmentPaths/EnvironmentPathActions.js
@@ -5372,11 +5363,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
5372
5363
  version: '2.5'
5373
5364
  required_rubygems_version: !ruby/object:Gem::Requirement
5374
5365
  requirements:
5375
- - - ">"
5366
+ - - ">="
5376
5367
  - !ruby/object:Gem::Version
5377
- version: 1.3.1
5368
+ version: '0'
5378
5369
  requirements: []
5379
- rubygems_version: 3.1.2
5370
+ rubygems_version: 3.1.6
5380
5371
  signing_key:
5381
5372
  specification_version: 4
5382
5373
  summary: Content and Subscription Management plugin for Foreman
@@ -1,32 +0,0 @@
1
- import React from 'react';
2
- import { shallow } from 'enzyme';
3
- import toJson from 'enzyme-to-json';
4
- import SearchBar from 'foremanReact/components/SearchBar';
5
- import ContentPage from '../ContentPage';
6
- import ContentTable from '../ContentTable';
7
-
8
- describe('Content page', () => {
9
- it('should render and contain appropriate components', async () => {
10
- const contentHeader = 'Content Header';
11
- const content = {};
12
- const onSearch = () => {};
13
- const updateSearchQuery = () => {};
14
- const searchQuery = '';
15
- const onPaginationChange = () => {};
16
- const TableSchema = [];
17
-
18
- const wrapper = shallow(<ContentPage
19
- header={contentHeader}
20
- content={content}
21
- tableSchema={TableSchema}
22
- onSearch={onSearch}
23
- updateSearchQuery={updateSearchQuery}
24
- initialInputValue={searchQuery}
25
- onPaginationChange={onPaginationChange}
26
- />);
27
-
28
- expect(toJson(wrapper)).toMatchSnapshot();
29
- expect(wrapper.find(ContentTable)).toHaveLength(1);
30
- expect(wrapper.find(SearchBar)).toHaveLength(1);
31
- });
32
- });