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