1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

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

Signed-off-by: Jim Ehrismann <jehrismann@mirantis.com>
This commit is contained in:
Jim Ehrismann 2021-11-17 11:34:45 -05:00 committed by GitHub
parent 2446b6cf9b
commit 1fad7a18f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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 });