Skip to content

Commit 121b0f7

Browse files
authored
Fix collection detail global css (#4143) (#4148)
* Collection dependencies - reduce custom css, add missing space before helpertext moving CollectionUsedbyDependenciesList outside the pf-c-content section removes the need for custom pagination styling (we'll now get 2 different empty states for deps & rdeps when both are missing) No-Issue * Collection docs - rename css classes to hub-docs-{container,content,main,sidebar}, remove global toolbar margin affects the new insights breadcrumbs, this fixed it * hub-nav-title * duplicate/unused legacy role scss * hub-header-bordered: replace old header class * header-bottom -> hub-header-bottom * merge hub-toolbar and hub-list-toolbar css now that `.pf-c-toolbar__group { margin-left: 16px }` is limite to `.hub-docs-sidebar`, changing the left padding is no longer needed .. which makes hub-toolbar and hub-list-toolbar identical, merging * approvals: use ToolbarContent, add missing niceNames * hub-toolbar, hub-toolbar-left - unify from .toolbar, .hub-toolbar-wrapper (cherry picked from commit b051f84)
1 parent 508f508 commit 121b0f7

File tree

49 files changed

+186
-362
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+186
-362
lines changed

src/components/collection-dependencies-list/collection-dependencies-list.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { t } from '@lingui/macro';
2-
import { List, ListItem, ListVariant } from '@patternfly/react-core';
3-
import * as React from 'react';
2+
import { List, ListItem } from '@patternfly/react-core';
3+
import React from 'react';
44
import { Link } from 'react-router-dom';
55
import { CollectionVersion, CollectionVersionSearch } from 'src/api';
66
import { EmptyStateNoData, HelperText } from 'src/components';
@@ -29,7 +29,7 @@ export const CollectionDependenciesList = ({
2929
}
3030

3131
return (
32-
<List variant={ListVariant.inline} className='hub-c-list-dependencies'>
32+
<List className='hub-c-list-dependencies'>
3333
{dependencies_repos.map((dependency, i) =>
3434
listDep(dependency, i, dependencies),
3535
)}
@@ -50,7 +50,7 @@ const listDep = (dependency, i, dependencies) => {
5050
} else {
5151
return (
5252
<ListItem key={i} style={{ marginRight: '70px' }}>
53-
{fqn}: {version_range}
53+
{fqn}: {version_range}{' '}
5454
<HelperText
5555
content={t`No version of ${fqn} exists that matches ${version_range}.`}
5656
/>
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/headers/base-header.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export class BaseHeader extends React.Component<IProps> {
5252
{versionControl || null}
5353

5454
{children ? (
55-
<div className='header-bottom'>{children}</div>
55+
<div className='hub-header-bottom'>{children}</div>
5656
) : (
5757
<div className='placeholder' />
5858
)}

src/components/headers/collection-header.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ import {
6262
} from 'src/utilities';
6363
import { DateComponent } from '../date-component/date-component';
6464
import { SignatureBadge } from '../signing';
65-
import './header.scss';
6665

6766
interface IProps {
6867
collections: CollectionVersionSearch[];
@@ -924,7 +923,7 @@ export class CollectionHeader extends React.Component<IProps, IState> {
924923
if (deleteAll) {
925924
promise = CollectionAPI.deleteCollectionVersion(deleteCollection);
926925
} else {
927-
promise = promise = RepositoriesUtils.deleteCollection(
926+
promise = RepositoriesUtils.deleteCollection(
928927
deleteCollection.repository.name,
929928
deleteCollection.collection_version.pulp_href,
930929
);

src/components/headers/header.scss

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
$breakpoint-md: 1000px;
22

3+
.hub-header-bordered {
4+
border-bottom: 1px solid #d8d8d8;
5+
}
6+
37
.image {
48
padding-right: 16px;
59
}
@@ -42,7 +46,7 @@ $breakpoint-md: 1000px;
4246
padding-bottom: 10px;
4347
}
4448

45-
.header-bottom {
49+
.hub-header-bottom {
4650
padding-top: 10px;
4751
}
4852

src/components/headers/partner-header.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {
1010
Tabs,
1111
TabsType,
1212
} from 'src/components';
13-
import './header.scss';
1413

1514
interface IProps {
1615
namespace: NamespaceType;
@@ -54,7 +53,7 @@ export class PartnerHeader extends React.Component<IProps> {
5453
}
5554
breadcrumbs={<Breadcrumbs links={breadcrumbs} />}
5655
pageControls={pageControls}
57-
className='header'
56+
className='hub-header-bordered'
5857
>
5958
{namespace.description ? <div>{namespace.description}</div> : null}
6059

src/components/page/list-page.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ export const ListPage = function <T>({
270270
<LoadingPageSpinner />
271271
) : (
272272
<section className='body' data-cy={`ListPage-${displayName}`}>
273-
<div className='hub-list-toolbar'>
273+
<div className='hub-toolbar'>
274274
<Toolbar>
275275
<ToolbarContent>
276276
<ToolbarGroup>

src/components/page/page-with-tabs.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ export const PageWithTabs = function <
194194
}
195195
pageControls={
196196
loading ? null : (
197-
<div className='hub-list-toolbar'>
197+
<div className='hub-toolbar'>
198198
<Toolbar>
199199
<ToolbarContent>
200200
<ToolbarGroup>

src/components/page/page.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ export const Page = function <
156156
/>
157157
}
158158
pageControls={
159-
<div className='hub-list-toolbar'>
159+
<div className='hub-toolbar'>
160160
<Toolbar>
161161
<ToolbarContent>
162162
<ToolbarGroup>

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/components/shared/detail-list.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export function DetailList<T>({
113113
<LoadingPageSpinner />
114114
) : (
115115
<>
116-
<div className='hub-list-toolbar' data-cy={`DetailList`}>
116+
<div className='hub-toolbar' data-cy={`DetailList`}>
117117
<Toolbar>
118118
<ToolbarContent>
119119
<ToolbarGroup>

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

+51-46
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
Label,
77
LabelGroup,
88
Toolbar,
9+
ToolbarContent,
910
ToolbarGroup,
1011
ToolbarItem,
1112
} from '@patternfly/react-core';
@@ -211,53 +212,55 @@ class CertificationDashboard extends React.Component<RouteProps, IState> {
211212
) : (
212213
<Main className='hub-certification-dashboard'>
213214
<section className='body' data-cy='body'>
214-
<div className='toolbar hub-toolbar'>
215+
<div className='hub-toolbar'>
215216
<Toolbar>
216-
<ToolbarGroup>
217-
<ToolbarItem>
218-
<CompoundFilter
219-
inputText={this.state.inputText}
220-
onChange={(text) => {
221-
this.setState({ inputText: text });
222-
}}
223-
updateParams={(p) =>
224-
this.updateParams(p, () =>
225-
this.queryCollections(true),
226-
)
227-
}
228-
params={params}
229-
filterConfig={[
230-
{
231-
id: 'namespace',
232-
title: t`Namespace`,
233-
},
234-
{
235-
id: 'name',
236-
title: t`Collection Name`,
237-
},
238-
{
239-
id: 'repository_label',
240-
title: t`Status`,
241-
inputType: 'select',
242-
options: [
243-
{
244-
id: `pipeline=${Constants.NOTCERTIFIED}`,
245-
title: t`Rejected`,
246-
},
247-
{
248-
id: `pipeline=${Constants.NEEDSREVIEW}`,
249-
title: t`Needs Review`,
250-
},
251-
{
252-
id: `pipeline=${Constants.APPROVED}`,
253-
title: t`Approved`,
254-
},
255-
],
256-
},
257-
]}
258-
/>
259-
</ToolbarItem>
260-
</ToolbarGroup>
217+
<ToolbarContent>
218+
<ToolbarGroup>
219+
<ToolbarItem>
220+
<CompoundFilter
221+
inputText={this.state.inputText}
222+
onChange={(text) => {
223+
this.setState({ inputText: text });
224+
}}
225+
updateParams={(p) =>
226+
this.updateParams(p, () =>
227+
this.queryCollections(true),
228+
)
229+
}
230+
params={params}
231+
filterConfig={[
232+
{
233+
id: 'namespace',
234+
title: t`Namespace`,
235+
},
236+
{
237+
id: 'name',
238+
title: t`Collection name`,
239+
},
240+
{
241+
id: 'repository_label',
242+
title: t`Status`,
243+
inputType: 'select',
244+
options: [
245+
{
246+
id: `pipeline=${Constants.NOTCERTIFIED}`,
247+
title: t`Rejected`,
248+
},
249+
{
250+
id: `pipeline=${Constants.NEEDSREVIEW}`,
251+
title: t`Needs Review`,
252+
},
253+
{
254+
id: `pipeline=${Constants.APPROVED}`,
255+
title: t`Approved`,
256+
},
257+
],
258+
},
259+
]}
260+
/>
261+
</ToolbarItem>
262+
</ToolbarGroup>
263+
</ToolbarContent>
261264
</Toolbar>
262265

263266
<Pagination
@@ -285,6 +288,8 @@ class CertificationDashboard extends React.Component<RouteProps, IState> {
285288
},
286289
}}
287290
niceNames={{
291+
name: t`Collection name`,
292+
namespace: t`Namespace`,
288293
repository_label: t`Status`,
289294
}}
290295
/>
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
// resets to default, possible bug pagination shows disc list-style-type with 'pf-c-content' className
2-
.pf-c-options-menu__menu {
3-
padding-left: 0 !important;
4-
margin-left: 0 !important;
5-
list-style: none !important;
6-
}
7-
1+
// CollectionDependenciesList
82
.hub-c-list-dependencies li {
93
list-style: disc;
104
}

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

+22-31
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {
1919
import { AppContext } from 'src/loaders/app-context';
2020
import { Paths, formatPath } from 'src/paths';
2121
import { RouteProps, withRouter } from 'src/utilities';
22-
import { ParamHelper, errorMessage, filterIsSet } from 'src/utilities';
22+
import { ParamHelper, errorMessage } from 'src/utilities';
2323
import { IBaseCollectionState, loadCollection } from './base';
2424
import './collection-dependencies.scss';
2525

@@ -136,43 +136,34 @@ class CollectionDependencies extends React.Component<RouteProps, IState> {
136136
<section className='body'>
137137
<div className='pf-c-content collection-dependencies'>
138138
<h1>{t`Dependencies`}</h1>
139-
{noDependencies &&
140-
!usedByDependenciesCount &&
141-
!filterIsSet(params, ['name__icontains']) ? (
139+
<p>{t`This collections requires the following collections for use`}</p>
140+
141+
{noDependencies ? (
142142
<EmptyStateNoData
143143
title={t`No dependencies`}
144144
description={t`Collection does not have any dependencies.`}
145145
/>
146146
) : (
147-
<>
148-
<p>{t`This collections requires the following collections for use`}</p>
149-
{noDependencies ? (
150-
<EmptyStateNoData
151-
title={t`No dependencies`}
152-
description={t`Collection does not have any dependencies.`}
153-
/>
154-
) : (
155-
<CollectionDependenciesList
156-
collection={this.state.collection}
157-
dependencies_repos={this.state.dependencies_repos}
158-
/>
159-
)}
160-
<p>{t`This collection is being used by`}</p>
161-
<CollectionUsedbyDependenciesList
162-
usedByDependencies={usedByDependencies}
163-
itemCount={usedByDependenciesCount}
164-
params={dependenciesParams}
165-
usedByDependenciesLoading={usedByDependenciesLoading}
166-
updateParams={(p) =>
167-
this.updateParams(
168-
this.combineParams(this.state.params, p),
169-
() => this.loadUsedByDependencies(),
170-
)
171-
}
172-
/>
173-
</>
147+
<CollectionDependenciesList
148+
collection={this.state.collection}
149+
dependencies_repos={this.state.dependencies_repos}
150+
/>
174151
)}
152+
153+
<p>{t`This collection is being used by`}</p>
175154
</div>
155+
<CollectionUsedbyDependenciesList
156+
usedByDependencies={usedByDependencies}
157+
itemCount={usedByDependenciesCount}
158+
params={dependenciesParams}
159+
usedByDependenciesLoading={usedByDependenciesLoading}
160+
updateParams={(p) =>
161+
this.updateParams(
162+
this.combineParams(this.state.params, p),
163+
() => this.loadUsedByDependencies(),
164+
)
165+
}
166+
/>
176167
</section>
177168
</Main>
178169
</React.Fragment>

0 commit comments

Comments
 (0)