diff --git a/src/localization/en.json b/src/localization/en.json
index 07d30185..6da11e77 100644
--- a/src/localization/en.json
+++ b/src/localization/en.json
@@ -96,7 +96,6 @@
"delete": "Delete"
},
"toolbar": {
- "editing": "Editing Dashboard",
"name_placeholder": "Dashboard Name",
"icon_placeholder": "Icon Class (Optional)"
},
diff --git a/src/views/Dashboard/Dashboard.vue b/src/views/Dashboard/Dashboard.vue
index 9f93200e..3498b336 100644
--- a/src/views/Dashboard/Dashboard.vue
+++ b/src/views/Dashboard/Dashboard.vue
@@ -28,7 +28,7 @@
:dashboard-id="id"
:is-editing="true"
@update-panel="handleUpdatePanel"
- @remove-row="handleRemoveRow" />
+ @remove-panel="handleRemovePanel" />
{
- editRows.value.splice(rowIndex, 1);
+ const handleRemovePanel = (rowIndex, panelIndex) => {
+ const row = editRows.value[rowIndex];
+ if (!row) return;
+ if (row.panels.length <= 1) {
+ editRows.value.splice(rowIndex, 1);
+ } else {
+ row.panels.splice(panelIndex, 1);
+ }
};
const handleUpdatePanel = (rowIndex, panelIndex, panelKey) => {
diff --git a/src/views/Dashboard/components/DashboardEditToolbar.vue b/src/views/Dashboard/components/DashboardEditToolbar.vue
index b5b7754e..5cecb3b9 100644
--- a/src/views/Dashboard/components/DashboardEditToolbar.vue
+++ b/src/views/Dashboard/components/DashboardEditToolbar.vue
@@ -1,9 +1,8 @@
-
{{ t('dashboard.toolbar.editing') }}
diff --git a/src/views/Dashboard/components/DashboardPanel.vue b/src/views/Dashboard/components/DashboardPanel.vue
index a30b807d..4a11ef0f 100644
--- a/src/views/Dashboard/components/DashboardPanel.vue
+++ b/src/views/Dashboard/components/DashboardPanel.vue
@@ -1,6 +1,14 @@
+
@@ -13,7 +21,7 @@
-
+
@@ -32,6 +40,7 @@
+
+
diff --git a/src/views/Dashboard/components/DashboardRow.vue b/src/views/Dashboard/components/DashboardRow.vue
index 40fce616..09d9433f 100644
--- a/src/views/Dashboard/components/DashboardRow.vue
+++ b/src/views/Dashboard/components/DashboardRow.vue
@@ -9,16 +9,10 @@
:key="panelIndex"
:panel-key="panelKey"
:is-editing="true"
+ :show-remove="true"
:class="panelEditClass"
- @select="(key) => emit('update-panel', rowIndex, panelIndex, key)" />
-
-
+ @select="(key) => emit('update-panel', rowIndex, panelIndex, key)"
+ @remove="emit('remove-panel', rowIndex, panelIndex)" />
import { computed } from 'vue';
- import { X } from 'lucide-vue-next';
- import { Button } from '@/components/ui/button';
import { ResizableHandle, ResizablePanel, ResizablePanelGroup } from '@/components/ui/resizable';
import DashboardPanel from './DashboardPanel.vue';
@@ -69,7 +61,7 @@
}
});
- const emit = defineEmits(['update-panel', 'remove-row']);
+ const emit = defineEmits(['update-panel', 'remove-panel']);
const isVertical = computed(() => props.row.direction === 'vertical');
diff --git a/src/views/Search/Search.vue b/src/views/Search/Search.vue
index 5bee6063..7df01aee 100644
--- a/src/views/Search/Search.vue
+++ b/src/views/Search/Search.vue
@@ -126,7 +126,7 @@
-
+
-
+