Skip to content

Commit

Permalink
CNV-5024: Inform for pending changes in VM's configuration
Browse files Browse the repository at this point in the history
Present a warning when the user make changes while the VM is running

Signed-off-by: Ido Rosenzwig <irosenzw@redhat.com>

CNV-5024# Please enter the commit message for your changes. Lines starting
  • Loading branch information
irosenzw committed Jul 29, 2020
1 parent 99c0004 commit 4c2c611
Show file tree
Hide file tree
Showing 41 changed files with 1,064 additions and 259 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,23 @@ import PopoverStatus from './PopoverStatus';
import StatusIconAndText from './StatusIconAndText';

const GenericStatus: React.FC<GenericStatusProps> = (props) => {
const { Icon, children, ...restProps } = props;
const { Icon, children, popoverTitle, title, ...restProps } = props;
return React.Children.toArray(children).length ? (
<PopoverStatus {...restProps} statusBody={<StatusIconAndText {...restProps} icon={<Icon />} />}>
<PopoverStatus
title={popoverTitle || title}
{...restProps}
statusBody={<StatusIconAndText {...restProps} title={title} icon={<Icon />} />}
>
{children}
</PopoverStatus>
) : (
<StatusIconAndText {...restProps} icon={<Icon />} />
<StatusIconAndText {...restProps} title={title} icon={<Icon />} />
);
};

type GenericStatusProps = StatusComponentProps & {
Icon: React.ComponentType<{}>;
popoverTitle?: string;
};

export default GenericStatus;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.kv__pending_changes-alert {
margin-bottom: var(--pf-global--spacer--sm);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import * as React from 'react';
import { Alert, AlertVariant } from '@patternfly/react-core';

import './PendingChangesAlert.scss';

type PendingChangesAlertProps = {
warningMsg?: string;
isWarning?: boolean;
};

export const PendingChangesAlert: React.FC<PendingChangesAlertProps> = ({
warningMsg,
isWarning,
children,
}) => (
<Alert
title="Pending Changes"
isInline
variant={isWarning ? AlertVariant.warning : AlertVariant.info}
className="kv__pending_changes-alert"
>
{warningMsg || children}
</Alert>
);

This file was deleted.

0 comments on commit 4c2c611

Please sign in to comment.