7729-devToTest_2430 #554

Merged
alexm merged 401 commits from 7729-devToTest_2430 into test 2024-07-16 07:17:04 +00:00
2 changed files with 6 additions and 3 deletions
Showing only changes of commit 361024abe2 - Show all commits

View File

@ -9,6 +9,7 @@ import { toLowerCamel } from 'src/filters';
import routes from 'src/router/modules';
import LeftMenuItem from './LeftMenuItem.vue';
import LeftMenuItemGroup from './LeftMenuItemGroup.vue';
import { useRole } from 'src/composables/useRole';
const { t } = useI18n();
const route = useRoute();
@ -58,6 +59,8 @@ function addChildren(module, route, parent) {
}
const items = ref([]);
const role = useRole();
function getRoutes() {
if (props.source === 'main') {
const modules = Object.assign([], navigation.getModules().value);
@ -66,9 +69,9 @@ function getRoutes() {
const moduleDef = routes.find(
(route) => toLowerCamel(route.name) === item.module
);
item.children = [];
if (!moduleDef) continue;
if (!role.isEmployee()) continue;
item.children = [];
addChildren(item.module, moduleDef, item.children);
}

View File

@ -80,7 +80,7 @@ export const useNavigationStore = defineStore('navigationStore', () => {
}
async function fetchPinned() {
if (pinnedModules.value.length) return;
if (pinnedModules.value.length || !role.isEmployee()) return;
const response = await axios.get('StarredModules/getStarredModules');
pinnedModules.value = response.data.map((row) => row.moduleFk);