Bug 37762: VueJS framework: Add 'name' to moduleDashboard
This is required to differentiate between selected widgets on different module dashboards i.e. ERM vs ILL Signed-off-by: Jason Robb <jrobb@sekls.org> Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
parent
a2c13377ed
commit
b4fe2b92dd
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<ModuleDashboard :availableWidgets="availableWidgets" />
|
||||
<ModuleDashboard name="ERM" :availableWidgets="availableWidgets" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
|
|
|||
|
|
@ -92,9 +92,11 @@ import { VueDraggableNext } from "vue-draggable-next";
|
|||
export default {
|
||||
props: {
|
||||
availableWidgets: Array,
|
||||
name: String,
|
||||
},
|
||||
setup(props) {
|
||||
const availableWidgets = props.availableWidgets;
|
||||
const name = props.name;
|
||||
const selectedWidgetsLeft = ref([]);
|
||||
const selectedWidgetsRight = ref([]);
|
||||
const isDragging = ref(false);
|
||||
|
|
@ -216,7 +218,9 @@ export default {
|
|||
};
|
||||
|
||||
onMounted(() => {
|
||||
const storedWidgets = localStorage.getItem("dashboard-widgets");
|
||||
const storedWidgets = localStorage.getItem(
|
||||
name + "-dashboard-widgets"
|
||||
);
|
||||
if (storedWidgets) {
|
||||
const { left, right } = JSON.parse(storedWidgets);
|
||||
left.forEach(widgetName => {
|
||||
|
|
@ -246,7 +250,7 @@ export default {
|
|||
const leftWidgetNames = left.map(widget => widget.name);
|
||||
const rightWidgetNames = right.map(widget => widget.name);
|
||||
localStorage.setItem(
|
||||
"dashboard-widgets",
|
||||
name + "-dashboard-widgets",
|
||||
JSON.stringify({
|
||||
left: leftWidgetNames,
|
||||
right: rightWidgetNames,
|
||||
|
|
|
|||
Loading…
Reference in New Issue