Skip to content

Commit 28102a7

Browse files
authored
Merge pull request #25 from codebar-ag/main
m/p
2 parents cb1d707 + 953a854 commit 28102a7

File tree

3 files changed

+35
-15
lines changed

3 files changed

+35
-15
lines changed

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

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616
import { formatCents } from '@/packages/ui/src/utils/money';
1717
import ReportingTabNavbar from '@/Components/Common/Reporting/ReportingTabNavbar.vue';
1818
import ReportingExportButton from '@/Components/Common/Reporting/ReportingExportButton.vue';
19+
import ReportingRoundingControls from '@/Components/Common/Reporting/ReportingRoundingControls.vue';
1920
import TaskMultiselectDropdown from '@/Components/Common/Task/TaskMultiselectDropdown.vue';
2021
import ClientMultiselectDropdown from '@/Components/Common/Client/ClientMultiselectDropdown.vue';
2122
import ReportingRow from '@/Components/Common/Reporting/ReportingRow.vue';
@@ -33,7 +34,7 @@ import ReportSaveButton from '@/Components/Common/Report/ReportSaveButton.vue';
3334
import TagDropdown from '@/packages/ui/src/Tag/TagDropdown.vue';
3435
import ReportingPieChart from '@/Components/Common/Reporting/ReportingPieChart.vue';
3536
36-
import { computed, type ComputedRef, inject, onMounted, ref } from 'vue';
37+
import { computed, type ComputedRef, inject, onMounted, ref, watch } from 'vue';
3738
import { type GroupingOption, useReportingStore } from '@/utils/useReporting';
3839
import { storeToRefs } from 'pinia';
3940
import {
@@ -54,6 +55,9 @@ import type { ExportFormat } from '@/types/reporting';
5455
import { getRandomColorWithSeed } from '@/packages/ui/src/utils/color';
5556
import { useProjectsStore } from '@/utils/useProjects';
5657
58+
// TimeEntryRoundingType is now defined in ReportingRoundingControls component
59+
type TimeEntryRoundingType = 'up' | 'down' | 'nearest';
60+
5761
const { handleApiRequestNotifications } = useNotificationsStore();
5862
5963
const startDate = useSessionStorage<string>(
@@ -71,6 +75,9 @@ const selectedTasks = ref<string[]>([]);
7175
const selectedClients = ref<string[]>([]);
7276
7377
const billable = ref<'true' | 'false' | null>(null);
78+
const roundingEnabled = ref<boolean>(false);
79+
const roundingType = ref<TimeEntryRoundingType>('nearest');
80+
const roundingMinutes = ref<number>(15);
7481
7582
const group = useStorage<GroupingOption>('reporting-group', 'project');
7683
const subGroup = useStorage<GroupingOption>('reporting-sub-group', 'task');
@@ -84,6 +91,11 @@ const { groupByOptions } = reportingStore;
8491
8592
const organization = inject<ComputedRef<Organization>>('organization');
8693
94+
// Watch rounding enabled state to trigger updates
95+
watch(roundingEnabled, () => {
96+
updateReporting();
97+
});
98+
8799
function getFilterAttributes(): AggregatedTimeEntriesQueryParams {
88100
let params: AggregatedTimeEntriesQueryParams = {
89101
start: getLocalizedDayJs(startDate.value).startOf('day').utc().format(),
@@ -111,6 +123,8 @@ function getFilterAttributes(): AggregatedTimeEntriesQueryParams {
111123
getCurrentRole() === 'employee'
112124
? getCurrentMembershipId()
113125
: undefined,
126+
rounding_type: roundingEnabled.value ? roundingType.value : undefined,
127+
rounding_minutes: roundingEnabled.value ? roundingMinutes.value : undefined,
114128
};
115129
return params;
116130
}
@@ -305,7 +319,7 @@ const tableData = computed(() => {
305319
<div class="py-2.5 w-full border-b border-default-background-separator">
306320
<MainContainer class="sm:flex space-y-4 sm:space-y-0 justify-between">
307321
<div
308-
class="flex flex-wrap items-center space-y-2 sm:space-y-0 space-x-4">
322+
class="flex flex-wrap items-center space-y-2 sm:space-y-0 space-x-3">
309323
<div class="text-sm font-medium">Filters</div>
310324
<MemberMultiselectDropdown
311325
v-model="selectedMembers"
@@ -395,6 +409,11 @@ const tableData = computed(() => {
395409
:icon="BillableIcon"></ReportingFilterBadge>
396410
</template>
397411
</SelectDropdown>
412+
<ReportingRoundingControls
413+
v-model:enabled="roundingEnabled"
414+
v-model:type="roundingType"
415+
v-model:minutes="roundingMinutes"
416+
@change="updateReporting"></ReportingRoundingControls>
398417
</div>
399418
<div>
400419
<DateRangePicker
@@ -490,7 +509,7 @@ const tableData = computed(() => {
490509
<div
491510
v-else
492511
class="chart flex flex-col items-center justify-center py-12 col-span-3">
493-
<p class="text-lg text-text-primary font-semibold">
512+
<p class="text-lg text-text-primary font-medium">
494513
No time entries found
495514
</p>
496515
<p>Try to change the filters and time range</p>
@@ -505,4 +524,4 @@ const tableData = computed(() => {
505524
</MainContainer>
506525
</template>
507526

508-
<style scoped></style>
527+
<style scoped></style>

resources/js/Components/Dashboard/ThisWeekOverview.vue

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import ProjectsChartCard from '@/Components/Dashboard/ProjectsChartCard.vue';
1818
import { formatHumanReadableDuration } from '@/packages/ui/src/utils/time';
1919
import { formatCents } from '@/packages/ui/src/utils/money';
2020
import { getWeekStart } from '@/packages/ui/src/utils/settings';
21-
import { useCssVar } from '@vueuse/core';
21+
import { useCssVariable } from '@/utils/useCssVariable';
2222
import { getOrganizationCurrencyString } from '@/utils/money';
2323
import { useQuery } from '@tanstack/vue-query';
2424
import { getCurrentOrganizationId } from '@/utils/useUser';
@@ -60,7 +60,7 @@ const weekdays = computed(() => {
6060
}
6161
});
6262
63-
const accentColor = useCssVar('--theme-color-chart', null, { observe: true });
63+
const accentColor = useCssVariable('--theme-color-chart');
6464
6565
// Get the organization ID using the utility function
6666
const organizationId = computed(() => getCurrentOrganizationId());
@@ -176,10 +176,8 @@ const seriesData = computed(() => {
176176
});
177177
});
178178
179-
const markLineColor = useCssVar('--color-border-secondary', null, {
180-
observe: true,
181-
});
182-
const labelColor = useCssVar('--color-text-secondary', null, { observe: true });
179+
const markLineColor = useCssVariable('--color-border-secondary');
180+
const labelColor = useCssVariable('--color-text-secondary');
183181
const option = computed(() => {
184182
return {
185183
tooltip: {
@@ -204,7 +202,7 @@ const option = computed(() => {
204202
fontSize: 16,
205203
fontWeight: 600,
206204
margin: 24,
207-
fontFamily: 'Outfit, sans-serif',
205+
fontFamily: 'Inter, sans-serif',
208206
color: labelColor.value,
209207
},
210208
axisTick: {
@@ -215,6 +213,10 @@ const option = computed(() => {
215213
},
216214
yAxis: {
217215
type: 'value',
216+
axisLabel: {
217+
color: labelColor.value,
218+
fontFamily: 'Inter, sans-serif',
219+
},
218220
splitLine: {
219221
lineStyle: {
220222
color: markLineColor.value,
@@ -304,4 +306,4 @@ const option = computed(() => {
304306
height: 280px;
305307
background: transparent;
306308
}
307-
</style>
309+
</style>

routes/api.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
// Organization routes
4444
Route::name('organizations.')->group(static function (): void {
4545
Route::get('/organizations/{organization}', [OrganizationController::class, 'show'])->name('show');
46-
Route::get('/organizations/{organization}/counts', [OrganizationController::class, 'getCounts'])->name('counts');
4746
Route::put('/organizations/{organization}', [OrganizationController::class, 'update'])->name('update');
4847
});
4948

@@ -89,7 +88,7 @@
8988
Route::get('/projects/{project}', [ProjectController::class, 'show'])->name('show');
9089
Route::post('/projects', [ProjectController::class, 'store'])->name('store')->middleware('check-organization-blocked');
9190
Route::put('/projects/{project}', [ProjectController::class, 'update'])->name('update')->middleware('check-organization-blocked');
92-
Route::delete('/projects/{project}', [ProjectController::class, 'destroy'])->name('destroy'); // @otod uncommented
91+
Route::delete('/projects/{project}', [ProjectController::class, 'destroy'])->name('destroy');
9392
});
9493

9594
// Project member routes
@@ -153,7 +152,7 @@
153152
Route::get('/clients', [ClientController::class, 'index'])->name('index');
154153
Route::post('/clients', [ClientController::class, 'store'])->name('store')->middleware('check-organization-blocked');
155154
Route::put('/clients/{client}', [ClientController::class, 'update'])->name('update')->middleware('check-organization-blocked');
156-
Route::delete('/clients/{client}', [ClientController::class, 'destroy'])->name('destroy'); // @otod uncommented
155+
Route::delete('/clients/{client}', [ClientController::class, 'destroy'])->name('destroy');
157156
});
158157

159158
// Task routes

0 commit comments

Comments
 (0)