import { loadModules, packages } from "./modules";
import { memoize } from "lodash";
import pkg from "../package.json";
import { ensureArray } from "@openimis/fe-core";
class ModulesManager {
constructor(cfg) {
this.cfg = cfg;
this.modules = loadModules(cfg);
this.contributionsCache = {};
this.controlsCache = this.buildControlsCache();
this.refsCache = this.buildRefsCache();
this.reportsCache = this.buildReportsCache();
}
buildControlsCache() {
const ctrls = {};
for (var k in this.cfg) {
if (!!this.cfg[k].controls) {
for (var i in this.cfg[k].controls) {
var c = this.cfg[k].controls[i];
ctrls[k + "." + c["field"]] = c["usage"];
}
}
}
return ctrls;
}
Failed to compile.
./src/ModulesManager.js Attempted import error: 'loadModules' is not exported from './modules'.
error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.