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

fix(Dialog): render error popup inside the dialog #1657

Merged
merged 1 commit into from
Jun 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/components/Dialog/DialogFooter/DialogFooter.tsx
Original file line number Diff line number Diff line change
@@ -134,6 +134,7 @@ export class DialogFooter extends React.Component<DialogFooterInnerProps> {
anchorRef={this.errorTooltipRef}
placement={['bottom', 'top']}
disableLayer
disablePortal
hasArrow
>
<div className={b('error')}>{errorText}</div>
9 changes: 8 additions & 1 deletion src/components/Dialog/__stories__/Dialog.stories.tsx
Original file line number Diff line number Diff line change
@@ -11,9 +11,14 @@ import {DialogShowcase} from './DialogShowcase';
export default {
title: 'Components/Overlays/Dialog',
component: Dialog,
argTypes: {
showError: {
type: 'boolean',
},
},
} as Meta<DialogProps>;

const DefaultTemplate: StoryFn<DialogProps> = (args) => {
const DefaultTemplate: StoryFn<DialogProps & {showError: boolean}> = ({showError, ...args}) => {
const dialogTitleId = 'app-confirmation-dialog-title';
const [open, setOpen] = React.useState(false);
return (
@@ -37,6 +42,8 @@ const DefaultTemplate: StoryFn<DialogProps> = (args) => {
onClickButtonApply={() => alert('onApply')}
textButtonApply="Apply"
textButtonCancel="Cancel"
showError={showError}
errorText="Error text"
/>
</Dialog>
</React.Fragment>

Unchanged files with check annotations Beta

const [{theme}] = useGlobals();
React.useEffect(() => {
api.setOptions({theme: themes[getThemeType(theme)]});
}, [theme]);

Check warning on line 26 in .storybook/theme-addon/register.tsx

GitHub Actions / Verify Files

React Hook React.useEffect has a missing dependency: 'api'. Either include it or remove the dependency array
return null;
}
};
const child = React.Children.only(children);
const childRef = (child as any).ref;

Check warning on line 80 in src/components/ActionTooltip/ActionTooltip.tsx

GitHub Actions / Verify Files

Unexpected any. Specify a different type
const ref = useForkRef(setAnchorElement, childRef);
expect(() =>
render(
<CopyToClipboard text="Text to copy" onCopy={onCopy}>
{(() => 123) as any as CopyToClipboardContent}

Check warning on line 13 in src/components/CopyToClipboard/__tests__/CopyToClipboard.test.tsx

GitHub Actions / Verify Files

Unexpected any. Specify a different type
</CopyToClipboard>,
),
).toThrow('Content must be a valid react element');
}
function getKeyId(defs: PlatformDefs, val: string): string {
val = val.toLowerCase();

Check warning on line 34 in src/components/Hotkey/parse.ts

GitHub Actions / Verify Files

Assignment to function parameter 'val'
return defs.NormalizeMap[val] ?? val;
}
export const isMac = (): boolean =>
typeof navigator !== 'undefined' ? /Mac|iP(hone|[oa]d)/.test(navigator.platform) : false;

Check warning on line 2 in src/components/Hotkey/utils.ts

GitHub Actions / Verify Files

Unexpected negated condition
export function split(val: string, separator: string | RegExp): string[] {
return val.trim().split(separator).filter(Boolean);
};
refFilter = React.createRef<HTMLInputElement>();
refContainer = React.createRef<any>();

Check warning on line 102 in src/components/List/List.tsx

GitHub Actions / Verify Files

Unexpected any. Specify a different type
blurTimer: ReturnType<typeof setTimeout> | null = null;
loadingItem = {value: '__LIST_ITEM_LOADING__', disabled: false} as unknown as ListItemData<
T & {value: string}
break;
}
case 'PageDown': {
this.handleKeyMove(event, pageSize!);

Check warning on line 220 in src/components/List/List.tsx

GitHub Actions / Verify Files

Forbidden non-null assertion
break;
}
case 'PageUp': {
this.handleKeyMove(event, -pageSize!);

Check warning on line 224 in src/components/List/List.tsx

GitHub Actions / Verify Files

Forbidden non-null assertion
break;
}
case 'Home': {
} as Meta<typeof ListItem>;
const getComponentTemplate = <
T extends React.JSXElementConstructor<ListItemProps<any>> = typeof ListItem,

Check warning on line 80 in src/components/List/__stories__/ListItem.stories.tsx

GitHub Actions / Verify Files

Unexpected any. Specify a different type
>(): StoryFn<T> =>
// eslint-disable-next-line react/display-name
((args: any) => <ListItem {...args} />) as any;

Check warning on line 83 in src/components/List/__stories__/ListItem.stories.tsx

GitHub Actions / Verify Files

Unexpected any. Specify a different type
const Template = getComponentTemplate();