mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-13 02:32:15 +01:00
hide create project buttons and modal depending on the permission
This commit is contained in:
@@ -34,6 +34,7 @@ const props = defineProps<{
|
||||
isActive: boolean;
|
||||
currency: string;
|
||||
enableEstimatedTime: boolean;
|
||||
canCreateProject: boolean;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
@@ -110,6 +111,7 @@ function updateTimeEntryDescription() {
|
||||
class="flex items-center w-[130px] @2xl:w-auto shrink min-w-0">
|
||||
<TimeTrackerProjectTaskDropdown
|
||||
:createClient
|
||||
:canCreateProject
|
||||
:clients
|
||||
:createProject
|
||||
:currency="currency"
|
||||
|
||||
@@ -64,6 +64,7 @@ const props = withDefaults(
|
||||
emptyPlaceholder: string;
|
||||
allowReset: boolean;
|
||||
enableEstimatedTime: boolean;
|
||||
canCreateProject: boolean;
|
||||
}>(),
|
||||
{
|
||||
showBadgeBorder: true,
|
||||
@@ -532,7 +533,7 @@ const showCreateProject = ref(false);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div v-if="projects.length === 0">
|
||||
<div v-if="projects.length === 0 && canCreateProject">
|
||||
<Badge
|
||||
@click="showCreateProject = true"
|
||||
size="large"
|
||||
@@ -689,7 +690,9 @@ const showCreateProject = ref(false);
|
||||
</template>
|
||||
</template>
|
||||
</div>
|
||||
<div class="hover:bg-card-background-active rounded-b-lg">
|
||||
<div
|
||||
v-if="canCreateProject"
|
||||
class="hover:bg-card-background-active rounded-b-lg">
|
||||
<button
|
||||
@click="
|
||||
open = false;
|
||||
|
||||
Reference in New Issue
Block a user