Skip to content

Commit

Permalink
Various fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dlabrecq committed Jun 3, 2023
1 parent c1be859 commit faa59da
Show file tree
Hide file tree
Showing 20 changed files with 63 additions and 62 deletions.
6 changes: 3 additions & 3 deletions fec.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ module.exports = {
debug: true,
interceptChromeConfig: false, // Change to false after your app is registered in configuration files
proxyVerbose: true,
// sassPrefix: `.${moduleName}`,
sassPrefix: 'body', // For PF v5 testing only
bundlePfModules: true, // For PF v5 testing only
sassPrefix: `.${moduleName}`,
// sassPrefix: 'body', // For PF v5 testing only
// bundlePfModules: true, // For PF v5 testing only
stats,
standalone: process.env.LOCAL_API_PORT ? true : false,
useCache: true,
Expand Down
1 change: 0 additions & 1 deletion src/appEntry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { configureStore } from './store';

// Todo: Uncomment for use with non-shared PatternFly packages
require.resolve('@patternfly/patternfly/patternfly.css');
require.resolve('@patternfly/patternfly/patternfly-base.css');
require.resolve('@patternfly/patternfly/patternfly-addons.css');

import './styles/global.css';
Expand Down
4 changes: 3 additions & 1 deletion src/components/drawers/commonDrawer/commonDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ class CommonDrawerBase extends React.Component<CommonDrawerProps> {
return (
<Drawer className="drawerOverride" isExpanded={isExpanded} onExpand={this.handleExpand}>
<DrawerContent panelContent={this.getPanelContent()}>
<DrawerContentBody className="pf-u-display-flex pf-u-flex-direction-column">{children}</DrawerContentBody>
<DrawerContentBody className="pf-v5-u-display-flex pf-v5-u-flex-direction-column">
{children}
</DrawerContentBody>
</DrawerContent>
</Drawer>
);
Expand Down
2 changes: 1 addition & 1 deletion src/routes/components/export/exportModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ export class ExportModalBase extends React.Component<ExportModalProps, ExportMod
onChange={this.handleNameChange}
validated={validated}
/>
{helpText && (
{validated === 'error' && (
<HelperText>
<HelperTextItem variant="error">{intl.formatMessage(helpText)}</HelperTextItem>
</HelperText>
Expand Down
10 changes: 5 additions & 5 deletions src/routes/costModels/components/inputs/rateInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ const RateInputBase: React.FC<RateInputBaseProps> = ({
onKeyDown={handleOnKeyDown}
validated={validated}
/>
{helpText !== null && typeof helpText === 'object' && (
<HelperText>
<HelperTextItem variant="error">{intl.formatMessage(helpText)}</HelperTextItem>
</HelperText>
)}
</InputGroupItem>
</InputGroup>
{validated === 'error' && typeof helpText === 'object' && (
<HelperText>
<HelperTextItem variant="error">{intl.formatMessage(helpText)}</HelperTextItem>
</HelperText>
)}
</FormGroup>
);
};
Expand Down
6 changes: 3 additions & 3 deletions src/routes/costModels/components/inputs/selector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ const SelectorBase: React.FC<SelectorProps> = ({
menuAppendTo={appendMenuTo}
isOpen={isOpen}
onToggle={() => setIsOpen(!isOpen)}
onSelect={(event: React.MouseEvent, sel: SelectOptionObject) => {
onSelect={(event: React.MouseEvent, sel: SelectorOption) => {
setSelection(sel);
onChange(null, sel.toString());
onChange(null, sel.value);
setIsOpen(false);
}}
selections={selection}
Expand All @@ -111,7 +111,7 @@ const SelectorBase: React.FC<SelectorProps> = ({
<SelectOption key={`${opt.value}`} value={opt} description={opt.description} />
))}
</Select>
{helpText !== null && typeof helpText === 'object' && (
{isInvalid && typeof helpText === 'object' && (
<HelperText>
<HelperTextItem variant="error">{intl.formatMessage(helpText)}</HelperTextItem>
</HelperText>
Expand Down
2 changes: 1 addition & 1 deletion src/routes/costModels/components/inputs/simpleInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const SimpleInputBase: React.FC<SimpleInputProps> = ({
isRequired={isRequired}
placeholder={placeholder}
/>
{helpText !== null && typeof helpText === 'object' && (
{validated === 'error' && typeof helpText === 'object' && (
<HelperText>
<HelperTextItem variant="error">{intl.formatMessage(helpText)}</HelperTextItem>
</HelperText>
Expand Down
10 changes: 5 additions & 5 deletions src/routes/costModels/costModel/updateMarkupDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,18 +212,18 @@ class UpdateMarkupDialogBase extends React.Component<UpdateMarkupDialogProps, Up
validated={validated}
value={this.state.markup}
/>
{helpText && (
<HelperText>
<HelperTextItem variant="error">{intl.formatMessage(helpText)}</HelperTextItem>
</HelperText>
)}
</InputGroupItem>
<InputGroupItem isBox>
<InputGroupText style={styles.percent}>
{intl.formatMessage(messages.percentSymbol)}
</InputGroupText>
</InputGroupItem>
</InputGroup>
{validated === 'error' && (
<HelperText>
<HelperTextItem variant="error">{intl.formatMessage(helpText)}</HelperTextItem>
</HelperText>
)}
</FormGroup>
</Form>
</FlexItem>
Expand Down
10 changes: 5 additions & 5 deletions src/routes/costModels/costModelWizard/costModelWizard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -438,11 +438,11 @@ class CostModelWizardBase extends React.Component<CostModelWizardProps, CostMode
loading: this.state.loading,
metricsHash,
onClose: () => this.setState({ ...this.defaultState }, this.props.closeWizard),
onCurrencyChange: value =>
onCurrencyChange: (_evt, value) =>
this.setState({ currencyUnits: value, tiers: updateTiersCurrency(this.state.tiers, value) }),
onDescChange: value => this.setState({ description: value }),
onFilterChange: value => this.setState({ filterName: value }),
onNameChange: value => this.setState({ name: value, dirtyName: true }),
onDescChange: (_evt, value) => this.setState({ description: value }),
onFilterChange: (_evt, value) => this.setState({ filterName: value }),
onNameChange: (_evt, value) => this.setState({ name: value, dirtyName: true }),
onPageChange: (_evt, page) => this.setState({ page }),
onPerPageChange: (_evt, perPage) => this.setState({ page: 1, perPage }),
onSourceSelect: (rowId, isSelected) => {
Expand All @@ -465,7 +465,7 @@ class CostModelWizardBase extends React.Component<CostModelWizardProps, CostMode
};
return this.setState({ checked: newState });
},
onTypeChange: value => this.setState({ type: value, dataFetched: false, loading: false }),
onTypeChange: (_evt, value) => this.setState({ type: value, dataFetched: false, loading: false }),
page: this.state.page,
priceListPagination: {
page: this.state.priceListPagination.page,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class GeneralInformation extends React.Component<GeneralInformationProps, any> {
value={name}
onChange={onNameChange}
/>
{nameErrors(name) && (
{dirtyName && nameErrors(name) && (
<HelperText>
<HelperTextItem variant="error">{intl.formatMessage(nameErrors(name))}</HelperTextItem>
</HelperText>
Expand Down
10 changes: 5 additions & 5 deletions src/routes/costModels/costModelWizard/markup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,18 +139,18 @@ class MarkupWithDistributionBase extends React.Component<MarkupWithDistributionP
validated={validated}
value={markup}
/>
{helpText && (
<HelperText>
<HelperTextItem variant="error">{intl.formatMessage(helpText)}</HelperTextItem>
</HelperText>
)}
</InputGroupItem>
<InputGroupItem isBox>
<InputGroupText style={costCalcStyles.percent}>
{intl.formatMessage(messages.percentSymbol)}
</InputGroupText>
</InputGroupItem>
</InputGroup>
{validated === 'error' && (
<HelperText>
<HelperTextItem variant="error">{intl.formatMessage(helpText)}</HelperTextItem>
</HelperText>
)}
</FormGroup>
</Form>
</FlexItem>
Expand Down
10 changes: 5 additions & 5 deletions src/routes/settings/costModels/components/inputs/rateInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ const RateInputBase: React.FC<RateInputBaseProps> = ({
onKeyDown={handleOnKeyDown}
validated={validated}
/>
{helpText !== null && typeof helpText === 'object' && (
<HelperText>
<HelperTextItem variant="error">{intl.formatMessage(helpText)}</HelperTextItem>
</HelperText>
)}
</InputGroupItem>
</InputGroup>
{validated === 'error' && typeof helpText === 'object' && (
<HelperText>
<HelperTextItem variant="error">{intl.formatMessage(helpText)}</HelperTextItem>
</HelperText>
)}
</FormGroup>
);
};
Expand Down
6 changes: 3 additions & 3 deletions src/routes/settings/costModels/components/inputs/selector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ const SelectorBase: React.FC<SelectorProps> = ({
menuAppendTo={appendMenuTo}
isOpen={isOpen}
onToggle={() => setIsOpen(!isOpen)}
onSelect={(e, sel: SelectOptionObject) => {
onSelect={(e, sel: SelectorOption) => {
setSelection(sel);
onChange(null, sel.toString());
onChange(null, sel.value);
setIsOpen(false);
}}
selections={selection}
Expand All @@ -111,7 +111,7 @@ const SelectorBase: React.FC<SelectorProps> = ({
<SelectOption key={`${opt.value}`} value={opt} description={opt.description} />
))}
</Select>
{helpText !== null && typeof helpText === 'object' && (
{isInvalid && typeof helpText === 'object' && (
<HelperText>
<HelperTextItem variant="error">{intl.formatMessage(helpText)}</HelperTextItem>
</HelperText>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const SimpleInputBase: React.FC<SimpleInputProps> = ({
isRequired={isRequired}
placeholder={placeholder}
/>
{helpText !== null && typeof helpText === 'object' && (
{validated === 'error' && typeof helpText === 'object' && (
<HelperText>
<HelperTextItem variant="error">{intl.formatMessage(helpText)}</HelperTextItem>
</HelperText>
Expand Down
10 changes: 5 additions & 5 deletions src/routes/settings/costModels/costModel/updateMarkupDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,18 +212,18 @@ class UpdateMarkupDialogBase extends React.Component<UpdateMarkupDialogProps, Up
validated={validated}
value={this.state.markup}
/>
{helpText && (
<HelperText>
<HelperTextItem variant="error">{intl.formatMessage(helpText)}</HelperTextItem>
</HelperText>
)}
</InputGroupItem>
<InputGroupItem isBox>
<InputGroupText style={styles.percent}>
{intl.formatMessage(messages.percentSymbol)}
</InputGroupText>
</InputGroupItem>
</InputGroup>
{validated === 'error' && (
<HelperText>
<HelperTextItem variant="error">{intl.formatMessage(helpText)}</HelperTextItem>
</HelperText>
)}
</FormGroup>
</Form>
</FlexItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -438,11 +438,11 @@ class CostModelWizardBase extends React.Component<CostModelWizardProps, CostMode
loading: this.state.loading,
metricsHash,
onClose: () => this.setState({ ...this.defaultState }, this.props.closeWizard),
onCurrencyChange: value =>
onCurrencyChange: (_evt, value) =>
this.setState({ currencyUnits: value, tiers: updateTiersCurrency(this.state.tiers, value) }),
onDescChange: value => this.setState({ description: value }),
onFilterChange: value => this.setState({ filterName: value }),
onNameChange: value => this.setState({ name: value, dirtyName: true }),
onDescChange: (_evt, value) => this.setState({ description: value }),
onFilterChange: (_evt, value) => this.setState({ filterName: value }),
onNameChange: (_evt, value) => this.setState({ name: value, dirtyName: true }),
onPageChange: (_evt, page) => this.setState({ page }),
onPerPageChange: (_evt, perPage) => this.setState({ page: 1, perPage }),
onSourceSelect: (rowId, isSelected) => {
Expand All @@ -465,7 +465,7 @@ class CostModelWizardBase extends React.Component<CostModelWizardProps, CostMode
};
return this.setState({ checked: newState });
},
onTypeChange: value => this.setState({ type: value, dataFetched: false, loading: false }),
onTypeChange: (_evt, value) => this.setState({ type: value, dataFetched: false, loading: false }),
page: this.state.page,
priceListPagination: {
page: this.state.priceListPagination.page,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class GeneralInformation extends React.Component<GeneralInformationProps, any> {
value={name}
onChange={onNameChange}
/>
{nameErrors(name) && (
{dirtyName && nameErrors(name) && (
<HelperText>
<HelperTextItem variant="error">{intl.formatMessage(nameErrors(name))}</HelperTextItem>
</HelperText>
Expand Down
10 changes: 5 additions & 5 deletions src/routes/settings/costModels/costModelWizard/markup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,18 +139,18 @@ class MarkupWithDistributionBase extends React.Component<MarkupWithDistributionP
validated={validated}
value={markup}
/>
{helpText && (
<HelperText>
<HelperTextItem variant="error">{intl.formatMessage(helpText)}</HelperTextItem>
</HelperText>
)}
</InputGroupItem>
<InputGroupItem isBox>
<InputGroupText style={costCalcStyles.percent}>
{intl.formatMessage(messages.percentSymbol)}
</InputGroupText>
</InputGroupItem>
</InputGroup>
{validated === 'error' && (
<HelperText>
<HelperTextItem variant="error">{intl.formatMessage(helpText)}</HelperTextItem>
</HelperText>
)}
</FormGroup>
</Form>
</FlexItem>
Expand Down
4 changes: 2 additions & 2 deletions src/styles/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ body {
display: flex;
}

.pf-l-grid > *,
.pf-l-grid .pf-l-grid__item {
.pf-v5-l-grid > *,
.pf-v5-l-grid .pf-v5-l-grid__item {
min-height: 0;
min-width: 0;
}
Expand Down
8 changes: 4 additions & 4 deletions src/styles/revert.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
/* https://developer.mozilla.org/en-US/docs/Web/CSS/revert */
[class*="pf-v5-c"],
[class*="pf-v5-c"] *,
[class*="pf-l"],
[class*="pf-l"] *,
[class*="pf-u"],
[class*="pf-u"] * {
[class*="pf-v5-l"],
[class*="pf-v5-l"] *,
[class*="pf-v5-u"],
[class*="pf-v5-u"] * {
all: revert;
}

0 comments on commit faa59da

Please sign in to comment.