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.
- checksums.yaml +4 -4
- data/app/controllers/katello/api/registry/registry_proxies_controller.rb +2 -18
- data/app/controllers/katello/api/v2/alternate_content_sources_controller.rb +7 -5
- data/app/controllers/katello/api/v2/repositories_controller.rb +3 -18
- data/app/helpers/katello/hosts_and_hostgroups_helper.rb +13 -8
- data/app/lib/actions/katello/alternate_content_source/create.rb +3 -1
- data/app/lib/actions/katello/alternate_content_source/update.rb +3 -1
- data/app/lib/actions/pulp3/orchestration/content_view_version/copy_version_units_to_library.rb +1 -1
- data/app/lib/actions/pulp3/orchestration/content_view_version/export.rb +11 -11
- data/app/lib/actions/pulp3/orchestration/content_view_version/syncable_export.rb +0 -2
- data/app/lib/actions/pulp3/repository/reclaim_space.rb +1 -1
- data/app/lib/katello/api/v2/error_handling.rb +12 -2
- data/app/lib/katello/concerns/base_template_scope_extensions.rb +7 -3
- data/app/models/katello/alternate_content_source.rb +54 -4
- data/app/models/katello/concerns/host_managed_extensions.rb +14 -0
- data/app/models/katello/glue/provider.rb +1 -1
- data/app/models/katello/host/content_facet.rb +2 -0
- data/app/services/katello/pulp3/content_view_version/export_validation_error.rb +1 -1
- data/app/services/katello/pulp3/content_view_version/export_validator.rb +16 -0
- data/app/views/foreman/smart_proxies/_content_sync.html.erb +1 -1
- data/db/migrate/20230203141353_set_new_acs_verify_ssl_default.rb +5 -0
- data/db/seeds.d/111-upgrade_tasks.rb +2 -1
- data/lib/katello/plugin.rb +0 -12
- data/lib/katello/tasks/upgrades/4.8/regenerate_imported_repository_metadata.rake +33 -0
- data/lib/katello/version.rb +1 -1
- data/webpack/components/Content/{ContentPage.js → GenericContentPage.js} +7 -4
- data/webpack/components/Content/__tests__/ContentTable.test.js +1 -1
- data/webpack/components/Content/__tests__/GenericContentPage.test.js +35 -0
- data/webpack/components/Search/SearchText.js +70 -0
- data/webpack/components/Table/EmptyStateMessage.js +2 -2
- data/webpack/components/Table/TableWrapper.js +4 -0
- data/webpack/components/extensions/HostDetails/Cards/ContentViewDetailsCard/ChangeHostCVModal.js +10 -72
- data/webpack/components/extensions/HostDetails/HostDetailsConstants.js +0 -1
- data/webpack/components/extensions/HostDetails/HostDetailsSelectors.js +0 -6
- data/webpack/components/extensions/HostDetails/Tabs/__tests__/moduleStreamsTab.test.js +76 -0
- data/webpack/components/extensions/SearchBar/SearchBarConstants.js +3 -0
- data/webpack/components/extensions/SearchBar/SearchBarHooks.js +50 -0
- data/webpack/components/extensions/SearchBar/SearchBarReducer.js +14 -0
- data/webpack/components/extensions/SearchBar/SearchBarSelectors.js +5 -0
- data/webpack/redux/actions/RedHatRepositories/helpers.js +5 -3
- data/webpack/redux/reducers/index.js +2 -2
- data/webpack/scenes/AlternateContentSources/Create/__tests__/acsCreate.test.js +1 -13
- data/webpack/scenes/AlternateContentSources/Details/ACSExpandableDetails.js +6 -5
- data/webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditCredentials.js +1 -0
- data/webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditDetails.js +3 -2
- data/webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditProducts.js +1 -0
- data/webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditSmartProxies.js +2 -0
- data/webpack/scenes/AlternateContentSources/Details/EditModals/ACSEditURLPaths.js +1 -0
- data/webpack/scenes/AlternateContentSources/MainTable/ACSTable.js +1 -0
- data/webpack/scenes/Content/{ContentPage.js → GenericContentPage.js} +2 -2
- data/webpack/scenes/Content/__tests__/contentTable.test.js +2 -2
- data/webpack/scenes/Content/index.js +2 -2
- data/webpack/scenes/ContentViews/Details/ContentViewDetails.js +1 -0
- data/webpack/scenes/ContentViews/Details/Filters/Rules/ContainerTag/AddEditContainerTagRuleModal.js +14 -17
- data/webpack/scenes/ContentViews/Details/Filters/Rules/Package/AddEditPackageRuleModal.js +24 -28
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/CVContainerImageFilterContent.test.js +11 -18
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/CVRpmFilterContent.test.js +10 -23
- data/webpack/scenes/ContentViews/Details/Filters/__tests__/ContentViewPackageGroupFilter.test.js +0 -2
- data/webpack/scenes/ContentViews/Details/Versions/__tests__/contentViewVersions.test.js +1 -7
- data/webpack/scenes/ContentViews/components/ContentViewSelect/ContentViewSelectOption.js +87 -0
- data/webpack/scenes/ContentViews/components/EnvironmentPaths/EnvironmentPaths.js +1 -1
- data/webpack/scenes/ContentViews/expansions/__tests__/contentViewComponentsModal.test.js +0 -2
- data/webpack/scenes/Hosts/ChangeContentSource/components/ContentSourceForm.js +153 -28
- data/webpack/scenes/Hosts/ChangeContentSource/index.js +14 -15
- data/webpack/scenes/Hosts/ChangeContentSource/selectors.js +4 -0
- data/webpack/scenes/Hosts/ChangeContentSource/styles.scss +4 -0
- data/webpack/scenes/ModuleStreams/ModuleStreamsPage.js +2 -2
- data/webpack/scenes/ModuleStreams/__tests__/ModuleStreamPage.test.js +2 -2
- data/webpack/scenes/ModuleStreams/__tests__/__snapshots__/ModuleStreamPage.test.js.snap +1 -1
- data/webpack/scenes/Settings/SettingsConstants.js +2 -3
- data/webpack/scenes/Settings/SettingsReducer.js +2 -16
- data/webpack/scenes/Settings/SettingsSelectors.js +2 -2
- data/webpack/test-utils/react-testing-lib-wrapper.js +0 -6
- metadata +16 -25
- data/webpack/components/Content/__tests__/ContentPage.test.js +0 -32
- data/webpack/components/Content/__tests__/__snapshots__/ContentPage.test.js.snap +0 -89
- data/webpack/components/Search/Search.js +0 -156
- data/webpack/components/Search/__tests__/search.test.js +0 -104
- data/webpack/components/Search/helpers.js +0 -6
- data/webpack/components/Search/index.js +0 -15
- data/webpack/components/TypeAhead/TypeAhead.js +0 -157
- data/webpack/components/TypeAhead/TypeAhead.scss +0 -7
- data/webpack/components/TypeAhead/helpers/commonPropTypes.js +0 -35
- data/webpack/components/TypeAhead/helpers/helpers.js +0 -32
- data/webpack/components/TypeAhead/index.js +0 -3
- data/webpack/components/TypeAhead/pf3Search/TypeAheadInput.js +0 -44
- data/webpack/components/TypeAhead/pf3Search/TypeAheadItems.js +0 -56
- data/webpack/components/TypeAhead/pf3Search/TypeAheadSearch.js +0 -53
- data/webpack/components/TypeAhead/pf4Search/TypeAheadInput.js +0 -66
- data/webpack/components/TypeAhead/pf4Search/TypeAheadInput.scss +0 -12
- data/webpack/components/TypeAhead/pf4Search/TypeAheadItems.js +0 -59
- data/webpack/components/TypeAhead/pf4Search/TypeAheadSearch.js +0 -81
@@ -1,56 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { Dropdown, MenuItem } from 'patternfly-react';
|
3
|
-
|
4
|
-
import { commonItemPropTypes } from '../helpers/commonPropTypes';
|
5
|
-
|
6
|
-
const TypeAheadItems = ({
|
7
|
-
items, activeItems, getItemProps, highlightedIndex,
|
8
|
-
}) => (
|
9
|
-
<Dropdown.Menu className="typeahead-dropdown" ouiaId="typeahead-dropdown">
|
10
|
-
{items.map(({ text, type, disabled = false }, index) => {
|
11
|
-
if (type === 'header') {
|
12
|
-
return (
|
13
|
-
<MenuItem key={text} header>
|
14
|
-
{text}
|
15
|
-
</MenuItem>
|
16
|
-
);
|
17
|
-
}
|
18
|
-
|
19
|
-
if (type === 'divider') {
|
20
|
-
// eslint-disable-next-line react/no-array-index-key
|
21
|
-
return <MenuItem key={`divider-${index}`} divider />;
|
22
|
-
}
|
23
|
-
|
24
|
-
if (disabled) {
|
25
|
-
return (
|
26
|
-
<MenuItem key={text} disabled>
|
27
|
-
{text}
|
28
|
-
</MenuItem>
|
29
|
-
);
|
30
|
-
}
|
31
|
-
|
32
|
-
const itemProps = getItemProps({
|
33
|
-
index: activeItems.indexOf(text),
|
34
|
-
item: text,
|
35
|
-
active: activeItems[highlightedIndex] === text,
|
36
|
-
onClick: (e) => {
|
37
|
-
// At this point the event.defaultPrevented
|
38
|
-
// is already set to true by react-bootstrap
|
39
|
-
// MenuItem. We need to set it back to false
|
40
|
-
// So downshift will execute it's own handler
|
41
|
-
e.defaultPrevented = false;
|
42
|
-
},
|
43
|
-
});
|
44
|
-
|
45
|
-
return (
|
46
|
-
<MenuItem {...itemProps} key={text}>
|
47
|
-
{text}
|
48
|
-
</MenuItem>
|
49
|
-
);
|
50
|
-
})}
|
51
|
-
</Dropdown.Menu>
|
52
|
-
);
|
53
|
-
|
54
|
-
TypeAheadItems.propTypes = commonItemPropTypes;
|
55
|
-
|
56
|
-
export default TypeAheadItems;
|
@@ -1,53 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { InputGroup, Button, Icon } from 'patternfly-react';
|
3
|
-
import PropTypes from 'prop-types';
|
4
|
-
import { translate as __ } from 'foremanReact/common/I18n';
|
5
|
-
|
6
|
-
import TypeAheadInput from './TypeAheadInput';
|
7
|
-
import TypeAheadItems from './TypeAheadItems';
|
8
|
-
import keyPressHandler from '../helpers/helpers';
|
9
|
-
import commonSearchPropTypes from '../helpers/commonPropTypes';
|
10
|
-
|
11
|
-
const TypeAheadSearch = ({
|
12
|
-
userInputValue, clearSearch, getInputProps, getItemProps, isOpen, inputValue, highlightedIndex,
|
13
|
-
selectedItem, selectItem, openMenu, onSearch, items, activeItems, actionText, shouldShowItems,
|
14
|
-
}) => (
|
15
|
-
<div>
|
16
|
-
<InputGroup>
|
17
|
-
<TypeAheadInput
|
18
|
-
onKeyPress={e => keyPressHandler(
|
19
|
-
e, isOpen, activeItems, highlightedIndex,
|
20
|
-
selectItem, userInputValue, onSearch,
|
21
|
-
)}
|
22
|
-
onInputFocus={openMenu}
|
23
|
-
passedProps={getInputProps()}
|
24
|
-
/>
|
25
|
-
{userInputValue &&
|
26
|
-
<InputGroup.Button>
|
27
|
-
<Button onClick={clearSearch}>
|
28
|
-
<Icon name="times" />
|
29
|
-
</Button>
|
30
|
-
</InputGroup.Button>
|
31
|
-
}
|
32
|
-
<InputGroup.Button>
|
33
|
-
<Button aria-label="patternfly 3 search button" onClick={() => onSearch(inputValue)}>{actionText}</Button>
|
34
|
-
</InputGroup.Button>
|
35
|
-
</InputGroup>
|
36
|
-
|
37
|
-
{shouldShowItems && <TypeAheadItems {...{
|
38
|
-
items, highlightedIndex, selectedItem, getItemProps, activeItems,
|
39
|
-
}}
|
40
|
-
/>}
|
41
|
-
</div>
|
42
|
-
);
|
43
|
-
|
44
|
-
TypeAheadSearch.propTypes = {
|
45
|
-
...commonSearchPropTypes,
|
46
|
-
actionText: PropTypes.string,
|
47
|
-
};
|
48
|
-
|
49
|
-
TypeAheadSearch.defaultProps = {
|
50
|
-
actionText: __('Search'),
|
51
|
-
};
|
52
|
-
|
53
|
-
export default TypeAheadSearch;
|
@@ -1,66 +0,0 @@
|
|
1
|
-
import React, { useRef } from 'react';
|
2
|
-
import PropTypes from 'prop-types';
|
3
|
-
import { TextInput, Button } from '@patternfly/react-core';
|
4
|
-
import { TimesIcon } from '@patternfly/react-icons';
|
5
|
-
import useEventListener from '../../../utils/useEventListener';
|
6
|
-
import { commonInputPropTypes } from '../helpers/commonPropTypes';
|
7
|
-
|
8
|
-
import './TypeAheadInput.scss';
|
9
|
-
|
10
|
-
const TypeAheadInput = ({
|
11
|
-
onKeyPress, onInputFocus, passedProps, isDisabled, autoSearchEnabled, placeholder, isTextInput,
|
12
|
-
}) => {
|
13
|
-
const inputRef = useRef(null);
|
14
|
-
const {
|
15
|
-
onChange, value, clearSearch, ...downshiftProps
|
16
|
-
} = passedProps;
|
17
|
-
|
18
|
-
// What patternfly4 expects for args and what downshift creates as a function is different,
|
19
|
-
// downshift only expects the event handler
|
20
|
-
const onChangeWrapper = (_userValue, event) => onChange(event);
|
21
|
-
|
22
|
-
useEventListener('keydown', onKeyPress, inputRef.current);
|
23
|
-
|
24
|
-
return (
|
25
|
-
<>
|
26
|
-
<TextInput
|
27
|
-
isDisabled={isDisabled}
|
28
|
-
value={value}
|
29
|
-
{...downshiftProps}
|
30
|
-
ref={inputRef}
|
31
|
-
onFocus={onInputFocus}
|
32
|
-
aria-label="text input for search"
|
33
|
-
ouiaId="type-ahead-input"
|
34
|
-
onChange={onChangeWrapper}
|
35
|
-
type="text"
|
36
|
-
iconVariant={autoSearchEnabled && !isTextInput ? 'search' : undefined}
|
37
|
-
placeholder={placeholder}
|
38
|
-
/>
|
39
|
-
{
|
40
|
-
(value && !isTextInput) &&
|
41
|
-
<Button
|
42
|
-
variant={autoSearchEnabled ? 'plain' : 'control'}
|
43
|
-
className="search-clear"
|
44
|
-
ouiaId="search-clear-button"
|
45
|
-
onClick={clearSearch}
|
46
|
-
>
|
47
|
-
<TimesIcon />
|
48
|
-
</Button>}
|
49
|
-
</>);
|
50
|
-
};
|
51
|
-
|
52
|
-
TypeAheadInput.propTypes = {
|
53
|
-
isDisabled: PropTypes.bool,
|
54
|
-
autoSearchEnabled: PropTypes.bool.isRequired,
|
55
|
-
...commonInputPropTypes,
|
56
|
-
placeholder: PropTypes.string,
|
57
|
-
isTextInput: PropTypes.bool,
|
58
|
-
};
|
59
|
-
|
60
|
-
TypeAheadInput.defaultProps = {
|
61
|
-
isDisabled: undefined,
|
62
|
-
placeholder: '',
|
63
|
-
isTextInput: false,
|
64
|
-
};
|
65
|
-
|
66
|
-
export default TypeAheadInput;
|
@@ -1,12 +0,0 @@
|
|
1
|
-
.highlighted {
|
2
|
-
--pf-c-dropdown__menu-item--Color: var(--pf-c-dropdown__menu-item--hover--Color);
|
3
|
-
--pf-c-dropdown__menu-item--BackgroundColor: var(--pf-c-dropdown__menu-item--hover--BackgroundColor);
|
4
|
-
text-decoration: none;
|
5
|
-
}
|
6
|
-
|
7
|
-
.search-clear {
|
8
|
-
margin-left: -36px;
|
9
|
-
z-index: 2;
|
10
|
-
padding: 10px;
|
11
|
-
display: flex;
|
12
|
-
}
|
@@ -1,59 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import {
|
3
|
-
Dropdown,
|
4
|
-
DropdownItem,
|
5
|
-
DropdownSeparator,
|
6
|
-
} from '@patternfly/react-core';
|
7
|
-
import PropTypes from 'prop-types';
|
8
|
-
|
9
|
-
import { commonItemPropTypes } from '../helpers/commonPropTypes';
|
10
|
-
|
11
|
-
const TypeAheadItems = ({
|
12
|
-
isOpen, items, activeItems, getItemProps, highlightedIndex,
|
13
|
-
}) => {
|
14
|
-
const buildDropdownItems = () => items.map(({ text, type, disabled = false }, index) => {
|
15
|
-
const key = `${text}${index}`;
|
16
|
-
if (type === 'divider') return (<DropdownSeparator key={key} />);
|
17
|
-
const isHighlighted = highlightedIndex === index;
|
18
|
-
const itemProps = getItemProps({
|
19
|
-
index: activeItems.indexOf(text),
|
20
|
-
item: text,
|
21
|
-
key,
|
22
|
-
disabled,
|
23
|
-
className: isHighlighted ? 'highlighted' : '',
|
24
|
-
});
|
25
|
-
const { onClick, ...dropdownProps } = itemProps;
|
26
|
-
return (
|
27
|
-
<DropdownItem
|
28
|
-
ouiaId={text}
|
29
|
-
{...dropdownProps}
|
30
|
-
component={
|
31
|
-
<button onClick={onClick}>{text}</button>
|
32
|
-
}
|
33
|
-
/>
|
34
|
-
);
|
35
|
-
});
|
36
|
-
|
37
|
-
// toggle prop is required but since it is not manually toggled, React.Fragment is used to
|
38
|
-
// satisfy the requirement
|
39
|
-
return (
|
40
|
-
<Dropdown
|
41
|
-
toggle={<React.Fragment />}
|
42
|
-
isOpen={isOpen}
|
43
|
-
dropdownItems={buildDropdownItems()}
|
44
|
-
className="typeahead-dropdown"
|
45
|
-
ouiaId="typeahead-dropdown"
|
46
|
-
/>
|
47
|
-
);
|
48
|
-
};
|
49
|
-
|
50
|
-
TypeAheadItems.propTypes = {
|
51
|
-
...commonItemPropTypes,
|
52
|
-
isOpen: PropTypes.bool,
|
53
|
-
};
|
54
|
-
|
55
|
-
TypeAheadItems.defaultProps = {
|
56
|
-
isOpen: false,
|
57
|
-
};
|
58
|
-
|
59
|
-
export default TypeAheadItems;
|
@@ -1,81 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { InputGroup, Button } from '@patternfly/react-core';
|
3
|
-
import { SearchIcon } from '@patternfly/react-icons';
|
4
|
-
|
5
|
-
import PropTypes from 'prop-types';
|
6
|
-
import keyPressHandler from '../helpers/helpers';
|
7
|
-
import TypeAheadInput from './TypeAheadInput';
|
8
|
-
import TypeAheadItems from './TypeAheadItems';
|
9
|
-
import commonSearchPropTypes from '../helpers/commonPropTypes';
|
10
|
-
import Bookmark from './../../../components/Bookmark';
|
11
|
-
|
12
|
-
const TypeAheadSearch = ({
|
13
|
-
userInputValue, clearSearch, getInputProps, getItemProps, isOpen, highlightedIndex,
|
14
|
-
selectedItem, selectItem, openMenu, onSearch, items, activeItems, shouldShowItems,
|
15
|
-
autoSearchEnabled, isDisabled, bookmarkController, inputValue, placeholder, isTextInput,
|
16
|
-
readOnlyBookmarks,
|
17
|
-
}) => (
|
18
|
-
<>
|
19
|
-
<InputGroup>
|
20
|
-
<TypeAheadInput
|
21
|
-
isDisabled={isDisabled}
|
22
|
-
onKeyPress={
|
23
|
-
(e) => {
|
24
|
-
keyPressHandler(
|
25
|
-
e,
|
26
|
-
isOpen,
|
27
|
-
activeItems,
|
28
|
-
highlightedIndex,
|
29
|
-
selectItem,
|
30
|
-
userInputValue,
|
31
|
-
onSearch,
|
32
|
-
);
|
33
|
-
}
|
34
|
-
}
|
35
|
-
onInputFocus={openMenu}
|
36
|
-
passedProps={{ ...getInputProps(), clearSearch }}
|
37
|
-
autoSearchEnabled={autoSearchEnabled}
|
38
|
-
placeholder={placeholder}
|
39
|
-
isTextInput={isTextInput}
|
40
|
-
/>
|
41
|
-
<>
|
42
|
-
{bookmarkController &&
|
43
|
-
<Bookmark
|
44
|
-
{...{
|
45
|
-
isDisabled,
|
46
|
-
selectedItem,
|
47
|
-
selectItem,
|
48
|
-
readOnlyBookmarks,
|
49
|
-
}}
|
50
|
-
controller={bookmarkController}
|
51
|
-
/>}
|
52
|
-
{(!autoSearchEnabled && !isTextInput) &&
|
53
|
-
<Button ouiaId="search-button" aria-label="search button" variant="control" onClick={() => onSearch(inputValue)}>
|
54
|
-
<SearchIcon />
|
55
|
-
</Button>}
|
56
|
-
</>
|
57
|
-
</InputGroup>
|
58
|
-
<TypeAheadItems
|
59
|
-
isOpen={shouldShowItems}
|
60
|
-
{...{
|
61
|
-
items, highlightedIndex, selectedItem, getItemProps, activeItems,
|
62
|
-
}}
|
63
|
-
/>
|
64
|
-
</>
|
65
|
-
);
|
66
|
-
|
67
|
-
TypeAheadSearch.propTypes = {
|
68
|
-
isDisabled: PropTypes.bool,
|
69
|
-
autoSearchEnabled: PropTypes.bool.isRequired,
|
70
|
-
bookmarkController: PropTypes.string,
|
71
|
-
isTextInput: PropTypes.bool,
|
72
|
-
...commonSearchPropTypes,
|
73
|
-
};
|
74
|
-
|
75
|
-
TypeAheadSearch.defaultProps = {
|
76
|
-
bookmarkController: undefined,
|
77
|
-
isDisabled: undefined,
|
78
|
-
isTextInput: false,
|
79
|
-
};
|
80
|
-
|
81
|
-
export default TypeAheadSearch;
|