Skip to content

Commit 0d6f5d2

Browse files
committed
hub-toolbar, hub-toolbar-left - unify from .toolbar, .hub-toolbar-wrapper
1 parent 0fc6dfa commit 0d6f5d2

File tree

19 files changed

+39
-60
lines changed

19 files changed

+39
-60
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
1-
.hub-toolbar-wrapper {
2-
.toolbar {
3-
display: flex;
4-
justify-content: space-between;
5-
align-items: center;
6-
7-
.hub-pagination-container {
8-
display: flex;
9-
align-items: center;
10-
}
11-
}
1+
.hub-pagination-container {
2+
display: flex;
3+
align-items: center;
124
}

src/components/copy-collection-to-repository-modal/copy-collection-to-repository-modal.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ export const CopyCollectionToRepositoryModal = (props: IProps) => {
362362
>
363363
<section className='modal-body' data-cy='modal-body'>
364364
{renderLabels(selectedRepos)}
365-
<div className='toolbar hub-toolbar'>
365+
<div className='hub-toolbar'>
366366
<Toolbar>
367367
<ToolbarGroup>
368368
<ToolbarItem>{renderMultipleSelector()}</ToolbarItem>

src/components/repo-selector/multiple-repo-selector.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ export const MultipleRepoSelector = (props: IProps) => {
279279
return (
280280
<>
281281
{renderLabels()}
282-
<div className='toolbar hub-toolbar'>
282+
<div className='hub-toolbar'>
283283
<Toolbar>
284284
<ToolbarGroup>
285285
{!props.singleSelectionOnly && (

src/containers/certification-dashboard/certification-dashboard.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ class CertificationDashboard extends React.Component<RouteProps, IState> {
212212
) : (
213213
<Main className='hub-certification-dashboard'>
214214
<section className='body' data-cy='body'>
215-
<div className='toolbar hub-toolbar'>
215+
<div className='hub-toolbar'>
216216
<Toolbar>
217217
<ToolbarContent>
218218
<ToolbarGroup>

src/containers/collection-detail/collection-distributions.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ const CollectionDistributions = (props: RouteProps) => {
225225
/>
226226
<Main>
227227
<section className='body'>
228-
<div className='toolbar hub-toolbar'>
228+
<div className='hub-toolbar'>
229229
<Toolbar>
230230
<ToolbarGroup>
231231
<ToolbarItem>

src/containers/execution-environment-detail/execution_environment_detail_images.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ class ExecutionEnvironmentDetailImages extends React.Component<
246246
tag={publishToController?.tag}
247247
/>
248248

249-
<div className='hub-toolbar toolbar'>
249+
<div className='hub-toolbar'>
250250
<Toolbar>
251251
<ToolbarContent>
252252
<ToolbarGroup>

src/containers/group-management/group-detail.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ class GroupDetail extends React.Component<RouteProps, IState> {
501501

502502
return (
503503
<section className='body'>
504-
<div className='toolbar'>
504+
<div className='hub-toolbar'>
505505
<Toolbar>
506506
<ToolbarContent>
507507
<ToolbarGroup>

src/containers/namespace-detail/namespace-detail.scss

-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
.namespace-detail {
2-
.pf-c-toolbar__content {
3-
padding-left: 0;
4-
}
5-
}
6-
71
.delete-namespace-modal-message {
82
padding-bottom: var(--pf-global--spacer--md);
93
}

src/containers/namespace-detail/namespace-detail.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -407,8 +407,8 @@ export class NamespaceDetail extends React.Component<RouteProps, IState> {
407407
pageControls={this.renderPageControls()}
408408
filters={
409409
tab === 'collections' ? (
410-
<div className='hub-toolbar-wrapper namespace-detail'>
411-
<div className='toolbar'>
410+
<div>
411+
<div className='hub-toolbar hub-toolbar-left'>
412412
<CollectionFilter
413413
ignoredParams={ignoredParams}
414414
params={params}

src/containers/namespace-list/namespace-list.scss

-9
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,6 @@
2020
}
2121
}
2222

23-
.toolbar {
24-
display: flex;
25-
justify-content: space-between;
26-
}
27-
28-
.pf-c-toolbar__content {
29-
padding-left: 0;
30-
}
31-
3223
.footer {
3324
border-top: 1px solid #d8d8d8;
3425
flex-shrink: 0;

src/containers/namespace-list/namespace-list.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ export class NamespaceList extends React.Component<IProps, IState> {
200200
</div>
201201
)}
202202
{noData ? null : (
203-
<div className='toolbar'>
203+
<div className='hub-toolbar hub-toolbar-left'>
204204
<Toolbar>
205205
<ToolbarContent>
206206
<ToolbarGroup style={{ marginLeft: 0 }}>

src/containers/search/search.scss

+1-5
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,10 @@
33
display: flex;
44
flex-direction: column;
55

6-
.hub-toolbar-wrapper .toolbar .hub-pagination-container .card-list-switcher {
6+
.hub-pagination-container .card-list-switcher {
77
margin-right: 24px;
88
}
99

10-
.pf-c-toolbar__content {
11-
padding-left: 0;
12-
}
13-
1410
.collection-container {
1511
padding-top: 24px;
1612
flex-grow: 1;

src/containers/search/search.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,8 @@ class Search extends React.Component<RouteProps, IState> {
214214
)}
215215
<BaseHeader className='hub-header-bordered' title={t`Collections`}>
216216
{!noData && (
217-
<div className='hub-toolbar-wrapper'>
218-
<div className='toolbar'>
217+
<div>
218+
<div className='hub-toolbar hub-toolbar-left'>
219219
<CollectionFilter
220220
ignoredParams={['page', 'page_size', 'sort', 'view_type']}
221221
params={params}

src/loaders/app.scss

+7-1
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,15 @@ body,
5353
}
5454

5555
// list screen toolbars
56-
// FIXME: merge with search, namespace-list, namespace-details, hub-toolbar-wrapper
5756
.hub-toolbar {
5857
display: flex;
5958
justify-content: space-between;
6059
align-items: center;
6160
}
61+
62+
// collections and namespaces - align with cards/lists, instead of table columns
63+
.hub-toolbar-left {
64+
.pf-c-toolbar__content {
65+
padding-left: 0;
66+
}
67+
}

test/cypress/e2e/approval/approval_dashboard_list.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,11 @@ describe('Approval Dashboard list tests for sorting, paging and filtering', () =
126126
'[data-cy="body"] [data-cy="compound_filter"] a',
127127
'Collection name',
128128
).click();
129-
cy.get('[data-cy="body"] .toolbar input').type(
129+
cy.get('[data-cy="body"] .hub-toolbar input').type(
130130
'approval_dashboard_collection_test0{enter}',
131131
);
132132

133-
cy.get('[data-cy="body"] .toolbar button:first').click();
133+
cy.get('[data-cy="body"] .hub-toolbar button:first').click();
134134
cy.contains(
135135
'[data-cy="body"] [data-cy="compound_filter"] a',
136136
'Namespace',

test/cypress/e2e/approval_modal/approval_multiple_repos.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ describe('Approval Dashboard process with multiple repos', () => {
137137
rejectItem('published');
138138

139139
// 2 items should be left there
140-
cy.contains('.toolbar', '1 - 2 of 2');
140+
cy.contains('.hub-toolbar', '1 - 2 of 2');
141141
cy.get(
142142
'[data-cy="CertificationDashboard-row-rejected-namespace-collection1"]',
143143
);
@@ -164,7 +164,7 @@ describe('Approval Dashboard process with multiple repos', () => {
164164

165165
cy.visit(`${uiPrefix}approval-dashboard`);
166166
cy.contains('Clear all filters').click();
167-
cy.contains('.toolbar', '1 - 2 of 2');
167+
cy.contains('.hub-toolbar', '1 - 2 of 2');
168168
cy.get(
169169
'[data-cy="CertificationDashboard-row-repo2-namespace-collection1"]',
170170
);

test/cypress/e2e/approval_modal/approval_multiple_repos_list.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,11 @@ describe('Approval Dashboard process with multiple repos', () => {
9191

9292
it('should test paging.', () => {
9393
openModal();
94-
cy.contains('.modal-body .toolbar', '1 - 10 of 11');
94+
cy.contains('.modal-body .hub-toolbar', '1 - 10 of 11');
9595
cy.contains('.modal-body', 'repo1');
9696
cy.contains('.modal-body', 'published');
97-
cy.get('.modal-body .toolbar [data-action="next"]').click();
98-
cy.contains('.modal-body .toolbar', '11 - 11 of 11');
97+
cy.get('.modal-body .hub-toolbar [data-action="next"]').click();
98+
cy.contains('.modal-body .hub-toolbar', '11 - 11 of 11');
9999
cy.contains('.modal-body', 'repo9');
100100
});
101101

@@ -127,15 +127,15 @@ describe('Approval Dashboard process with multiple repos', () => {
127127
openModal();
128128

129129
// select all
130-
cy.get('.toolbar [aria-label="Select"] svg').click();
130+
cy.get('.hub-toolbar [aria-label="Select"] svg').click();
131131
cy.contains('a', 'Select all (11 items)').click();
132132
cy.contains('[aria-label="Label group category"] button', '8 more').click();
133133
reposList.forEach((repo) => {
134134
cy.contains('[aria-label="Label group category"]', repo);
135135
});
136136

137137
// deselect all
138-
cy.get('.toolbar [aria-label="Select"] svg').click();
138+
cy.get('.hub-toolbar [aria-label="Select"] svg').click();
139139
cy.contains('a', 'Deselect all (11 items)').click();
140140
reposList.forEach((repo) => {
141141
cy.contains('[aria-label="Label group category"]', repo).should(
@@ -144,7 +144,7 @@ describe('Approval Dashboard process with multiple repos', () => {
144144
});
145145

146146
// select page
147-
cy.get('.toolbar [aria-label="Select"] svg').click();
147+
cy.get('.hub-toolbar [aria-label="Select"] svg').click();
148148
cy.contains('a', 'Select page (10 items)').click();
149149
reposList.forEach((repo) => {
150150
if (repo != 'repo9') {
@@ -161,7 +161,7 @@ describe('Approval Dashboard process with multiple repos', () => {
161161
cy.contains('Clear all filters').click();
162162

163163
// deselect page and repo9 should remain here
164-
cy.get('.toolbar [aria-label="Select"] svg').click();
164+
cy.get('.hub-toolbar [aria-label="Select"] svg').click();
165165
cy.contains('a', 'Deselect page (10 items)').click();
166166
reposList.forEach((repo) => {
167167
if (repo != 'repo9') {

test/cypress/e2e/collections/collections_list.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ describe('Collections list Tests', () => {
77
function deprecate(list) {
88
const container = list ? '.hub-list' : '.hub-cards';
99

10-
cy.get('.toolbar')
10+
cy.get('.hub-toolbar')
1111
.get('[aria-label="keywords"]:first')
1212
.type('my_collection0{enter}');
1313
cy.get(container).contains('my_collection2').should('not.exist');
@@ -120,7 +120,7 @@ describe('Collections list Tests', () => {
120120

121121
it('Can delete collection in collection list', () => {
122122
cy.get('[data-cy="view_type_list"] svg').click();
123-
cy.get('.toolbar')
123+
cy.get('.hub-toolbar')
124124
.get('[aria-label="keywords"]:first')
125125
.type('my_collection0{enter}');
126126
cy.get('.hub-list').contains('my_collection2').should('not.exist');
@@ -139,7 +139,7 @@ describe('Collections list Tests', () => {
139139

140140
it('Can delete collection in namespace collection list', () => {
141141
cy.visit(`${uiPrefix}namespaces/my_namespace`);
142-
cy.get('.toolbar')
142+
cy.get('.hub-toolbar')
143143
.get('[aria-label="keywords"]:first')
144144
.type('my_collection1{enter}');
145145

test/cypress/e2e/insights_collections/collections_list.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ describe('Collections list Tests', () => {
66
function deprecate(list) {
77
const container = list ? '.hub-list' : '.hub-cards';
88

9-
cy.get('.toolbar')
9+
cy.get('.hub-toolbar')
1010
.get('[aria-label="keywords"]:first')
1111
.type('my_collection0{enter}');
1212
cy.get(container).contains('my_collection2').should('not.exist');
@@ -103,7 +103,7 @@ describe('Collections list Tests', () => {
103103

104104
it('Can delete collection in collection list', () => {
105105
cy.get('[data-cy="view_type_list"] svg').click();
106-
cy.get('.toolbar')
106+
cy.get('.hub-toolbar')
107107
.get('[aria-label="keywords"]:first')
108108
.type('my_collection0{enter}');
109109
cy.get('.hub-list').contains('my_collection2').should('not.exist');
@@ -122,7 +122,7 @@ describe('Collections list Tests', () => {
122122

123123
it('Can delete collection in namespace collection list', () => {
124124
cy.visit(`${uiPrefix}namespaces/my_namespace`);
125-
cy.get('.toolbar')
125+
cy.get('.hub-toolbar')
126126
.get('[aria-label="keywords"]:first')
127127
.type('my_collection1{enter}');
128128

0 commit comments

Comments
 (0)