Skip to content

Commit

Permalink
Merge branch 'main' into textArea-size
Browse files Browse the repository at this point in the history
  • Loading branch information
GermanVor authored Jul 2, 2024
2 parents 3e814f8 + 42de6db commit 847f14e
Show file tree
Hide file tree
Showing 16 changed files with 57 additions and 22 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: PR Title

on:
pull_request:
types:
- opened
- synchronize
- reopened
- edited

jobs:
verify_title:
name: Verify Title
runs-on: ubuntu-latest
if: ${{github.event.action != 'edited' || github.event.changes.title}}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
cache: npm
- name: Install Packages
run: npm ci
- name: Run Commitlint
run: echo "${{github.event.pull_request.title}}" | npx commitlint
4 changes: 2 additions & 2 deletions src/components/Dialog/Dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import './Dialog.scss';

const b = block('dialog');

interface DialogOwnProps {
interface DialogOwnProps extends QAProps {
open: boolean;
children: React.ReactNode;
onEscapeKeyDown?: ModalProps['onEscapeKeyDown'];
Expand Down Expand Up @@ -52,7 +52,7 @@ interface DialogDefaultProps {
}

export type DialogProps = DialogOwnProps & Partial<DialogDefaultProps>;
type DialogInnerProps = DialogOwnProps & DialogDefaultProps & QAProps;
type DialogInnerProps = DialogOwnProps & DialogDefaultProps;

export class Dialog extends React.Component<DialogInnerProps> {
static defaultProps: DialogDefaultProps = {
Expand Down
1 change: 1 addition & 0 deletions src/components/Dialog/__stories__/DialogShowcase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ function OtherDialog() {
hasCloseButton
keepMounted
onEnterKeyDown={handleApply}
qa="darthVader"
onTransitionEntered={() => {
selectRef?.current?.focus();
setTimeout(() => setOpenSelect(true), 0);
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions src/components/Table/__tests__/Table.visual.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from 'react';

import {test} from '~playwright/core';

import {TableStories} from './helpersPlaywright';

test.describe('Table', () => {
test('render story: <Default>', async ({mount, expectScreenshot}) => {
await mount(<TableStories.Default />);

await expectScreenshot();
});

test('render story: <HOCWithTableSorting>', async ({mount, expectScreenshot}) => {
await mount(<TableStories.HOCWithTableSorting />);

await expectScreenshot();
});
});
5 changes: 5 additions & 0 deletions src/components/Table/__tests__/helpersPlaywright.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import {composeStories} from '@storybook/react';

import * as DefaultTableStories from '../__stories__/Table.stories';

export const TableStories = composeStories(DefaultTableStories);

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,11 @@ import React from 'react';
import {ArrowDown, ArrowUp, ArrowUpArrowDown} from '@gravity-ui/icons';

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

import './SortIndicator.scss';

export interface SortIndicatorProps {
order?: 'asc' | 'desc';
}

const b = block('sort-indicator');

export function SortIndicator({order}: SortIndicatorProps) {
let icon;
switch (order) {
Expand All @@ -26,9 +21,5 @@ export function SortIndicator({order}: SortIndicatorProps) {
icon = ArrowUpArrowDown;
}

return (
<div className={b()}>
<Icon data={icon} size={14} className={b('icon')} />
</div>
);
return <Icon data={icon} size={14} />;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ $block: '.#{variables.$ns}table';
#{$block} {
&__sort {
display: inline-flex;
align-items: baseline;
align-items: center;
gap: var(--g-spacing-1);
// `top` to avoid redundant height to appear
vertical-align: top;
Expand All @@ -14,6 +14,7 @@ $block: '.#{variables.$ns}table';
border-radius: var(--g-border-radius-xs);

&-indicator {
display: flex;
flex-shrink: 0;
color: var(--g-color-text-hint);
}
Expand Down

0 comments on commit 847f14e

Please sign in to comment.