Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align all flyout components to be overlay kind and add close button X in header #373

1 change: 0 additions & 1 deletion public/components/Flyout/flyouts/alertsDashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const alertsDashboard = (payload) => {
size: 'm',
hideCloseButton: true,
'data-test-subj': `alertsDashboardFlyout_${trigger_name}`,
type: 'push',
},
headerProps: { hasBorder: true },
header: (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ export default class AlertsDashboardFlyoutComponent extends Component {
columns.splice(
0,
0,
getAlertsFindingColumn(httpClient, history, true, location, notifications)
getAlertsFindingColumn(httpClient, history, location, notifications)
);
break;
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ export default class CreateMonitor extends Component {
plugins={plugins}
isAd={values.searchType === SEARCH_TYPE.AD}
detectorId={this.props.detectorId}
setFlyout={this.props.setFlyout}
/>
<EuiSpacer />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,6 @@ export default class AcknowledgeAlertsModal extends Component {
getAlertsFindingColumn(
httpClient,
history,
false,
location,
notifications,
flyoutIsOpen,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,16 @@ export default class FindingFlyout extends Component {

closeFlyout = () => {
this.setState({ isFlyoutOpen: false });

const { dashboardFlyoutIsOpen = false, closeFlyout } = this.props;

if (typeof closeFlyout === 'function') {
if (dashboardFlyoutIsOpen) closeFlyout();
amsiglan marked this conversation as resolved.
Show resolved Hide resolved
}
};

async renderFlyout() {
const { alert, isAlertsFlyout = false } = this.props;
const { alert } = this.props;
if (!_.isEmpty(alert)) await this.getFinding();

const { docList, finding } = this.state;
Expand All @@ -93,9 +99,8 @@ export default class FindingFlyout extends Component {

const flyout = (
<EuiFlyout
type={isAlertsFlyout ? 'overlay' : 'push'}
onClose={this.closeFlyout}
ownFocus={false}
ownFocus={true}
hideCloseButton={true}
side={'right'}
size={'m'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ export const ALERTS_FINDING_COLUMN = {
export const getAlertsFindingColumn = (
httpClient,
history,
isAlertsFlyout = false,
location,
notifications,
flyoutIsOpen,
Expand All @@ -58,7 +57,6 @@ export const getAlertsFindingColumn = (
console.log('Alerts index contains an entry with 0 related document IDs:', alert);
return (
<FindingFlyout
isAlertsFlyout={isAlertsFlyout}
alert={alert}
httpClient={httpClient}
history={history}
Expand Down
1 change: 0 additions & 1 deletion public/pages/Dashboard/containers/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,6 @@ export default class Dashboard extends Component {
getAlertsFindingColumn(
httpClient,
history,
false,
location,
notifications,
flyoutIsOpen,
Expand Down
4 changes: 4 additions & 0 deletions public/pages/MonitorDetails/containers/MonitorDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ export default class MonitorDetails extends Component {
history,
httpClient,
notifications,
setFlyout,
} = this.props;
const detectorId = _.get(monitor, MONITOR_INPUT_DETECTOR_ID, undefined);
const groupBy = _.get(monitor, MONITOR_GROUP_BY);
Expand All @@ -277,6 +278,7 @@ export default class MonitorDetails extends Component {
monitorType={monitor.monitor_type}
perAlertView={true}
groupBy={groupBy}
setFlyout={setFlyout}
/>
);
};
Expand Down Expand Up @@ -344,6 +346,7 @@ export default class MonitorDetails extends Component {
httpClient,
notifications,
isDarkMode,
setFlyout,
} = this.props;
const { action } = queryString.parse(location.search);
const updatingMonitor = action === MONITOR_ACTIONS.UPDATE_MONITOR;
Expand All @@ -365,6 +368,7 @@ export default class MonitorDetails extends Component {
monitorToEdit={monitor}
detectorId={detectorId}
notifications={notifications}
setFlyout={setFlyout}
{...this.props}
/>
);
Expand Down