Merge pull request #11066 from Budibase/merge/gitstart

Merge/gitstart
This commit is contained in:
Michael Drury 2023-06-29 12:12:24 +01:00 committed by GitHub
commit 279ca6a73a
2 changed files with 16 additions and 4 deletions

View File

@ -32,7 +32,12 @@
<div slot="control" class="icon">
<Icon s hoverable name="MoreSmallList" />
</div>
<MenuItem icon="Duplicate" on:click={duplicateAutomation}>Duplicate</MenuItem>
<MenuItem
icon="Duplicate"
on:click={duplicateAutomation}
disabled={automation.definition.trigger.name === "Webhook"}
>Duplicate</MenuItem
>
<MenuItem icon="Edit" on:click={updateAutomationDialog.show}>Edit</MenuItem>
<MenuItem icon="Delete" on:click={confirmDeleteDialog.show}>Delete</MenuItem>
</ActionMenu>

View File

@ -92,13 +92,20 @@
},
}
function downloadWithBlob(data, filename) {
download(new Blob([data], { type: "text/plain" }), filename)
}
async function exportView() {
try {
const data = await API.exportView({
viewName: view,
format: exportFormat,
})
download(data, `export.${exportFormat === "csv" ? "csv" : "json"}`)
downloadWithBlob(
data,
`export.${exportFormat === "csv" ? "csv" : "json"}`
)
} catch (error) {
notifications.error(`Unable to export ${exportFormat.toUpperCase()} data`)
}
@ -111,7 +118,7 @@
rows: selectedRows.map(row => row._id),
format: exportFormat,
})
download(data, `export.${exportFormat}`)
downloadWithBlob(data, `export.${exportFormat}`)
} else if (filters || sorting) {
let response
try {
@ -130,7 +137,7 @@
notifications.error("Export Failed")
}
if (response) {
download(response, `export.${exportFormat}`)
downloadWithBlob(response, `export.${exportFormat}`)
notifications.success("Export Successful")
}
} else {