katello 4.6.2 → 4.6.2.1
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/services/katello/content_unit_indexer.rb +1 -2
- data/lib/katello/version.rb +1 -1
- data/webpack/components/Table/TableHooks.js +2 -1
- data/webpack/components/Table/__test__/useBulkSelect.test.js +99 -0
- data/webpack/components/extensions/HostDetails/Tabs/ErrataTab/ErrataTab.js +12 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2dd589cc9f10f642c5e8eac5dec7145c6e36eb35ba7ff39da34e295998277e0f
|
4
|
+
data.tar.gz: 8e6e3b9674bc9c153cb54ff2408a6c504d61c9bb95e4dd45b30ecbaabc3c1cd3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 166848d61324a18d58a58708146b5525888788707ffac5c1d0899cb9f1663a42f075628d691289c54771db0dd769bfbbdd159df68c9249c4dc87fd11f265fef8
|
7
|
+
data.tar.gz: 9a693e7711623e663ceadaea211a5aa2d2b4a0c658d36fd36f1705f0d5a799a763574c75415af9373caec26f41b34de227e2e70e7a3e4915279d7603fe8c39f2
|
@@ -22,7 +22,6 @@ module Katello
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def import_all(filtered_indexing = false)
|
25
|
-
additive = filtered_indexing || (@repository&.mirroring_policy == 'additive')
|
26
25
|
association_tracker = RepoAssociationTracker.new(@content_type, @service_class, @repository)
|
27
26
|
units_from_pulp.each do |units|
|
28
27
|
units.each do |unit|
|
@@ -52,7 +51,7 @@ module Katello
|
|
52
51
|
end
|
53
52
|
|
54
53
|
if @model_class.many_repository_associations && @repository
|
55
|
-
sync_repository_associations(association_tracker, additive:
|
54
|
+
sync_repository_associations(association_tracker, additive: filtered_indexing)
|
56
55
|
end
|
57
56
|
end
|
58
57
|
|
data/lib/katello/version.rb
CHANGED
@@ -145,6 +145,7 @@ export const useBulkSelect = ({
|
|
145
145
|
initialArry = [],
|
146
146
|
initialSearchQuery = '',
|
147
147
|
idColumn = 'id',
|
148
|
+
filtersQuery = '',
|
148
149
|
isSelectable,
|
149
150
|
}) => {
|
150
151
|
const { selectionSet: inclusionSet, ...selectOptions } =
|
@@ -208,7 +209,7 @@ export const useBulkSelect = ({
|
|
208
209
|
|
209
210
|
const fetchBulkParams = (idColumnName = idColumn) => {
|
210
211
|
const searchQueryWithExclusionSet = () => {
|
211
|
-
const query = [searchQuery,
|
212
|
+
const query = [searchQuery, filtersQuery,
|
212
213
|
!isEmpty(exclusionSet) && `${idColumnName} !^ (${[...exclusionSet].join(',')})`];
|
213
214
|
return query.filter(item => item).join(' and ');
|
214
215
|
};
|
@@ -0,0 +1,99 @@
|
|
1
|
+
import { act, renderHook } from '@testing-library/react-hooks';
|
2
|
+
import { useBulkSelect } from '../TableHooks';
|
3
|
+
|
4
|
+
const isSelectable = () => true;
|
5
|
+
const idColumn = 'errata_id';
|
6
|
+
const metadata = {
|
7
|
+
error: null, selectable: 2, subtotal: 2, total: 2,
|
8
|
+
};
|
9
|
+
const results = [
|
10
|
+
{
|
11
|
+
errata_id: 'RHSA-2022:2031',
|
12
|
+
id: 311,
|
13
|
+
severity: 'Low',
|
14
|
+
type: 'security',
|
15
|
+
},
|
16
|
+
{
|
17
|
+
errata_id: 'RHSA-2022:2110',
|
18
|
+
id: 17,
|
19
|
+
severity: 'Low',
|
20
|
+
type: 'security',
|
21
|
+
},
|
22
|
+
];
|
23
|
+
|
24
|
+
it('returns a scoped search string based on inclusionSet', () => {
|
25
|
+
const { result } = renderHook(() => useBulkSelect({
|
26
|
+
results,
|
27
|
+
metadata,
|
28
|
+
idColumn,
|
29
|
+
isSelectable,
|
30
|
+
}));
|
31
|
+
|
32
|
+
act(() => {
|
33
|
+
result.current.selectOne(true, 'RHSA-2022:2031');
|
34
|
+
});
|
35
|
+
|
36
|
+
expect(result.current.fetchBulkParams()).toBe('errata_id ^ (RHSA-2022:2031)');
|
37
|
+
});
|
38
|
+
|
39
|
+
it('returns a scoped search string based on exclusionSet', () => {
|
40
|
+
const { result } = renderHook(() => useBulkSelect({
|
41
|
+
results,
|
42
|
+
metadata,
|
43
|
+
idColumn,
|
44
|
+
isSelectable,
|
45
|
+
}));
|
46
|
+
|
47
|
+
act(() => {
|
48
|
+
result.current.selectAll(true);
|
49
|
+
});
|
50
|
+
|
51
|
+
act(() => {
|
52
|
+
result.current.selectOne(false, 'RHSA-2022:2031');
|
53
|
+
});
|
54
|
+
|
55
|
+
expect(result.current.fetchBulkParams()).toBe('errata_id !^ (RHSA-2022:2031)');
|
56
|
+
});
|
57
|
+
|
58
|
+
it('adds search query to scoped search string based on exclusionSet', () => {
|
59
|
+
const { result } = renderHook(() => useBulkSelect({
|
60
|
+
results,
|
61
|
+
metadata,
|
62
|
+
idColumn,
|
63
|
+
isSelectable,
|
64
|
+
}));
|
65
|
+
|
66
|
+
act(() => {
|
67
|
+
result.current.updateSearchQuery('type=security');
|
68
|
+
});
|
69
|
+
|
70
|
+
act(() => {
|
71
|
+
result.current.selectAll(true);
|
72
|
+
});
|
73
|
+
|
74
|
+
act(() => {
|
75
|
+
result.current.selectOne(false, 'RHSA-2022:2031');
|
76
|
+
});
|
77
|
+
|
78
|
+
expect(result.current.fetchBulkParams()).toBe('type=security and errata_id !^ (RHSA-2022:2031)');
|
79
|
+
});
|
80
|
+
|
81
|
+
it('adds filter dropdown query to scoped search string', () => {
|
82
|
+
const { result } = renderHook(() => useBulkSelect({
|
83
|
+
results,
|
84
|
+
metadata,
|
85
|
+
idColumn,
|
86
|
+
isSelectable,
|
87
|
+
filtersQuery: 'severity=Low',
|
88
|
+
}));
|
89
|
+
|
90
|
+
act(() => {
|
91
|
+
result.current.selectAll(true);
|
92
|
+
});
|
93
|
+
|
94
|
+
act(() => {
|
95
|
+
result.current.selectOne(false, 'RHSA-2022:2031');
|
96
|
+
});
|
97
|
+
|
98
|
+
expect(result.current.fetchBulkParams()).toBe('severity=Low and errata_id !^ (RHSA-2022:2031)');
|
99
|
+
});
|
@@ -120,6 +120,17 @@ export const ErrataTab = () => {
|
|
120
120
|
initialSortColumnName: 'Errata',
|
121
121
|
});
|
122
122
|
|
123
|
+
const filtersQuery = () => {
|
124
|
+
const query = [];
|
125
|
+
if (errataTypeSelected !== ERRATA_TYPE) {
|
126
|
+
query.push(`type=${TYPES_TO_PARAM[errataTypeSelected]}`);
|
127
|
+
}
|
128
|
+
if (errataSeveritySelected !== ERRATA_SEVERITY) {
|
129
|
+
query.push(`severity=${SEVERITIES_TO_PARAM[errataSeveritySelected]}`);
|
130
|
+
}
|
131
|
+
return query.join(' and ');
|
132
|
+
};
|
133
|
+
|
123
134
|
const fetchItems = useCallback(
|
124
135
|
(params) => {
|
125
136
|
if (!hostId) return hostIdNotReady;
|
@@ -155,6 +166,7 @@ export const ErrataTab = () => {
|
|
155
166
|
results,
|
156
167
|
metadata,
|
157
168
|
idColumn: 'errata_id',
|
169
|
+
filtersQuery: filtersQuery(),
|
158
170
|
isSelectable: result => result.installable,
|
159
171
|
initialSearchQuery: searchParam || '',
|
160
172
|
});
|
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.6.2
|
4
|
+
version: 4.6.2.1
|
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-01-
|
11
|
+
date: 2023-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -4629,6 +4629,7 @@ files:
|
|
4629
4629
|
- webpack/components/Table/PageControls.js
|
4630
4630
|
- webpack/components/Table/TableHooks.js
|
4631
4631
|
- webpack/components/Table/TableWrapper.js
|
4632
|
+
- webpack/components/Table/__test__/useBulkSelect.test.js
|
4632
4633
|
- webpack/components/Table/components/SortableColumnHeaders.js
|
4633
4634
|
- webpack/components/Table/components/TranslatedPlural.js
|
4634
4635
|
- webpack/components/Table/helpers.js
|