mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-06-15 05:22:44 +01:00
Compare commits
3 Commits
8a1a187f7f
...
1e93830672
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1e93830672 | ||
|
|
cb5c2547f4 | ||
|
|
13a25524f3 |
@@ -9,7 +9,7 @@
|
||||
"ext-zip": "*",
|
||||
"brick/money": "^0.10.0",
|
||||
"datomatic/laravel-enum-helper": "^2.0.0",
|
||||
"dedoc/scramble": "^0.13.24",
|
||||
"dedoc/scramble": "^0.13.26",
|
||||
"filament/filament": "^3.2",
|
||||
"flowframe/laravel-trend": "^0.5.0",
|
||||
"gotenberg/gotenberg-php": "^2.8",
|
||||
|
||||
148
composer.lock
generated
148
composer.lock
generated
@@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "04f787adb892147fb9952aca6f338020",
|
||||
"content-hash": "09353cfdfcaf9d1f4e2f1b391fe9e19a",
|
||||
"packages": [
|
||||
{
|
||||
"name": "anourvalar/eloquent-serialize",
|
||||
@@ -128,16 +128,16 @@
|
||||
},
|
||||
{
|
||||
"name": "aws/aws-sdk-php",
|
||||
"version": "3.383.2",
|
||||
"version": "3.384.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/aws/aws-sdk-php.git",
|
||||
"reference": "11c2de39e4511dc99e44f049c7dfc8087e051867"
|
||||
"reference": "8e232a5703896541a7a34691a41ece5bd6170269"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/11c2de39e4511dc99e44f049c7dfc8087e051867",
|
||||
"reference": "11c2de39e4511dc99e44f049c7dfc8087e051867",
|
||||
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/8e232a5703896541a7a34691a41ece5bd6170269",
|
||||
"reference": "8e232a5703896541a7a34691a41ece5bd6170269",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -219,9 +219,9 @@
|
||||
"support": {
|
||||
"forum": "https://github.com/aws/aws-sdk-php/discussions",
|
||||
"issues": "https://github.com/aws/aws-sdk-php/issues",
|
||||
"source": "https://github.com/aws/aws-sdk-php/tree/3.383.2"
|
||||
"source": "https://github.com/aws/aws-sdk-php/tree/3.384.4"
|
||||
},
|
||||
"time": "2026-06-01T18:08:21+00:00"
|
||||
"time": "2026-06-05T18:05:57+00:00"
|
||||
},
|
||||
{
|
||||
"name": "bacon/bacon-qr-code",
|
||||
@@ -757,16 +757,16 @@
|
||||
},
|
||||
{
|
||||
"name": "composer/composer",
|
||||
"version": "2.10.0",
|
||||
"version": "2.10.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/composer/composer.git",
|
||||
"reference": "c13824d95608b15913a7c0def0a3dea4474b71fc"
|
||||
"reference": "4120703b9bda8795075047b40361d7ec4d2abe49"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/composer/composer/zipball/c13824d95608b15913a7c0def0a3dea4474b71fc",
|
||||
"reference": "c13824d95608b15913a7c0def0a3dea4474b71fc",
|
||||
"url": "https://api.github.com/repos/composer/composer/zipball/4120703b9bda8795075047b40361d7ec4d2abe49",
|
||||
"reference": "4120703b9bda8795075047b40361d7ec4d2abe49",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -854,7 +854,7 @@
|
||||
"irc": "ircs://irc.libera.chat:6697/composer",
|
||||
"issues": "https://github.com/composer/composer/issues",
|
||||
"security": "https://github.com/composer/composer/security/policy",
|
||||
"source": "https://github.com/composer/composer/tree/2.10.0"
|
||||
"source": "https://github.com/composer/composer/tree/2.10.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -866,7 +866,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2026-05-28T09:22:08+00:00"
|
||||
"time": "2026-06-04T08:25:59+00:00"
|
||||
},
|
||||
{
|
||||
"name": "composer/metadata-minifier",
|
||||
@@ -1502,16 +1502,16 @@
|
||||
},
|
||||
{
|
||||
"name": "dedoc/scramble",
|
||||
"version": "v0.13.24",
|
||||
"version": "v0.13.26",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/dedoc/scramble.git",
|
||||
"reference": "a5a82b30c59e0b2734cdb024af3a8c32f8b1bb6c"
|
||||
"reference": "5ca42b5e23b9d5c120607138f790b51e22d8b4a1"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/dedoc/scramble/zipball/a5a82b30c59e0b2734cdb024af3a8c32f8b1bb6c",
|
||||
"reference": "a5a82b30c59e0b2734cdb024af3a8c32f8b1bb6c",
|
||||
"url": "https://api.github.com/repos/dedoc/scramble/zipball/5ca42b5e23b9d5c120607138f790b51e22d8b4a1",
|
||||
"reference": "5ca42b5e23b9d5c120607138f790b51e22d8b4a1",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1570,7 +1570,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/dedoc/scramble/issues",
|
||||
"source": "https://github.com/dedoc/scramble/tree/v0.13.24"
|
||||
"source": "https://github.com/dedoc/scramble/tree/v0.13.26"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -1578,7 +1578,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2026-05-29T18:39:09+00:00"
|
||||
"time": "2026-06-02T14:43:17+00:00"
|
||||
},
|
||||
{
|
||||
"name": "defuse/php-encryption",
|
||||
@@ -3021,25 +3021,26 @@
|
||||
},
|
||||
{
|
||||
"name": "guzzlehttp/guzzle",
|
||||
"version": "7.10.6",
|
||||
"version": "7.11.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/guzzle/guzzle.git",
|
||||
"reference": "e7412b3180912c01650cc66647f18c1d1cbe9b94"
|
||||
"reference": "5af96f374e0ab4ebd747b8310888c99d3adb0a8c"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/e7412b3180912c01650cc66647f18c1d1cbe9b94",
|
||||
"reference": "e7412b3180912c01650cc66647f18c1d1cbe9b94",
|
||||
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/5af96f374e0ab4ebd747b8310888c99d3adb0a8c",
|
||||
"reference": "5af96f374e0ab4ebd747b8310888c99d3adb0a8c",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-json": "*",
|
||||
"guzzlehttp/promises": "^2.3",
|
||||
"guzzlehttp/psr7": "^2.8",
|
||||
"guzzlehttp/promises": "^2.5",
|
||||
"guzzlehttp/psr7": "^2.11",
|
||||
"php": "^7.2.5 || ^8.0",
|
||||
"psr/http-client": "^1.0",
|
||||
"symfony/deprecation-contracts": "^2.2 || ^3.0"
|
||||
"symfony/deprecation-contracts": "^2.5 || ^3.0",
|
||||
"symfony/polyfill-php80": "^1.24"
|
||||
},
|
||||
"provide": {
|
||||
"psr/http-client-implementation": "1.0"
|
||||
@@ -3048,7 +3049,7 @@
|
||||
"bamarni/composer-bin-plugin": "^1.8.2",
|
||||
"ext-curl": "*",
|
||||
"guzzle/client-integration-tests": "3.0.2",
|
||||
"guzzlehttp/test-server": "^0.4",
|
||||
"guzzlehttp/test-server": "^0.5",
|
||||
"php-http/message-factory": "^1.1",
|
||||
"phpunit/phpunit": "^8.5.52 || ^9.6.34",
|
||||
"psr/log": "^1.1 || ^2.0 || ^3.0"
|
||||
@@ -3128,7 +3129,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/guzzle/guzzle/issues",
|
||||
"source": "https://github.com/guzzle/guzzle/tree/7.10.6"
|
||||
"source": "https://github.com/guzzle/guzzle/tree/7.11.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -3144,24 +3145,25 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2026-06-01T13:06:22+00:00"
|
||||
"time": "2026-06-07T22:54:06+00:00"
|
||||
},
|
||||
{
|
||||
"name": "guzzlehttp/promises",
|
||||
"version": "2.4.1",
|
||||
"version": "2.5.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/guzzle/promises.git",
|
||||
"reference": "09e8a212562fb1fb6a512c4156ed71525969d6c2"
|
||||
"reference": "4360e982f87f5f258bf872d094647791db2f4c8e"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/guzzle/promises/zipball/09e8a212562fb1fb6a512c4156ed71525969d6c2",
|
||||
"reference": "09e8a212562fb1fb6a512c4156ed71525969d6c2",
|
||||
"url": "https://api.github.com/repos/guzzle/promises/zipball/4360e982f87f5f258bf872d094647791db2f4c8e",
|
||||
"reference": "4360e982f87f5f258bf872d094647791db2f4c8e",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.2.5 || ^8.0"
|
||||
"php": "^7.2.5 || ^8.0",
|
||||
"symfony/deprecation-contracts": "^2.5 || ^3.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"bamarni/composer-bin-plugin": "^1.8.2",
|
||||
@@ -3211,7 +3213,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/guzzle/promises/issues",
|
||||
"source": "https://github.com/guzzle/promises/tree/2.4.1"
|
||||
"source": "https://github.com/guzzle/promises/tree/2.5.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -3227,27 +3229,29 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2026-05-20T22:57:30+00:00"
|
||||
"time": "2026-06-02T12:23:43+00:00"
|
||||
},
|
||||
{
|
||||
"name": "guzzlehttp/psr7",
|
||||
"version": "2.10.4",
|
||||
"version": "2.11.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/guzzle/psr7.git",
|
||||
"reference": "d2a1a094e396da8957e797489fddaf860c340cfc"
|
||||
"reference": "bbb5e61349fa5cb822b3e87842b951088b76b81f"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/guzzle/psr7/zipball/d2a1a094e396da8957e797489fddaf860c340cfc",
|
||||
"reference": "d2a1a094e396da8957e797489fddaf860c340cfc",
|
||||
"url": "https://api.github.com/repos/guzzle/psr7/zipball/bbb5e61349fa5cb822b3e87842b951088b76b81f",
|
||||
"reference": "bbb5e61349fa5cb822b3e87842b951088b76b81f",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.2.5 || ^8.0",
|
||||
"psr/http-factory": "^1.0",
|
||||
"psr/http-message": "^1.1 || ^2.0",
|
||||
"ralouphie/getallheaders": "^3.0"
|
||||
"ralouphie/getallheaders": "^3.0",
|
||||
"symfony/deprecation-contracts": "^2.5 || ^3.0",
|
||||
"symfony/polyfill-php80": "^1.24"
|
||||
},
|
||||
"provide": {
|
||||
"psr/http-factory-implementation": "1.0",
|
||||
@@ -3328,7 +3332,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/guzzle/psr7/issues",
|
||||
"source": "https://github.com/guzzle/psr7/tree/2.10.4"
|
||||
"source": "https://github.com/guzzle/psr7/tree/2.11.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -3344,7 +3348,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2026-05-29T12:59:07+00:00"
|
||||
"time": "2026-06-02T12:30:48+00:00"
|
||||
},
|
||||
{
|
||||
"name": "guzzlehttp/uri-template",
|
||||
@@ -3568,16 +3572,16 @@
|
||||
},
|
||||
{
|
||||
"name": "justinrainbow/json-schema",
|
||||
"version": "6.8.2",
|
||||
"version": "6.9.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/jsonrainbow/json-schema.git",
|
||||
"reference": "2c89ebb95ca9cedc9347f780333f7b25792dcb76"
|
||||
"reference": "bd1bda2ebfc8bff418565941771ea8f03c557886"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/jsonrainbow/json-schema/zipball/2c89ebb95ca9cedc9347f780333f7b25792dcb76",
|
||||
"reference": "2c89ebb95ca9cedc9347f780333f7b25792dcb76",
|
||||
"url": "https://api.github.com/repos/jsonrainbow/json-schema/zipball/bd1bda2ebfc8bff418565941771ea8f03c557886",
|
||||
"reference": "bd1bda2ebfc8bff418565941771ea8f03c557886",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -3587,7 +3591,7 @@
|
||||
},
|
||||
"require-dev": {
|
||||
"friendsofphp/php-cs-fixer": "3.3.0",
|
||||
"json-schema/json-schema-test-suite": "dev-main",
|
||||
"json-schema/json-schema-test-suite": "^23.2",
|
||||
"marc-mabe/php-enum-phpstan": "^2.0",
|
||||
"phpspec/prophecy": "^1.19",
|
||||
"phpstan/phpstan": "^1.12",
|
||||
@@ -3637,9 +3641,9 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/jsonrainbow/json-schema/issues",
|
||||
"source": "https://github.com/jsonrainbow/json-schema/tree/6.8.2"
|
||||
"source": "https://github.com/jsonrainbow/json-schema/tree/6.9.0"
|
||||
},
|
||||
"time": "2026-05-05T05:39:01+00:00"
|
||||
"time": "2026-06-05T14:05:24+00:00"
|
||||
},
|
||||
{
|
||||
"name": "kirschbaum-development/eloquent-power-joins",
|
||||
@@ -4189,16 +4193,16 @@
|
||||
},
|
||||
{
|
||||
"name": "laravel/framework",
|
||||
"version": "v12.61.0",
|
||||
"version": "v12.61.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/laravel/framework.git",
|
||||
"reference": "1124062a1ca92d290c8bcb9b7f649920fa6816bf"
|
||||
"reference": "e8472ca9774452fe50841d9bdced060679f4d58d"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/laravel/framework/zipball/1124062a1ca92d290c8bcb9b7f649920fa6816bf",
|
||||
"reference": "1124062a1ca92d290c8bcb9b7f649920fa6816bf",
|
||||
"url": "https://api.github.com/repos/laravel/framework/zipball/e8472ca9774452fe50841d9bdced060679f4d58d",
|
||||
"reference": "e8472ca9774452fe50841d9bdced060679f4d58d",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -4407,7 +4411,7 @@
|
||||
"issues": "https://github.com/laravel/framework/issues",
|
||||
"source": "https://github.com/laravel/framework"
|
||||
},
|
||||
"time": "2026-05-26T23:41:33+00:00"
|
||||
"time": "2026-06-04T14:22:52+00:00"
|
||||
},
|
||||
{
|
||||
"name": "laravel/jetstream",
|
||||
@@ -14819,16 +14823,16 @@
|
||||
},
|
||||
{
|
||||
"name": "laravel/sail",
|
||||
"version": "v1.61.0",
|
||||
"version": "v1.62.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/laravel/sail.git",
|
||||
"reference": "68ef35015630fe510432e63e11e21749006df688"
|
||||
"reference": "3aaeefc979f8ba6586fbc5b6e0b1b3638058f98e"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/laravel/sail/zipball/68ef35015630fe510432e63e11e21749006df688",
|
||||
"reference": "68ef35015630fe510432e63e11e21749006df688",
|
||||
"url": "https://api.github.com/repos/laravel/sail/zipball/3aaeefc979f8ba6586fbc5b6e0b1b3638058f98e",
|
||||
"reference": "3aaeefc979f8ba6586fbc5b6e0b1b3638058f98e",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -14878,7 +14882,7 @@
|
||||
"issues": "https://github.com/laravel/sail/issues",
|
||||
"source": "https://github.com/laravel/sail"
|
||||
},
|
||||
"time": "2026-05-23T23:33:57+00:00"
|
||||
"time": "2026-05-27T04:02:01+00:00"
|
||||
},
|
||||
{
|
||||
"name": "laravel/sentinel",
|
||||
@@ -15304,11 +15308,11 @@
|
||||
},
|
||||
{
|
||||
"name": "phpstan/phpstan",
|
||||
"version": "2.2.1",
|
||||
"version": "2.2.2",
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/dea9c8f2d25cc849391042b71e429c1a4bf82660",
|
||||
"reference": "dea9c8f2d25cc849391042b71e429c1a4bf82660",
|
||||
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/e5cc34d491a90e79c216d824f60fe21fd4d93bd6",
|
||||
"reference": "e5cc34d491a90e79c216d824f60fe21fd4d93bd6",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -15364,7 +15368,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2026-05-28T14:44:12+00:00"
|
||||
"time": "2026-06-05T09:00:01+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpunit/php-code-coverage",
|
||||
@@ -15713,16 +15717,16 @@
|
||||
},
|
||||
{
|
||||
"name": "phpunit/phpunit",
|
||||
"version": "12.5.28",
|
||||
"version": "12.5.29",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/phpunit.git",
|
||||
"reference": "5895d05f5bf421ed230fbd76e1277e4b8955def4"
|
||||
"reference": "9aa66a47db3ea70f1a468e66dd969f67e594945a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/5895d05f5bf421ed230fbd76e1277e4b8955def4",
|
||||
"reference": "5895d05f5bf421ed230fbd76e1277e4b8955def4",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9aa66a47db3ea70f1a468e66dd969f67e594945a",
|
||||
"reference": "9aa66a47db3ea70f1a468e66dd969f67e594945a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -15736,7 +15740,7 @@
|
||||
"phar-io/manifest": "^2.0.4",
|
||||
"phar-io/version": "^3.2.1",
|
||||
"php": ">=8.3",
|
||||
"phpunit/php-code-coverage": "^12.5.6",
|
||||
"phpunit/php-code-coverage": "^12.5.7",
|
||||
"phpunit/php-file-iterator": "^6.0.1",
|
||||
"phpunit/php-invoker": "^6.0.0",
|
||||
"phpunit/php-text-template": "^5.0.0",
|
||||
@@ -15746,7 +15750,7 @@
|
||||
"sebastian/diff": "^7.0.0",
|
||||
"sebastian/environment": "^8.1.2",
|
||||
"sebastian/exporter": "^7.0.3",
|
||||
"sebastian/global-state": "^8.0.2",
|
||||
"sebastian/global-state": "^8.0.3",
|
||||
"sebastian/object-enumerator": "^7.0.0",
|
||||
"sebastian/recursion-context": "^7.0.1",
|
||||
"sebastian/type": "^6.0.4",
|
||||
@@ -15791,7 +15795,7 @@
|
||||
"support": {
|
||||
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
|
||||
"security": "https://github.com/sebastianbergmann/phpunit/security/policy",
|
||||
"source": "https://github.com/sebastianbergmann/phpunit/tree/12.5.28"
|
||||
"source": "https://github.com/sebastianbergmann/phpunit/tree/12.5.29"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -15799,7 +15803,7 @@
|
||||
"type": "other"
|
||||
}
|
||||
],
|
||||
"time": "2026-05-27T14:01:10+00:00"
|
||||
"time": "2026-06-04T06:14:42+00:00"
|
||||
},
|
||||
{
|
||||
"name": "sebastian/cli-parser",
|
||||
|
||||
@@ -62,4 +62,35 @@ describe('TimesheetCell', () => {
|
||||
expect(wrapper.emitted('update')).toBeUndefined();
|
||||
expect((input.element as HTMLInputElement).value).toBe(previousValue);
|
||||
});
|
||||
|
||||
it('shows a pending 0 (delete in flight) over the cell total', () => {
|
||||
const wrapper = mount(TimesheetCell, {
|
||||
props: {
|
||||
cell: buildCell(2 * 3600),
|
||||
dayIndex: 0,
|
||||
date: '2026-04-13',
|
||||
isToday: false,
|
||||
hasRunningEntry: false,
|
||||
pendingSeconds: 0,
|
||||
},
|
||||
});
|
||||
|
||||
// `??` (not `||`): a pending 0 must win over the 2h cell total.
|
||||
expect((wrapper.get('input').element as HTMLInputElement).value).toBe('');
|
||||
});
|
||||
|
||||
it('disables editing while the cell is saving', () => {
|
||||
const wrapper = mount(TimesheetCell, {
|
||||
props: {
|
||||
cell: buildCell(2 * 3600),
|
||||
dayIndex: 0,
|
||||
date: '2026-04-13',
|
||||
isToday: false,
|
||||
hasRunningEntry: false,
|
||||
saveStatus: 'saving',
|
||||
},
|
||||
});
|
||||
|
||||
expect((wrapper.get('input').element as HTMLInputElement).disabled).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue';
|
||||
import { CheckIcon } from '@heroicons/vue/16/solid';
|
||||
import DurationSecondsInput from '@/packages/ui/src/Input/DurationSecondsInput.vue';
|
||||
import LoadingSpinner from '@/packages/ui/src/LoadingSpinner.vue';
|
||||
import {
|
||||
Tooltip,
|
||||
TooltipContent,
|
||||
@@ -7,18 +10,40 @@ import {
|
||||
TooltipTrigger,
|
||||
} from '@/packages/ui/src/tooltip';
|
||||
import type { TimesheetCell } from '@/utils/useTimesheetGrid';
|
||||
import type { CellSaveStatus } from '@/utils/timesheet/useTimesheetCellMutations';
|
||||
|
||||
defineProps<{
|
||||
const props = defineProps<{
|
||||
cell?: TimesheetCell;
|
||||
dayIndex: number;
|
||||
date: string;
|
||||
isToday: boolean;
|
||||
hasRunningEntry: boolean;
|
||||
saveStatus?: CellSaveStatus;
|
||||
pendingSeconds?: number;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
update: [newSeconds: number];
|
||||
}>();
|
||||
|
||||
// Show the optimistic value while saving; `??` (not `||`) so a pending 0 (delete) wins.
|
||||
const displaySeconds = computed(() => props.pendingSeconds ?? props.cell?.totalSeconds ?? 0);
|
||||
const isSaving = computed(() => props.saveStatus === 'saving');
|
||||
|
||||
// Swap the border color (don't layer) to avoid same-specificity fights.
|
||||
const inputClass = computed(() => {
|
||||
const border = props.saveStatus === 'error' ? 'border-red-500/70' : 'border-input-border';
|
||||
return [
|
||||
'w-[80px] mx-auto text-center font-medium',
|
||||
'bg-transparent text-text-primary placeholder:text-text-quaternary',
|
||||
'rounded-lg border shadow-none',
|
||||
border,
|
||||
'hover:bg-card-background',
|
||||
'focus-visible:bg-tertiary focus-visible:border-transparent',
|
||||
'focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none',
|
||||
'disabled:cursor-wait disabled:opacity-70',
|
||||
].join(' ');
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -46,18 +71,26 @@ const emit = defineEmits<{
|
||||
<TooltipContent> Stop the running time entry to edit the timesheet </TooltipContent>
|
||||
</Tooltip>
|
||||
</TooltipProvider>
|
||||
<DurationSecondsInput
|
||||
v-else
|
||||
:model-value="cell?.totalSeconds ?? 0"
|
||||
default-unit="hours"
|
||||
placeholder="-"
|
||||
size="sm"
|
||||
input-class="w-[80px] mx-auto text-center font-medium
|
||||
bg-transparent text-text-primary placeholder:text-text-quaternary
|
||||
rounded-lg border border-input-border shadow-none
|
||||
hover:bg-card-background
|
||||
focus-visible:bg-tertiary focus-visible:border-transparent
|
||||
focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none"
|
||||
@commit="(seconds) => emit('update', seconds ?? 0)" />
|
||||
<template v-else>
|
||||
<span class="relative inline-flex items-center">
|
||||
<DurationSecondsInput
|
||||
:model-value="displaySeconds"
|
||||
default-unit="hours"
|
||||
placeholder="-"
|
||||
size="sm"
|
||||
:disabled="isSaving"
|
||||
:input-class="inputClass"
|
||||
@commit="(seconds) => emit('update', seconds ?? 0)" />
|
||||
<span
|
||||
v-if="saveStatus === 'saving' || saveStatus === 'saved'"
|
||||
class="pointer-events-none absolute left-full top-1/2 ml-1.5 flex -translate-y-1/2 items-center"
|
||||
:aria-label="saveStatus === 'saving' ? 'Saving' : 'Saved'">
|
||||
<LoadingSpinner
|
||||
v-if="saveStatus === 'saving'"
|
||||
class="h-3 w-3 m-0 text-text-tertiary" />
|
||||
<CheckIcon v-else class="h-3 w-3 text-text-tertiary" />
|
||||
</span>
|
||||
</span>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -15,6 +15,7 @@ import type {
|
||||
Task,
|
||||
} from '@/packages/api/src';
|
||||
import type { TimesheetRow as TimesheetRowType, TimesheetRowKey } from '@/utils/useTimesheetGrid';
|
||||
import type { CellSaveStatus } from '@/utils/timesheet/useTimesheetCellMutations';
|
||||
|
||||
const organization = inject<ComputedRef<Organization>>('organization');
|
||||
const dayjs = getDayJsInstance();
|
||||
@@ -36,6 +37,8 @@ defineProps<{
|
||||
createClient: (client: CreateClientBody) => Promise<Client | undefined>;
|
||||
createTag: (name: string) => Promise<Tag | undefined>;
|
||||
formatDuration: (seconds: number) => string;
|
||||
cellStatuses: Record<string, CellSaveStatus>;
|
||||
cellPendingSeconds: Record<string, number>;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
@@ -60,7 +63,7 @@ const emit = defineEmits<{
|
||||
class="grid min-w-full w-max border-y border-default-background-separator"
|
||||
style="
|
||||
grid-template-columns:
|
||||
minmax(420px, 1fr) repeat(7, minmax(96px, 120px)) minmax(100px, auto)
|
||||
minmax(420px, 1fr) repeat(7, minmax(116px, 120px)) minmax(100px, auto)
|
||||
40px;
|
||||
">
|
||||
<!-- Header row -->
|
||||
@@ -100,6 +103,8 @@ const emit = defineEmits<{
|
||||
:create-client="createClient"
|
||||
:create-tag="createTag"
|
||||
:format-duration="formatDuration"
|
||||
:cell-statuses="cellStatuses"
|
||||
:cell-pending-seconds="cellPendingSeconds"
|
||||
@remove-row="$emit('remove-row', $event)"
|
||||
@cell-update="
|
||||
(dayIndex, seconds) => $emit('cell-update', row, dayIndex, seconds)
|
||||
|
||||
@@ -15,6 +15,10 @@ import type {
|
||||
Organization,
|
||||
} from '@/packages/api/src';
|
||||
import type { TimesheetRow, TimesheetRowKey } from '@/utils/useTimesheetGrid';
|
||||
import {
|
||||
makeCellStatusKey,
|
||||
type CellSaveStatus,
|
||||
} from '@/utils/timesheet/useTimesheetCellMutations';
|
||||
import { Button } from '@/packages/ui/src/Buttons';
|
||||
|
||||
const organization = inject<ComputedRef<Organization>>('organization');
|
||||
@@ -34,6 +38,8 @@ const props = defineProps<{
|
||||
createClient: (client: CreateClientBody) => Promise<Client | undefined>;
|
||||
createTag: (name: string) => Promise<Tag | undefined>;
|
||||
formatDuration: (seconds: number) => string;
|
||||
cellStatuses: Record<string, CellSaveStatus>;
|
||||
cellPendingSeconds: Record<string, number>;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
@@ -109,6 +115,8 @@ function hasRunningEntry(dayIndex: number): boolean {
|
||||
:date="day"
|
||||
:is-today="day === todayDate"
|
||||
:has-running-entry="hasRunningEntry(dayIndex)"
|
||||
:save-status="cellStatuses[makeCellStatusKey(row.key, dayIndex)]"
|
||||
:pending-seconds="cellPendingSeconds[makeCellStatusKey(row.key, dayIndex)]"
|
||||
@update="(seconds) => emit('cellUpdate', dayIndex, seconds)" />
|
||||
|
||||
<!-- Row total -->
|
||||
|
||||
@@ -293,7 +293,7 @@ const page = usePage<{
|
||||
<div class="justify-self-end">
|
||||
<UpdateSidebarNotification></UpdateSidebarNotification>
|
||||
<ul
|
||||
class="border-t border-default-background-separator pt-3 gap-1 pr-2 flex justify-between items-center">
|
||||
class="border-t border-default-background-separator pt-3 gap-1 flex justify-between items-center">
|
||||
<UserSettingsIcon></UserSettingsIcon>
|
||||
|
||||
<NavigationSidebarItem
|
||||
|
||||
@@ -90,7 +90,12 @@ const weekRangeDisplay = computed(() => {
|
||||
});
|
||||
|
||||
// ── Cell / row mutation handlers ──────────────────────────────────
|
||||
const { handleCellUpdate } = useTimesheetCellMutations(weekDays, timeEntries, rows, removeSlot);
|
||||
const { handleCellUpdate, cellStatus, cellPendingSeconds } = useTimesheetCellMutations(
|
||||
weekDays,
|
||||
timeEntries,
|
||||
rows,
|
||||
removeSlot
|
||||
);
|
||||
|
||||
const { handleRowIdentityChange, handleAddRow } = useTimesheetRowMutations(
|
||||
mutations,
|
||||
@@ -167,6 +172,8 @@ async function createTag(name: string): Promise<Tag | undefined> {
|
||||
:create-client="createClient"
|
||||
:create-tag="createTag"
|
||||
:format-duration="formatDuration"
|
||||
:cell-statuses="cellStatus"
|
||||
:cell-pending-seconds="cellPendingSeconds"
|
||||
@remove-row="handleRemoveRow"
|
||||
@cell-update="handleCellUpdate"
|
||||
@project-task-change="
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
|
||||
import { ref } from 'vue';
|
||||
import { createPinia, setActivePinia } from 'pinia';
|
||||
import { useTimesheetCellMutations } from './useTimesheetCellMutations';
|
||||
import { useTimesheetCellMutations, makeCellStatusKey } from './useTimesheetCellMutations';
|
||||
import { api } from '@/packages/api/src';
|
||||
import type { TimesheetRow, TimesheetCell } from '@/utils/useTimesheetGrid';
|
||||
import type { TimeEntry } from '@/packages/api/src';
|
||||
@@ -549,3 +549,119 @@ describe('useTimesheetCellMutations.handleCellUpdate', () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('useTimesheetCellMutations save status', () => {
|
||||
// Timer handles keep old fade-outs from clearing newer status, and
|
||||
// the same-cell saving guard prevents concurrent writes from stale rows.
|
||||
|
||||
it('does not let a stale fade-out timer clear a newer edit on the same cell', async () => {
|
||||
const { cellMutations } = setup([]);
|
||||
const row = buildEmptyRow('p-1');
|
||||
const key = makeCellStatusKey(row.key, 0);
|
||||
|
||||
await cellMutations.handleCellUpdate(row, 0, HOUR);
|
||||
expect(cellMutations.cellStatus.value[key]).toBe('saved');
|
||||
|
||||
// Re-edit the same cell partway through the first "saved" window.
|
||||
vi.advanceTimersByTime(1000);
|
||||
await cellMutations.handleCellUpdate(row, 0, 2 * HOUR);
|
||||
expect(cellMutations.cellPendingSeconds.value[key]).toBe(2 * HOUR);
|
||||
|
||||
// Advance past the FIRST timer's deadline: it must not wipe the newer state.
|
||||
vi.advanceTimersByTime(2000);
|
||||
expect(cellMutations.cellStatus.value[key]).toBe('saved');
|
||||
expect(cellMutations.cellPendingSeconds.value[key]).toBe(2 * HOUR);
|
||||
});
|
||||
|
||||
it('ignores another commit while the same cell is saving', async () => {
|
||||
const { cellMutations } = setup([]);
|
||||
const row = buildEmptyRow('p-1');
|
||||
const key = makeCellStatusKey(row.key, 0);
|
||||
|
||||
let release!: () => void;
|
||||
const gateA = new Promise<void>((res) => {
|
||||
release = () => res();
|
||||
});
|
||||
apiMocks.createTimeEntry.mockImplementationOnce(async () => {
|
||||
await gateA;
|
||||
return { data: { id: 'a' } } as never;
|
||||
});
|
||||
|
||||
const save = cellMutations.handleCellUpdate(row, 0, HOUR);
|
||||
expect(cellMutations.cellStatus.value[key]).toBe('saving');
|
||||
expect(cellMutations.cellPendingSeconds.value[key]).toBe(HOUR);
|
||||
|
||||
// The second commit would be planned from the same stale row, so it is ignored.
|
||||
await cellMutations.handleCellUpdate(row, 0, 2 * HOUR);
|
||||
expect(apiMocks.createTimeEntry).toHaveBeenCalledTimes(1);
|
||||
expect(cellMutations.cellPendingSeconds.value[key]).toBe(HOUR);
|
||||
|
||||
release();
|
||||
await save;
|
||||
expect(cellMutations.cellStatus.value[key]).toBe('saved');
|
||||
expect(cellMutations.cellPendingSeconds.value[key]).toBe(HOUR);
|
||||
});
|
||||
|
||||
it('marks error and drops the optimistic value when the save fails', async () => {
|
||||
const { cellMutations } = setup([]);
|
||||
const row = buildEmptyRow('p-1');
|
||||
const key = makeCellStatusKey(row.key, 0);
|
||||
|
||||
apiMocks.createTimeEntry.mockRejectedValueOnce(new Error('boom'));
|
||||
|
||||
await cellMutations.handleCellUpdate(row, 0, HOUR);
|
||||
|
||||
expect(cellMutations.cellStatus.value[key]).toBe('error');
|
||||
expect(cellMutations.cellPendingSeconds.value[key]).toBeUndefined();
|
||||
expect(addNotification).toHaveBeenCalledWith(
|
||||
'error',
|
||||
'Failed to update timesheet',
|
||||
expect.any(String)
|
||||
);
|
||||
});
|
||||
|
||||
it('marks error and drops the optimistic value when the day is full', async () => {
|
||||
// Block all but the last 2h, then ask for 3h → NoFreeWindowError.
|
||||
const blocker = entry('2026-04-10T00:00:00Z', '2026-04-10T22:00:00Z', { id: 'blocker' });
|
||||
const { cellMutations } = setup([blocker]);
|
||||
const row = buildEmptyRow('p-1');
|
||||
const key = makeCellStatusKey(row.key, 0);
|
||||
|
||||
await cellMutations.handleCellUpdate(row, 0, 3 * HOUR);
|
||||
|
||||
expect(cellMutations.cellStatus.value[key]).toBe('error');
|
||||
expect(cellMutations.cellPendingSeconds.value[key]).toBeUndefined();
|
||||
expect(addNotification).toHaveBeenCalledWith(
|
||||
'error',
|
||||
"This day can't fit any more work",
|
||||
expect.any(String)
|
||||
);
|
||||
});
|
||||
|
||||
it('creates no status when the committed value is unchanged', async () => {
|
||||
const cellEntry = entry('2026-04-10T09:00:00Z', '2026-04-10T10:00:00Z');
|
||||
const { cellMutations } = setup([cellEntry]);
|
||||
const row = buildRow('p-1', [cellEntry]);
|
||||
const key = makeCellStatusKey(row.key, 0);
|
||||
|
||||
await cellMutations.handleCellUpdate(row, 0, HOUR);
|
||||
|
||||
expect(cellMutations.cellStatus.value[key]).toBeUndefined();
|
||||
expect(cellMutations.cellPendingSeconds.value[key]).toBeUndefined();
|
||||
});
|
||||
|
||||
it('tracks save status independently for each cell', async () => {
|
||||
const { cellMutations } = setup([]);
|
||||
const row = buildEmptyRow('p-1');
|
||||
const mondayKey = makeCellStatusKey(row.key, 0);
|
||||
const tuesdayKey = makeCellStatusKey(row.key, 1);
|
||||
|
||||
await cellMutations.handleCellUpdate(row, 0, HOUR);
|
||||
await cellMutations.handleCellUpdate(row, 1, 2 * HOUR);
|
||||
|
||||
expect(cellMutations.cellStatus.value[mondayKey]).toBe('saved');
|
||||
expect(cellMutations.cellStatus.value[tuesdayKey]).toBe('saved');
|
||||
expect(cellMutations.cellPendingSeconds.value[mondayKey]).toBe(HOUR);
|
||||
expect(cellMutations.cellPendingSeconds.value[tuesdayKey]).toBe(2 * HOUR);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { Ref } from 'vue';
|
||||
import { ref, type Ref } from 'vue';
|
||||
import { useQueryClient } from '@tanstack/vue-query';
|
||||
import { api, type CreateTimeEntryBody, type TimeEntry } from '@/packages/api/src';
|
||||
import { formatHumanReadableDuration, getDayJsInstance } from '@/packages/ui/src/utils/time';
|
||||
@@ -19,6 +19,17 @@ import {
|
||||
type FreeWindow,
|
||||
} from './cellMath';
|
||||
|
||||
export type CellSaveStatus = 'saving' | 'saved' | 'error';
|
||||
|
||||
/** Map key for a cell's save state (row + day). */
|
||||
export function makeCellStatusKey(rowKey: TimesheetRowKey, dayIndex: number): string {
|
||||
return `${rowKey}:${dayIndex}`;
|
||||
}
|
||||
|
||||
/** How long the saved/error state stays visible before fading. */
|
||||
const SAVED_VISIBLE_MS = 2800;
|
||||
const ERROR_VISIBLE_MS = 2500;
|
||||
|
||||
/**
|
||||
* Cell-level edit dispatcher. Picks one of four strategies based on
|
||||
* the diff between current and requested totals:
|
||||
@@ -48,15 +59,58 @@ export function useTimesheetCellMutations(
|
||||
const queryClient = useQueryClient();
|
||||
const notifications = useNotificationsStore();
|
||||
|
||||
// Save status + the optimistic value shown while saving, so a saved cell
|
||||
// doesn't flicker back to its old total before the refetch lands.
|
||||
const cellStatus = ref<Record<string, CellSaveStatus>>({});
|
||||
const cellPendingSeconds = ref<Record<string, number>>({});
|
||||
const statusClearTimers: Record<string, ReturnType<typeof setTimeout>> = {};
|
||||
|
||||
function clearStatusTimer(key: string): void {
|
||||
clearTimeout(statusClearTimers[key]);
|
||||
delete statusClearTimers[key];
|
||||
}
|
||||
|
||||
function beginSaving(key: string, seconds: number): void {
|
||||
clearStatusTimer(key);
|
||||
cellPendingSeconds.value[key] = seconds;
|
||||
cellStatus.value[key] = 'saving';
|
||||
}
|
||||
|
||||
function markSaved(key: string): void {
|
||||
clearStatusTimer(key);
|
||||
cellStatus.value[key] = 'saved';
|
||||
statusClearTimers[key] = setTimeout(() => {
|
||||
delete cellStatus.value[key];
|
||||
delete cellPendingSeconds.value[key];
|
||||
delete statusClearTimers[key];
|
||||
}, SAVED_VISIBLE_MS);
|
||||
}
|
||||
|
||||
function markError(key: string): void {
|
||||
clearStatusTimer(key);
|
||||
cellStatus.value[key] = 'error';
|
||||
// Drop the optimistic value so the cell shows server truth after refetch.
|
||||
delete cellPendingSeconds.value[key];
|
||||
statusClearTimers[key] = setTimeout(() => {
|
||||
delete cellStatus.value[key];
|
||||
delete statusClearTimers[key];
|
||||
}, ERROR_VISIBLE_MS);
|
||||
}
|
||||
|
||||
async function handleCellUpdate(
|
||||
row: TimesheetRow,
|
||||
dayIndex: number,
|
||||
newTotalSeconds: number
|
||||
): Promise<void> {
|
||||
const statusKey = makeCellStatusKey(row.key, dayIndex);
|
||||
if (cellStatus.value[statusKey] === 'saving') return;
|
||||
|
||||
const cell = row.cells.get(dayIndex);
|
||||
const existingSeconds = cell?.totalSeconds ?? 0;
|
||||
if (newTotalSeconds === existingSeconds) return;
|
||||
|
||||
beginSaving(statusKey, newTotalSeconds);
|
||||
|
||||
// Capture row state before the mutation: a row that was empty
|
||||
// and shares identity with another slot collapses after the
|
||||
// first entry lands, so the entry naturally identity-routes to
|
||||
@@ -74,7 +128,9 @@ export function useTimesheetCellMutations(
|
||||
'Another row with the same project, task, billable status and tags already exists.'
|
||||
);
|
||||
}
|
||||
markSaved(statusKey);
|
||||
} catch (err) {
|
||||
markError(statusKey);
|
||||
if (err instanceof NoFreeWindowError) {
|
||||
const friendlyDuration = formatHumanReadableDuration(
|
||||
err.requiredSeconds,
|
||||
@@ -93,7 +149,6 @@ export function useTimesheetCellMutations(
|
||||
'Failed to update timesheet',
|
||||
'Please try again later.'
|
||||
);
|
||||
throw err;
|
||||
} finally {
|
||||
queryClient.invalidateQueries({ queryKey: ['timeEntries'] });
|
||||
}
|
||||
@@ -316,5 +371,5 @@ export function useTimesheetCellMutations(
|
||||
return best;
|
||||
}
|
||||
|
||||
return { handleCellUpdate };
|
||||
return { handleCellUpdate, cellStatus, cellPendingSeconds };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user