Skip to content

πŸ”₯ πŸ”₯ πŸ”₯ A Free & Self-hostable Airtable Alternative

fix: mini sidebar action menu

DarkPhoenix27043f93280f305f
diff --git a/packages/nc-gui/components/dashboard/MiniSidebar/CreateNewActionMenu.vue b/packages/nc-gui/components/dashboard/MiniSidebar/CreateNewActionMenu.vue
index 7ee15583f1..9066966243 100644
--- a/packages/nc-gui/components/dashboard/MiniSidebar/CreateNewActionMenu.vue
+++ b/packages/nc-gui/components/dashboard/MiniSidebar/CreateNewActionMenu.vue
@@ -15,6 +15,8 @@ const { activeTable } = storeToRefs(tablesStore)
const { openNewScriptModal } = useAutomationStore()
+const { openNewDashboardModal } = useDashboardStore()
+
const viewsStore = useViewsStore()
const { loadViews, onOpenViewCreateModal } = viewsStore
const { activeView } = storeToRefs(viewsStore)
@@ -123,6 +125,12 @@ const hasAutomationCreateAccess = computed(() => {
return isUIAllowed('scriptCreateOrEdit')
})
+
+const hasDashboardCreateAccess = computed(() => {
+ if (!base.value || !isBaseHomePage.value) return true
+
+ return isUIAllowed('dashboardCreate')
+})
</script>
<template>
@@ -167,6 +175,28 @@ const hasAutomationCreateAccess = computed(() => {
{{ $t('objects.table') }}
</NcMenuItem>
</NcTooltip>
+
+ <template v-if="isEeUI">
+ <NcTooltip
+ :title="
+ hasDashboardCreateAccess
+ ? $t('tooltip.navigateToBaseToCreateDashboard')
+ : $t('tooltip.youDontHaveAccessToCreateNewDashboard')
+ "
+ :disabled="!(!isBaseHomePage || !hasDashboardCreateAccess)"
+ placement="right"
+ >
+ <NcMenuItem
+ data-testid="mini-sidebar--dashboard-create"
+ :disabled="!isBaseHomePage || !hasDashboardCreateAccess"
+ @click="openNewDashboardModal({ baseId: openedProject?.id })"
+ >
+ <GeneralIcon icon="dashboards" />
+ {{ $t('general.dashboard') }}
+ </NcMenuItem>
+ </NcTooltip>
+ </template>
+
<NcTooltip
:title="
hasViewCreateAccess ? $t('tooltip.navigateToTableToCreateView') : $t('tooltip.youDontHaveAccessToCreateNewView')
@@ -242,7 +272,7 @@ const hasAutomationCreateAccess = computed(() => {
@click="openNewScriptModal({ baseId: openedProject?.id })"
>
<GeneralIcon icon="ncScript" />
- {{ $t('general.scripts') }}
+ {{ $t('general.script') }}
</NcMenuItem>
</NcTooltip>
</template>
diff --git a/packages/nc-gui/lang/en.json b/packages/nc-gui/lang/en.json
index 8628411cee..e3aa347c08 100644
--- a/packages/nc-gui/lang/en.json
+++ b/packages/nc-gui/lang/en.json
@@ -1816,10 +1816,12 @@
"filteredByCurrentUser": "Filtered by current user",
"navigateToBaseToCreateTable": "Navigate to a base to a create table",
"navigateToBaseToCreateAutomation": "Navigate to a base to a create script",
+ "navigateToBaseToCreateDashboard": "Navigate to a base to a create dashboard",
"navigateToTableToCreateView": "Navigate to a table to a create view",
"youDontHaveAccessToCreateNewTable": "You don't have access to create new table",
"youDontHaveAccessToCreateNewView": "You don't have access to create new view",
"youDontHaveAccessToCreateNewAutomation": "You don't have access to create new script",
+ "youDontHaveAccessToCreateNewDashboard": "You don't have access to create new dashboard",
"formViewCreationNotSupportedForSyncedTable": "Form view creation is not supported for synced table",
"dataInThisFieldCantBeManuallyEdited": "Data in this field can't be manually edited",
"viewAndEditPermissionsForAllFieldsInThisTable": "View and edit permissions for all fields in this table",