asab_webui_shell 27.2.4 → 27.2.6
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.
|
@@ -100,5 +100,52 @@ class I18nService extends _asab_webui_components.Service {
|
|
|
100
100
|
addSource(promise) {
|
|
101
101
|
this.Sources.push(promise);
|
|
102
102
|
}
|
|
103
|
+
|
|
104
|
+
/*
|
|
105
|
+
Adds a library source for localization.
|
|
106
|
+
@param {string} path - The path in the library.
|
|
107
|
+
Usage:
|
|
108
|
+
in the main.js file of the microfrontend application add the following line:
|
|
109
|
+
app.Services?.I18nService.addLibrarySource('path/to/localization');
|
|
110
|
+
|
|
111
|
+
All available translations are merged and the priority/precedence (when there are duplicate keys) is the following:
|
|
112
|
+
1. Library
|
|
113
|
+
2. Microfrontend (src/locales)
|
|
114
|
+
3. Container (public/locales)
|
|
115
|
+
*/
|
|
116
|
+
addLibrarySource() {
|
|
117
|
+
var _this2 = this;
|
|
118
|
+
var path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
119
|
+
var tenantService = this.App.Services.TenantService;
|
|
120
|
+
var basePath = path ? "/library/item/Localization/".concat(path) : "/library/item/Localization";
|
|
121
|
+
if (!tenantService) {
|
|
122
|
+
console.warn('TenantService not available, skipping Library localization source.');
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
this.Sources.push(/*#__PURE__*/function () {
|
|
126
|
+
var _ref3 = (0, _asyncToGenerator2.default)(function* (language, namespace) {
|
|
127
|
+
var currentTenant = tenantService.getCurrentTenant();
|
|
128
|
+
if (!currentTenant) {
|
|
129
|
+
console.debug('Current tenant not available, skipping Library localization source.');
|
|
130
|
+
return {};
|
|
131
|
+
}
|
|
132
|
+
try {
|
|
133
|
+
var ASABLibraryAPI = _this2.App.axiosCreate('asab-library');
|
|
134
|
+
var response = yield ASABLibraryAPI.get("".concat(basePath, "/").concat(language, "/").concat(namespace, ".json"), {
|
|
135
|
+
params: {
|
|
136
|
+
tenant: currentTenant
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
return response.data;
|
|
140
|
+
} catch (error) {
|
|
141
|
+
console.error("Failed to load localization from Library for ".concat(language, "/").concat(namespace, ":"), error.message);
|
|
142
|
+
return {};
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
return function (_x5, _x6) {
|
|
146
|
+
return _ref3.apply(this, arguments);
|
|
147
|
+
};
|
|
148
|
+
}());
|
|
149
|
+
}
|
|
103
150
|
}
|
|
104
151
|
exports.default = I18nService;
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
|
|
24
24
|
/* Needed for background color of status indicator widget */
|
|
25
25
|
html {
|
|
26
|
+
print-color-adjust: exact;
|
|
26
27
|
-webkit-print-color-adjust: exact;
|
|
27
28
|
}
|
|
28
29
|
|
|
@@ -166,7 +167,10 @@
|
|
|
166
167
|
|
|
167
168
|
|
|
168
169
|
.reports-container {
|
|
169
|
-
|
|
170
|
+
margin-top: 0 !important; /* Remove margin-top to prevent blank first page */
|
|
171
|
+
padding-top: 0 !important; /* Remove padding to prevent blank first page */
|
|
172
|
+
padding-bottom: 0 !important; /* Remove bottom padding to prevent blank spaces at the endof the sheet */
|
|
173
|
+
margin-bottom: 0 !important; /* Remove bottom margin to prevent blank spaces at the endof the sheet */
|
|
170
174
|
.react-grid-layout {
|
|
171
175
|
height: unset !important;
|
|
172
176
|
display: table;
|