katello 4.8.0.rc2 → 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 (55) hide show
  1. checksums.yaml +4 -4
  2. data/lib/katello/plugin.rb +0 -12
  3. data/lib/katello/version.rb +1 -1
  4. data/webpack/components/Content/{ContentPage.js → GenericContentPage.js} +7 -4
  5. data/webpack/components/Content/__tests__/ContentTable.test.js +1 -1
  6. data/webpack/components/Content/__tests__/GenericContentPage.test.js +35 -0
  7. data/webpack/components/Search/SearchText.js +70 -0
  8. data/webpack/components/Table/EmptyStateMessage.js +2 -2
  9. data/webpack/components/Table/TableWrapper.js +4 -0
  10. data/webpack/components/extensions/HostDetails/HostDetailsConstants.js +0 -1
  11. data/webpack/components/extensions/HostDetails/HostDetailsSelectors.js +0 -6
  12. data/webpack/components/extensions/HostDetails/Tabs/__tests__/moduleStreamsTab.test.js +76 -0
  13. data/webpack/components/extensions/SearchBar/SearchBarConstants.js +3 -0
  14. data/webpack/components/extensions/SearchBar/SearchBarHooks.js +50 -0
  15. data/webpack/components/extensions/SearchBar/SearchBarReducer.js +14 -0
  16. data/webpack/components/extensions/SearchBar/SearchBarSelectors.js +5 -0
  17. data/webpack/redux/reducers/index.js +2 -2
  18. data/webpack/scenes/AlternateContentSources/Create/__tests__/acsCreate.test.js +1 -13
  19. data/webpack/scenes/AlternateContentSources/MainTable/ACSTable.js +1 -0
  20. data/webpack/scenes/Content/{ContentPage.js → GenericContentPage.js} +2 -2
  21. data/webpack/scenes/Content/__tests__/contentTable.test.js +2 -2
  22. data/webpack/scenes/Content/index.js +2 -2
  23. data/webpack/scenes/ContentViews/Details/Filters/Rules/ContainerTag/AddEditContainerTagRuleModal.js +14 -17
  24. data/webpack/scenes/ContentViews/Details/Filters/Rules/Package/AddEditPackageRuleModal.js +24 -28
  25. data/webpack/scenes/ContentViews/Details/Filters/__tests__/CVContainerImageFilterContent.test.js +11 -18
  26. data/webpack/scenes/ContentViews/Details/Filters/__tests__/CVRpmFilterContent.test.js +10 -23
  27. data/webpack/scenes/ContentViews/Details/Filters/__tests__/ContentViewPackageGroupFilter.test.js +0 -2
  28. data/webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.test.js +1 -7
  29. data/webpack/scenes/ContentViews/expansions/__tests__/contentViewComponentsModal.test.js +0 -2
  30. data/webpack/scenes/ModuleStreams/ModuleStreamsPage.js +2 -2
  31. data/webpack/scenes/ModuleStreams/__tests__/ModuleStreamPage.test.js +2 -2
  32. data/webpack/scenes/ModuleStreams/__tests__/__snapshots__/ModuleStreamPage.test.js.snap +1 -1
  33. data/webpack/scenes/Settings/SettingsConstants.js +2 -3
  34. data/webpack/scenes/Settings/SettingsReducer.js +2 -16
  35. data/webpack/scenes/Settings/SettingsSelectors.js +2 -2
  36. data/webpack/test-utils/react-testing-lib-wrapper.js +0 -6
  37. metadata +12 -24
  38. data/webpack/components/Content/__tests__/ContentPage.test.js +0 -32
  39. data/webpack/components/Content/__tests__/__snapshots__/ContentPage.test.js.snap +0 -89
  40. data/webpack/components/Search/Search.js +0 -156
  41. data/webpack/components/Search/__tests__/search.test.js +0 -104
  42. data/webpack/components/Search/helpers.js +0 -6
  43. data/webpack/components/Search/index.js +0 -15
  44. data/webpack/components/TypeAhead/TypeAhead.js +0 -157
  45. data/webpack/components/TypeAhead/TypeAhead.scss +0 -7
  46. data/webpack/components/TypeAhead/helpers/commonPropTypes.js +0 -35
  47. data/webpack/components/TypeAhead/helpers/helpers.js +0 -32
  48. data/webpack/components/TypeAhead/index.js +0 -3
  49. data/webpack/components/TypeAhead/pf3Search/TypeAheadInput.js +0 -44
  50. data/webpack/components/TypeAhead/pf3Search/TypeAheadItems.js +0 -56
  51. data/webpack/components/TypeAhead/pf3Search/TypeAheadSearch.js +0 -53
  52. data/webpack/components/TypeAhead/pf4Search/TypeAheadInput.js +0 -66
  53. data/webpack/components/TypeAhead/pf4Search/TypeAheadInput.scss +0 -12
  54. data/webpack/components/TypeAhead/pf4Search/TypeAheadItems.js +0 -59
  55. data/webpack/components/TypeAhead/pf4Search/TypeAheadSearch.js +0 -81
