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

Signed-off-by: Jim Ehrismann <jehrismann@mirantis.com>
This commit is contained in:
Jim Ehrismann committed 2021-11-17 10:29:47 -05:00
1 parent 2446b6cf9b
commit e9e1b726b7
1 file changed
+2 -2
+2 -2
View File
@@ -147,9 +147,9 @@ export class Drawer extends React.Component<DrawerProps> {
}; };
copyTitle = (title: string) => { 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 }); this.setState({ isCopied: true });
setTimeout(() => { setTimeout(() => {
this.setState({ isCopied: false }); this.setState({ isCopied: false });