Skip to content

Commit 2159571

Browse files
committed
Add Euro Symbol as Billable Icon when EUR is the organization currency.
fixes #423
1 parent fd012e7 commit 2159571

File tree

18 files changed

+94
-46
lines changed

18 files changed

+94
-46
lines changed

resources/js/Components/CommandPalette/CommandPaletteProvider.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ const firstProjectId = computed(() => projects.value[0]?.id ?? '');
201201
<TimeTrackerProjectTaskDropdown
202202
v-model:project="currentTimeEntry.project_id"
203203
v-model:task="currentTimeEntry.task_id"
204-
variant="input"
204+
variant="outline"
205205
:projects="projects"
206206
:tasks="tasks"
207207
:clients="activeClients"
@@ -225,7 +225,7 @@ const firstProjectId = computed(() => projects.value[0]?.id ?? '');
225225
<TimeTrackerProjectTaskDropdown
226226
v-model:project="currentTimeEntry.project_id"
227227
v-model:task="currentTimeEntry.task_id"
228-
variant="input"
228+
variant="outline"
229229
:projects="projects"
230230
:tasks="tasks"
231231
:clients="activeClients"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ async function createTag(name: string) {
103103

104104
<Select v-model="billable" @update:model-value="emit('submit')">
105105
<SelectTrigger
106-
size="small"
106+
size="sm"
107107
variant="outline"
108108
:active="billable !== null"
109109
:show-chevron="false">

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const title = computed(() => {
2525

2626
<template>
2727
<Select v-model="model" @update:model-value="emit('changed')">
28-
<SelectTrigger size="small" :show-chevron="false">
28+
<SelectTrigger size="sm" :show-chevron="false">
2929
<SelectValue class="flex items-center gap-2">
3030
<component :is="icon" class="h-4 text-icon-default" />
3131
<span>{{ title }}</span>

resources/js/Layouts/AppLayout.vue

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ import { useOrganizationQuery } from '@/utils/useOrganizationQuery';
4848
import { getCurrentOrganizationId } from '@/utils/useUser';
4949
import LoadingSpinner from '@/packages/ui/src/LoadingSpinner.vue';
5050
import { twMerge } from 'tailwind-merge';
51-
import { Button as UiButton } from '@/packages/ui/src';
52-
import { Button } from '@/Components/ui/button';
51+
import { Button } from '@/packages/ui/src/Buttons';
5352
import { openFeedback } from '@/utils/feedback';
5453
import { CommandPaletteProvider } from '@/Components/CommandPalette';
5554
import { useCommandPalette } from '@/utils/useCommandPalette';
@@ -263,14 +262,14 @@ const page = usePage<{
263262
:icon="Cog6ToothIcon"
264263
:href="route('profile.show')"></NavigationSidebarItem>
265264

266-
<UiButton
265+
<Button
267266
v-if="page.props.has_services_extension"
268267
variant="outline"
269268
size="xs"
270269
class="rounded-full ml-2 flex h-6 w-6 items-center text-xs text-icon-default justify-center"
271270
@click="openFeedback">
272271
?
273-
</UiButton>
272+
</Button>
274273
</ul>
275274
</div>
276275
</div>

resources/js/packages/ui/src/Client/ClientDropdown.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ function updateValue(client: { id: string | null; name: string }) {
8585
<UseFocusTrap v-if="open" :options="{ immediate: true, allowOutsideClick: true }">
8686
<ComboboxRoot
8787
v-model:search-term="searchValue"
88-
:open="open"
88+
v-model:open="open"
8989
:model-value="currentClient"
9090
class="relative"
9191
@update:model-value="updateValue">
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
<script setup lang="ts"></script>
1+
<script setup lang="ts">
2+
import { computed } from 'vue';
3+
import { useOrganizationQuery } from '@/utils/useOrganizationQuery';
4+
import { getCurrentOrganizationId } from '@/utils/useUser';
5+
import DollarIcon from './DollarIcon.vue';
6+
import EuroIcon from './EuroIcon.vue';
7+
8+
const { organization } = useOrganizationQuery(getCurrentOrganizationId()!);
9+
const icon = computed(() => (organization.value?.currency === 'EUR' ? EuroIcon : DollarIcon));
10+
</script>
211

312
<template>
4-
<svg viewBox="0 0 8 14" fill="none" xmlns="http://www.w3.org/2000/svg">
5-
<path
6-
d="M4 1V13M1 10.182L1.879 10.841C3.05 11.72 4.949 11.72 6.121 10.841C7.293 9.962 7.293 8.538 6.121 7.659C5.536 7.219 4.768 7 4 7C3.275 7 2.55 6.78 1.997 6.341C0.891 5.462 0.891 4.038 1.997 3.159C3.103 2.28 4.897 2.28 6.003 3.159L6.418 3.489"
7-
stroke="currentColor"
8-
stroke-width="1.5"
9-
stroke-linecap="round"
10-
stroke-linejoin="round" />
11-
</svg>
13+
<component :is="icon" />
1214
</template>
13-
14-
<style scoped></style>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<template>
2+
<svg viewBox="0 0 8 14" fill="none" xmlns="http://www.w3.org/2000/svg">
3+
<path
4+
d="M4 1V13M1 10.182L1.879 10.841C3.05 11.72 4.949 11.72 6.121 10.841C7.293 9.962 7.293 8.538 6.121 7.659C5.536 7.219 4.768 7 4 7C3.275 7 2.55 6.78 1.997 6.341C0.891 5.462 0.891 4.038 1.997 3.159C3.103 2.28 4.897 2.28 6.003 3.159L6.418 3.489"
5+
stroke="currentColor"
6+
stroke-width="1.5"
7+
stroke-linecap="round"
8+
stroke-linejoin="round" />
9+
</svg>
10+
</template>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<template>
2+
<svg viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
3+
<path
4+
d="M9.44214 2.80599C8.64364 1.84779 7.44588 1.20898 6.0485 1.20898C3.85262 1.20898 2.05599 3.36494 2.05599 6C2.05599 8.63506 3.85262 10.791 6.0485 10.791C7.44588 10.791 8.64364 10.1522 9.44214 9.19401M1.05786 4.80225H6.64738M1.05786 7.19775H6.64738"
5+
stroke="currentColor"
6+
stroke-width="1.5"
7+
stroke-linecap="round"
8+
stroke-linejoin="round" />
9+
</svg>
10+
</template>

resources/js/packages/ui/src/Input/BillableToggleButton.vue

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
import { computed } from 'vue';
33
import { twMerge } from 'tailwind-merge';
44
import BillableIcon from '@/packages/ui/src/Icons/BillableIcon.vue';
5+
import {
6+
Tooltip,
7+
TooltipContent,
8+
TooltipProvider,
9+
TooltipTrigger,
10+
} from '@/packages/ui/src/tooltip';
511
const active = defineModel({ default: false });
612
const emit = defineEmits(['changed']);
713
function toggleBillable() {
@@ -12,12 +18,16 @@ function toggleBillable() {
1218
const props = withDefaults(
1319
defineProps<{
1420
size?: 'small' | 'base';
21+
faded?: boolean;
1522
}>(),
1623
{
1724
size: 'base',
25+
faded: false,
1826
}
1927
);
2028
29+
const tooltipLabel = computed(() => (active.value ? 'Billable' : 'Non Billable'));
30+
2131
const iconColorClasses = computed(() => {
2232
if (active.value) {
2333
return 'text-input-select-active focus:text-input-select-active-hover hover:text-input-select-active-hover';
@@ -38,17 +48,28 @@ const iconSizeWrapperClasses = props.size === 'small' ? 'w-6 sm:w-8 h-6 sm:h-8'
3848
</script>
3949

4050
<template>
41-
<button
42-
:class="
43-
twMerge(
44-
iconColorClasses,
45-
iconSizeWrapperClasses,
46-
'flex-shrink-0 ring-0 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring transition focus:bg-card-background-separator hover:bg-card-background-separator rounded-full flex items-center justify-center'
47-
)
48-
"
49-
@click="toggleBillable">
50-
<BillableIcon :class="iconSizeClasses"></BillableIcon>
51-
</button>
51+
<TooltipProvider>
52+
<Tooltip disable-closing-trigger>
53+
<TooltipTrigger as-child>
54+
<button
55+
:aria-label="tooltipLabel"
56+
:class="
57+
twMerge(
58+
iconColorClasses,
59+
iconSizeWrapperClasses,
60+
'flex-shrink-0 ring-0 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring transition focus:bg-card-background-separator hover:bg-card-background-separator rounded-full flex items-center justify-center',
61+
faded
62+
? 'opacity-50 group-hover:opacity-100 focus-visible:opacity-100'
63+
: ''
64+
)
65+
"
66+
@click="toggleBillable">
67+
<BillableIcon :class="iconSizeClasses"></BillableIcon>
68+
</button>
69+
</TooltipTrigger>
70+
<TooltipContent>
71+
{{ tooltipLabel }}
72+
</TooltipContent>
73+
</Tooltip>
74+
</TooltipProvider>
5275
</template>
53-
54-
<style scoped></style>

resources/js/packages/ui/src/Input/DatePicker.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
} from '@/packages/ui/src/utils/time';
99
import { Popover, PopoverContent, PopoverTrigger } from '@/packages/ui/src/popover';
1010
import { Calendar } from '@/Components/ui/calendar';
11-
import { Button } from '@/Components/ui/button';
11+
import { Button } from '@/packages/ui/src/Buttons';
1212
import { CalendarIcon } from 'lucide-vue-next';
1313
import { parseDate, type DateValue } from '@internationalized/date';
1414
import type { Organization } from '@/packages/api/src';

0 commit comments

Comments
 (0)