Compare commits

..

1 Commits

12 changed files with 619 additions and 717 deletions

View File

@@ -14,7 +14,7 @@ class ActiveUserOverview extends BaseWidget
{ {
protected static ?int $sort = 1; protected static ?int $sort = 1;
protected ?string $heading = 'A Registrations'; protected static ?string $heading = 'A Registrations';
protected function getCards(): array protected function getCards(): array
{ {

View File

@@ -45,34 +45,18 @@ class HealthCheckController extends Controller
$dbTimezone = DB::select('show timezone;'); $dbTimezone = DB::select('show timezone;');
$response = [
'ip_address' => $ipAddress,
'url' => $request->url(),
'path' => $request->path(),
'hostname' => $hostname,
'timestamp' => Carbon::now()->timestamp,
'date_time_utc' => Carbon::now('UTC')->toDateTimeString(),
'date_time_app' => Carbon::now()->toDateTimeString(),
'timezone' => $dbTimezone[0]->TimeZone,
'secure' => $secure,
'is_trusted_proxy' => $isTrustedProxy,
];
if (app()->hasDebugModeEnabled()) {
$response['app_debug'] = true;
$response['app_url'] = config('app.url');
$response['app_env'] = app()->environment();
$response['app_timezone'] = config('app.timezone');
$response['app_force_https'] = config('app.force_https');
$response['trusted_proxies'] = config('trustedproxy.proxies');
$headers = $request->headers->all();
if (isset($headers['cookie'])) {
$headers['cookie'] = '***';
}
$response['headers'] = $headers;
}
return response() return response()
->json($response); ->json([
'ip_address' => $ipAddress,
'url' => $request->url(),
'path' => $request->path(),
'hostname' => $hostname,
'timestamp' => Carbon::now()->timestamp,
'date_time_utc' => Carbon::now('UTC')->toDateTimeString(),
'date_time_app' => Carbon::now()->toDateTimeString(),
'timezone' => $dbTimezone[0]->TimeZone,
'secure' => $secure,
'is_trusted_proxy' => $isTrustedProxy,
]);
} }
} }

View File

