asab_webui_shell 28.1.0-alpha.1 → 28.1.0-alpha.3

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.
@@ -12,25 +12,31 @@ var _BrandImage = require("../../components/branding/BrandImage");
12
12
  var _reactstrap = require("reactstrap");
13
13
  var _jsxRuntime = require("react/jsx-runtime");
14
14
  function AboutScreen(props) {
15
- const [brandImage, setBrandImage] = (0, _react.useState)(undefined);
16
15
  const theme = (0, _asab_webui_components.useAppSelector)(state => state.theme);
17
- (0, _react.useEffect)(() => {
16
+ const [brandImage, setBrandImage] = (0, _react.useState)(null);
17
+ (0, _react.useLayoutEffect)(() => {
18
18
  setBrandImage((0, _BrandImage.getBrandImage)(props, theme));
19
19
  }, [theme]);
20
20
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.Container, {
21
- className: "pt-5",
21
+ className: "h-100",
22
22
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.Row, {
23
- className: "justify-content-center",
23
+ className: "justify-content-center h-100 pt-4",
24
24
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactstrap.Col, {
25
25
  md: "6",
26
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
27
- className: "my-4",
28
- children: brandImage ? /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
29
- src: brandImage?.full,
26
+ className: "d-flex flex-column gap-4 h-100 min-vh-0",
27
+ children: [brandImage && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
28
+ style: {
29
+ height: '8rem'
30
+ },
31
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
32
+ src: brandImage.full,
30
33
  alt: "TeskaLabs logo"
31
- }) : null
32
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(AboutCard, {
33
- app: props.app
34
+ })
35
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(AboutCard, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
36
+ className: "flex-grow-1",
37
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ApplicationManifestsCard, {
38
+ app: props.app
39
+ })
34
40
  })]
35
41
  })
36
42
  })
@@ -52,9 +58,7 @@ var _default = exports.default = AboutScreen;
52
58
  }
53
59
 
54
60
  */
55
- function AboutCard({
56
- app
57
- }) {
61
+ function AboutCard() {
58
62
  const {
59
63
  t
60
64
  } = (0, _reactI18next.useTranslation)();
@@ -62,7 +66,6 @@ function AboutCard({
62
66
  const vendor = (0, _asab_webui_components.useAppSelector)(state => state.config?.vendor);
63
67
  const website = (0, _asab_webui_components.useAppSelector)(state => state.config?.website);
64
68
  const email = (0, _asab_webui_components.useAppSelector)(state => state.config?.email);
65
- const manifests = app?.Services?.ManifestService?.getAll?.() ?? [];
66
69
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactstrap.Card, {
67
70
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.CardHeader, {
68
71
  className: "card-header-flex",
@@ -112,30 +115,94 @@ function AboutCard({
112
115
  })
113
116
  })]
114
117
  })
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))]
118
+ })]
139
119
  })]
140
120
  });
121
+ }
122
+ function ApplicationManifestsCard({
123
+ app
124
+ }) {
125
+ const {
126
+ t
127
+ } = (0, _reactI18next.useTranslation)();
128
+ const manifestService = app?.Services?.ManifestService;
129
+ const loader = async ({
130
+ params
131
+ }) => {
132
+ const {
133
+ count,
134
+ data
135
+ } = manifestService?.list?.(params) ?? {
136
+ count: 0,
137
+ data: []
138
+ };
139
+ return {
140
+ count,
141
+ rows: data
142
+ };
143
+ };
144
+ const columns = [{
145
+ title: t('General|Name'),
146
+ tdStyle: {
147
+ width: '8rem',
148
+ maxWidth: '12rem'
149
+ },
150
+ render: ({
151
+ row
152
+ }) => {
153
+ const label = row.displayName ?? row.id;
154
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
155
+ className: "fw-semibold d-block text-truncate",
156
+ title: label,
157
+ children: label
158
+ });
159
+ }
160
+ }, {
161
+ title: t('AboutCard|Tag'),
162
+ tdStyle: {
163
+ width: '8rem',
164
+ maxWidth: '12rem'
165
+ },
166
+ render: ({
167
+ row
168
+ }) => {
169
+ const tag = row.version ?? '';
170
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
171
+ className: "d-block text-truncate",
172
+ title: tag,
173
+ children: tag
174
+ });
175
+ }
176
+ }, {
177
+ title: t('AboutCard|Built at'),
178
+ tdStyle: {
179
+ width: '8rem',
180
+ maxWidth: '12rem'
181
+ },
182
+ render: ({
183
+ row
184
+ }) => {
185
+ const builtAt = row.created_at ?? '';
186
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
187
+ className: "d-block text-truncate",
188
+ title: builtAt,
189
+ children: builtAt
190
+ });
191
+ }
192
+ }];
193
+ const Header = () => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
194
+ className: "flex-fill",
195
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("h3", {
196
+ children: t('AboutCard|Application versions')
197
+ })
198
+ });
199
+ if (!manifestService || manifestService.isEmpty()) {
200
+ return null;
201
+ }
202
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_asab_webui_components.DataTableCard2, {
203
+ columns: columns,
204
+ loader: loader,
205
+ header: /*#__PURE__*/(0, _jsxRuntime.jsx)(Header, {}),
206
+ disableParams: true
207
+ });
141
208
  }
@@ -14,43 +14,38 @@ class ManifestService extends _asab_webui_components.Service {
14
14
  super(app, serviceName);
15
15
  this._manifests = new Map();
16
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
17
  register(entry) {
26
18
  if (entry == null || typeof entry !== 'object') {
27
19
  console.warn('ManifestService: manifest entry must be an object');
28
20
  return;
29
21
  }
30
- const id = entry.id;
31
- if (id == null || String(id).trim() === '') {
22
+ const manifestId = String(entry.id ?? '').trim();
23
+ if (!manifestId) {
32
24
  console.warn('ManifestService: manifest entry requires a non-empty id');
33
25
  return;
34
26
  }
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,
27
+ this._manifests.set(manifestId, {
40
28
  ...entry,
41
- id: key,
42
- displayName
29
+ id: manifestId,
30
+ displayName: entry.displayName ?? manifestId
43
31
  });
44
32
  }
45
- get(id) {
46
- if (id == null) {
47
- return undefined;
48
- }
49
- return this._manifests.get(String(id));
33
+ isEmpty() {
34
+ return this._manifests.size === 0;
50
35
  }
51
36
 
52
- /** All registered manifests, sorted by displayName then id. */
53
- getAll() {
37
+ /** Paginated list for DataTable loaders (`p` = page, `i` = limit per page). */
38
+ list(params = {}) {
39
+ const all = this._getSortedManifests();
40
+ const page = Math.max(1, parseInt(params.p, 10) || 1);
41
+ const limit = Math.max(1, parseInt(params.i, 10) || 10);
42
+ const start = (page - 1) * limit;
43
+ return {
44
+ count: all.length,
45
+ data: all.slice(start, start + limit)
46
+ };
47
+ }
48
+ _getSortedManifests() {
54
49
  return [...this._manifests.values()].sort((a, b) => {
55
50
  const nameCmp = String(a.displayName).localeCompare(String(b.displayName));
56
51
  if (nameCmp !== 0) {
@@ -81,6 +81,11 @@
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
+
84
89
  .cursor-pointer {
85
90
  cursor: pointer;
86
91
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asab_webui_shell",
3
- "version": "28.1.0-alpha.1",
3
+ "version": "28.1.0-alpha.3",
4
4
  "license": "BSD-3-Clause",
5
5
  "description": "TeskaLabs ASAB WebUI Shell Application",
6
6
  "contributors": [