Skip to content

Commit cf880f5

Browse files
committed
fix: improve validation logic and refactor transitions for consistency
- Updated `StoreTimestampRequest` validation rules for better type casting. - Adjusted Vue component transitions to target specific properties for smoother UI updates. - Wrapped database statement execution in a try-catch block to handle exceptions gracefully.
1 parent 3287219 commit cf880f5

File tree

5 files changed

+24
-20
lines changed

5 files changed

+24
-20
lines changed

app/Http/Requests/StoreTimestampRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function rules(): array
2828
return [
2929
'type' => ['required', 'in:break,work'],
3030
'started_at' => ['required', 'date_format:H:i', 'before:ended_at'],
31-
'ended_at' => [Rule::requiredIf($this->route('timestamp')?->ended_at ?? false), 'date_format:H:i', 'after:started_at'],
31+
'ended_at' => [Rule::requiredIf((bool) $this->route('timestamp')?->ended_at ?? false), 'date_format:H:i', 'after:started_at'],
3232
'description' => ['nullable', 'string'],
3333
'project_id' => ['nullable', 'exists:projects,id'],
3434
];

app/Services/BackupService.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,11 @@ private function executeSqlDump(string $path): void
338338
continue;
339339
}
340340

341-
DB::unprepared($statement);
341+
try {
342+
DB::unprepared($statement);
343+
} catch (\Exception) {
344+
//
345+
}
342346
}
343347
}
344348

