Skip to content

Commit 97dcadc

Browse files
Onatcerkorridor
authored andcommitted
add frontend blocking for rounding for non-premium users
1 parent e7fa414 commit 97dcadc

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

resources/js/Components/Common/Reporting/ReportingRoundingControls.vue

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ import {
2020
import { ArrowsUpDownIcon } from '@heroicons/vue/20/solid';
2121
import { computed, ref, watch } from 'vue';
2222
import { twMerge } from 'tailwind-merge';
23+
import { isAllowedToPerformPremiumAction } from '@/utils/billing';
24+
import { Link } from '@inertiajs/vue3';
25+
import { CreditCardIcon } from '@heroicons/vue/20/solid';
2326
// TimeEntryRoundingType definition
2427
const TimeEntryRoundingType = {
2528
Up: 'up' as const,
@@ -150,7 +153,17 @@ const iconClass = computed(() => {
150153
</Button>
151154
</PopoverTrigger>
152155
<PopoverContent class="w-72 p-4">
153-
<div class="space-y-4">
156+
<div v-if="!isAllowedToPerformPremiumAction()" class="flex flex-col space-y-2">
157+
<span class="font-semibold text-xs">Premium</span>
158+
<span class="text-xs text-text-secondary flex-1">Rounding is a premium feature. Upgrade to unlock this feature.</span>
159+
<Link href="/billing">
160+
<Button size="sm" variant="input" class="items-center space-x-1">
161+
<CreditCardIcon class="w-3.5 h-3.5 text-text-tertiary mr-1" />
162+
Go to Billing
163+
</Button>
164+
</Link>
165+
</div>
166+
<div v-else class="space-y-4">
154167
<div>
155168
<div class="flex items-center justify-between">
156169
<InputLabel for="enable-rounding" value="Enable Rounding" />

0 commit comments

Comments
 (0)