hide create project buttons and modal depending on the permission

This commit is contained in:
Gregor Vostrak
2024-10-28 13:37:39 +01:00
parent eb4debe481
commit cd7573dcf1
11 changed files with 29 additions and 2 deletions

View File

@@ -66,6 +66,7 @@ import { getCurrentOrganizationId } from '@/utils/useUser';
import { useTimeEntriesStore } from '@/utils/useTimeEntries';
import TimeEntryMassActionRow from '@/packages/ui/src/TimeEntry/TimeEntryMassActionRow.vue';
import { isAllowedToPerformPremiumAction } from '@/utils/billing';
import { canCreateProjects } from '@/utils/permissions';
const startDate = useSessionStorage<string>(
'reporting-start-date',
@@ -340,6 +341,7 @@ async function clearSelectionAndState() {
</div>
<TimeEntryMassActionRow
:selected-time-entries="selectedTimeEntries"
:canCreateProject="canCreateProjects()"
:enableEstimatedTime="isAllowedToPerformPremiumAction()"
@submit="clearSelectionAndState"
:delete-selected="deleteSelected"
@@ -366,6 +368,7 @@ async function clearSelectionAndState() {
<TimeEntryRow
:selected="selectedTimeEntries.includes(entry)"
@selected="selectedTimeEntries.push(entry)"
:canCreateProject="canCreateProjects()"
@unselected="
selectedTimeEntries = selectedTimeEntries.filter(
(item) => item.id !== entry.id