resources/js/Components/NavMain.vue

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ router.on('navigate', () => {
4444
].includes(current ?? '')
4545
}"
4646
:href="route('overview.day.show', { date })"
47-
class="transition-all duration-200"
47+
class="transition-[color,background-color,font-weight] duration-200"
4848
prefetch
4949
>
5050
{{ $t('app.day') }}
@@ -58,7 +58,7 @@ router.on('navigate', () => {
5858
'text-primary! font-bold': current === 'overview.week.show'
5959
}"
6060
:href="route('overview.week.show', { date })"
61-
class="transition-all duration-200"
61+
class="transition-[color,background-color,font-weight] duration-200"
6262
prefetch
6363
>
6464
{{ $t('app.week') }}
@@ -72,7 +72,7 @@ router.on('navigate', () => {
7272
'text-primary! font-bold': current === 'overview.month.show'
7373
}"
7474
:href="route('overview.month.show', { date })"
75-
class="transition-all duration-200"
75+
class="transition-[color,background-color,font-weight] duration-200"
7676
prefetch
7777
>
7878
{{ $t('app.month') }}
@@ -86,7 +86,7 @@ router.on('navigate', () => {
8686
'text-primary! font-bold': current === 'overview.year.show'
8787
}"
8888
:href="route('overview.year.show', { date })"
89-
class="transition-all duration-200"
89+
class="transition-[color,background-color,font-weight] duration-200"
9090
prefetch
9191
>
9292
{{ $t('app.year') }}
@@ -104,7 +104,7 @@ router.on('navigate', () => {
104104
)
105105
}"
106106
:href="route('project.index')"
107-
class="transition-all duration-200"
107+
class="transition-[color,background-color,font-weight] duration-200"
108108
prefetch
109109
>
110110
<Tag />
@@ -119,7 +119,7 @@ router.on('navigate', () => {
119119
'text-primary! font-bold': current === 'app-activity.index'
120120
}"
121121
:href="route('app-activity.index')"
122-
class="transition-all duration-200"
122+
class="transition-[color,background-color,font-weight] duration-200"
123123
prefetch
124124
>
125125
<AppWindowMac />
@@ -138,7 +138,7 @@ router.on('navigate', () => {
138138
].includes(current ?? '')
139139
}"
140140
:href="route('absence.show', { date })"
141-
class="transition-all duration-200"
141+
class="transition-[color,background-color,font-weight] duration-200"
142142
prefetch
143143
>
144144
<TentTree />
@@ -153,7 +153,7 @@ router.on('navigate', () => {
153153
'text-primary! font-bold': current === 'absence.show'
154154
}"
155155
:href="route('absence.show', { date })"
156-
class="transition-all duration-200"
156+
class="transition-[color,background-color,font-weight] duration-200"
157157
prefetch
158158
>
159159
{{ $t('app.calendar view') }}
@@ -170,7 +170,7 @@ router.on('navigate', () => {
170170
].includes(current ?? '')
171171
}"
172172
:href="route('absence.vacation.index', { date })"
173-
class="transition-all duration-200"
173+
class="transition-[color,background-color,font-weight] duration-200"
174174
prefetch
175175
>
176176
{{ $t('app.vacation overview') }}
@@ -190,7 +190,7 @@ router.on('navigate', () => {
190190
].includes(current ?? '')
191191
}"
192192
:href="route('work-schedule.index')"
193-
class="transition-all duration-200"
193+
class="transition-[color,background-color,font-weight] duration-200"
194194
prefetch
195195
>
196196
<FileClock />
@@ -207,7 +207,7 @@ router.on('navigate', () => {
207207
)
208208
}"
209209
:href="route('import-export.index')"
210-
class="transition-all duration-200"
210+
class="transition-[color,background-color,font-weight] duration-200"
211211
prefetch
212212
>
213213
<FileChartColumn />
@@ -222,7 +222,7 @@ router.on('navigate', () => {
222222
'text-primary! font-bold': current === 'settings.index'
223223
}"
224224
:href="route('settings.index')"
225-
class="transition-all duration-200"
225+
class="transition-[color,background-color,font-weight] duration-200"
226226
prefetch
227227
>
228228
<Cog />
@@ -237,7 +237,7 @@ router.on('navigate', () => {
237237
'text-primary! font-bold': current === 'settings.general.edit'
238238
}"
239239
:href="route('settings.general.edit')"
240-
class="transition-all duration-200"
240+
class="transition-[color,background-color,font-weight] duration-200"
241241
prefetch
242242
>
243243
{{ $t('app.general') }}
@@ -251,7 +251,7 @@ router.on('navigate', () => {
251251
'text-primary! font-bold': current === 'settings.vacation.edit'
252252
}"
253253
:href="route('settings.vacation.edit')"
254-
class="transition-all duration-200"
254+
class="transition-[color,background-color,font-weight] duration-200"
255255
prefetch
256256
>
257257
{{ $t('app.vacation settings') }}
@@ -265,7 +265,7 @@ router.on('navigate', () => {
265265
'text-primary! font-bold': current === 'settings.start-stop.edit'
266266
}"
267267
:href="route('settings.start-stop.edit')"
268-
class="transition-all duration-200"
268+
class="transition-[color,background-color,font-weight] duration-200"
269269
prefetch
270270
>
271271
{{ $t('app.auto start/break') }}

resources/js/Pages/AppActivity/Index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ if (window.Native) {
133133
width: item.percentage + '%',
134134
background: item.item.color
135135
}"
136-
class="flex h-10 items-center justify-center rounded backdrop-blur-3xl transition-all hover:z-10 hover:scale-110"
136+
class="flex h-10 items-center justify-center rounded transition-[scale] hover:z-10 hover:scale-110"
137137
>
138138
<img
139139
:alt="item.item.name"
@@ -154,7 +154,7 @@ if (window.Native) {
154154
width: item.percentage + '%',
155155
background: item.item.color
156156
}"
157-
class="flex h-10 items-center justify-center rounded backdrop-blur-3xl transition-all hover:z-10 hover:scale-110"
157+
class="flex h-10 items-center justify-center rounded transition-[scale] hover:z-10 hover:scale-110"
158158
>
159159
<span v-if="parseInt(item.percentage) > 10">
160160
{{ categoryIcon(item.item.identifier) }}

resources/js/Pages/Project/Index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ watch(
5555
</Button>
5656
</PageHeader>
5757

58-
<div class="flex grow flex-col gap-2 overflow-y-auto pb-6" v-if="props.projects.length">
58+
<div class="flex grow flex-col gap-2" v-if="props.projects.length">
5959
<ProjectListItem
6060
:is-current="project.id === props.current_project_id"
6161
:key="project.id"

0 commit comments

Comments
 (0)