Merge pull request #5771 from Budibase/feature/copy-app-ID-from-app-list

allow copying of app ID from the edit menu
This commit is contained in:
Martin McKeaveney 2022-05-09 15:45:24 +01:00 committed by GitHub
commit 1850bf2629
2 changed files with 11 additions and 0 deletions

View File

@ -19,6 +19,7 @@
export let unpublishApp export let unpublishApp
export let releaseLock export let releaseLock
export let editIcon export let editIcon
export let copyAppId
</script> </script>
<div class="title"> <div class="title">
@ -102,6 +103,9 @@
<MenuItem on:click={() => unpublishApp(app)} icon="GlobeRemove"> <MenuItem on:click={() => unpublishApp(app)} icon="GlobeRemove">
Unpublish Unpublish
</MenuItem> </MenuItem>
<MenuItem on:click={() => copyAppId(app)} icon="Copy">
Copy App ID
</MenuItem>
{/if} {/if}
{#if !app.deployed} {#if !app.deployed}
<MenuItem on:click={() => updateApp(app)} icon="Edit">Edit</MenuItem> <MenuItem on:click={() => updateApp(app)} icon="Edit">Edit</MenuItem>

View File

@ -12,6 +12,7 @@
Body, Body,
Search, Search,
Divider, Divider,
Helpers,
} from "@budibase/bbui" } from "@budibase/bbui"
import TemplateDisplay from "components/common/TemplateDisplay.svelte" import TemplateDisplay from "components/common/TemplateDisplay.svelte"
import Spinner from "components/common/Spinner.svelte" import Spinner from "components/common/Spinner.svelte"
@ -261,6 +262,11 @@
} }
} }
const copyAppId = async app => {
await Helpers.copyToClipboard(app.prodId)
notifications.success("App ID copied to clipboard.")
}
function createAppFromTemplateUrl(templateKey) { function createAppFromTemplateUrl(templateKey) {
// validate the template key just to make sure // validate the template key just to make sure
const templateParts = templateKey.split("/") const templateParts = templateKey.split("/")
@ -394,6 +400,7 @@
<div class="appTable"> <div class="appTable">
{#each filteredApps as app (app.appId)} {#each filteredApps as app (app.appId)}
<AppRow <AppRow
{copyAppId}
{releaseLock} {releaseLock}
{editIcon} {editIcon}
{app} {app}