Skip to content

Commit

Permalink
Fix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
TeterinaSvetlana committed Feb 6, 2020
1 parent 5308d47 commit 98d1835
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 69 deletions.
36 changes: 20 additions & 16 deletions blueprints/flexberry-edit-form/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 24 additions & 18 deletions blueprints/flexberry-edit-form/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
Expand All @@ -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;
Expand Down Expand Up @@ -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';
};
}

Expand Down
36 changes: 20 additions & 16 deletions blueprints/flexberry-list-form/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 25 additions & 19 deletions blueprints/flexberry-list-form/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
Expand All @@ -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");
Expand All @@ -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';
};
}

Expand Down

0 comments on commit 98d1835

Please sign in to comment.