diff --git a/packages/builder/src/helpers/userInitials.js b/packages/builder/src/helpers/userInitials.js new file mode 100644 index 0000000000..c87d38c494 --- /dev/null +++ b/packages/builder/src/helpers/userInitials.js @@ -0,0 +1,13 @@ +const getUserInitials = user => { + if (user.firstName && user.lastName) { + return user.firstName[0] + user.lastName[0] + } else if (user.firstName) { + return user.firstName[0] + } else if (user.email) { + return user.email[0] + } + + return "U" +} + +export default getUserInitials diff --git a/packages/builder/src/pages/builder/portal/overview/[appId]/backups/_components/ActionsRenderer.svelte b/packages/builder/src/pages/builder/portal/overview/[appId]/backups/_components/ActionsRenderer.svelte index 7dc302186a..4787112760 100644 --- a/packages/builder/src/pages/builder/portal/overview/[appId]/backups/_components/ActionsRenderer.svelte +++ b/packages/builder/src/pages/builder/portal/overview/[appId]/backups/_components/ActionsRenderer.svelte @@ -3,31 +3,26 @@ ActionMenu, MenuItem, Icon, - Input, Heading, Body, Modal, } from "@budibase/bbui" import ConfirmDialog from "components/common/ConfirmDialog.svelte" import CreateRestoreModal from "./CreateRestoreModal.svelte" - import { createEventDispatcher, onMount } from "svelte" + import { createEventDispatcher } from "svelte" export let row let deleteDialog let restoreDialog - let updateDialog - let name let restoreBackupModal const dispatch = createEventDispatcher() - const onClickRestore = name => { + const onClickRestore = () => { dispatch("buttonclick", { type: "backupRestore", - name, backupId: row._id, - restoreBackupName: name, }) } @@ -38,21 +33,9 @@ }) } - const onClickUpdate = () => { - dispatch("buttonclick", { - type: "backupUpdate", - backupId: row._id, - name, - }) - } - async function downloadExport() { window.open(`/api/apps/${row.appId}/backups/${row._id}/file`, "_blank") } - - onMount(() => { - name = row.name - })