Skip to content

Commit

Permalink
[ui] Fix z-indexing for custom alert provider (#20192)
Browse files Browse the repository at this point in the history
Previously, in certain situations, error dialogs display underneath
their corresponding editor modals.

This PR fixes this issue.
  • Loading branch information
clairelin135 authored Mar 7, 2024
1 parent 258bc71 commit e770305
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ export const Dialog = (props: Props) => {
return (
<BlueprintDialog
{...rest}
portalClassName="dagster-portal"
portalClassName={`dagster-portal${props.portalClassName ? ` ${props.portalClassName}` : ''}`}
backdropClassName="dagster-backdrop"
className="dagster-dialog"
className={`dagster-dialog${props.className ? ` ${props.className}` : ''}`}
>
{title ? <DialogHeader icon={icon} label={title} /> : null}
<ErrorBoundary region="dialog">{children}</ErrorBoundary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {createGlobalStyle} from 'styled-components';
import {SubscriptionClient} from 'subscriptions-transport-ws';

import {AppContext} from './AppContext';
import {CustomAlertProvider} from './CustomAlertProvider';
import {CustomAlertProvider, GlobalCustomAlertPortalStyle} from './CustomAlertProvider';
import {CustomConfirmationProvider} from './CustomConfirmationProvider';
import {LayoutProvider} from './LayoutProvider';
import {PermissionsProvider} from './Permissions';
Expand Down Expand Up @@ -211,6 +211,7 @@ export const AppProvider = (props: AppProviderProps) => {
<GlobalTooltipStyle />
<GlobalPopoverStyle />
<GlobalDialogStyle />
<GlobalCustomAlertPortalStyle />
<GlobalSuggestStyle />
<ApolloProvider client={apolloClient}>
<AssetLiveDataProvider>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Button, Dialog, DialogBody, DialogFooter, FontFamily} from '@dagster-io/ui-components';
import * as React from 'react';
import styled from 'styled-components';
import styled, {createGlobalStyle} from 'styled-components';

import {copyValue} from './DomUtils';
import {testId} from '../testing/testId';
Expand Down Expand Up @@ -73,6 +73,7 @@ export const CustomAlertProvider = () => {
onClose={() => setCustomAlert(null)}
style={{width: 'auto', maxWidth: '80vw'}}
isOpen={!!alert}
portalClassName="custom-alert-portal"
>
{alert ? (
<DialogBody data-testid={testId('alert-body')}>
Expand All @@ -96,3 +97,9 @@ const Body = styled.div`
font-family: ${FontFamily.monospace};
font-size: 16px;
`;

export const GlobalCustomAlertPortalStyle = createGlobalStyle`
.custom-alert-portal {
z-index: 1000;
}
`;

2 comments on commit e770305

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for dagit-storybook ready!

✅ Preview
https://dagit-storybook-9mm0fhcj3-elementl.vercel.app

Built with commit e770305.
This pull request is being automatically deployed with vercel-action

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for dagit-core-storybook ready!

✅ Preview
https://dagit-core-storybook-ndqpahupk-elementl.vercel.app

Built with commit e770305.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.