@@ -13,7 +13,7 @@ import {
13
13
  selectCreateFilterRuleStatus,
14
14
  } from '../../../ContentViewDetailSelectors';
15
15
  import { orgId } from '../../../../../../services/api';
16
- import Search from '../../../../../../components/Search/Search';
16
+ import SearchText from '../../../../../../components/Search/SearchText';
17
17
 
18
18
  const AddEditPackageRuleModal = ({
19
19
  filterId, onClose, selectedFilterRuleData, repositoryIds,
@@ -27,8 +27,8 @@ const AddEditPackageRuleModal = ({
27
27
  max_version: editingMaxVersion,
28
28
  } = selectedFilterRuleData || {};
29
29
 
30
- const architectureAutoCompleteEndpoint = '/packages/auto_complete_arch';
31
- const nameAutoCompleteEndpoint = '/packages/auto_complete_name';
30
+ const architectureAutoCompleteEndpoint = '/katello/api/v2/packages/auto_complete_arch';
31
+ const nameAutoCompleteEndpoint = '/katello/api/v2/packages/auto_complete_name';
32
32
 
33
33
  const isEditing = !!selectedFilterRuleData;
34
34
 
@@ -118,14 +118,11 @@ const AddEditPackageRuleModal = ({
118
118
  }
119
119
  }, [status, setSaving]);
120
120
 
121
- const getAutoCompleteParams = (term, autoCompleteEndpoint) => ({
122
- endpoint: autoCompleteEndpoint,
123
- params: {
124
- organization_id: orgId(),
125
- term,
126
- repoids: repositoryIds,
127
- non_modular: true,
128
- },
121
+ const searchDataProp = term => ({
122
+ organization_id: orgId(),
123
+ term,
124
+ repoids: repositoryIds,
125
+ non_modular: true,
129
126
  });
130
127
 
131
128
  return (
@@ -142,26 +139,25 @@ const AddEditPackageRuleModal = ({
142
139
  }}
143
140
  >
144
141
  <FormGroup label={__('RPM name')} isRequired fieldId="name">
145
- <Search
146
- patternfly4
147
- initialInputValue={name}
148
- onSearch={() => {}}
149
- getAutoCompleteParams={term => getAutoCompleteParams(term, nameAutoCompleteEndpoint)}
150
- foremanApiAutoComplete={false}
151
- isTextInput
152
- setTextInputValue={setName}
142
+ <SearchText
143
+ data={{
144
+ autocomplete: {
145
+ url: nameAutoCompleteEndpoint,
146
+ apiParams: input => searchDataProp(input),
147
+ },
148
+ }}
149
+ onSearchChange={setName}
153
150
  />
154
151
  </FormGroup>
155
152
  <FormGroup label={__('Architecture')} fieldId="architecture">
156
- <Search
157
- patternfly4
158
- initialInputValue={architecture}
159
- onSearch={() => {}}
160
- getAutoCompleteParams={term =>
161
- getAutoCompleteParams(term, architectureAutoCompleteEndpoint)}
162
- foremanApiAutoComplete={false}
163
- isTextInput
164
- setTextInputValue={setArchitecture}
153
+ <SearchText
154
+ data={{
155
+ autocomplete: {
156
+ url: architectureAutoCompleteEndpoint,
157
+ apiParams: arch => searchDataProp(arch),
158
+ },
159
+ }}
160
+ onSearchChange={setArchitecture}
165
161
  />
166
162
  </FormGroup>
167
163
  <FormGroup label={__('Version')} fieldId="version_comparator">
@@ -7,7 +7,6 @@ import {
7
7
  nockInstance,
8
8
  assertNockRequest,
9
9
  mockAutocomplete,
10
- mockSetting,
11
10
  } from '../../../../../test-utils/nockWrapper';
12
11
  import api from '../../../../../services/api';
13
12
  import CVContainerImageFilterContent from '../CVContainerImageFilterContent';
@@ -140,8 +139,6 @@ test('Can add filter rules', async (done) => {
140
139
  2,
141
140
  );
142
141
  const autocompleteNameScope = mockAutocomplete(nockInstance, autocompleteNameUrl, true, [], 2);
143
- const searchDelayScope = mockSetting(nockInstance, 'autosearch_delay', 0);
144
- const autoSearchScope = mockSetting(nockInstance, 'autosearch_while_typing');
145
142
 
146
143
  const cvFiltersScope = nockInstance
147
144
  .get(cvFilterRulesPath)
@@ -158,7 +155,7 @@ test('Can add filter rules', async (done) => {
158
155
  .query(true)
159
156
  .reply(200, { ...cvFilterFixtures, results: [...cvFilterFixtures.results, addedRule] });
160
157
 
161
- const { queryByText, getByLabelText } =
158
+ const { queryByText, getByLabelText, getAllByLabelText } =
162
159
  renderWithRedux(
163
160
  withCVRoute(<CVContainerImageFilterContent filterId={195} details={details} />),
164
161
  renderOptions,
@@ -177,7 +174,9 @@ test('Can add filter rules', async (done) => {
177
174
  expect(getByLabelText('add_edit_filter_rule')).toHaveAttribute('aria-disabled', 'true');
178
175
  });
179
176
 
180
- fireEvent.change(getByLabelText('text input for search'), { target: { value: 'new-rule' } });
177
+ const searchInput = getAllByLabelText('Search input')[1];
178
+ searchInput.focus();
179
+ fireEvent.change(searchInput, { target: { value: 'new-rule' } });
181
180
  fireEvent.submit(getByLabelText('add_edit_filter_rule'));
182
181
 
183
182
  await patientlyWaitFor(() => {
@@ -185,8 +184,6 @@ test('Can add filter rules', async (done) => {
185
184
  });
186
185
 
187
186
  assertNockRequest(autocompleteScope);
188
- assertNockRequest(searchDelayScope);
189
- assertNockRequest(autoSearchScope);
190
187
  assertNockRequest(cvFiltersScope);
191
188
  assertNockRequest(cvFilterAddScope);
192
189
  assertNockRequest(autocompleteNameScope);
@@ -205,8 +202,6 @@ test('Can edit filter rules', async (done) => {
205
202
  2,
206
203
  );
207
204
  const autocompleteNameScope = mockAutocomplete(nockInstance, autocompleteNameUrl, true, [], 2);
208
- const searchDelayScope = mockSetting(nockInstance, 'autosearch_delay', 0);
209
- const autoSearchScope = mockSetting(nockInstance, 'autosearch_while_typing');
210
205
 
211
206
  const cvFiltersScope = nockInstance
212
207
  .get(cvFilterRulesPath)
@@ -231,7 +226,9 @@ test('Can edit filter rules', async (done) => {
231
226
  }),
232
227
  });
233
228
 
234
- const { queryByText, getAllByLabelText, getByLabelText } =
229
+ const {
230
+ queryByText, getAllByLabelText, getByLabelText,
231
+ } =
235
232
  renderWithRedux(
236
233
  withCVRoute(<CVContainerImageFilterContent filterId={195} details={details} />),
237
234
  renderOptions,
@@ -258,7 +255,9 @@ test('Can edit filter rules', async (done) => {
258
255
  expect(getByLabelText('add_edit_filter_rule')).toHaveAttribute('aria-disabled', 'false');
259
256
  });
260
257
 
261
- fireEvent.change(getByLabelText('text input for search'), { target: { value: 'changed-name' } });
258
+ const searchInput = getAllByLabelText('Search input')[1];
259
+ searchInput.focus();
260
+ fireEvent.change(searchInput, { target: { value: 'changed-name' } });
262
261
  fireEvent.submit(getByLabelText('add_edit_filter_rule'));
263
262
 
264
263
  await patientlyWaitFor(() => {
@@ -266,8 +265,6 @@ test('Can edit filter rules', async (done) => {
266
265
  });
267
266
 
268
267
  assertNockRequest(autocompleteScope);
269
- assertNockRequest(searchDelayScope);
270
- assertNockRequest(autoSearchScope);
271
268
  assertNockRequest(cvFiltersScope);
272
269
  assertNockRequest(cvFilterAddScope);
273
270
  assertNockRequest(autocompleteNameScope);
@@ -284,8 +281,6 @@ test('Shows call-to-action when there are no filter rules', async (done) => {
284
281
  2,
285
282
  );
286
283
  const autocompleteNameScope = mockAutocomplete(nockInstance, autocompleteNameUrl, true, [], 2);
287
- const searchDelayScope = mockSetting(nockInstance, 'autosearch_delay', 0);
288
- const autoSearchScope = mockSetting(nockInstance, 'autosearch_while_typing');
289
284
  const cvFiltersScope = nockInstance
290
285
  .get(cvFilterRulesPath)
291
286
  .times(2)
@@ -302,13 +297,11 @@ test('Shows call-to-action when there are no filter rules', async (done) => {
302
297
  await patientlyWaitFor(() => expect(queryByLabelText('add_filter_rule_empty_state')).toBeInTheDocument());
303
298
  fireEvent.click(queryByLabelText('add_filter_rule_empty_state'));
304
299
  await patientlyWaitFor(() => {
305
- expect(getAllByLabelText('text input for search')[0]).toBeInTheDocument();
300
+ expect(getAllByLabelText('Search input')[0]).toBeInTheDocument();
306
301
  });
307
302
 
308
303
  assertNockRequest(autocompleteScope);
309
304
  assertNockRequest(autocompleteNameScope);
310
- assertNockRequest(searchDelayScope);
311
- assertNockRequest(autoSearchScope);
312
305
  assertNockRequest(cvFiltersScope, done);
313
306
  act(done);
314
307
  });
@@ -8,7 +8,6 @@ import {
8
8
  nockInstance,
9
9
  assertNockRequest,
10
10
  mockAutocomplete,
11
- mockSetting,
12
11
  } from '../../../../../test-utils/nockWrapper';
13
12
  import api from '../../../../../services/api';
14
13
  import cvFilterDetails from './cvPackageFilterDetail.fixtures.json';
@@ -163,8 +162,6 @@ test('Can add package rules to filter in a self-closing modal', async (done) =>
163
162
  nockInstance, autocompleteArchUrl, true,
164
163
  undefined, 2,
165
164
  );
166
- const searchDelayScope = mockSetting(nockInstance, 'autosearch_delay', 0, 3);
167
- const autoSearchScope = mockSetting(nockInstance, 'autosearch_while_typing', undefined, 3);
168
165
 
169
166
  const cvFiltersScope = nockInstance
170
167
  .get(cvFiltersPath)
@@ -214,20 +211,22 @@ test('Can add package rules to filter in a self-closing modal', async (done) =>
214
211
  });
215
212
  getByLabelText('add_rpm_rule').click();
216
213
  await patientlyWaitFor(() => {
217
- expect(getAllByLabelText('text input for search')[0]).toBeInTheDocument();
218
- expect(getAllByLabelText('text input for search')[1]).toBeInTheDocument();
214
+ expect(getAllByLabelText('Search input')[0]).toBeInTheDocument();
215
+ expect(getAllByLabelText('Search input')[1]).toBeInTheDocument();
219
216
  expect(getByLabelText('add_package_filter_rule')).toBeInTheDocument();
220
217
  });
221
- fireEvent.change(getAllByLabelText('text input for search')[0], { target: { value: 'elephant' } });
222
- fireEvent.change(getAllByLabelText('text input for search')[1], { target: { value: 'noarch' } });
218
+ const nameSearchInput = getAllByLabelText('Search input')[1];
219
+ const archSearchInput = getAllByLabelText('Search input')[2];
220
+ nameSearchInput.focus();
221
+ fireEvent.change(nameSearchInput, { target: { value: 'elephant' } });
222
+ archSearchInput.focus();
223
+ fireEvent.change(archSearchInput, { target: { value: 'noarch' } });
223
224
  fireEvent.submit(getByLabelText('add_package_filter_rule'));
224
225
 
225
226
  await patientlyWaitFor(() => {
226
227
  expect(queryByText('Add rule')).not.toBeInTheDocument();
227
228
  });
228
229
  assertNockRequest(autocompleteScope);
229
- assertNockRequest(searchDelayScope);
230
- assertNockRequest(autoSearchScope);
231
230
  assertNockRequest(autocompleteNameScope);
232
231
  assertNockRequest(autocompleteArchScope);
233
232
  assertNockRequest(cvFiltersScope);
@@ -241,8 +240,6 @@ test('Can add package rules to filter in a self-closing modal', async (done) =>
241
240
  test('Remove rpm filter rule in a self-closing modal', async (done) => {
242
241
  const { name: cvFilterName } = cvFilterDetails;
243
242
  const autocompleteScope = mockAutocomplete(nockInstance, autocompleteUrl);
244
- const searchDelayScope = mockSetting(nockInstance, 'autosearch_delay', 0);
245
- const autoSearchScope = mockSetting(nockInstance, 'autosearch_while_typing');
246
243
 
247
244
  const cvFiltersScope = nockInstance
248
245
  .get(cvFiltersPath)
@@ -289,8 +286,6 @@ test('Remove rpm filter rule in a self-closing modal', async (done) => {
289
286
  });
290
287
 
291
288
  assertNockRequest(autocompleteScope);
292
- assertNockRequest(searchDelayScope);
293
- assertNockRequest(autoSearchScope);
294
289
  assertNockRequest(cvFiltersScope);
295
290
  assertNockRequest(cvFilterDetailsScope);
296
291
  assertNockRequest(cvPackageFilterRulesScope);
@@ -310,8 +305,6 @@ test('Edit rpm filter rule in a self-closing modal', async (done) => {
310
305
  nockInstance, autocompleteArchUrl, true,
311
306
  undefined, 2,
312
307
  );
313
- const searchDelayScope = mockSetting(nockInstance, 'autosearch_delay', 0, 3);
314
- const autoSearchScope = mockSetting(nockInstance, 'autosearch_while_typing', undefined, 3);
315
308
  const cvFiltersScope = nockInstance
316
309
  .get(cvFiltersPath)
317
310
  .times(2)
@@ -366,8 +359,6 @@ test('Edit rpm filter rule in a self-closing modal', async (done) => {
366
359
  });
367
360
 
368
361
  assertNockRequest(autocompleteScope);
369
- assertNockRequest(searchDelayScope);
370
- assertNockRequest(autoSearchScope);
371
362
  assertNockRequest(autocompleteNameScope);
372
363
  assertNockRequest(autocompleteArchScope);
373
364
  assertNockRequest(cvFiltersScope);
@@ -381,8 +372,6 @@ test('Shows call-to-action when there are no RPM filters', async (done) => {
381
372
  const autocompleteScope = mockAutocomplete(nockInstance, autocompleteUrl);
382
373
  const autocompleteNameScope = mockAutocomplete(nockInstance, autocompleteNameUrl);
383
374
  const autocompleteArchScope = mockAutocomplete(nockInstance, autocompleteArchUrl);
384
- const searchDelayScope = mockSetting(nockInstance, 'autosearch_delay', 0, 3);
385
- const autoSearchScope = mockSetting(nockInstance, 'autosearch_while_typing', undefined, 3);
386
375
  const cvFilterDetailScope = nockInstance
387
376
  .get(cvFilterDetailsPath)
388
377
  .query(true)
@@ -397,7 +386,7 @@ test('Shows call-to-action when there are no RPM filters', async (done) => {
397
386
  .query(true)
398
387
  .reply(200, emptyCVPackageFilterRules);
399
388
  const {
400
- queryByLabelText, getAllByLabelText, queryByText,
389
+ queryByLabelText, queryByText, getAllByLabelText,
401
390
  } =
402
391
  renderWithRedux(withCVRoute(<ContentViewFilterDetails
403
392
  cvId={1}
@@ -408,7 +397,7 @@ test('Shows call-to-action when there are no RPM filters', async (done) => {
408
397
  fireEvent.click(queryByLabelText('add_rpm_rule_empty_state'));
409
398
 
410
399
  await patientlyWaitFor(() => {
411
- expect(getAllByLabelText('text input for search')[0]).toBeInTheDocument();
400
+ expect(getAllByLabelText('Search input')[0]).toBeInTheDocument();
412
401
  expect(queryByText('Cancel')).toBeInTheDocument();
413
402
  });
414
403
  fireEvent.click(queryByText('Cancel'));
@@ -418,8 +407,6 @@ test('Shows call-to-action when there are no RPM filters', async (done) => {
418
407
  assertNockRequest(autocompleteNameScope);
419
408
  assertNockRequest(autocompleteArchScope);
420
409
  assertNockRequest(autocompleteScope);
421
- assertNockRequest(searchDelayScope);
422
- assertNockRequest(autoSearchScope);
423
410
  assertNockRequest(cvFiltersScope);
424
411
  assertNockRequest(cvFilterDetailScope);
425
412
  assertNockRequest(cvPackageFilterRulesScope);
@@ -46,8 +46,6 @@ const renderOptions = {
46
46
 
47
47
  const withCVRoute = component => <Route path="/content_views/:id([0-9]+)#/filters/:filterId([0-9]+)">{component}</Route>;
48
48
 
49
- jest.mock('../../../../../components/Search', () => () => 'mocked!');
50
-
51
49
  test('Can enable and disable add filter button', async (done) => {
52
50
  const autocompleteScope = mockAutocomplete(nockInstance, autocompleteUrl, autocompleteQuery);
53
51
  const { name: cvFilterName } = cvFilterDetails;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { act, renderWithRedux, patientlyWaitFor, fireEvent } from 'react-testing-lib-wrapper';
3
3
  import { Route } from 'react-router-dom';
4
- import { nockInstance, assertNockRequest, mockAutocomplete, mockSetting } from '../../../../../test-utils/nockWrapper';
4
+ import { nockInstance, assertNockRequest, mockAutocomplete } from '../../../../../test-utils/nockWrapper';
5
5
  import api from '../../../../../services/api';
6
6
  import CONTENT_VIEWS_KEY from '../../../ContentViewsConstants';
7
7
  import ContentViewVersions from '../ContentViewVersions';
@@ -36,15 +36,11 @@ const autocompleteUrl = '/content_view_versions/auto_complete_search';
36
36
  const taskPollingUrl = '/foreman_tasks/api/tasks/6b900ff8-62bb-42ac-8c45-da86b7258520';
37
37
 
38
38
  let firstVersion;
39
- let searchDelayScope;
40
- let autoSearchScope;
41
39
  let envScope;
42
40
 
43
41
  beforeEach(() => {
44
42
  const { results } = cvVersionsData;
45
43
  [firstVersion] = results;
46
- searchDelayScope = mockSetting(nockInstance, 'autosearch_delay', 0);
47
- autoSearchScope = mockSetting(nockInstance, 'autosearch_while_typing');
48
44
  envScope = nockInstance
49
45
  .get(environmentPathsPath)
50
46
  .query(true)
@@ -53,8 +49,6 @@ beforeEach(() => {
53
49
 
54
50
  afterEach(() => {
55
51
  assertNockRequest(envScope);
56
- assertNockRequest(searchDelayScope);
57
- assertNockRequest(autoSearchScope);
58
52
  });
59
53
 
60
54
  test('Can call API and show versions on page load', async (done) => {
@@ -9,8 +9,6 @@ import RelatedCompositeContentViewsModal from '../RelatedCompositeContentViewsMo
9
9
 
10
10
  import contentViewComponentsResponse from './contentViewComponentsResponse.fixtures.json';
11
11
 
12
- jest.mock('../../../../components/Search', () => () => 'Mocked!');
13
-
14
12
  test('Can call API and show Related Content Views Components Modal', async (done) => {
15
13
  const cvId = 5;
16
14
  const relatedCvCount = 2;
@@ -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.rc2
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-03-29 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
@@ -4524,7 +4524,6 @@ files:
4524
4524
  - webpack/components/Bookmark/BookmarkConstants.js
4525
4525
  - webpack/components/Bookmark/BookmarkSelectors.js
4526
4526
  - webpack/components/Bookmark/index.js
4527
- - webpack/components/Content/ContentPage.js
4528
4527
  - webpack/components/Content/ContentTable.js
4529
4528
  - webpack/components/Content/Details/ContentDetailInfo.js
4530
4529
  - webpack/components/Content/Details/ContentDetailRepositories.js
@@ -4536,9 +4535,9 @@ files:
4536
4535
  - webpack/components/Content/Details/__tests__/__snapshots__/ContentDetailInfo.test.js.snap
4537
4536
  - webpack/components/Content/Details/__tests__/__snapshots__/ContentDetailRepositories.test.js.snap
4538
4537
  - webpack/components/Content/Details/__tests__/__snapshots__/ContentDetails.test.js.snap
4539
- - webpack/components/Content/__tests__/ContentPage.test.js
4538
+ - webpack/components/Content/GenericContentPage.js
4540
4539
  - webpack/components/Content/__tests__/ContentTable.test.js
4541
- - webpack/components/Content/__tests__/__snapshots__/ContentPage.test.js.snap
4540
+ - webpack/components/Content/__tests__/GenericContentPage.test.js
4542
4541
  - webpack/components/Content/__tests__/__snapshots__/ContentTable.test.js.snap
4543
4542
  - webpack/components/EditableSwitch.js
4544
4543
  - webpack/components/EditableTextInput/EditableTextInput.js
@@ -4563,10 +4562,7 @@ files:
4563
4562
  - webpack/components/Packages/index.js
4564
4563
  - webpack/components/RoutedTabs/__tests__/RoutedTabs.test.js
4565
4564
  - webpack/components/RoutedTabs/index.js
4566
- - webpack/components/Search/Search.js
4567
- - webpack/components/Search/__tests__/search.test.js
4568
- - webpack/components/Search/helpers.js
4569
- - webpack/components/Search/index.js
4565
+ - webpack/components/Search/SearchText.js
4570
4566
  - webpack/components/Select/Select.js
4571
4567
  - webpack/components/SelectAllCheckbox/SelectAllCheckbox.scss
4572
4568
  - webpack/components/SelectAllCheckbox/index.js
@@ -4593,18 +4589,6 @@ files:
4593
4589
  - webpack/components/TooltipButton/TooltipButton.test.js
4594
4590
  - webpack/components/TooltipButton/__snapshots__/TooltipButton.test.js.snap
4595
4591
  - webpack/components/TooltipButton/index.js
4596
- - webpack/components/TypeAhead/TypeAhead.js
4597
- - webpack/components/TypeAhead/TypeAhead.scss
4598
- - webpack/components/TypeAhead/helpers/commonPropTypes.js
4599
- - webpack/components/TypeAhead/helpers/helpers.js
4600
- - webpack/components/TypeAhead/index.js
4601
- - webpack/components/TypeAhead/pf3Search/TypeAheadInput.js
4602
- - webpack/components/TypeAhead/pf3Search/TypeAheadItems.js
4603
- - webpack/components/TypeAhead/pf3Search/TypeAheadSearch.js
4604
- - webpack/components/TypeAhead/pf4Search/TypeAheadInput.js
4605
- - webpack/components/TypeAhead/pf4Search/TypeAheadInput.scss
4606
- - webpack/components/TypeAhead/pf4Search/TypeAheadItems.js
4607
- - webpack/components/TypeAhead/pf4Search/TypeAheadSearch.js
4608
4592
  - webpack/components/WithOrganization/__snapshots__/withOrganization.test.js.snap
4609
4593
  - webpack/components/WithOrganization/withOrganization.js
4610
4594
  - webpack/components/WithOrganization/withOrganization.test.js
@@ -4724,6 +4708,10 @@ files:
4724
4708
  - webpack/components/extensions/RegistrationCommands/fields/IgnoreSubmanErrors.js
4725
4709
  - webpack/components/extensions/RegistrationCommands/fields/LifecycleEnvironment.js
4726
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
4727
4715
  - webpack/components/extensions/about/SystemStatuses.js
4728
4716
  - webpack/components/extensions/about/SystemStatusesActions.js
4729
4717
  - webpack/components/extensions/about/SystemStatusesConsts.js
@@ -4850,7 +4838,6 @@ files:
4850
4838
  - webpack/scenes/Content/ContentActions.js
4851
4839
  - webpack/scenes/Content/ContentConfig.js
4852
4840
  - webpack/scenes/Content/ContentConstants.js
4853
- - webpack/scenes/Content/ContentPage.js
4854
4841
  - webpack/scenes/Content/ContentSelectors.js
4855
4842
  - webpack/scenes/Content/Details/ContentDetails.js
4856
4843
  - webpack/scenes/Content/Details/ContentInfo.js
@@ -4861,6 +4848,7 @@ files:
4861
4848
  - webpack/scenes/Content/Details/__tests__/pythonPackageDetails.fixtures.json
4862
4849
  - webpack/scenes/Content/Details/__tests__/pythonPackageRepositoryDetails.fixtures.json
4863
4850
  - webpack/scenes/Content/Details/index.js
4851
+ - webpack/scenes/Content/GenericContentPage.js
4864
4852
  - webpack/scenes/Content/Table/ContentTable.js
4865
4853
  - webpack/scenes/Content/Table/index.js
4866
4854
  - webpack/scenes/Content/__tests__/ansibleCollections.fixtures.json
@@ -5375,9 +5363,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
5375
5363
  version: '2.5'
5376
5364
  required_rubygems_version: !ruby/object:Gem::Requirement
5377
5365
  requirements:
5378
- - - ">"
5366
+ - - ">="
5379
5367
  - !ruby/object:Gem::Version
5380
- version: 1.3.1
5368
+ version: '0'
5381
5369
  requirements: []
5382
5370
  rubygems_version: 3.1.6
5383
5371
  signing_key:
@@ -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
- });