Skip to content

Commit

Permalink
Merge pull request #128 from openimis/fix/merge-develop-to-release-br…
Browse files Browse the repository at this point in the history
…anch

fix: merge develop branch to the release one
  • Loading branch information
delcroip authored Apr 12, 2024
2 parents 9a0176b + 85d9387 commit 70777dc
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 20 deletions.
24 changes: 15 additions & 9 deletions modules-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,21 @@ export const packages = [
`);

stream.write(`
export function loadModules (cfg = {}) {
return [
${modules
.map(
({ name, logicalName, moduleName }) =>
`require("${moduleName}").${name ?? "default"}(cfg["${logicalName}"] || {})`,
)
.join(",\n ")}
];\n
export function loadModules(cfg = {}) {
const loadedModules = [];
${modules
.map(({ name, logicalName, moduleName }) => {
return `
try {
loadedModules.push(require("${moduleName}").${name ?? "default"}(cfg["${logicalName}"] || {}));
} catch (error) {
alert(\`Failed to load module "${moduleName}". More details can be found in the developer console. Look for: \${error}\`);
console.error(error);
}
`;
})
.join("")}
return loadedModules;
}
`);

Expand Down
24 changes: 15 additions & 9 deletions openimis-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,21 @@ export const packages = [
`);

stream.write(`
export function loadModules (cfg = {}) {
return [
${modules
.map(
({ name, logicalName, moduleName }) =>
`require("${moduleName}").${name ?? "default"}(cfg["${logicalName}"] || {})`,
)
.join(",\n ")}
];\n
export function loadModules(cfg = {}) {
const loadedModules = [];
${modules
.map(({ name, logicalName, moduleName }) => {
return `
try {
loadedModules.push(require("${moduleName}").${name ?? "default"}(cfg["${logicalName}"] || {}));
} catch (error) {
alert(\`Failed to load module "${moduleName}". More details can be found in the developer console. Look for: \${error}\`);
console.error(error);
}
`;
})
.join("")}
return loadedModules;
}
`);

Expand Down
4 changes: 2 additions & 2 deletions src/translations/ref.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@
"validation.maxValue": "{value} above allowed {max}",
"addTooltip": "Create new",
"saveTooltip": "Save changes",
"resetFilterTooltip": "Reset search criteria",
"refreshFilterTooltip": "Search again"
"resetFilterTooltip": "Reset filters",
"refreshFilterTooltip": "Search"
}

0 comments on commit 70777dc

Please sign in to comment.