mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-15 11:42:15 +01:00
hide create project buttons and modal depending on the permission
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -29,6 +29,7 @@ import { getOrganizationCurrencyString } from '@/utils/money';
|
||||
import TimeEntryMassActionRow from '@/packages/ui/src/TimeEntry/TimeEntryMassActionRow.vue';
|
||||
import type { UpdateMultipleTimeEntriesChangeset } from '@/packages/api/src';
|
||||
import { isAllowedToPerformPremiumAction } from '@/utils/billing';
|
||||
import { canCreateProjects } from '@/utils/permissions';
|
||||
|
||||
const timeEntriesStore = useTimeEntriesStore();
|
||||
const { timeEntries, allTimeEntriesLoaded } = storeToRefs(timeEntriesStore);
|
||||
@@ -142,6 +143,7 @@ function deleteSelected() {
|
||||
<TimeEntryMassActionRow
|
||||
:selected-time-entries="selectedTimeEntries"
|
||||
:enableEstimatedTime="isAllowedToPerformPremiumAction()"
|
||||
:canCreateProject="canCreateProjects()"
|
||||
@submit="clearSelectionAndState"
|
||||
:all-selected="selectedTimeEntries.length === timeEntries.length"
|
||||
@select-all="selectedTimeEntries = [...timeEntries]"
|
||||
@@ -166,6 +168,7 @@ function deleteSelected() {
|
||||
v-model:selected="selectedTimeEntries"
|
||||
:createProject
|
||||
:enableEstimatedTime="isAllowedToPerformPremiumAction()"
|
||||
:canCreateProject="canCreateProjects()"
|
||||
:clients
|
||||
:createClient
|
||||
:updateTimeEntry
|
||||
|
||||
Reference in New Issue
Block a user