asab_webui_shell 27.2.7 → 27.2.8-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -402,7 +402,14 @@ class Application extends _react.Component {
402
402
  for (var interceptor of this.WebSocketInterceptors.keys()) {
403
403
  // Avoid pushing undefined interceptor values
404
404
  if (interceptor) {
405
- subprotocols.push(interceptor);
405
+ /*
406
+ Interceptor should be a function that returns the current subprotocol value
407
+ Otherwise use the value directly (for backward compatibility)
408
+ */
409
+ var interceptorValue = typeof interceptor === 'function' ? interceptor() : interceptor;
410
+ if (interceptorValue) {
411
+ subprotocols.push(interceptorValue);
412
+ }
406
413
  }
407
414
  }
408
415
 
@@ -428,6 +435,7 @@ class Application extends _react.Component {
428
435
  this.setState(prevState => ({
429
436
  printReadyIndicators: prevState.printReadyIndicators + 1
430
437
  }));
438
+ console.log('print-ready', document.body.getAttribute('print-ready'), 'push');
431
439
  }
432
440
  popPrintReadyIndicator() {
433
441
  this.setState(prevState => {
@@ -439,6 +447,7 @@ class Application extends _react.Component {
439
447
  printReadyIndicators: Math.max(nextValue, 0)
440
448
  };
441
449
  });
450
+ console.log('print-ready', document.body.getAttribute('print-ready'), 'pop');
442
451
  }
443
452
  registerService(service) {
444
453
  if (service.Name in this.Services) {
@@ -489,11 +498,13 @@ class Application extends _react.Component {
489
498
  if (this.state.printReadyIndicators === 0) {
490
499
  document.body.setAttribute('print-ready', 'true');
491
500
  this._printReadyTimeout = null;
501
+ console.log('print-ready', document.body.getAttribute('print-ready'), 'set true');
492
502
  }
493
503
  }, 500); // Add 500ms delay to ensure that the print-ready attribute is set after the last print-ready indicator is popped
494
504
  } else {
495
505
  this._clearPrintReadyTimeout();
496
506
  document.body.setAttribute('print-ready', 'false');
507
+ console.log('print-ready', document.body.getAttribute('print-ready'), 'set false');
497
508
  }
498
509
  }
499
510
  componentWillUnmount() {
@@ -506,6 +517,7 @@ class Application extends _react.Component {
506
517
  }
507
518
  this._clearPrintReadyTimeout();
508
519
  document.body.removeAttribute('print-ready');
520
+ console.log('print-ready', document.body.getAttribute('print-ready'), 'unmount removed');
509
521
  }
510
522
  _clearPrintReadyTimeout() {
511
523
  if (this._printReadyTimeout !== null) {
@@ -541,6 +553,7 @@ class Application extends _react.Component {
541
553
  var splashscreen = document.getElementById('app-splashscreen'); // See public/index.html
542
554
  splashscreen === null || splashscreen === void 0 || splashscreen.classList.add("d-none");
543
555
  // Decrement print-ready indicator value if no splash screen requestors are present
556
+ console.log('print-ready', document.body.getAttribute('print-ready'), 'splash last removed, pop');
544
557
  this.popPrintReadyIndicator();
545
558
  }
546
559
  }
@@ -195,7 +195,8 @@ class AuthModule extends _asab_webui_components.Module {
195
195
  return interceptor;
196
196
  }
197
197
  webSocketAuthInterceptor() {
198
- return "access_token_".concat(this.OAuthTokens['access_token']);
198
+ // Return a function to ensure that the token is always current and not static
199
+ return () => "access_token_".concat(this.OAuthTokens['access_token']);
199
200
  }
200
201
  simulateUserinfo(mock_userinfo) {
201
202
  var _this2 = this;
@@ -36,15 +36,18 @@ function UnauthorizedAccessScreen(props) {
36
36
  if (!isAuthorized) {
37
37
  document.body.setAttribute('print-ready', 'true');
38
38
  document.body.setAttribute('print-unauthorized', 'true');
39
+ console.log('print-ready', document.body.getAttribute('print-ready'), 'UnauthorizedAccessScreen set true');
39
40
  } else {
40
41
  document.body.removeAttribute('print-ready');
41
42
  document.body.removeAttribute('print-unauthorized');
43
+ console.log('print-ready', document.body.getAttribute('print-ready'), 'UnauthorizedAccessScreen cleared');
42
44
  }
43
45
 
44
46
  // Cleanup function to remove the attributes when the component unmounts
45
47
  return () => {
46
48
  document.body.removeAttribute('print-ready');
47
49
  document.body.removeAttribute('print-unauthorized');
50
+ console.log('print-ready', document.body.getAttribute('print-ready'), 'UnauthorizedAccessScreen cleanup');
48
51
  };
49
52
  }, [isAuthorized]);
50
53
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asab_webui_shell",
3
- "version": "27.2.7",
3
+ "version": "27.2.8-alpha.0",
4
4
  "license": "BSD-3-Clause",
5
5
  "description": "TeskaLabs ASAB WebUI Shell Application",
6
6
  "contributors": [