@@ -7,11 +7,11 @@
"require": { "require": {
"php": "8.3.*", "php": "8.3.*",
"ext-zip": "*", "ext-zip": "*",
"brick/money": "^0.10.0", "brick/money": "^0.9.0",
"datomatic/laravel-enum-helper": "^2.0.0", "datomatic/laravel-enum-helper": "^1.1",
"dedoc/scramble": "dev-main", "dedoc/scramble": "dev-main",
"filament/filament": "^3.2", "filament/filament": "^3.2",
"flowframe/laravel-trend": "^0.3.0", "flowframe/laravel-trend": "^0.2.0",
"gotenberg/gotenberg-php": "^2.8", "gotenberg/gotenberg-php": "^2.8",
"guzzlehttp/guzzle": "^7.2", "guzzlehttp/guzzle": "^7.2",
"inertiajs/inertia-laravel": "^1.0", "inertiajs/inertia-laravel": "^1.0",

1185
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -65,7 +65,7 @@ return [
'asset_url' => env('ASSET_URL'), 'asset_url' => env('ASSET_URL'),
'force_https' => (bool) env('APP_FORCE_HTTPS', false), 'force_https' => env('APP_FORCE_HTTPS', false),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------

View File

@@ -57,38 +57,6 @@ test('test that starting and stopping a timer with a description works', async (
await assertThatTimerIsStopped(page); await assertThatTimerIsStopped(page);
}); });
test('test that starting the time entry starts the live timer and that it keeps running after reload', async ({
page,
}) => {
await goToDashboard(page);
await Promise.all([
newTimeEntryResponse(page),
startOrStopTimerWithButton(page),
]);
await assertThatTimerHasStarted(page);
await page.waitForTimeout(500);
const beforeTimerValue = await page
.getByTestId('time_entry_time')
.inputValue();
await page.waitForTimeout(2000);
const afterWaitTimeValue = await page
.getByTestId('time_entry_time')
.inputValue();
expect(afterWaitTimeValue).not.toEqual(beforeTimerValue);
await page.reload();
await page.waitForTimeout(500);
const afterReloadTimerValue = await page
.getByTestId('time_entry_time')
.inputValue();
await page.waitForTimeout(2000);
const afterReloadAfterWaitTimerValue = await page
.getByTestId('time_entry_time')
.inputValue();
expect(afterReloadTimerValue).not.toEqual(afterReloadAfterWaitTimerValue);
});
test('test that starting and updating the description while running works', async ({ test('test that starting and updating the description while running works', async ({
page, page,
}) => { }) => {

View File

@@ -125,6 +125,8 @@ function deleteSelected() {
:createClient="createClient" :createClient="createClient"
:createTag="createTag" :createTag="createTag"
:createTimeEntry="createTimeEntry" :createTimeEntry="createTimeEntry"
:currency="getOrganizationCurrencyString()"
:canCreateProject="canCreateProjects()"
:projects :projects
:tasks :tasks
:tags :tags

View File

@@ -1,12 +1,12 @@
{ {
"name": "@solidtime/ui", "name": "@solidtime/ui",
"version": "0.0.10", "version": "0.0.11",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@solidtime/ui", "name": "@solidtime/ui",
"version": "0.0.9", "version": "0.0.11",
"license": "AGPL-3.0", "license": "AGPL-3.0",
"devDependencies": { "devDependencies": {
"@types/node": "^22.4.1", "@types/node": "^22.4.1",

View File

@@ -1,6 +1,6 @@
{ {
"name": "@solidtime/ui", "name": "@solidtime/ui",
"version": "0.0.10", "version": "0.0.11",
"description": "Package containing the solidtime ui components", "description": "Package containing the solidtime ui components",
"main": "./dist/solidtime-ui-lib.umd.cjs", "main": "./dist/solidtime-ui-lib.umd.cjs",
"module": "./dist/solidtime-ui-lib.js", "module": "./dist/solidtime-ui-lib.js",

View File

@@ -19,8 +19,6 @@ import type {
CreateTimeEntryBody, CreateTimeEntryBody,
} from '@/packages/api/src'; } from '@/packages/api/src';
import TimePicker from '@/packages/ui/src/Input/TimePicker.vue'; import TimePicker from '@/packages/ui/src/Input/TimePicker.vue';
import { getOrganizationCurrencyString } from '@/utils/money';
import { canCreateProjects } from '@/utils/permissions';
import TagDropdown from '@/packages/ui/src/Tag/TagDropdown.vue'; import TagDropdown from '@/packages/ui/src/Tag/TagDropdown.vue';
import { Badge } from '@/packages/ui/src'; import { Badge } from '@/packages/ui/src';
import BillableIcon from '@/packages/ui/src/Icons/BillableIcon.vue'; import BillableIcon from '@/packages/ui/src/Icons/BillableIcon.vue';
@@ -46,6 +44,8 @@ const props = defineProps<{
projects: Project[]; projects: Project[];
tasks: Task[]; tasks: Task[];
clients: Client[]; clients: Client[];
currency: string;
canCreateProject: boolean;
}>(); }>();
const description = ref<HTMLInputElement | null>(null); const description = ref<HTMLInputElement | null>(null);
@@ -137,8 +137,8 @@ type BillableOption = {
:clients :clients
:createProject :createProject
:createClient :createClient
:canCreateProject="canCreateProjects()" :canCreateProject
:currency="getOrganizationCurrencyString()" :currency
size="xlarge" size="xlarge"
class="bg-input-background" class="bg-input-background"
:projects="projects" :projects="projects"

View File

@@ -66,12 +66,6 @@ export const useCurrentTimeEntryStore = defineStore('currentTimeEntry', () => {
if (timeEntriesResponse?.data) { if (timeEntriesResponse?.data) {
if (timeEntriesResponse.data) { if (timeEntriesResponse.data) {
currentTimeEntry.value = timeEntriesResponse.data; currentTimeEntry.value = timeEntriesResponse.data;
if (
currentTimeEntry.value.start !== '' &&
currentTimeEntry.value.end === null
) {
startLiveTimer();
}
} else { } else {
currentTimeEntry.value = { ...emptyTimeEntry }; currentTimeEntry.value = { ...emptyTimeEntry };
} }

View File

@@ -33,57 +33,20 @@ class HealthCheckEndpointTest extends EndpointTestAbstract
public function test_debug_endpoint_returns_ok(): void public function test_debug_endpoint_returns_ok(): void
{ {
// Arrange
config(['app.debug' => false]);
// Act // Act
$response = $this->get('health-check/debug'); $response = $this->get('health-check/debug');
// Assert // Assert
$response->assertSuccessful(); $response->assertSuccessful();
$response->assertExactJsonStructure([ $response->assertJsonStructure([
'date_time_app',
'date_time_utc',
'hostname',
'ip_address', 'ip_address',
'is_trusted_proxy',
'path',
'secure',
'timestamp',
'timezone',
'url',
]);
config(['app.debug' => true]);
}
public function test_debug_endpoint_returns_more_information_if_debug_mode_is_enabled(): void
{
// Arrange
config(['app.debug' => true]);
// Act
$response = $this->get('health-check/debug');
// Assert
$response->assertSuccessful();
$response->assertExactJsonStructure([
'app_debug',
'app_env',
'app_force_https',
'app_timezone',
'app_url',
'date_time_app',
'date_time_utc',
'headers',
'hostname', 'hostname',
'ip_address',
'is_trusted_proxy',
'path',
'secure',
'timestamp', 'timestamp',
'date_time_utc',
'date_time_app',
'timezone', 'timezone',
'trusted_proxies', 'secure',
'url', 'is_trusted_proxy',
]); ]);
} }
} }