This commit is contained in:
2020-04-05 18:42:27 +00:00
parent 0d9088816b
commit 97d68088fb
3 changed files with 21 additions and 7 deletions

View File

@@ -50,7 +50,6 @@ CURRENT TODOs
@@@@@@@@@@@ ROADMAP STAGE 2:
todo: Customer login should have help links go to a special customer end user section in the manual, but they can still view the rest of the manual becuase maybe they will buy it
todo: new widget
- There should be a new option (in addition to duplicate) within the existing widget form because it makes sense to want to make a new one while editing previous one
- Plus you could have arrived there from anywhere, don't want to have to reload a big list just to add a new one

View File

@@ -187,7 +187,7 @@
<v-content>
<v-container fluid>
<transition name="fade" mode="out-in" @after-leave="afterLeave">
<router-view class="view"></router-view>
<router-view class="view" :key="$route.fullPath"></router-view>
</transition>
</v-container>
</v-content>

View File

@@ -341,25 +341,25 @@ export default {
}
//enable / disable save button
let canSave = val.dirty && val.valid && !val.readOnly;
if (canSave) {
if (val.dirty && val.valid && !val.readOnly) {
window.$gz.eventBus.$emit("menu-enable-item", FORM_KEY + ":save");
} else {
window.$gz.eventBus.$emit("menu-disable-item", FORM_KEY + ":save");
}
//enable / disable duplicate button
let canDuplicate = !val.dirty && val.valid && !val.readOnly;
if (canDuplicate) {
//enable / disable duplicate / new button
if (!val.dirty && val.valid && !val.readOnly) {
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");
}
},
deep: true
@@ -574,6 +574,12 @@ function clickHandler(menuItem) {
case "delete":
m.vm.remove();
break;
case "new":
m.vm.$router.push({
name: "widget-edit",
params: { recordid: 0, new: true }
});
break;
case "duplicate":
m.vm.duplicate();
break;
@@ -657,6 +663,15 @@ function generateMenu(vm) {
vm: vm
});
if (vm.rights.change) {
menuOptions.menuItems.push({
title: vm.$ay.t("New"),
icon: "fa-plus",
key: FORM_KEY + ":new",
vm: vm
});
}
if (vm.rights.change) {
menuOptions.menuItems.push({
title: vm.$ay.t("Duplicate"),