mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-06-15 13:32:43 +01:00
Compare commits
4 Commits
feature/up
...
v0.4.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
83e17d4a40 | ||
|
|
5b27853546 | ||
|
|
f49f7b2c9b | ||
|
|
9e77500d94 |
@@ -14,7 +14,7 @@ class ActiveUserOverview extends BaseWidget
|
||||
{
|
||||
protected static ?int $sort = 1;
|
||||
|
||||
protected static ?string $heading = 'A Registrations';
|
||||
protected ?string $heading = 'A Registrations';
|
||||
|
||||
protected function getCards(): array
|
||||
{
|
||||
|
||||
@@ -45,18 +45,34 @@ class HealthCheckController extends Controller
|
||||
|
||||
$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()
|
||||
->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,
|
||||
]);
|
||||
->json($response);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
"require": {
|
||||
"php": "8.3.*",
|
||||
"ext-zip": "*",
|
||||
"brick/money": "^0.9.0",
|
||||
"datomatic/laravel-enum-helper": "^1.1",
|
||||
"brick/money": "^0.10.0",
|
||||
"datomatic/laravel-enum-helper": "^2.0.0",
|
||||
"dedoc/scramble": "dev-main",
|
||||
"filament/filament": "^3.2",
|
||||
"flowframe/laravel-trend": "^0.2.0",
|
||||
"flowframe/laravel-trend": "^0.3.0",
|
||||
"gotenberg/gotenberg-php": "^2.8",
|
||||
"guzzlehttp/guzzle": "^7.2",
|
||||
"inertiajs/inertia-laravel": "^1.0",
|
||||
|
||||
1185
composer.lock
generated
1185
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -65,7 +65,7 @@ return [
|
||||
|
||||
'asset_url' => env('ASSET_URL'),
|
||||
|
||||
'force_https' => env('APP_FORCE_HTTPS', false),
|
||||
'force_https' => (bool) env('APP_FORCE_HTTPS', false),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
||||
@@ -57,6 +57,38 @@ test('test that starting and stopping a timer with a description works', async (
|
||||
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 ({
|
||||
page,
|
||||
}) => {
|
||||
|
||||
@@ -66,6 +66,12 @@ export const useCurrentTimeEntryStore = defineStore('currentTimeEntry', () => {
|
||||
if (timeEntriesResponse?.data) {
|
||||
if (timeEntriesResponse.data) {
|
||||
currentTimeEntry.value = timeEntriesResponse.data;
|
||||
if (
|
||||
currentTimeEntry.value.start !== '' &&
|
||||
currentTimeEntry.value.end === null
|
||||
) {
|
||||
startLiveTimer();
|
||||
}
|
||||
} else {
|
||||
currentTimeEntry.value = { ...emptyTimeEntry };
|
||||
}
|
||||
|
||||
@@ -33,20 +33,57 @@ class HealthCheckEndpointTest extends EndpointTestAbstract
|
||||
|
||||
public function test_debug_endpoint_returns_ok(): void
|
||||
{
|
||||
// Arrange
|
||||
config(['app.debug' => false]);
|
||||
|
||||
// Act
|
||||
$response = $this->get('health-check/debug');
|
||||
|
||||
// Assert
|
||||
$response->assertSuccessful();
|
||||
$response->assertJsonStructure([
|
||||
'ip_address',
|
||||
'hostname',
|
||||
'timestamp',
|
||||
'date_time_utc',
|
||||
$response->assertExactJsonStructure([
|
||||
'date_time_app',
|
||||
'timezone',
|
||||
'secure',
|
||||
'date_time_utc',
|
||||
'hostname',
|
||||
'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',
|
||||
'ip_address',
|
||||
'is_trusted_proxy',
|
||||
'path',
|
||||
'secure',
|
||||
'timestamp',
|
||||
'timezone',
|
||||
'trusted_proxies',
|
||||
'url',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user