Skip to content

Commit dc64506

Browse files
authored
feat(Describe): add button to copy content to clipboard (#1192)
1 parent 62de3e6 commit dc64506

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed
Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,30 @@
11
@import '../../../../styles/mixins.scss';
22

3-
.kv-describe {
3+
.ydb-describe {
44
&__message-container {
55
padding: 15px 0;
66
}
77

88
&__result {
9+
position: relative;
10+
911
display: flex;
1012
overflow: auto;
1113
flex: 0 0 auto;
1214

13-
padding: 10px 20px 20px 0;
15+
padding: 0 20px 20px 0;
1416
}
1517

1618
&__tree {
1719
@include json-tree-styles();
1820
}
21+
22+
&__copy {
23+
position: absolute;
24+
left: 308px;
25+
}
26+
27+
.json-inspector__search {
28+
height: 26px;
29+
}
1930
}

src/containers/Tenant/Diagnostics/Describe/Describe.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import {ClipboardButton} from '@gravity-ui/uikit';
12
import {skipToken} from '@reduxjs/toolkit/query';
23
import JSONTree from 'react-json-inspector';
34
import {shallowEqual} from 'react-redux';
@@ -14,7 +15,7 @@ import {isEntityWithMergedImplementation} from '../../utils/schema';
1415
import './Describe.scss';
1516
import 'react-json-inspector/json-inspector.css';
1617

17-
const b = cn('kv-describe');
18+
const b = cn('ydb-describe');
1819

1920
const expandMap = new Map();
2021

@@ -86,6 +87,11 @@ const Describe = ({path, database, type}: IDescribeProps) => {
8687
return expandMap.get(keypath) || false;
8788
}}
8889
/>
90+
<ClipboardButton
91+
view="flat-secondary"
92+
text={JSON.stringify(preparedDescribeData)}
93+
className={b('copy')}
94+
/>
8995
</div>
9096
) : null}
9197
</div>

0 commit comments

Comments
 (0)