This commit is contained in:
2020-06-25 14:02:06 +00:00
parent 186d4858fa
commit 39c6e1923b
3 changed files with 28 additions and 7 deletions

View File

@@ -185,6 +185,8 @@
v-else
:key="item.key"
:disabled="item.disabled"
:href="item.href"
:target="item.target"
@click="clickMenuItem(item)"
v-bind:class="{ 'hidden-sm-and-up': item.surface }"
:data-cy="!!$ay.dev ? item.key : false"

View File

@@ -329,6 +329,16 @@ export default {
return window.$gz.store.state.helpUrl.replace("/docs/", "/");
},
/////////////////////////////
// generic routed download URL
//
genericDownloadUrl(route) {
//http://localhost:7575/api/v8/backup/download/100?t=sssss
let url = route + "?t=" + window.$gz.store.state.downloadToken;
return this.APIUrl(url);
},
/////////////////////////////
// backup file download URL
//
backupDownloadUrl(fileName) {

View File

@@ -508,7 +508,7 @@ async function clickHandler(menuItem) {
m.vm.replaceDialog = true;
break;
case "export":
alert("download stub");
//ignore download link let it go
break;
case "delete":
m.vm.remove();
@@ -636,12 +636,21 @@ function generateMenu(vm) {
});
}
menuOptions.menuItems.push({
title: "Export",
icon: "fa-file-download",
key: FORM_KEY + ":export",
vm: vm
});
//EXPORT
if (vm.$route.params.recordid != 0) {
let href = window.$gz.api.genericDownloadUrl(
"translation/download/" + vm.$route.params.recordid
);
menuOptions.menuItems.push({
title: "Export",
icon: "fa-file-download",
href: href,
target: "blank",
key: FORM_KEY + ":export",
vm: vm
});
}
window.$gz.eventBus.$emit("menu-change", menuOptions);
}