mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-06-15 13:32:43 +01:00
Compare commits
6 Commits
feature/pa
...
feature/fi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1e7de6022a | ||
|
|
4de7868851 | ||
|
|
ffc016a1ec | ||
|
|
be69626970 | ||
|
|
f1dce88dab | ||
|
|
15411ec0c8 |
3
.github/workflows/build-private.yml
vendored
3
.github/workflows/build-private.yml
vendored
@@ -10,6 +10,8 @@ on:
|
||||
- '.github/workflows/build-private.yml'
|
||||
- 'docker/prod/**'
|
||||
workflow_dispatch:
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
name: Build - Private
|
||||
jobs:
|
||||
@@ -17,6 +19,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 20
|
||||
|
||||
|
||||
steps:
|
||||
- name: "Check out code"
|
||||
uses: actions/checkout@v4
|
||||
|
||||
16
.github/workflows/build-public.yml
vendored
16
.github/workflows/build-public.yml
vendored
@@ -11,6 +11,12 @@ on:
|
||||
- 'docker/prod/**'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
packages: write
|
||||
contents: read
|
||||
attestations: write
|
||||
id-token: write
|
||||
|
||||
env:
|
||||
DOCKERHUB_REPO: solidtime/solidtime
|
||||
GHCR_REPO: ghcr.io/solidtime-io/solidtime
|
||||
@@ -26,11 +32,6 @@ jobs:
|
||||
- runs-on: "ubuntu-24.04"
|
||||
platform: "linux/amd64"
|
||||
runs-on: ${{ matrix.runs-on }}
|
||||
permissions:
|
||||
packages: write
|
||||
contents: read
|
||||
attestations: write
|
||||
id-token: write
|
||||
timeout-minutes: 90
|
||||
|
||||
steps:
|
||||
@@ -163,11 +164,6 @@ jobs:
|
||||
|
||||
merge:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
packages: write
|
||||
contents: read
|
||||
attestations: write
|
||||
id-token: write
|
||||
timeout-minutes: 90
|
||||
needs:
|
||||
- build
|
||||
|
||||
3
.github/workflows/generate-api-docs.yml
vendored
3
.github/workflows/generate-api-docs.yml
vendored
@@ -3,6 +3,9 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
api_docs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
2
.github/workflows/npm-build.yml
vendored
2
.github/workflows/npm-build.yml
vendored
@@ -1,6 +1,8 @@
|
||||
name: NPM Build
|
||||
|
||||
on: [push]
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
2
.github/workflows/npm-lint.yml
vendored
2
.github/workflows/npm-lint.yml
vendored
@@ -1,6 +1,8 @@
|
||||
name: NPM Lint
|
||||
|
||||
on: [push]
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
2
.github/workflows/npm-publish-api.yml
vendored
2
.github/workflows/npm-publish-api.yml
vendored
@@ -1,6 +1,8 @@
|
||||
name: Publish API package to NPM
|
||||
on:
|
||||
workflow_dispatch
|
||||
permissions:
|
||||
contents: read
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
2
.github/workflows/npm-publish-ui.yml
vendored
2
.github/workflows/npm-publish-ui.yml
vendored
@@ -1,6 +1,8 @@
|
||||
name: Publish UI package to NPM
|
||||
on:
|
||||
workflow_dispatch
|
||||
permissions:
|
||||
contents: read
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
3
.github/workflows/npm-typecheck.yml
vendored
3
.github/workflows/npm-typecheck.yml
vendored
@@ -1,7 +1,8 @@
|
||||
name: NPM Typecheck
|
||||
|
||||
on: [push]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
2
.github/workflows/phpstan.yml
vendored
2
.github/workflows/phpstan.yml
vendored
@@ -1,5 +1,7 @@
|
||||
name: Static code analysis (PHPStan)
|
||||
on: push
|
||||
permissions:
|
||||
contents: read
|
||||
jobs:
|
||||
phpstan:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
9
.github/workflows/phpunit.yml
vendored
9
.github/workflows/phpunit.yml
vendored
@@ -1,13 +1,18 @@
|
||||
name: PHPUnit Tests
|
||||
on: push
|
||||
permissions:
|
||||
contents: read
|
||||
jobs:
|
||||
phpunit:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
strategy:
|
||||
matrix:
|
||||
postgres_version: [ 15, 16, 17 ]
|
||||
|
||||
services:
|
||||
pgsql_test:
|
||||
image: postgres:15
|
||||
image: postgres:${{ matrix.postgres_version }}
|
||||
env:
|
||||
PGPASSWORD: 'root'
|
||||
POSTGRES_DB: 'laravel'
|
||||
@@ -63,7 +68,7 @@ jobs:
|
||||
run: php artisan test --stop-on-failure --coverage-text --coverage-clover=coverage.xml
|
||||
|
||||
- name: "Upload coverage reports to Codecov"
|
||||
uses: codecov/codecov-action@v5.4.2
|
||||
uses: codecov/codecov-action@v5.4.3
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
slug: solidtime-io/solidtime
|
||||
|
||||
2
.github/workflows/pint.yml
vendored
2
.github/workflows/pint.yml
vendored
@@ -1,5 +1,7 @@
|
||||
name: PHP Linting
|
||||
on: push
|
||||
permissions:
|
||||
contents: read
|
||||
jobs:
|
||||
pint:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
2
.github/workflows/playwright.yml
vendored
2
.github/workflows/playwright.yml
vendored
@@ -1,5 +1,7 @@
|
||||
name: Playwright Tests
|
||||
on: [push]
|
||||
permissions:
|
||||
contents: read
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
@@ -23,6 +23,7 @@ use Filament\Tables;
|
||||
use Filament\Tables\Filters\TernaryFilter;
|
||||
use Filament\Tables\Table;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Korridor\LaravelModelValidationRules\Rules\UniqueEloquent;
|
||||
@@ -207,6 +208,14 @@ class UserResource extends Resource
|
||||
}),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\BulkAction::make('Resend verification email')
|
||||
->icon('heroicon-o-paper-airplane')
|
||||
->action(function (Collection $records): void {
|
||||
foreach ($records as $user) {
|
||||
/** @var User $user */
|
||||
$user->sendEmailVerificationNotification();
|
||||
}
|
||||
}),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
TooltipComponent,
|
||||
} from 'echarts/components';
|
||||
import type { AggregatedTimeEntries, Organization } from '@/packages/api/src';
|
||||
import { useCssVar } from '@vueuse/core';
|
||||
import { useCssVariable } from '@/utils/useCssVariable';
|
||||
|
||||
use([
|
||||
CanvasRenderer,
|
||||
@@ -47,8 +47,10 @@ const xAxisLabels = computed(() => {
|
||||
formatDate(el.key ?? '', organization?.value?.date_format)
|
||||
);
|
||||
});
|
||||
const accentColor = useCssVar('--theme-color-chart', null, { observe: true });
|
||||
const labelColor = useCssVar('--color-text-secondary', null, { observe: true });
|
||||
const accentColor = useCssVariable('--theme-color-chart');
|
||||
const labelColor = useCssVariable('--color-text-secondary');
|
||||
const markLineColor = useCssVariable('--color-border-secondary');
|
||||
const splitLineColor = useCssVariable('--color-border-tertiary');
|
||||
|
||||
const seriesData = computed(() => {
|
||||
return props?.groupedData?.map((el) => {
|
||||
@@ -111,7 +113,7 @@ const option = computed(() => ({
|
||||
data: xAxisLabels.value,
|
||||
markLine: {
|
||||
lineStyle: {
|
||||
color: 'rgba(125,156,188,0.1)',
|
||||
color: markLineColor.value,
|
||||
type: 'dashed',
|
||||
},
|
||||
},
|
||||
@@ -135,9 +137,13 @@ const option = computed(() => ({
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
axisLabel: {
|
||||
color: labelColor.value,
|
||||
fontFamily: 'Outfit, sans-serif',
|
||||
},
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
color: 'rgba(125,156,188,0.2)', // Set desired color here
|
||||
color: splitLineColor.value,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
TooltipComponent,
|
||||
} from 'echarts/components';
|
||||
import { formatHumanReadableDuration } from '@/packages/ui/src/utils/time';
|
||||
import { useCssVar } from '@vueuse/core';
|
||||
import { useCssVariable } from '@/utils/useCssVariable';
|
||||
import type { Organization } from '@/packages/api/src';
|
||||
|
||||
use([
|
||||
@@ -36,7 +36,7 @@ type ReportingChartDataEntry = {
|
||||
const props = defineProps<{
|
||||
data: ReportingChartDataEntry | null;
|
||||
}>();
|
||||
const labelColor = useCssVar('--color-text-secondary', null, { observe: true });
|
||||
const labelColor = useCssVariable('--color-text-secondary');
|
||||
|
||||
const seriesData = computed(() => {
|
||||
return props.data?.map((el) => {
|
||||
|
||||
@@ -19,7 +19,7 @@ import {
|
||||
formatHumanReadableDuration,
|
||||
getDayJsInstance,
|
||||
} from '@/packages/ui/src/utils/time';
|
||||
import { useCssVar } from '@vueuse/core';
|
||||
import { useCssVariable } from '@/utils/useCssVariable';
|
||||
import { useQuery } from '@tanstack/vue-query';
|
||||
import { getCurrentOrganizationId } from '@/utils/useUser';
|
||||
import { api, type Organization } from '@/packages/api/src';
|
||||
@@ -64,12 +64,9 @@ const max = computed(() => {
|
||||
}
|
||||
});
|
||||
|
||||
const backgroundColor = useCssVar('--color-card-background', null, {
|
||||
observe: true,
|
||||
});
|
||||
const itemBackgroundColor = useCssVar('--color-bg-tertiary', null, {
|
||||
observe: true,
|
||||
});
|
||||
const backgroundColor = useCssVariable('--theme-color-card-background');
|
||||
const itemBackgroundColor = useCssVariable('--color-bg-tertiary');
|
||||
const borderColor = useCssVariable('--color-border');
|
||||
|
||||
const option = computed(() => {
|
||||
return {
|
||||
@@ -120,7 +117,7 @@ const option = computed(() => {
|
||||
[],
|
||||
itemStyle: {
|
||||
borderRadius: 5,
|
||||
borderColor: 'rgba(255,255,255,0.05)',
|
||||
borderColor: borderColor.value,
|
||||
borderWidth: 1,
|
||||
},
|
||||
tooltip: {
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
<script setup lang="ts">
|
||||
import VChart from 'vue-echarts';
|
||||
import { computed, ref } from 'vue';
|
||||
import { useCssVar } from '@vueuse/core';
|
||||
import { computed } from 'vue';
|
||||
import { useCssVariable } from '@/utils/useCssVariable';
|
||||
|
||||
const props = defineProps<{
|
||||
history: number[];
|
||||
}>();
|
||||
|
||||
const accentColor = useCssVar('--theme-color-chart', null, { observe: true });
|
||||
const accentColor = useCssVariable('--theme-color-chart');
|
||||
const markLineColor = useCssVariable('--color-border-secondary');
|
||||
|
||||
const seriesData = computed(() => props.history.map((el) => {
|
||||
return {
|
||||
@@ -22,7 +23,7 @@ const seriesData = computed(() => props.history.map((el) => {
|
||||
},
|
||||
};
|
||||
}));
|
||||
const option = ref({
|
||||
const option = computed(() => ({
|
||||
grid: {
|
||||
top: 0,
|
||||
right: 0,
|
||||
@@ -35,7 +36,7 @@ const option = ref({
|
||||
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
|
||||
markLine: {
|
||||
lineStyle: {
|
||||
color: 'rgba(125,156,188,0.1)',
|
||||
color: markLineColor.value,
|
||||
type: 'dashed',
|
||||
},
|
||||
},
|
||||
@@ -66,11 +67,11 @@ const option = ref({
|
||||
},
|
||||
series: [
|
||||
{
|
||||
data: seriesData,
|
||||
data: seriesData.value,
|
||||
type: 'bar',
|
||||
},
|
||||
],
|
||||
});
|
||||
}));
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
TooltipComponent,
|
||||
} from 'echarts/components';
|
||||
import { formatHumanReadableDuration } from '@/packages/ui/src/utils/time';
|
||||
import { useCssVar } from "@vueuse/core";
|
||||
import { useCssVariable } from '@/utils/useCssVariable';
|
||||
import type { Organization } from "@/packages/api/src";
|
||||
|
||||
use([
|
||||
@@ -24,7 +24,7 @@ use([
|
||||
]);
|
||||
|
||||
provide(THEME_KEY, 'dark');
|
||||
const labelColor = useCssVar('--color-text-secondary', null, { observe: true });
|
||||
const labelColor = useCssVariable('--color-text-secondary');
|
||||
|
||||
const props = defineProps<{
|
||||
weeklyProjectOverview: {
|
||||
|
||||
@@ -18,7 +18,7 @@ import ProjectsChartCard from '@/Components/Dashboard/ProjectsChartCard.vue';
|
||||
import { formatHumanReadableDuration } from '@/packages/ui/src/utils/time';
|
||||
import { formatCents } from '@/packages/ui/src/utils/money';
|
||||
import { getWeekStart } from '@/packages/ui/src/utils/settings';
|
||||
import { useCssVar } from '@vueuse/core';
|
||||
import { useCssVariable } from '@/utils/useCssVariable';
|
||||
import { getOrganizationCurrencyString } from '@/utils/money';
|
||||
import { useQuery } from '@tanstack/vue-query';
|
||||
import { getCurrentOrganizationId } from '@/utils/useUser';
|
||||
@@ -60,7 +60,7 @@ const weekdays = computed(() => {
|
||||
}
|
||||
});
|
||||
|
||||
const accentColor = useCssVar('--theme-color-chart', null, { observe: true });
|
||||
const accentColor = useCssVariable('--theme-color-chart');
|
||||
|
||||
// Get the organization ID using the utility function
|
||||
const organizationId = computed(() => getCurrentOrganizationId());
|
||||
@@ -176,10 +176,8 @@ const seriesData = computed(() => {
|
||||
});
|
||||
});
|
||||
|
||||
const markLineColor = useCssVar('--color-border-secondary', null, {
|
||||
observe: true,
|
||||
});
|
||||
const labelColor = useCssVar('--color-text-secondary', null, { observe: true });
|
||||
const markLineColor = useCssVariable('--color-border-secondary');
|
||||
const labelColor = useCssVariable('--color-text-secondary');
|
||||
const option = computed(() => {
|
||||
return {
|
||||
tooltip: {
|
||||
@@ -215,6 +213,10 @@ const option = computed(() => {
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
axisLabel: {
|
||||
color: labelColor.value,
|
||||
fontFamily: 'Outfit, sans-serif',
|
||||
},
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
color: markLineColor.value,
|
||||
|
||||
@@ -5,10 +5,7 @@ import {
|
||||
PopoverTrigger,
|
||||
} from '@/Components/ui/popover';
|
||||
import { RangeCalendar } from '@/Components/ui/range-calendar';
|
||||
import {
|
||||
CalendarDate,
|
||||
getLocalTimeZone,
|
||||
} from '@internationalized/date';
|
||||
import { CalendarDate } from '@internationalized/date';
|
||||
import { CalendarIcon } from 'lucide-vue-next';
|
||||
import { computed, ref, inject, type ComputedRef, watch } from 'vue';
|
||||
import { twMerge } from 'tailwind-merge';
|
||||
@@ -16,8 +13,9 @@ import {
|
||||
getDayJsInstance,
|
||||
getLocalizedDayJs,
|
||||
} from '@/packages/ui/src/utils/time';
|
||||
import { formatDateLocalized } from '@/packages/ui/src/utils/time';
|
||||
import { type Organization } from '@/packages/api/src';
|
||||
import { getUserTimezone } from '@/packages/ui/src/utils/settings';
|
||||
import { formatDate } from '@/packages/ui/src/utils/time';
|
||||
|
||||
const props = defineProps<{
|
||||
start: string;
|
||||
@@ -59,12 +57,13 @@ const modelValue = computed<CalendarDateRange>({
|
||||
}),
|
||||
set: (newValue) => {
|
||||
if (newValue.start) {
|
||||
const date = newValue.start.toDate(getLocalTimeZone());
|
||||
emit('update:start', getDayJsInstance()(date).format('YYYY-MM-DD'));
|
||||
console.log(newValue.start);
|
||||
const date = newValue.start.toDate(getUserTimezone());
|
||||
emit('update:start', getLocalizedDayJs(date.toString()).format());
|
||||
}
|
||||
if (newValue.end) {
|
||||
const date = newValue.end.toDate(getLocalTimeZone());
|
||||
emit('update:end', getDayJsInstance()(date).format('YYYY-MM-DD'));
|
||||
const date = newValue.end.toDate(getUserTimezone());
|
||||
emit('update:end', getLocalizedDayJs(date.toString()).format());
|
||||
}
|
||||
},
|
||||
});
|
||||
@@ -219,12 +218,27 @@ watch(open, (value) => {
|
||||
<CalendarIcon class="mr-2 h-4 w-4" />
|
||||
<template v-if="modelValue.start">
|
||||
<template v-if="modelValue.end">
|
||||
{{ formatDateLocalized(modelValue.start.toString(), organization?.date_format) }}
|
||||
{{
|
||||
formatDate(
|
||||
modelValue.start.toString(),
|
||||
organization?.date_format
|
||||
)
|
||||
}}
|
||||
-
|
||||
{{ formatDateLocalized(modelValue.end.toString(), organization?.date_format) }}
|
||||
{{
|
||||
formatDate(
|
||||
modelValue.end.toString(),
|
||||
organization?.date_format
|
||||
)
|
||||
}}
|
||||
</template>
|
||||
<template v-else>
|
||||
{{ formatDateLocalized(modelValue.start.toString(), organization?.date_format) }}
|
||||
{{
|
||||
formatDate(
|
||||
modelValue.start.toString(),
|
||||
organization?.date_format
|
||||
)
|
||||
}}
|
||||
</template>
|
||||
</template>
|
||||
<template v-else> Pick a date </template>
|
||||
|
||||
@@ -3,13 +3,6 @@ import { computed, watch } from "vue";
|
||||
|
||||
type themeOption = "system" | "light" | "dark";
|
||||
const themeSetting = useStorage<themeOption>("theme", "system");
|
||||
// reload page when themeSettingChanges
|
||||
watch(
|
||||
themeSetting,
|
||||
() => {
|
||||
location.reload();
|
||||
}
|
||||
)
|
||||
const preferredColor = usePreferredColorScheme();
|
||||
const theme = computed(() => {
|
||||
if(themeSetting.value === "system"){
|
||||
|
||||
49
resources/js/utils/useCssVariable.ts
Normal file
49
resources/js/utils/useCssVariable.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
import { ref, onMounted, onUnmounted } from 'vue'
|
||||
|
||||
export function useCssVariable(variableName: string) {
|
||||
const value = ref('')
|
||||
let observer: MutationObserver | null = null
|
||||
let mediaQuery: MediaQueryList | null = null
|
||||
|
||||
const updateValue = () => {
|
||||
const computedStyle = getComputedStyle(document.documentElement)
|
||||
const cssValue = computedStyle.getPropertyValue(variableName).trim()
|
||||
value.value = cssValue
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
// Initialize with current value
|
||||
updateValue()
|
||||
|
||||
// Watch for class changes on document.documentElement (where theme classes are applied)
|
||||
observer = new MutationObserver((mutations) => {
|
||||
mutations.forEach((mutation) => {
|
||||
if (mutation.type === 'attributes' && mutation.attributeName === 'class') {
|
||||
updateValue()
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
observer.observe(document.documentElement, {
|
||||
attributes: true,
|
||||
attributeFilter: ['class']
|
||||
})
|
||||
|
||||
// Also watch for system color scheme changes
|
||||
if (window.matchMedia) {
|
||||
mediaQuery = window.matchMedia('(prefers-color-scheme: dark)')
|
||||
mediaQuery.addEventListener('change', updateValue)
|
||||
}
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
if (observer) {
|
||||
observer.disconnect()
|
||||
}
|
||||
if (mediaQuery) {
|
||||
mediaQuery.removeEventListener('change', updateValue)
|
||||
}
|
||||
})
|
||||
|
||||
return value
|
||||
}
|
||||
Reference in New Issue
Block a user