update some checks

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™ 2024-10-17 12:25:26 +02:00
parent fbae17d8fb
commit 72f90d67ff
No known key found for this signature in database

View file

@ -32,6 +32,7 @@ const home = computed<IMenuItem>(() => ({
to: { name: VIEWS.HOMEPAGE }, to: { name: VIEWS.HOMEPAGE },
}, },
})); }));
const addProject = computed<IMenuItem>(() => ({ const addProject = computed<IMenuItem>(() => ({
id: 'addProject', id: 'addProject',
label: locale.baseText('projects.menu.addProject'), label: locale.baseText('projects.menu.addProject'),
@ -102,6 +103,10 @@ const displayProjects = computed(() => {
}); });
}); });
const canCreateProjects = computed(
() => projectsStore.hasPermissionToCreateProjects && projectsStore.isTeamProjectFeatureEnabled,
);
const goToUpgrade = async () => { const goToUpgrade = async () => {
await uiStore.goToUpgrade('rbac', 'upgrade-rbac'); await uiStore.goToUpgrade('rbac', 'upgrade-rbac');
}; };
@ -123,14 +128,13 @@ onMounted(async () => {
data-test-id="project-home-menu-item" data-test-id="project-home-menu-item"
/> />
</ElMenu> </ElMenu>
<hr <hr v-if="displayProjects.length || canCreateProjects" class="mt-m mb-m" />
v-if=" <N8nText
displayProjects.length || v-if="!props.collapsed && displayProjects.length"
(projectsStore.hasPermissionToCreateProjects && projectsStore.isTeamProjectFeatureEnabled) :class="$style.projectsLabel"
" tag="h3"
class="mt-m mb-m" bold
/> >
<N8nText v-if="!props.collapsed" :class="$style.projectsLabel" tag="h3" bold>
<span>{{ locale.baseText('projects.menu.title') }}</span> <span>{{ locale.baseText('projects.menu.title') }}</span>
</N8nText> </N8nText>
<ElMenu v-if="displayProjects.length" :collapse="props.collapsed" :class="$style.projectItems"> <ElMenu v-if="displayProjects.length" :collapse="props.collapsed" :class="$style.projectItems">
@ -155,9 +159,7 @@ onMounted(async () => {
/> />
</ElMenu> </ElMenu>
<N8nTooltip <N8nTooltip
v-if=" v-if="canCreateProjects"
projectsStore.hasPermissionToCreateProjects && projectsStore.isTeamProjectFeatureEnabled
"
placement="right" placement="right"
:disabled="projectsStore.canCreateProjects" :disabled="projectsStore.canCreateProjects"
> >
@ -189,13 +191,7 @@ onMounted(async () => {
</i18n-t> </i18n-t>
</template> </template>
</N8nTooltip> </N8nTooltip>
<hr <hr v-if="displayProjects.length || canCreateProjects" class="mt-m mb-m" />
v-if="
displayProjects.length ||
(projectsStore.hasPermissionToCreateProjects && projectsStore.isTeamProjectFeatureEnabled)
"
class="mt-m mb-m"
/>
</div> </div>
</template> </template>