Skip to content

Commit 2d8b380

Browse files
fix(TenantOverview): add copy button to tenant name (#459)
1 parent 253e401 commit 2d8b380

File tree

3 files changed

+10
-20
lines changed

3 files changed

+10
-20
lines changed

src/components/EntityStatus/EntityStatus.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class EntityStatus extends React.Component {
3131
label: PropTypes.string,
3232
iconPath: PropTypes.string,
3333
hasClipboardButton: PropTypes.bool,
34+
clipboardButtonAlwaysVisible: PropTypes.bool,
3435
showStatus: PropTypes.bool,
3536
externalLink: PropTypes.bool,
3637
className: PropTypes.string,
@@ -47,6 +48,7 @@ class EntityStatus extends React.Component {
4748
externalLink: false,
4849
mode: 'color',
4950
withLeftTrim: false,
51+
clipboardButtonAlwaysVisible: false,
5052
};
5153
renderIcon() {
5254
const {status, size, showStatus, mode} = this.props;
@@ -123,7 +125,7 @@ class EntityStatus extends React.Component {
123125
component="span"
124126
size="s"
125127
className={b('clipboard-button', {
126-
visible: false,
128+
visible: this.props.clipboardButtonAlwaysVisible,
127129
})}
128130
>
129131
<ClipboardButton text={name} size={16} />

src/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,13 @@ const renderName = (tenant) => {
2727
const {Name} = tenant;
2828
return (
2929
<div className={b('tenant-name-wrapper')}>
30-
<EntityStatus status={tenant.State} />
31-
<span className={b('tenant-name-trim')}>
32-
<span className={b('tenant-name')}>{Name}</span>
33-
</span>
30+
<EntityStatus
31+
status={tenant.State}
32+
name={Name}
33+
withLeftTrim
34+
hasClipboardButton
35+
clipboardButtonAlwaysVisible
36+
/>
3437
</div>
3538
);
3639
}

src/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.scss

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,6 @@
1010
display: flex;
1111
overflow: hidden;
1212
align-items: center;
13-
14-
& .yc-link {
15-
display: flex;
16-
}
17-
}
18-
&__tenant-name-trim {
19-
overflow: hidden;
20-
21-
white-space: nowrap;
22-
text-overflow: ellipsis;
23-
direction: rtl;
24-
}
25-
26-
&__tenant-name {
27-
unicode-bidi: plaintext;
2813
}
2914

3015
&__top {

0 commit comments

Comments
 (0)