Ensure Drawer copyTitle() copies everything after the first ':' (#4373)

Signed-off-by: Jim Ehrismann <jehrismann@mirantis.com>
This commit is contained in:
Jim Ehrismann authored and GitHub committed 2021-11-17 11:34:45 -05:00
1 parent 2446b6cf9b
commit 1fad7a18f9
1 file changed
+2 -2
+2 -2
View File
@@ -147,9 +147,9 @@ export class Drawer extends React.Component<DrawerProps> {
};
copyTitle = (title: string) => {
const k8sObjName = title.split(":")[1] || title; // copy whole if no :
const itemName = title.split(":").splice(1).join(":") || title; // copy whole if no :
clipboard.writeText(k8sObjName.trim());
clipboard.writeText(itemName.trim());
this.setState({ isCopied: true });
setTimeout(() => {
this.setState({ isCopied: false });