UNPKG

@netgrif/components

Version:

Netgrif Application Engine frontend Angular components

35 lines 2.07 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createDashboardView = void 0; const schematics_1 = require("@angular-devkit/schematics"); const core_1 = require("@angular-devkit/core"); const utility_functions_1 = require("../../../../_utility/utility-functions"); const view_utility_functions_1 = require("../../../_utility/view-utility-functions"); const view_service_functions_1 = require("../../../_utility/view-service-functions"); const view_class_info_1 = require("../../../../_commons/view-class-info"); const import_to_add_1 = require("../../../../_commons/import-to-add"); function createDashboardView(tree, args, addViewToService) { const projectInfo = (0, utility_functions_1.getProjectInfo)(tree); const rules = []; const view = new view_class_info_1.ViewClassInfo(args.path, args.viewType, args.componentName); rules.push((0, utility_functions_1.createFilesFromTemplates)('./views/dashboard-view/files', `${projectInfo.path}/views/${args.path}`, { prefix: projectInfo.projectPrefixDasherized, className: view.nameWithoutComponent, webPath: args.path, dasherize: core_1.strings.dasherize, classify: core_1.strings.classify, configName: projectInfo.projectNameClassified, configImportPath: (0, utility_functions_1.createRelativePath)(view.fileImportPath, `./${projectInfo.projectNameDasherized}-configuration.service`), viewIdSegment: (0, view_utility_functions_1.getViewIdSegmentFromPath)(args.path) })); (0, view_utility_functions_1.updateAppModule)(tree, view.className, view.fileImportPath, [ new import_to_add_1.ImportToAdd('DashboardComponentModule', '@netgrif/components'), new import_to_add_1.ImportToAdd('PieChartModule', '@swimlane/ngx-charts') ]); if (addViewToService) { (0, view_service_functions_1.addViewToViewService)(tree, view); } return (0, schematics_1.chain)(rules); } exports.createDashboardView = createDashboardView; //# sourceMappingURL=create-dashboard-view.js.map