Skip to content

Commit 45fe48b

Browse files
committed
fix: review
1 parent b53324f commit 45fe48b

File tree

8 files changed

+60
-34
lines changed

8 files changed

+60
-34
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
1-
.developer-ui-link-button {
2-
display: none;
3-
4-
&_visible {
5-
display: inline-block;
6-
}
1+
@import '../../styles/mixins.scss';
72

8-
.data-table__row:hover &,
9-
.ydb-paginated-table__row:hover & {
10-
display: inline-block;
11-
}
3+
.developer-ui-link-button {
4+
@include table-hover-appearing-button();
125
}

src/components/DeveloperUILinkButton/DeveloperUILinkButton.tsx

+9-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import {Button, Icon} from '@gravity-ui/uikit';
44

55
import {cn} from '../../utils/cn';
66

7+
import i18n from './i18n';
8+
79
import './DeveloperUILinkButton.scss';
810

911
const b = cn('developer-ui-link-button');
@@ -30,7 +32,13 @@ export function DeveloperUILinkButton({
3032
size = 's',
3133
}: DeveloperUiLinkProps) {
3234
return (
33-
<Button size={size} href={href} className={b({visible}, className)} target="_blank">
35+
<Button
36+
size={size}
37+
href={href}
38+
className={b({visible}, className)}
39+
target="_blank"
40+
title={i18n('action_go-to', {href})}
41+
>
3442
<Icon data={ArrowUpRightFromSquare} size={buttonSizeToIconSize[size]} />
3543
</Button>
3644
);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"action_go-to": "Go to {{href}}"
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import {registerKeysets} from '../../../utils/i18n';
2+
3+
import en from './en.json';
4+
5+
const COMPONENT = 'ydb-developer-ui-button';
6+
7+
export default registerKeysets(COMPONENT, {en});

src/components/EntityStatus/EntityStatus.scss

+8-8
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,9 @@
1616
}
1717

1818
&__clipboard-button {
19-
display: flex;
20-
flex-shrink: 0;
21-
22-
opacity: 0;
2319
color: var(--g-color-text-secondary);
2420

25-
&_visible,
26-
&:focus-visible {
27-
opacity: 1;
28-
}
21+
@include table-hover-appearing-button();
2922
}
3023

3124
&__controls-wrapper {
@@ -41,6 +34,13 @@
4134
height: 100%;
4235

4336
background-color: var(--g-color-base-float);
37+
38+
.data-table__row:hover &,
39+
.ydb-paginated-table__row:hover &,
40+
.ydb-tree-view__item & {
41+
width: min-content;
42+
padding: var(--g-spacing-1);
43+
}
4444
}
4545

4646
&__label {

src/containers/App/App.scss

-15
Original file line numberDiff line numberDiff line change
@@ -89,21 +89,6 @@ body,
8989
color: var(--g-color-text-danger);
9090
}
9191

92-
.data-table__row,
93-
.ydb-paginated-table__row,
94-
.ydb-tree-view__item {
95-
&:hover {
96-
& .entity-status__clipboard-button,
97-
.ydb-versions-nodes-tree-title__clipboard-button {
98-
opacity: 1;
99-
}
100-
& .entity-status__controls-wrapper {
101-
width: min-content;
102-
padding: var(--g-spacing-1);
103-
}
104-
}
105-
}
106-
10792
.g-root .data-table_highlight-rows .data-table__row:hover {
10893
background: var(--ydb-data-table-color-hover);
10994
}

src/containers/Versions/NodesTreeTitle/NodesTreeTitle.scss

+4
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,9 @@
6565

6666
opacity: 0;
6767
color: var(--g-color-text-secondary);
68+
.ydb-tree-view__item:hover &,
69+
&:focus-visible {
70+
opacity: 1;
71+
}
6872
}
6973
}

src/styles/mixins.scss

+26
Original file line numberDiff line numberDiff line change
@@ -368,3 +368,29 @@
368368
--entity-state-border-color: var(--g-color-line-generic-hover);
369369
}
370370
}
371+
372+
@mixin table-hover-appearing-button {
373+
opacity: 0;
374+
375+
&_visible,
376+
&:focus-visible {
377+
opacity: 1;
378+
}
379+
&:focus-visible {
380+
position: absolute;
381+
top: 2px;
382+
right: 2px;
383+
384+
background-color: var(--g-color-base-float);
385+
}
386+
.data-table__row:hover &,
387+
.ydb-paginated-table__row:hover & {
388+
opacity: 1;
389+
}
390+
.data-table__row:hover &:focus-visible,
391+
.ydb-paginated-table__row:hover &:focus-visible {
392+
position: static;
393+
394+
background-color: unset;
395+
}
396+
}

0 commit comments

Comments
 (0)