From 54b93cc349b167b63535f2323a51ecefccaaeea1 Mon Sep 17 00:00:00 2001
From: jelveh
Date: Fri, 13 Dec 2024 18:37:43 -0800
Subject: [PATCH] add a copy button next to App UID in Dev Center
---
src/dev-center/js/dev-center.js | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/src/dev-center/js/dev-center.js b/src/dev-center/js/dev-center.js
index 31c9670f..d00341d0 100644
--- a/src/dev-center/js/dev-center.js
+++ b/src/dev-center/js/dev-center.js
@@ -54,6 +54,7 @@ const loading_spinner = `
`;
const index_missing_error = `Please upload an 'index.html' file or if you're uploading a directory, make sure it contains an 'index.html' file at its root.`;
const lock_svg = '';
+const copy_svg = ``;
// authUsername
(async () => {
@@ -536,7 +537,9 @@ function generate_edit_app_section(app) {
-
+
+ ${copy_svg}
+
@@ -614,7 +617,7 @@ function generate_edit_app_section(app) {
credentialless attribute for the iframe tag.
-
+
@@ -2766,3 +2769,13 @@ async function handleSocialImageUpload(app_name, socialImageData) {
throw err;
}
}
+
+$(document).on('click', '.copy-app-uid', function(e) {
+ const appUID = $('#edit-app-uid').val();
+ navigator.clipboard.writeText(appUID);
+ // change to 'copied'
+ $(this).html('Copied');
+ setTimeout(() => {
+ $(this).html(copy_svg);
+ }, 2000);
+});
\ No newline at end of file