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

feat(Notifications): add qa prop #218

Merged
merged 3 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
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
13 changes: 10 additions & 3 deletions src/components/FilePreview/FilePreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,15 @@ import {
TextAlignLeft as TextIcon,
Filmstrip as VideoIcon,
} from '@gravity-ui/icons';
import {Icon, IconData, Text, useActionHandlers, useMobile, useUniqId} from '@gravity-ui/uikit';
import {
Icon,
IconData,
QAProps,
Text,
useActionHandlers,
useMobile,
useUniqId,
} from '@gravity-ui/uikit';

import {block} from '../utils/cn';

Expand All @@ -36,9 +44,8 @@ const FILE_ICON: Record<FileType, IconData> = {
table: TableIcon,
};

export interface FilePreviewProps {
export interface FilePreviewProps extends QAProps {
className?: string;
qa?: string;

file: File;
imageSrc?: string;
Expand Down
1 change: 1 addition & 0 deletions src/components/Notification/NotificationAction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export const NotificationAction = React.memo(function NotificationAction({action

const button = (
<Button
qa={action.qa}
className={b('action', {icon: Boolean(action.icon)})}
view={action.view ?? 'flat'}
href={action.href}
Expand Down
4 changes: 2 additions & 2 deletions src/components/Notification/definitions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {ButtonProps, IconData} from '@gravity-ui/uikit';
import {ButtonProps, IconData, QAProps} from '@gravity-ui/uikit';

export type NotificationTheme = 'success' | 'info' | 'warning' | 'danger';

Expand Down Expand Up @@ -46,4 +46,4 @@ export type NotificationActionProps = {
onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
href?: string;
target?: '_blank';
};
} & QAProps;
2 changes: 1 addition & 1 deletion src/components/Notifications/Notifications.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const Notifications = React.memo(function Notifications(props: Notificati
}

return (
<div className={b()}>
<div className={b()} data-qa={props.qa}>
<div className={b('head')}>
<div className={b('head-title')}>{props.title || i18n('title')}</div>
{<div className={b('actions')}>{props.actions}</div>}
Expand Down
4 changes: 3 additions & 1 deletion src/components/Notifications/definitions.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import {QAProps} from '@gravity-ui/uikit';

import {NotificationActionProps, NotificationProps} from '../Notification/definitions';

export type NotificationsActionProps = NotificationActionProps;
Expand All @@ -21,4 +23,4 @@ export type NotificationsProps = {
emptyImage?: React.ReactNode;

swipeThreshold?: number;
};
} & QAProps;
Loading