This commit is contained in:
@@ -6,21 +6,17 @@ PRIORITY - ALWAYS Lowest level stuff first, i.e. TODO at server, api route chang
|
||||
todo: Administration - Attached files manager
|
||||
replicate v7
|
||||
|
||||
|
||||
DELETE bulk OP
|
||||
delete selected file Attachments db record and physical file if present or just the fileAttachment if missing the physical file
|
||||
This is how you fix broken missing file links, because it's bulk it's not too onerous
|
||||
BULK OPS
|
||||
DELETE bulk OP
|
||||
delete selected file Attachments db record and physical file if present or just the fileAttachment if missing the physical file
|
||||
This is how you fix broken missing file links, because it's bulk it's not too onerous
|
||||
MOVE bulk op
|
||||
Select one ore more files then select MOVE
|
||||
UI pops up to select object type and manually type in the id
|
||||
it then checks to see that that object exists before moving them to it
|
||||
|
||||
|
||||
Add physical file path to grid data
|
||||
Add physical file path to grid data
|
||||
REplace notes with physical file path for grid but keep notes in there as an option`
|
||||
|
||||
MOVE bulk op
|
||||
Select one ore more files then select MOVE
|
||||
UI pops up to select object type and manually type in the id
|
||||
it then checks to see that that object exists before moving them to it
|
||||
|
||||
|
||||
|
||||
TESTING:
|
||||
Delete a file that's been attached in windows
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
v-on:selection-change="handleSelected"
|
||||
>
|
||||
</gz-data-table>
|
||||
{{ selectedItems }}
|
||||
|
||||
<template v-if="jobActive">
|
||||
<v-progress-circular
|
||||
indeterminate
|
||||
@@ -48,11 +48,44 @@ export default {
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
handleSelected(selected) {
|
||||
console.log(selected);
|
||||
this.selectedItems = selected;
|
||||
canBulkOp() {
|
||||
return (
|
||||
this.rights.change &&
|
||||
this.selectedItems &&
|
||||
this.selectedItems.length > 0
|
||||
);
|
||||
},
|
||||
handleSelected(selected) {
|
||||
this.selectedItems = selected;
|
||||
|
||||
if (this.canBulkOp()) {
|
||||
window.$gz.eventBus.$emit("menu-enable-item", FORM_KEY + ":duplicate");
|
||||
window.$gz.eventBus.$emit("menu-enable-item", FORM_KEY + ":new");
|
||||
} else {
|
||||
window.$gz.eventBus.$emit("menu-disable-item", FORM_KEY + ":duplicate");
|
||||
window.$gz.eventBus.$emit("menu-disable-item", FORM_KEY + ":new");
|
||||
}
|
||||
},
|
||||
async deleteSelected() {
|
||||
let vm = this;
|
||||
try {
|
||||
let dialogResult = await window.$gz.dialog.confirmDelete();
|
||||
if (dialogResult != true) {
|
||||
return;
|
||||
}
|
||||
|
||||
let url = API_BASE_URL + vm.$route.params.recordid;
|
||||
|
||||
window.$gz.form.deleteAllErrorBoxErrors(vm);
|
||||
let res = await window.$gz.api.remove(url);
|
||||
if (res.error) {
|
||||
vm.formState.serverError = res.error;
|
||||
window.$gz.form.setErrorBoxErrors(vm);
|
||||
}
|
||||
} catch (ex) {
|
||||
window.$gz.errorHandler.handleFormError(ex, vm);
|
||||
}
|
||||
},
|
||||
async startMaintenanceJob() {
|
||||
let vm = this;
|
||||
|
||||
@@ -131,6 +164,12 @@ function clickHandler(menuItem) {
|
||||
case "START_MAINTENANCE_JOB":
|
||||
m.vm.startMaintenanceJob();
|
||||
break;
|
||||
case "MOVE_SELECTED":
|
||||
m.vm.moveSelected();
|
||||
break;
|
||||
case "DELETE_SELECTED":
|
||||
m.vm.deleteSelected();
|
||||
break;
|
||||
default:
|
||||
window.$gz.eventBus.$emit(
|
||||
"notify-warning",
|
||||
@@ -176,6 +215,22 @@ function generateMenu(vm) {
|
||||
key: FORM_KEY + ":START_MAINTENANCE_JOB",
|
||||
vm: vm
|
||||
});
|
||||
|
||||
menuOptions.menuItems.push({
|
||||
title: "MoveSelected",
|
||||
icon: "fa-people-carry",
|
||||
surface: false,
|
||||
key: FORM_KEY + ":MOVE_SELECTED",
|
||||
vm: vm
|
||||
});
|
||||
|
||||
menuOptions.menuItems.push({
|
||||
title: "DeleteSelected",
|
||||
icon: "fa-trash-alt",
|
||||
surface: false,
|
||||
key: FORM_KEY + ":DELETE_SELECTED",
|
||||
vm: vm
|
||||
});
|
||||
}
|
||||
|
||||
window.$gz.eventBus.$emit("menu-change", menuOptions);
|
||||
@@ -188,7 +243,9 @@ function generateMenu(vm) {
|
||||
async function fetchTranslatedText(vm) {
|
||||
await window.$gz.translation.cacheTranslations([
|
||||
"StartAttachmentMaintenanceJob",
|
||||
"JobExclusiveWarning"
|
||||
"JobExclusiveWarning",
|
||||
"DeleteSelected",
|
||||
"MoveSelected"
|
||||
]);
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user