Fix subpanels not showing correctly

This commit is contained in:
Jack Anderson 2024-12-10 14:10:41 +00:00
parent c9cfb5cc4e
commit 5ef4351996
2 changed files with 39 additions and 2 deletions

View file

@ -84,8 +84,8 @@ export class UserPreferenceStore implements StateStore {
protected localStorage: LocalStorageService,
) {
const uiSettings = config.getConfigValue('ui') ?? {};
const delay = uiSettings.user_preferences_save_delay ?? 5000;
this.saveBuffer$ = this.saveBufferStore.asObservable().pipe(debounceTime(delay ?? 5000));
const delay = uiSettings.user_preferences_save_delay ?? 2500;
this.saveBuffer$ = this.saveBufferStore.asObservable().pipe(debounceTime(delay ?? 2500));
this.subs.push(this.saveBuffer$.subscribe((value) => {
if (!value) {
return;

View file

@ -28,12 +28,15 @@
namespace App\UserPreferences\LegacyHandler;
use ApiPlatform\Exception\InvalidArgumentException;
use App\Engine\LegacyHandler\CacheManagerHandler;
use App\Engine\LegacyHandler\LegacyHandler;
use App\Engine\LegacyHandler\LegacyScopeState;
use App\Process\Entity\Process;
use App\Process\Service\ProcessHandlerInterface;
use Exception;
use Psr\Log\LoggerAwareInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\HttpFoundation\RequestStack;
class SaveUiPreferences extends LegacyHandler implements ProcessHandlerInterface, LoggerAwareInterface
{
@ -45,6 +48,38 @@ class SaveUiPreferences extends LegacyHandler implements ProcessHandlerInterface
*/
private $logger;
private CacheManagerHandler $cacheManagerHandler;
/**
* LegacyHandler constructor.
* @param string $projectDir
* @param string $legacyDir
* @param string $legacySessionName
* @param string $defaultSessionName
* @param LegacyScopeState $legacyScopeState
* @param RequestStack $requestStack
* @param CacheManagerHandler $cacheManagerHandler
*/
public function __construct(
string $projectDir,
string $legacyDir,
string $legacySessionName,
string $defaultSessionName,
LegacyScopeState $legacyScopeState,
RequestStack $requestStack,
CacheManagerHandler $cacheManagerHandler
) {
parent::__construct(
$projectDir,
$legacyDir,
$legacySessionName,
$defaultSessionName,
$legacyScopeState,
$requestStack
);
$this->cacheManagerHandler = $cacheManagerHandler;
}
/**
* @inheritDoc
*/
@ -130,6 +165,8 @@ class SaveUiPreferences extends LegacyHandler implements ProcessHandlerInterface
}
$this->close();
$this->cacheManagerHandler->markAsNeedsUpdate('app-metadata-user-preferences-' . $current_user->id);
}
/**