This commit is contained in:
2020-06-25 23:00:06 +00:00
parent 00c94b111b
commit 82580eb282
3 changed files with 47 additions and 37 deletions

View File

@@ -5,9 +5,6 @@ PRIORITY - ALWAYS Lowest level stuff first, i.e. TODO at server, api route chang
todo: translation get value for key should not return ?? if it's empty, instead just return empty
This will avoid fouc on slow retrieval
todo: help links for User, Users, Translations, Translation

View File

@@ -359,6 +359,10 @@ export default {
singleSelect: {
type: Boolean,
default: false
},
reload: {
type: Boolean,
default: false
}
},
watch: {
@@ -390,6 +394,11 @@ export default {
if (newValue.length != oldValue.length) {
this.handleSelectChange();
}
},
reload: function(newValue, oldValue) {
if (newValue != oldValue) {
this.getDataFromApi();
}
}
},
methods: {

View File

@@ -7,6 +7,7 @@
:dataListSort="dataListSort"
:showSelect="false"
:singleSelect="false"
:reload="reload"
v-on:update:selected="handleSelected"
>
</gz-data-table>
@@ -18,9 +19,14 @@
multiple
chips
></v-file-input>
<v-btn v-if="uploadFiles.length > 0" color="primary" text @click="upload">{{
$ay.t("Upload")
}}</v-btn>
<v-btn
v-if="uploadFiles.length > 0"
:loading="uploading"
color="primary"
text
@click="upload"
>{{ $ay.t("Upload") }}</v-btn
>
</div>
</template>
@@ -43,7 +49,9 @@ export default {
dataListKey: "TranslationDataList",
dataListFilter: "",
dataListSort: "",
rights: window.$gz.role.defaultRightsObject()
rights: window.$gz.role.defaultRightsObject(),
reload: false,
uploading: false
};
},
methods: {
@@ -62,15 +70,19 @@ export default {
fileData: JSON.stringify(fileData)
};
try {
vm.uploading = true;
let res = await window.$gz.api.upload("translation/upload", at);
if (res.error) {
window.$gz.errorHandler.handleFormError(res.error);
} else {
vm.uploadFiles = [];
//TODO: trigger grid refresh
this.reload = !this.reload;
}
} catch (error) {
window.$gz.errorHandler.handleFormError(error);
} finally {
vm.uploading = false;
}
},
handleSelected(selectedItems) {
@@ -89,12 +101,12 @@ function clickHandler(menuItem) {
let 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;
// case "new":
// m.vm.$router.push({
// name: "adm-translation",
// params: { recordid: 0 }
// });
// break;
default:
window.$gz.eventBus.$emit(
"notify-warning",
@@ -119,31 +131,23 @@ function generateMenu(vm) {
}
};
if (vm.rights.change) {
menuOptions.menuItems.push({
title: "New",
icon: "fa-plus",
surface: true,
key: FORM_KEY + ":new",
vm: vm
});
}
//STUB REPORTS
//Report not Print, print is a further option
menuOptions.menuItems.push({
title: "Report",
icon: "fa-file-alt",
key: FORM_KEY + ":report",
vm: vm
});
// //STUB REPORTS
// //Report not Print, print is a further option
// menuOptions.menuItems.push({
// title: "Report",
// icon: "fa-file-alt",
// key: FORM_KEY + ":report",
// vm: vm
// });
menuOptions.menuItems.push({
title: "stub: Last report used",
icon: "fa-file-alt",
key: FORM_KEY + ":report:STUBlastusedreportid",
vm: vm
});
// menuOptions.menuItems.push({
// title: "stub: Last report used",
// icon: "fa-file-alt",
// key: FORM_KEY + ":report:STUBlastusedreportid",
// vm: vm
// });
window.$gz.eventBus.$emit("menu-change", menuOptions);
}