diff --git a/src/__tests__/admin/settings/menu-entities.spec.tsx b/src/__tests__/admin/settings/menu.spec.tsx
similarity index 91%
rename from src/__tests__/admin/settings/menu-entities.spec.tsx
rename to src/__tests__/admin/settings/menu.spec.tsx
index 5da1c74f1..978015f05 100644
--- a/src/__tests__/admin/settings/menu-entities.spec.tsx
+++ b/src/__tests__/admin/settings/menu.spec.tsx
@@ -3,13 +3,13 @@ import React from "react";
import { render, screen, waitFor } from "@testing-library/react";
import { ApplicationRoot } from "frontend/components/ApplicationRoot";
import userEvent from "@testing-library/user-event";
-import MenuEntitiesSettings from "pages/admin/settings/menu-entities";
+import MenuSettings from "pages/admin/settings/menu";
import { setupApiHandlers } from "__tests__/_/setupApihandlers";
setupApiHandlers();
-describe("pages/admin/settings/menu-entities", () => {
+describe("pages/admin/settings/menu", () => {
beforeAll(() => {
const useRouter = jest.spyOn(require("next/router"), "useRouter");
useRouter.mockImplementation(() => ({
@@ -21,7 +21,7 @@ describe("pages/admin/settings/menu-entities", () => {
it("should display only active entities with correct state", async () => {
render(
-
+
);
@@ -48,7 +48,7 @@ describe("pages/admin/settings/menu-entities", () => {
it("should toggle menu state successfully", async () => {
render(
-
+
);
@@ -80,7 +80,7 @@ describe("pages/admin/settings/menu-entities", () => {
it("should display updated entities state", async () => {
render(
-
+
);
diff --git a/src/backend/menu/menu.service.ts b/src/backend/menu/menu.service.ts
index 911aa64fe..c1c22bfb2 100644
--- a/src/backend/menu/menu.service.ts
+++ b/src/backend/menu/menu.service.ts
@@ -66,14 +66,6 @@ export class NavigationMenuApiService implements IApplicationService {
type: NavigationMenuItemType.System,
link: SystemLinks.Home,
},
- // {
- // id: nanoid(),
- // title: "Dashboards",
- // icon: "PieChart",
- // type: NavigationMenuItemType.System,
- // link: SystemLinks.AllDashboards,
- // children: [],
- // },
]);
const entitiesToShow = await this.getUserMenuEntities();
@@ -90,7 +82,7 @@ export class NavigationMenuApiService implements IApplicationService {
entitiesToShow.forEach((entity) => {
navItems.push({
id: nanoid(),
- title: userFriendlyCase(entity.label), // get the current label
+ title: userFriendlyCase(entity.label), // TODO get the current label
icon: "File",
type: NavigationMenuItemType.Entities,
link: entity.value,
@@ -208,8 +200,8 @@ export class NavigationMenuApiService implements IApplicationService {
userPermissions
);
- if (isMenuAllowed) {
- return true;
+ if (typeof isMenuAllowed === "boolean") {
+ return isMenuAllowed;
}
switch (menuItem.type) {
diff --git a/src/backend/menu/portal/main.ts b/src/backend/menu/portal/main.ts
index 6bb52536b..d9946b45c 100644
--- a/src/backend/menu/portal/main.ts
+++ b/src/backend/menu/portal/main.ts
@@ -5,9 +5,9 @@ export const portalCheckIfIsMenuAllowed = async (
menuItem: INavigationMenuItem,
userRole: string,
userPermissions: string[]
-) => {
+): Promise => {
noop(menuItem, userRole, userPermissions);
- return false;
+ return undefined;
};
export const getPortalMenuItems = (