Skip to content

Commit 18bd38d

Browse files
Merge branch 'master' into branch_2
2 parents 4cc3e07 + fb83207 commit 18bd38d

File tree

18 files changed

+108
-54
lines changed

18 files changed

+108
-54
lines changed

.eslintrc.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,7 @@ module.exports = {
110110
bundledDependencies: false,
111111
},
112112
],
113-
'jsx-a11y/anchor-is-valid': 'off',
114-
'jsx-a11y/click-events-have-key-events': 'off',
115-
'jsx-a11y/label-has-associated-control': 'off',
116-
'jsx-a11y/no-static-element-interactions': 'off',
113+
'jsx-a11y/label-has-associated-control': 'off', // Disabled due to false positives.
117114
'max-classes-per-file': 'off',
118115
'max-len': 'off',
119116
'@typescript-eslint/naming-convention': [

locales/en/plugin__odf-console.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1395,6 +1395,7 @@
13951395
"Remove delete markers with no noncurrent versions.": "Remove delete markers with no noncurrent versions.",
13961396
"Remove disaster recovery": "Remove disaster recovery",
13971397
"Remove disaster recovery?": "Remove disaster recovery?",
1398+
"Remove tag": "Remove tag",
13981399
"Remove Tier": "Remove Tier",
13991400
"Remove unnecessary delete markers that clutter bucket listings and do not serve a purpose. Targets delete markers in versioned buckets that do not have any associated object versions (orphaned delete markers).": "Remove unnecessary delete markers that clutter bucket listings and do not serve a purpose. Targets delete markers in versioned buckets that do not have any associated object versions (orphaned delete markers).",
14001401
"Replaying": "Replaying",

packages/ocs/storage-class/sc-form.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ export const CephFsPoolComponent: React.FC<ProvisionerProps> = ({
401401
if (isExternal) {
402402
return (
403403
<div className="form-group">
404-
<label className="co-required" htmlFor="ocs-storage-pool">
404+
<label className="co-required" htmlFor="pool-name">
405405
{t('Storage Pool')}
406406
</label>
407407
<input
@@ -567,7 +567,7 @@ export const BlockPoolResourceComponent: React.FC<ProvisionerProps> = ({
567567
systemNamespace={systemNamespace}
568568
/>
569569
<div className="form-group">
570-
<label className="co-required" htmlFor="ocs-storage-pool">
570+
<label className="co-required" htmlFor="pool-name">
571571
{t('Storage Pool')}
572572
</label>
573573
<input

packages/ocs/storage-pool/body.scss

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,15 @@
88
}
99

1010
.ceph-block-pool-body__compression {
11-
align-items: center;
11+
align-items: start;
1212
display: flex;
13+
14+
input[type='checkbox'] {
15+
// Override some inherited styles.
16+
margin-left: unset !important;
17+
position: unset !important;
18+
margin-right: 10px;
19+
}
1320
}
1421

1522
.ceph-block-pool__switch {

packages/ocs/storage-pool/body.tsx

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -374,24 +374,23 @@ export const StoragePoolBody: React.FC<StoragePoolBodyProps> = ({
374374
<label className="control-label" htmlFor="compression-check">
375375
{t('Data compression')}
376376
</label>
377-
<div className="checkbox">
378-
<label className="ceph-block-pool-body__compression">
379-
<input
380-
type="checkbox"
381-
onChange={(event) =>
382-
dispatch({
383-
type: StoragePoolActionType.SET_POOL_COMPRESSED,
384-
payload: event.target.checked,
385-
})
386-
}
387-
checked={state.isCompressed}
388-
name="compression-check"
389-
data-test="compression-checkbox"
390-
/>
391-
{t(
392-
'Optimize storage efficiency by enabling data compression within replicas.'
393-
)}
394-
</label>
377+
<div className="checkbox ceph-block-pool-body__compression">
378+
<input
379+
type="checkbox"
380+
onChange={(event) =>
381+
dispatch({
382+
type: StoragePoolActionType.SET_POOL_COMPRESSED,
383+
payload: event.target.checked,
384+
})
385+
}
386+
checked={state.isCompressed}
387+
id="compression-check"
388+
name="compression-check"
389+
data-test="compression-checkbox"
390+
/>
391+
{t(
392+
'Optimize storage efficiency by enabling data compression within replicas.'
393+
)}
395394
</div>
396395
</div>
397396
{state.isCompressed && (

packages/odf/components/s3-browser/bucket-policy/BucketPolicy.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,9 @@ const PolicyBody: React.FC<PolicyBodyProps> = ({
184184
)}
185185
emptyStateButton={t('Browse')}
186186
emptyStateLink={
187-
<span onClick={onEdit}>
187+
<Button variant={ButtonVariant.link} onClick={onEdit}>
188188
{t('Start from scratch or use predefined policy configuration')}
189-
</span>
189+
</Button>
190190
}
191191
onEditorDidMount={handleEditorDidMount}
192192
className="pf-v5-u-mt-sm pf-v5-u-mb-xl"

packages/odf/components/topology/TopBar/TopologyNavigation.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,7 @@
1818
border: none;
1919
}
2020
}
21+
22+
.odf-topology-nav__item-storage-cluster-link {
23+
text-decoration: underline;
24+
}

packages/odf/components/topology/TopBar/TopologyNavigation.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
OptionsMenuItem,
99
OptionsMenuToggle,
1010
} from '@patternfly/react-core/deprecated';
11+
import { Button, ButtonVariant } from '@patternfly/react-core';
1112
import { AngleRightIcon } from '@patternfly/react-icons';
1213
import { useVisualizationController } from '@patternfly/react-topology';
1314
import { STEP_INTO_EVENT, STEP_TO_CLUSTER } from '../constants';
@@ -75,15 +76,22 @@ const TopologyNavigationBar: React.FC<TopologyNavigationBarProps> = ({
7576
[selected]
7677
);
7778

78-
const onStorageClusterClick = (e: React.MouseEvent<HTMLAnchorElement>) => {
79+
const onStorageClusterClick = (e: React.MouseEvent<HTMLButtonElement>) => {
7980
e.stopPropagation();
8081
controller.fireEvent(STEP_TO_CLUSTER);
8182
};
8283

8384
return (
8485
<TopologyNavigationBarGroup>
8586
<TopologyNavigationItem>
86-
<a onClick={onStorageClusterClick}>StorageCluster</a>
87+
<Button
88+
variant={ButtonVariant.link}
89+
isInline
90+
className="odf-topology-nav__item-storage-cluster-link"
91+
onClick={onStorageClusterClick}
92+
>
93+
StorageCluster
94+
</Button>
8795
</TopologyNavigationItem>
8896
<TopologyNavigationItem>
8997
<ResourceIcon

packages/odf/components/topology/TopBar/TopologySearch.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,7 @@
1515
&-search-bar__expand-icon {
1616
margin-right: var(--pf-v5-global--spacer--sm);
1717
}
18+
&-search-bar__expand-button {
19+
text-decoration: underline;
20+
}
1821
}

packages/odf/components/topology/TopBar/TopologySearch.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as React from 'react';
22
import { useCustomTranslation } from '@odf/shared/useCustomTranslationHook';
3+
import { Button, ButtonVariant } from '@patternfly/react-core';
34
import { ExpandIcon } from '@patternfly/react-icons';
45
import SearchBar from './SearchComponent';
56
import './TopologySearch.scss';
@@ -19,7 +20,7 @@ const TopologySearchBar: React.FC = () => {
1920
};
2021
}, [isFullScreen]);
2122

22-
const toggleFullScreen = (e: React.MouseEvent<HTMLAnchorElement>) => {
23+
const toggleFullScreen = (e: React.MouseEvent<HTMLButtonElement>) => {
2324
e.stopPropagation();
2425
const element = document.getElementById('odf-topology');
2526
if (!isFullScreen) {
@@ -40,10 +41,15 @@ const TopologySearchBar: React.FC = () => {
4041
<SearchBar />
4142
</span>
4243
<span className="odf-topology-search-bar__expand">
43-
<a onClick={toggleFullScreen}>
44+
<Button
45+
variant={ButtonVariant.link}
46+
isInline
47+
onClick={toggleFullScreen}
48+
className="odf-topology-search-bar__expand-button"
49+
>
4450
<ExpandIcon className="odf-topology-search-bar__expand-icon" />
4551
{!isFullScreen ? t('Expand to fullscreen') : t('Exit fullscreen')}
46-
</a>
52+
</Button>
4753
</span>
4854
</div>
4955
);

packages/odf/components/topology/Topology.tsx

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ import {
3838
import * as _ from 'lodash-es';
3939
import { Link } from 'react-router-dom-v5-compat';
4040
import {
41+
Button,
42+
ButtonVariant,
4143
EmptyState,
4244
EmptyStateBody,
4345
EmptyStateIcon,
@@ -126,19 +128,28 @@ const MessageButton: React.FC = () => {
126128
<BlueInfoCircleIcon />{' '}
127129
{showMessage &&
128130
t('This view is not available for external mode cluster.')}{' '}
129-
<a onClick={() => setShowMessage(!showMessage)}>
131+
<Button
132+
variant={ButtonVariant.link}
133+
isInline
134+
className="odf-topology__show-message-button"
135+
onClick={() => setShowMessage(!showMessage)}
136+
>
130137
{!showMessage ? t('Show message') : t('Hide message')}
131-
</a>
138+
</Button>
132139
</div>
133140
);
134141
};
135142

136143
const BackButton: React.FC<BackButtonProps> = ({ onClick }) => {
137144
const { t } = useCustomTranslation();
138145
return (
139-
<div className="odf-topology__back-button" onClick={onClick}>
146+
<Button
147+
variant={ButtonVariant.plain}
148+
className="odf-topology__back-button"
149+
onClick={onClick}
150+
>
140151
<ArrowCircleLeftIcon /> {t('Back to main view')}
141-
</div>
152+
</Button>
142153
);
143154
};
144155

packages/odf/components/topology/topology.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
}
1616

1717
.odf-topology__back-button {
18-
background-color: var(--pf-v5-global--palette--black-300);
18+
background-color: var(--pf-v5-global--palette--black-300) !important;
1919
color: var(--pf-v5-global--Color--dark-200);
2020
left: var(--pf-v5-global--gutter);
2121
position: absolute;
@@ -37,6 +37,10 @@
3737
z-index: 2;
3838
}
3939

40+
.odf-topology__show-message-button {
41+
text-decoration: underline;
42+
}
43+
4044
.odf-topology__back-button:hover {
4145
box-shadow: 1px 1px 3px 1px #aaabac;
4246
cursor: pointer;

packages/shared/src/alert/AlertsPanel.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,22 +57,22 @@ const AlertBadge: React.FC<AlertBadgeProps> = ({
5757
const onClick = () => onToggle(`alert-toggle-${alertSeverity}`);
5858

5959
return (
60-
<span onClick={onClick}>
60+
<Button
61+
variant={ButtonVariant.plain}
62+
isInline
63+
onClick={onClick}
64+
className="odf-alerts-panel__button"
65+
>
6166
<Badge
6267
key={key}
6368
className={`odf-alerts-panel__badge odf-alerts-panel__badge-${alertSeverity}`}
6469
>
65-
<Button
66-
variant={ButtonVariant.plain}
67-
className="odf-alerts-panel__button"
68-
>
69-
<StatusIconAndText title={alerts.length.toString()} icon={icon} />
70-
</Button>
70+
<StatusIconAndText title={alerts.length.toString()} icon={icon} />
7171
</Badge>
7272
<span className="odf-alerts-panel__badge-text">
7373
{_.startCase(alertSeverity)}
7474
</span>
75-
</span>
75+
</Button>
7676
);
7777
};
7878

packages/shared/src/alert/alerts.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
.odf-alerts-panel__badge {
1717
border: 1.5px solid;
18+
padding: .2rem .7rem;
1819
}
1920

2021
.odf-alerts-panel__badge-critical {

packages/shared/src/modals/EditLabelModal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { ResourceIcon } from '../resource-link/resource-link';
1919
import { useCustomTranslation } from '../useCustomTranslationHook';
2020
import { CommonModalProps } from './common';
2121
import { ModalBody, ModalFooter } from './Modal';
22-
import { SelectorInput } from './Selector';
22+
import { TranslatedSelectorInput } from './Selector';
2323

2424
type Patch = {
2525
op: string;
@@ -146,7 +146,7 @@ export const EditLabelModal: React.FC<EditLabelModalProps> = ({
146146
<ResourceIcon resourceModel={resourceModel} />{' '}
147147
{resource.metadata.name}
148148
</label>
149-
<SelectorInput
149+
<TranslatedSelectorInput
150150
onChange={(l) => setLabels(l)}
151151
tags={labels}
152152
labelClassName={labelClassName || `co-text-${resourceModel.id}`}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.odf-selector-input__remove-tag-button {
2+
text-decoration: underline;
3+
}

packages/shared/src/modals/Selector.tsx

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@ import {
66
} from '@openshift-console/dynamic-plugin-sdk/lib/api/common-types';
77
import classNames from 'classnames';
88
import * as _ from 'lodash-es';
9+
import { WithTranslation, withTranslation } from 'react-i18next';
910
import * as TagsInput from 'react-tagsinput';
11+
import { Button } from '@patternfly/react-core';
1012
import * as k8sSelectorRequirement from './selector-requirement';
1113
import { createEquals, requirementFromString } from './selector-requirement';
14+
import './Selector.scss';
1215

1316
declare global {
1417
namespace JSX {
@@ -133,7 +136,7 @@ export const selectorToString = (selector: Selector): string => {
133136
const cleanSelectorStr = (tag) => selectorToString(selectorFromString(tag));
134137
const cleanTags = (tags) => split(cleanSelectorStr(tags.join(',')));
135138

136-
type SelectorProps = {
139+
type SelectorProps = WithTranslation & {
137140
setErrorMessage?: (isValid: boolean) => void;
138141
placeholder?: string;
139142
options?: any;
@@ -151,10 +154,7 @@ type SelectorInputState = {
151154
tags: any;
152155
};
153156

154-
export class SelectorInput extends React.Component<
155-
SelectorProps,
156-
SelectorInputState
157-
> {
157+
class SelectorInput extends React.Component<SelectorProps, SelectorInputState> {
158158
isBasic: boolean;
159159
setRef: (ref: any) => any;
160160
ref_: any;
@@ -245,6 +245,7 @@ export class SelectorInput extends React.Component<
245245
}
246246

247247
render() {
248+
const { t } = this.props;
248249
const { inputValue, isInputValid, tags } = this.state;
249250

250251
// Keys that add tags: Enter
@@ -275,9 +276,15 @@ export class SelectorInput extends React.Component<
275276
>
276277
<span className="tag-item__content">{getTagDisplayValue(tag)}</span>
277278
&nbsp;
278-
<a className="remove-button" onClick={() => onRemove(key)}>
279+
<Button
280+
variant="link"
281+
isInline
282+
className="odf-selector-input__remove-tag-button"
283+
onClick={() => onRemove(key)}
284+
arial-label={t('Remove tag')}
285+
>
279286
×
280-
</a>
287+
</Button>
281288
</span>
282289
);
283290
};
@@ -306,3 +313,5 @@ export class SelectorInput extends React.Component<
306313
);
307314
}
308315
}
316+
317+
export const TranslatedSelectorInput = withTranslation()(SelectorInput);

stylelint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ module.exports = {
44
rules: {
55
'order/order': ['custom-properties', 'declarations'],
66
'selector-class-pattern': null,
7+
'selector-no-qualifying-type': [true, { ignore: ['attribute'] }],
78
},
89
};

0 commit comments

Comments
 (0)