HUGE REFACTOR / CLEANUP

if there is a issue it's probably something in here that was changed
This commit is contained in:
2021-09-28 20:19:44 +00:00
parent 51eddfede9
commit d0afdd9855
238 changed files with 3127 additions and 8614 deletions

View File

@@ -35,7 +35,6 @@ export default {
async created() {
this.rights = window.$gz.role.getRights(window.$gz.type.Report);
window.$gz.eventBus.$on("menu-click", clickHandler);
//await fetchTranslatedText(this);
generateMenu(this);
},
beforeDestroy() {
@@ -52,21 +51,19 @@ export default {
methods: {
async upload() {
//similar code in wiki-control
let vm = this;
let fileData = [];
const vm = this;
const fileData = [];
for (let i = 0; i < vm.uploadFiles.length; i++) {
let f = vm.uploadFiles[i];
const f = vm.uploadFiles[i];
fileData.push({ name: f.name, lastModified: f.lastModified });
}
let at = {
// ayaId: vm.ayaId,
// ayaType: vm.ayaType,
const at = {
files: vm.uploadFiles,
fileData: JSON.stringify(fileData)
};
try {
vm.uploading = true;
let res = await window.$gz.api.upload("report/upload", at);
const res = await window.$gz.api.upload("report/upload", at);
if (res.error) {
window.$gz.errorHandler.handleFormError(res.error);
} else {
@@ -91,15 +88,9 @@ function clickHandler(menuItem) {
if (!menuItem) {
return;
}
let m = window.$gz.menu.parseMenuItem(menuItem);
const m = window.$gz.menu.parseMenuItem(menuItem);
if (m.owner == FORM_KEY && !m.disabled) {
switch (m.key) {
// case "new":
// m.vm.$router.push({
// name: "adm-translation",
// params: { recordid: 0 }
// });
// break;
default:
window.$gz.eventBus.$emit(
"notify-warning",
@@ -113,7 +104,7 @@ function clickHandler(menuItem) {
//
//
function generateMenu(vm) {
let menuOptions = {
const menuOptions = {
isMain: true,
icon: "$ayiDraftingCompass",
title: "ReportList",
@@ -126,12 +117,4 @@ function generateMenu(vm) {
window.$gz.eventBus.$emit("menu-change", menuOptions);
}
//////////////////////////////////////////////////////////
//
// Ensures UI translated text is available
//
async function fetchTranslatedText(vm) {
await window.$gz.translation.cacheTranslations(["ReadOnly"]);
}
</script>