From 98d18350e703c7ca3b068e35bf1c071dc060f5d4 Mon Sep 17 00:00:00 2001 From: TeterinaSvetlana <40786685+TeterinaSvetlana@users.noreply.github.com> Date: Thu, 6 Feb 2020 13:33:02 +0500 Subject: [PATCH] Fix errors --- blueprints/flexberry-edit-form/index.js | 36 +++++++++++--------- blueprints/flexberry-edit-form/index.ts | 42 +++++++++++++---------- blueprints/flexberry-list-form/index.js | 36 +++++++++++--------- blueprints/flexberry-list-form/index.ts | 44 ++++++++++++++----------- 4 files changed, 89 insertions(+), 69 deletions(-) diff --git a/blueprints/flexberry-edit-form/index.js b/blueprints/flexberry-edit-form/index.js index 2881d1b2e4..1d61100560 100644 --- a/blueprints/flexberry-edit-form/index.js +++ b/blueprints/flexberry-edit-form/index.js @@ -82,10 +82,10 @@ module.exports = { parentRoute: editFormBlueprint.parentRoute, flexberryComponents: editFormBlueprint.flexberryComponents, functionGetCellComponent: editFormBlueprint.functionGetCellComponent, - importFormRouteName: editFormBlueprint.importFormRoute.name, - importFormRoutePath: editFormBlueprint.importFormRoute.path, - importFormControllerName: editFormBlueprint.importFormController.name, - importFormControllerPath: editFormBlueprint.importFormController.path, + importFormRouteName: editFormBlueprint.importFormRouteName, + importFormRoutePath: editFormBlueprint.importFormRoutePath, + importFormControllerName: editFormBlueprint.importFormControllerName, + importFormControllerPath: editFormBlueprint.importFormControllerPath, }, editFormBlueprint.locales.getLodashVariablesProperties() // for use in files\__root__\locales\**\forms\__name__.js ); } @@ -124,25 +124,29 @@ var EditFormBlueprint = /** @class */ (function () { if (fs.existsSync(configsFile)) { var configs = JSON.parse(stripBom(fs.readFileSync(configsFile, "utf8"))); if (configs.editForms == undefined) { - this.importFormRoute.name = 'EditFormRoute'; - this.importFormRoute.path = 'ember-flexberry/routes/edit-form'; - this.importFormController.name = 'EditFormController'; - this.importFormController.path = 'ember-flexberry/controllers/edit-form'; + this.importFormRouteName = 'EditFormRoute'; + this.importFormRoutePath = 'ember-flexberry/routes/edit-form'; + this.importFormControllerName = 'EditFormController'; + this.importFormControllerPath = 'ember-flexberry/controllers/edit-form'; } else { if (configs.editForms[options.entity.name] != undefined) { - this.importFormRoute = configs.editForms[options.entity.name].baseRoute; - this.importFormController = configs.editForms[options.entity.name].baseController; + this.importFormRouteName = configs.editForms[options.entity.name].baseRoute.name; + this.importFormRoutePath = configs.editForms[options.entity.name].baseRoute.path; + this.importFormControllerName = configs.editForms[options.entity.name].baseController.name; + this.importFormControllerPath = configs.editForms[options.entity.name].baseController.path; } else if (configs.editForms.defaultForm != undefined) { - this.importFormRoute = configs.editForms.defaultForm.baseRoute; - this.importFormController = configs.editForms.defaultForm.baseController; + this.importFormRouteName = configs.editForms.defaultForm.baseRoute.name; + this.importFormRoutePath = configs.editForms.defaultForm.baseRoute.path; + this.importFormControllerName = configs.editForms.defaultForm.baseController.name; + this.importFormControllerPath = configs.editForms.defaultForm.baseController.path; }; }; } else { - this.importFormRoute.name = 'EditFormRoute'; - this.importFormRoute.path = 'ember-flexberry/routes/edit-form'; - this.importFormController.name = 'EditFormController'; - this.importFormController.path = 'ember-flexberry/controllers/edit-form'; + this.importFormRouteName = 'EditFormRoute'; + this.importFormRoutePath = 'ember-flexberry/routes/edit-form'; + this.importFormControllerName = 'EditFormController'; + this.importFormControllerPath = 'ember-flexberry/controllers/edit-form'; }; } EditFormBlueprint.prototype.readSnippetFile = function (fileName, fileExt) { diff --git a/blueprints/flexberry-edit-form/index.ts b/blueprints/flexberry-edit-form/index.ts index b186fab5e3..0bc868532b 100644 --- a/blueprints/flexberry-edit-form/index.ts +++ b/blueprints/flexberry-edit-form/index.ts @@ -87,10 +87,10 @@ module.exports = { parentRoute: editFormBlueprint.parentRoute,// for use in files\__root__\controllers\__name__.js flexberryComponents: editFormBlueprint.flexberryComponents,// for use in files\__root__\templates\__name__.hbs functionGetCellComponent: editFormBlueprint.functionGetCellComponent,// for use in files\__root__\controllers\__name__.js - importFormRouteName: editFormBlueprint.importFormRoute.name, - importFormRoutePath: editFormBlueprint.importFormRoute.path, - importFormControllerName: editFormBlueprint.importFormController.name, - importFormControllerPath: editFormBlueprint.importFormController.path, + importFormRouteName: editFormBlueprint.importFormRouteName, + importFormRoutePath: editFormBlueprint.importFormRoutePath, + importFormControllerName: editFormBlueprint.importFormControllerName, + importFormControllerPath: editFormBlueprint.importFormControllerPath, }, editFormBlueprint.locales.getLodashVariablesProperties()// for use in files\__root__\locales\**\forms\__name__.js ); @@ -108,8 +108,10 @@ class EditFormBlueprint { private modelsDir: string; private blueprint; private options; - importFormRoute: any; - importFormController: any; + importFormRouteName: string; + importFormRoutePath: string; + importFormControllerName: string; + importFormControllerPath: any; constructor(blueprint, options) { this.blueprint = blueprint; @@ -139,25 +141,29 @@ class EditFormBlueprint { if (fs.existsSync(configsFile)) { var configs = JSON.parse(stripBom(fs.readFileSync(configsFile, "utf8"))); if (configs.editForms == undefined) { - this.importFormRoute.name = 'EditFormRoute'; - this.importFormRoute.path = 'ember-flexberry/routes/edit-form'; - this.importFormController.name = 'EditFormController'; - this.importFormController.path = 'ember-flexberry/controllers/edit-form'; + this.importFormRouteName = 'EditFormRoute'; + this.importFormRoutePath = 'ember-flexberry/routes/edit-form'; + this.importFormControllerName = 'EditFormController'; + this.importFormControllerPath = 'ember-flexberry/controllers/edit-form'; } else { if (configs.editForms[options.entity.name] != undefined) { - this.importFormRoute = configs.editForms[options.entity.name].baseRoute; - this.importFormController = configs.editForms[options.entity.name].baseController; + this.importFormRouteName = configs.editForms[options.entity.name].baseRoute.name; + this.importFormRoutePath = configs.editForms[options.entity.name].baseRoute.path; + this.importFormControllerName = configs.editForms[options.entity.name].baseController.name; + this.importFormControllerPath = configs.editForms[options.entity.name].baseController.path; } else if (configs.editForms.defaultForm != undefined) { - this.importFormRoute = configs.editForms.defaultForm.baseRoute; - this.importFormController = configs.editForms.defaultForm.baseController; + this.importFormRouteName = configs.editForms.defaultForm.baseRoute.name; + this.importFormRoutePath = configs.editForms.defaultForm.baseRoute.path; + this.importFormControllerName = configs.editForms.defaultForm.baseController.name; + this.importFormControllerPath = configs.editForms.defaultForm.baseController.path; }; }; } else { - this.importFormRoute.name = 'EditFormRoute'; - this.importFormRoute.path = 'ember-flexberry/routes/edit-form'; - this.importFormController.name = 'EditFormController'; - this.importFormController.path = 'ember-flexberry/controllers/edit-form'; + this.importFormRouteName = 'EditFormRoute'; + this.importFormRoutePath = 'ember-flexberry/routes/edit-form'; + this.importFormControllerName = 'EditFormController'; + this.importFormControllerPath = 'ember-flexberry/controllers/edit-form'; }; } diff --git a/blueprints/flexberry-list-form/index.js b/blueprints/flexberry-list-form/index.js index b403e2d006..4fbd82df48 100644 --- a/blueprints/flexberry-list-form/index.js +++ b/blueprints/flexberry-list-form/index.js @@ -68,10 +68,10 @@ module.exports = { modelName: listFormBlueprint.listForm.projections[0].modelName, modelProjection: listFormBlueprint.listForm.projections[0].modelProjection, caption: listFormBlueprint.listForm.caption, // for use in files\__root__\templates\__name__.hbs - importFormRouteName: listFormBlueprint.importFormRoute.name, - importFormRoutePath: listFormBlueprint.importFormRoute.path, - importFormControllerName: listFormBlueprint.importFormController.name, - importFormControllerPath: listFormBlueprint.importFormController.path, + importFormRouteName: listFormBlueprint.importFormRouteName, + importFormRoutePath: listFormBlueprint.importFormRoutePath, + importFormControllerName: listFormBlueprint.importFormControllerName, + importFormControllerPath: listFormBlueprint.importFormControllerPath, }, listFormBlueprint.locales.getLodashVariablesProperties() // for use in files\__root__\locales\**\forms\__name__.js ); } @@ -93,25 +93,29 @@ var ListFormBlueprint = /** @class */ (function () { if (fs.existsSync(configsFile)) { var configs = JSON.parse(stripBom(fs.readFileSync(configsFile, "utf8"))); if (configs.listForms == undefined) { - this.importFormRoute.name = 'ListFormRoute'; - this.importFormRoute.path = 'ember-flexberry/routes/list-form'; - this.importFormController.name = 'ListFormController'; - this.importFormController.path = 'ember-flexberry/controllers/list-form'; + this.importFormRouteName = 'ListFormRoute'; + this.importFormRoutePath = 'ember-flexberry/routes/list-form'; + this.importFormControllerName = 'ListFormController'; + this.importFormControllerPath = 'ember-flexberry/controllers/list-form'; } else { if (configs.listForms[options.entity.name] != undefined) { - this.importFormRoute = configs.listForms[options.entity.name].baseRoute; - this.importFormController = configs.listForms[options.entity.name].baseController; + this.importFormRouteName = configs.listForms[options.entity.name].baseRoute.name; + this.importFormRoutePath = configs.listForms[options.entity.name].baseRoute.path; + this.importFormControllerName = configs.listForms[options.entity.name].baseController.name; + this.importFormControllerPath = configs.listForms[options.entity.name].baseController.path; } else if (configs.listForms.defaultForm != undefined) { - this.importFormRoute = configs.listForms.defaultForm.baseRoute; - this.importFormController = configs.listForms.defaultForm.baseController; + this.importFormRouteName = configs.listForms.defaultForm.baseRoute.name; + this.importFormRoutePath = configs.listForms.defaultForm.baseRoute.path; + this.importFormControllerName = configs.listForms.defaultForm.baseController.name; + this.importFormControllerPath = configs.listForms.defaultForm.baseController.path; }; }; } else { - this.importFormRoute.name = 'ListFormRoute'; - this.importFormRoute.path = 'ember-flexberry/routes/list-form'; - this.importFormController.name = 'ListFormController'; - this.importFormController.path = 'ember-flexberry/controllers/list-form'; + this.importFormRouteName = 'ListFormRoute'; + this.importFormRoutePath = 'ember-flexberry/routes/list-form'; + this.importFormControllerName = 'ListFormController'; + this.importFormControllerPath = 'ember-flexberry/controllers/list-form'; }; } ListFormBlueprint.prototype.getLocalePathTemplate = function (options, isDummy, localePathSuffix) { diff --git a/blueprints/flexberry-list-form/index.ts b/blueprints/flexberry-list-form/index.ts index 406bcb15b1..3367d8589f 100644 --- a/blueprints/flexberry-list-form/index.ts +++ b/blueprints/flexberry-list-form/index.ts @@ -72,10 +72,10 @@ module.exports = { modelName: listFormBlueprint.listForm.projections[0].modelName,// for use in files\__root__\templates\__name__.hbs, files\__root__\routes\__name__.js modelProjection: listFormBlueprint.listForm.projections[0].modelProjection,// for use in files\__root__\routes\__name__.js caption: listFormBlueprint.listForm.caption,// for use in files\__root__\templates\__name__.hbs - importFormRouteName: listFormBlueprint.importFormRoute.name, - importFormRoutePath: listFormBlueprint.importFormRoute.path, - importFormControllerName: listFormBlueprint.importFormController.name, - importFormControllerPath: listFormBlueprint.importFormController.path, + importFormRouteName: listFormBlueprint.importFormRouteName, + importFormRoutePath: listFormBlueprint.importFormRoutePath, + importFormControllerName: listFormBlueprint.importFormControllerName, + importFormControllerPath: listFormBlueprint.importFormControllerPath, }, listFormBlueprint.locales.getLodashVariablesProperties()// for use in files\__root__\locales\**\forms\__name__.js ); @@ -84,9 +84,11 @@ module.exports = { class ListFormBlueprint { locales: Locales; - listForm: metadata.ListForm; - importFormRoute: any; - importFormController: any; + listForm: metadata.ListForm; + importFormRouteName: string; + importFormRoutePath: string; + importFormControllerName: string; + importFormControllerPath: string; constructor(blueprint, options) { let listFormsDir = path.join(options.metadataDir, "list-forms"); @@ -104,25 +106,29 @@ class ListFormBlueprint { if (fs.existsSync(configsFile)) { var configs = JSON.parse(stripBom(fs.readFileSync(configsFile, "utf8"))); if (configs.listForms == undefined) { - this.importFormRoute.name = 'ListFormRoute'; - this.importFormRoute.path = 'ember-flexberry/routes/list-form'; - this.importFormController.name = 'ListFormController'; - this.importFormController.path = 'ember-flexberry/controllers/list-form'; + this.importFormRouteName = 'ListFormRoute'; + this.importFormRoutePath = 'ember-flexberry/routes/list-form'; + this.importFormControllerName = 'ListFormController'; + this.importFormControllerPath = 'ember-flexberry/controllers/list-form'; } else { if (configs.listForms[options.entity.name] != undefined) { - this.importFormRoute = configs.listForms[options.entity.name].baseRoute; - this.importFormController = configs.listForms[options.entity.name].baseController; + this.importFormRouteName = configs.listForms[options.entity.name].baseRoute.name; + this.importFormRoutePath = configs.listForms[options.entity.name].baseRoute.path; + this.importFormControllerName = configs.listForms[options.entity.name].baseController.name; + this.importFormControllerPath = configs.listForms[options.entity.name].baseController.path; } else if (configs.listForms.defaultForm != undefined) { - this.importFormRoute = configs.listForms.defaultForm.baseRoute; - this.importFormController = configs.listForms.defaultForm.baseController; + this.importFormRouteName = configs.listForms.defaultForm.baseRoute.name; + this.importFormRoutePath = configs.listForms.defaultForm.baseRoute.path; + this.importFormControllerName = configs.listForms.defaultForm.baseController.name; + this.importFormControllerPath = configs.listForms.defaultForm.baseController.path; }; }; } else { - this.importFormRoute.name = 'ListFormRoute'; - this.importFormRoute.path = 'ember-flexberry/routes/list-form'; - this.importFormController.name = 'ListFormController'; - this.importFormController.path = 'ember-flexberry/controllers/list-form'; + this.importFormRouteName = 'ListFormRoute'; + this.importFormRoutePath = 'ember-flexberry/routes/list-form'; + this.importFormControllerName = 'ListFormController'; + this.importFormControllerPath = 'ember-flexberry/controllers/list-form'; }; }