Skip to content

Commit

Permalink
align all flyout components to overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
djindjic committed Nov 30, 2022
1 parent 6287bd5 commit 559d4dd
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 9 deletions.
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();
}
};

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

0 comments on commit 559d4dd

Please sign in to comment.