asab_webui_shell 28.0.1 → 28.1.0-alpha.1

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.
@@ -32,6 +32,7 @@ var _HeaderService = _interopRequireDefault(require("../services/HeaderService")
32
32
  var _ThemeService = _interopRequireDefault(require("../theme/ThemeService"));
33
33
  var _BrandingService = _interopRequireDefault(require("../services/BrandingService"));
34
34
  var _TitleService = _interopRequireDefault(require("../services/TitleService"));
35
+ var _ManifestService = _interopRequireDefault(require("../services/ManifestService"));
35
36
  var _HelpService = _interopRequireDefault(require("./Header/Help/HelpService"));
36
37
  var _AccessDeniedCard = _interopRequireDefault(require("../modules/tenant/access/AccessDeniedCard"));
37
38
  var _LoginLoopCard = require("../modules/auth/components/LoginLoopCard");
@@ -70,6 +71,7 @@ class Application extends _react.Component {
70
71
  this.ThemeService = new _ThemeService.default(this, "ThemeService");
71
72
  this.BrandingService = new _BrandingService.default(this, "BrandingService");
72
73
  this.TitleService = new _TitleService.default(this, "TitleService");
74
+ this.ManifestService = new _ManifestService.default(this, "ManifestService");
73
75
  this.HelpService = new _HelpService.default(this, "HelpService");
74
76
 
75
77
  // The application can provide a list of keys that should be automatically parsed as BigInt, when received from the server in Axios call
@@ -508,6 +510,9 @@ class Application extends _react.Component {
508
510
  }
509
511
  this.Services[service.Name] = service;
510
512
  }
513
+ registerManifest(entry) {
514
+ this.Services.ManifestService?.register(entry);
515
+ }
511
516
  locateService(name) {
512
517
  if (!name in this.Services) {
513
518
  console.warn(`Service ${name} doesn't exist.`);
@@ -52,8 +52,9 @@ var _default = exports.default = AboutScreen;
52
52
  }
53
53
 
54
54
  */
55
- // TODO: add info about version release and date of the release
56
- function AboutCard(props) {
55
+ function AboutCard({
56
+ app
57
+ }) {
57
58
  const {
58
59
  t
59
60
  } = (0, _reactI18next.useTranslation)();
@@ -61,6 +62,7 @@ function AboutCard(props) {
61
62
  const vendor = (0, _asab_webui_components.useAppSelector)(state => state.config?.vendor);
62
63
  const website = (0, _asab_webui_components.useAppSelector)(state => state.config?.website);
63
64
  const email = (0, _asab_webui_components.useAppSelector)(state => state.config?.email);
65
+ const manifests = app?.Services?.ManifestService?.getAll?.() ?? [];
64
66
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactstrap.Card, {
65
67
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.CardHeader, {
66
68
  className: "card-header-flex",
@@ -110,7 +112,30 @@ function AboutCard(props) {
110
112
  })
111
113
  })]
112
114
  })
113
- })]
115
+ }), manifests.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
116
+ className: "list-group-item",
117
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("h5", {
118
+ className: "py-2 mb-0",
119
+ children: t('AboutCard|Application versions')
120
+ })
121
+ }), manifests.map(entry => /*#__PURE__*/(0, _jsxRuntime.jsxs)("li", {
122
+ className: "list-group-item",
123
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactstrap.Row, {
124
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.Col, {
125
+ className: "fw-semibold",
126
+ children: entry.displayName ?? entry.id
127
+ }), entry.version && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.Col, {
128
+ children: entry.version
129
+ })]
130
+ }), entry.created_at && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactstrap.Row, {
131
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.Col, {
132
+ className: "col-6",
133
+ children: t('AboutCard|Built at')
134
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.Col, {
135
+ children: entry.created_at
136
+ })]
137
+ })]
138
+ }, entry.id))]
114
139
  })]
115
140
  });
116
141
  }
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _asab_webui_components = require("asab_webui_components");
8
+ /*
9
+ Registry of build-time manifests from the host and loaded microfrontends.
10
+ Each federated app registers in its Module constructor via app.registerManifest(...).
11
+ */
12
+ class ManifestService extends _asab_webui_components.Service {
13
+ constructor(app, serviceName = 'ManifestService') {
14
+ super(app, serviceName);
15
+ this._manifests = new Map();
16
+ }
17
+
18
+ /**
19
+ * @param {Object} entry
20
+ * @param {string} entry.id - Stable id (e.g. Module Federation name)
21
+ * @param {string} [entry.displayName] - Human-readable name; defaults to id
22
+ * @param {string} [entry.version] - Version / git describe tag
23
+ * @param {string} [entry.created_at] - Build time (UTC ISO)
24
+ */
25
+ register(entry) {
26
+ if (entry == null || typeof entry !== 'object') {
27
+ console.warn('ManifestService: manifest entry must be an object');
28
+ return;
29
+ }
30
+ const id = entry.id;
31
+ if (id == null || String(id).trim() === '') {
32
+ console.warn('ManifestService: manifest entry requires a non-empty id');
33
+ return;
34
+ }
35
+ const key = String(id);
36
+ const existing = this._manifests.get(key);
37
+ const displayName = entry.displayName ?? entry.name ?? existing?.displayName ?? key;
38
+ this._manifests.set(key, {
39
+ ...existing,
40
+ ...entry,
41
+ id: key,
42
+ displayName
43
+ });
44
+ }
45
+ get(id) {
46
+ if (id == null) {
47
+ return undefined;
48
+ }
49
+ return this._manifests.get(String(id));
50
+ }
51
+
52
+ /** All registered manifests, sorted by displayName then id. */
53
+ getAll() {
54
+ return [...this._manifests.values()].sort((a, b) => {
55
+ const nameCmp = String(a.displayName).localeCompare(String(b.displayName));
56
+ if (nameCmp !== 0) {
57
+ return nameCmp;
58
+ }
59
+ return String(a.id).localeCompare(String(b.id));
60
+ });
61
+ }
62
+ }
63
+ exports.default = ManifestService;
@@ -81,11 +81,6 @@
81
81
  position: fixed !important;
82
82
  }
83
83
 
84
- /* Temporal monaco workaround for not displaying the shortcut tooltips (e.g. o ctr+f) until this monaco issue is resolved (monaco-editor #5208) */
85
- .workbench-hover-container {
86
- display: none !important;
87
- }
88
-
89
84
  .cursor-pointer {
90
85
  cursor: pointer;
91
86
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asab_webui_shell",
3
- "version": "28.0.1",
3
+ "version": "28.1.0-alpha.1",
4
4
  "license": "BSD-3-Clause",
5
5
  "description": "TeskaLabs ASAB WebUI Shell Application",
6
6
  "contributors": [