not-node 4.0.4 → 4.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +2 -0
- package/package.json +1 -1
- package/src/domain.js +34 -30
- package/src/form/index.js +78 -0
- package/src/init/db/mongoose.js +1 -0
- package/src/init/index.js +2 -1
- package/src/init/rateLimiter.js +1 -1
- package/src/init/routes.js +1 -1
- package/src/manifest/module.js +14 -1
- package/src/manifest/registrator/forms.js +48 -0
- package/src/manifest/registrator/index.js +2 -0
- package/src/manifest/route.js +1 -1
- package/test/module/index.js +1 -1
- package/test/notDomain.js +22 -10
- package/test/notModule.js +7 -0
package/index.js
CHANGED
|
@@ -29,6 +29,8 @@ module.exports.Routine = require('./src/model/routine');
|
|
|
29
29
|
module.exports.Common = require('./src/common');
|
|
30
30
|
/** Fields library manager */
|
|
31
31
|
module.exports.Fields = require('./src/fields');
|
|
32
|
+
/** Form validation template **/
|
|
33
|
+
module.exports.Form = require('./src/form');
|
|
32
34
|
/** Application initialization procedures */
|
|
33
35
|
module.exports.Init = require('./src/init').Init;
|
|
34
36
|
/** Application object */
|
package/package.json
CHANGED
package/src/domain.js
CHANGED
|
@@ -133,6 +133,17 @@ class notDomain extends EventEmitter {
|
|
|
133
133
|
return null;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
+
/**
|
|
137
|
+
* Returns form
|
|
138
|
+
* @param {string} name 'formName' or 'moduleName//formName'
|
|
139
|
+
* ('login', 'not-user//login')
|
|
140
|
+
* @return {object} form
|
|
141
|
+
**/
|
|
142
|
+
getForm(name) {
|
|
143
|
+
const type = 'form';
|
|
144
|
+
return this.getByPath(name, type);
|
|
145
|
+
}
|
|
146
|
+
|
|
136
147
|
/**
|
|
137
148
|
* Returns model
|
|
138
149
|
* @param {string} name 'modelName' or 'moduleName//modelName'
|
|
@@ -141,11 +152,7 @@ class notDomain extends EventEmitter {
|
|
|
141
152
|
**/
|
|
142
153
|
getModel(name) {
|
|
143
154
|
const type = 'model';
|
|
144
|
-
|
|
145
|
-
return this.getByFullPath(name, type);
|
|
146
|
-
} else {
|
|
147
|
-
return this.getByShortPath(name, type);
|
|
148
|
-
}
|
|
155
|
+
return this.getByPath(name, type);
|
|
149
156
|
}
|
|
150
157
|
|
|
151
158
|
getByFullPath(name, type){
|
|
@@ -169,31 +176,23 @@ class notDomain extends EventEmitter {
|
|
|
169
176
|
|
|
170
177
|
/**
|
|
171
178
|
* Returns file with model declarations
|
|
172
|
-
* @param {string}
|
|
179
|
+
* @param {string} name 'modelName' or 'moduleName//modelName'
|
|
173
180
|
* @return {object} CommonJS module object
|
|
174
181
|
**/
|
|
175
|
-
getModelFile(
|
|
182
|
+
getModelFile(name) {
|
|
176
183
|
const type = 'modelFile';
|
|
177
|
-
|
|
178
|
-
return this.getByFullPath(modelName, type);
|
|
179
|
-
} else {
|
|
180
|
-
return this.getByShortPath(modelName, type);
|
|
181
|
-
}
|
|
184
|
+
return this.getByPath(name, type);
|
|
182
185
|
}
|
|
183
186
|
|
|
184
187
|
/**
|
|
185
188
|
* Returns specified by name or 'moduleName//modelName' model Schema
|
|
186
|
-
* @param {string}
|
|
189
|
+
* @param {string} name 'modelName' or 'moduleName//modelName'
|
|
187
190
|
* @return {object} model schema
|
|
188
191
|
**/
|
|
189
192
|
|
|
190
|
-
getModelSchema(
|
|
193
|
+
getModelSchema(name) {
|
|
191
194
|
const type = 'modelSchema';
|
|
192
|
-
|
|
193
|
-
return this.getByFullPath(modelName, type);
|
|
194
|
-
} else {
|
|
195
|
-
return this.getByShortPath(modelName, type);
|
|
196
|
-
}
|
|
195
|
+
return this.getByPath(name, type);
|
|
197
196
|
}
|
|
198
197
|
|
|
199
198
|
/**
|
|
@@ -204,25 +203,25 @@ class notDomain extends EventEmitter {
|
|
|
204
203
|
**/
|
|
205
204
|
getLogic(name) {
|
|
206
205
|
const type = 'logic';
|
|
207
|
-
|
|
208
|
-
return this.getByFullPath(name, type);
|
|
209
|
-
} else {
|
|
210
|
-
return this.getByShortPath(name, type);
|
|
211
|
-
}
|
|
206
|
+
return this.getByPath(name, type);
|
|
212
207
|
}
|
|
213
208
|
|
|
214
209
|
|
|
215
210
|
/**
|
|
216
211
|
* Returns file with logic declarations
|
|
217
|
-
* @param {string}
|
|
212
|
+
* @param {string} name 'logicName' or 'moduleName//logicName'
|
|
218
213
|
* @return {object} CommonJS module object
|
|
219
214
|
**/
|
|
220
|
-
getLogicFile(
|
|
215
|
+
getLogicFile(name) {
|
|
221
216
|
const type = 'logicFile';
|
|
222
|
-
|
|
223
|
-
|
|
217
|
+
return this.getByPath(name, type);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
getByPath(name, type){
|
|
221
|
+
if (name.indexOf('//') > 0) {
|
|
222
|
+
return this.getByFullPath(name, type);
|
|
224
223
|
} else {
|
|
225
|
-
return this.getByShortPath(
|
|
224
|
+
return this.getByShortPath(name, type);
|
|
226
225
|
}
|
|
227
226
|
}
|
|
228
227
|
|
|
@@ -403,6 +402,10 @@ class notDomain extends EventEmitter {
|
|
|
403
402
|
count: 0,
|
|
404
403
|
list: []
|
|
405
404
|
},
|
|
405
|
+
forms: {
|
|
406
|
+
count: 0,
|
|
407
|
+
list: []
|
|
408
|
+
},
|
|
406
409
|
actions: {
|
|
407
410
|
count: 0,
|
|
408
411
|
list: []
|
|
@@ -418,8 +421,9 @@ class notDomain extends EventEmitter {
|
|
|
418
421
|
stats.modules.content[modName] = modStatus;
|
|
419
422
|
stats.routes.count += modStatus.routes.count;
|
|
420
423
|
stats.models.count += modStatus.models.count;
|
|
424
|
+
stats.forms.count += modStatus.forms.count;
|
|
421
425
|
stats.actions.count += modStatus.actions.count;
|
|
422
|
-
for (let t of ['routes', 'models', 'actions']) {
|
|
426
|
+
for (let t of ['routes', 'models', 'actions', 'forms']) {
|
|
423
427
|
stats[t].list.push(...(modStatus[t].list.map(itmName => `${modName}//${itmName}`)));
|
|
424
428
|
}
|
|
425
429
|
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
//DB related validation tools
|
|
2
|
+
const mongoose = require('mongoose');
|
|
3
|
+
const Schema = mongoose.Schema;
|
|
4
|
+
//not-node
|
|
5
|
+
const initFields = require('../fields').initFields;
|
|
6
|
+
const {
|
|
7
|
+
byFieldsValidators
|
|
8
|
+
} = require('../model/enrich');
|
|
9
|
+
const {
|
|
10
|
+
notValidationError,
|
|
11
|
+
notError
|
|
12
|
+
} = require('not-error');
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Generic form validation class
|
|
16
|
+
**/
|
|
17
|
+
module.exports = class Form {
|
|
18
|
+
constructor({
|
|
19
|
+
FIELDS,
|
|
20
|
+
FORM_NAME
|
|
21
|
+
}) {
|
|
22
|
+
this.FORM_NAME = FORM_NAME;
|
|
23
|
+
this.FIELDS = FIELDS;
|
|
24
|
+
this.SCHEMA = byFieldsValidators(initFields(FIELDS, 'model'));
|
|
25
|
+
this.MODEL = mongoose.model(FORM_NAME, Schema(this.SCHEMA));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Extract data from ExpressRequest object and validates it
|
|
30
|
+
* returns it or throws
|
|
31
|
+
* @param {ExpressRequest} req expressjs request object
|
|
32
|
+
* @return {Promise<Object>} form data
|
|
33
|
+
* @throws {notValidationError}
|
|
34
|
+
**/
|
|
35
|
+
async run(req) {
|
|
36
|
+
let data = await this.extract(req);
|
|
37
|
+
await this.validate(data);
|
|
38
|
+
return data;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Extracts data, should be overriden
|
|
43
|
+
* @param {ExpressRequest} req expressjs request object
|
|
44
|
+
* @return {Object} forma data
|
|
45
|
+
**/
|
|
46
|
+
async extract( /*req*/ ) {
|
|
47
|
+
return {};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Validates form data or throws
|
|
52
|
+
* @param {Object} data form data
|
|
53
|
+
* @return {Object}
|
|
54
|
+
* @throws {notValidationError}
|
|
55
|
+
**/
|
|
56
|
+
async validate(data) {
|
|
57
|
+
try {
|
|
58
|
+
await this.MODEL.validate(data, this.FIELDS);
|
|
59
|
+
} catch (e) {
|
|
60
|
+
let fields = {};
|
|
61
|
+
if (e instanceof mongoose.Error.ValidationError) {
|
|
62
|
+
Object.keys(e.errors).forEach(name => {
|
|
63
|
+
fields[name] = [e.errors[name].message];
|
|
64
|
+
});
|
|
65
|
+
throw new notValidationError(e.message, fields, e, data);
|
|
66
|
+
} else {
|
|
67
|
+
throw new notError(
|
|
68
|
+
'core:form_validation_error', {
|
|
69
|
+
FORM_NAME: this.FORM_NAME,
|
|
70
|
+
FIELDS: this.FIELDS,
|
|
71
|
+
data
|
|
72
|
+
},
|
|
73
|
+
e
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
};
|
package/src/init/db/mongoose.js
CHANGED
|
@@ -28,6 +28,7 @@ module.exports = class InitDBMongoose{
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
async run({config, options, master, conf, alias}){
|
|
31
|
+
log.info(`db.${alias}.pre`);
|
|
31
32
|
await ADDS.run(`db.${alias}.pre`, {config, options, master, conf, alias});
|
|
32
33
|
await InitDBMongoose.initMongoose({conf, master, alias});
|
|
33
34
|
await ADDS.run(`db.${alias}.post`, {config, options, master, conf, alias});
|
package/src/init/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
//
|
|
2
|
+
const os = require('os');
|
|
2
3
|
const path = require('path');
|
|
3
4
|
const logger = require('not-log');
|
|
4
5
|
const log = logger(module, 'not-node:Init');
|
|
@@ -126,7 +127,7 @@ class Init {
|
|
|
126
127
|
additional
|
|
127
128
|
}) {
|
|
128
129
|
try {
|
|
129
|
-
log.info('Kick start app...');
|
|
130
|
+
log.info('Kick start app...'+ os.platform()+os.arch());
|
|
130
131
|
ADDS.init(additional);
|
|
131
132
|
const initSequence = new InitSequence(STANDART_INIT_SEQUENCE);
|
|
132
133
|
await ADDS.run('pre', {
|
package/src/init/rateLimiter.js
CHANGED
package/src/init/routes.js
CHANGED
|
@@ -13,7 +13,6 @@ module.exports = class InitRoutes {
|
|
|
13
13
|
static finalError({
|
|
14
14
|
master
|
|
15
15
|
}) {
|
|
16
|
-
// eslint-disable-next-line no-unused-vars
|
|
17
16
|
return (err, req, res, next) => {
|
|
18
17
|
//reportable errors from known cases
|
|
19
18
|
if (err instanceof notError) {
|
|
@@ -53,6 +52,7 @@ module.exports = class InitRoutes {
|
|
|
53
52
|
status: 'error'
|
|
54
53
|
});
|
|
55
54
|
}
|
|
55
|
+
next();
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
58
|
|
package/src/manifest/module.js
CHANGED
|
@@ -47,6 +47,7 @@ class notModule {
|
|
|
47
47
|
};
|
|
48
48
|
this.models = {};
|
|
49
49
|
this.logics = {};
|
|
50
|
+
this.forms = {};
|
|
50
51
|
this.manifests = {};
|
|
51
52
|
this.faulty = false;
|
|
52
53
|
this.paths = {
|
|
@@ -220,10 +221,15 @@ class notModule {
|
|
|
220
221
|
}
|
|
221
222
|
|
|
222
223
|
getStatus() {
|
|
224
|
+
const formsList = Object.keys(this.forms);
|
|
223
225
|
const modelsList = Object.keys(this.models);
|
|
224
226
|
const routesList = Object.keys(this.routes);
|
|
225
227
|
const actionsList = this.getActionsList();
|
|
226
228
|
return {
|
|
229
|
+
forms: {
|
|
230
|
+
count: formsList.length,
|
|
231
|
+
list: formsList
|
|
232
|
+
},
|
|
227
233
|
models: {
|
|
228
234
|
count: modelsList.length,
|
|
229
235
|
list: modelsList,
|
|
@@ -271,11 +277,18 @@ class notModule {
|
|
|
271
277
|
return content;
|
|
272
278
|
}
|
|
273
279
|
|
|
274
|
-
|
|
275
280
|
setManifest(key, val){
|
|
276
281
|
this.manifests[key] = val;
|
|
277
282
|
}
|
|
278
283
|
|
|
284
|
+
getForm(key) {
|
|
285
|
+
return this.forms[key];
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
setForm(key, val) {
|
|
289
|
+
this.forms[key] = val;
|
|
290
|
+
}
|
|
291
|
+
|
|
279
292
|
setModel(key, val){
|
|
280
293
|
this.models[key] = val;
|
|
281
294
|
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const fs = require('fs');
|
|
3
|
+
const {tryFile} = require('../../common');
|
|
4
|
+
|
|
5
|
+
module.exports = class notModuleRegistratorForms{
|
|
6
|
+
|
|
7
|
+
static openFile = require;
|
|
8
|
+
|
|
9
|
+
constructor({nModule}){
|
|
10
|
+
this.run({nModule});
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
run({nModule}){
|
|
14
|
+
const srcDir = notModuleRegistratorForms.getPath(nModule);
|
|
15
|
+
if (!srcDir) { return false; }
|
|
16
|
+
this.findAll(
|
|
17
|
+
{
|
|
18
|
+
nModule,
|
|
19
|
+
srcDir
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
static getPath(nModule){
|
|
26
|
+
return nModule.module.paths.forms;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Searching forms in directory
|
|
31
|
+
* @param {Object} input
|
|
32
|
+
* @param {string} input.srcDir
|
|
33
|
+
**/
|
|
34
|
+
findAll({nModule, srcDir}){
|
|
35
|
+
fs.readdirSync(srcDir).forEach((file) => {
|
|
36
|
+
let fromPath = path.join(srcDir, file);
|
|
37
|
+
if (!tryFile(fromPath)) { return; }
|
|
38
|
+
this.register({nModule, fromPath});
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
register({nModule, fromPath}){
|
|
43
|
+
const Form = notModuleRegistratorForms.openFile(fromPath);
|
|
44
|
+
const parts = path.parse(fromPath);
|
|
45
|
+
nModule.setForm(parts.name, new Form());
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
};
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
const
|
|
7
7
|
notModuleRegistratorFields = require('./fields'),
|
|
8
|
+
notModuleRegistratorForms = require('./forms'),
|
|
8
9
|
notModuleRegistratorModels = require('./models'),
|
|
9
10
|
notModuleRegistratorLogics = require('./logics'),
|
|
10
11
|
notModuleRegistratorRoutes = require('./routes'),
|
|
@@ -13,6 +14,7 @@ const
|
|
|
13
14
|
|
|
14
15
|
const DEFAULT_REGISTRATORS = [
|
|
15
16
|
notModuleRegistratorFields,
|
|
17
|
+
notModuleRegistratorForms,
|
|
16
18
|
notModuleRegistratorModels,
|
|
17
19
|
notModuleRegistratorLogics,
|
|
18
20
|
notModuleRegistratorRoutes,
|
package/src/manifest/route.js
CHANGED
|
@@ -148,7 +148,7 @@ class notRoute{
|
|
|
148
148
|
* if presented
|
|
149
149
|
* @param {ExpressRequest} req request object
|
|
150
150
|
* @param {object} result result returned by main action processor
|
|
151
|
-
|
|
151
|
+
*/
|
|
152
152
|
filterResultByReturnRule(req, result){
|
|
153
153
|
const returnList = this.extractReturn(req.notRouteData);
|
|
154
154
|
if(result && (typeof result === 'object') && returnList && Array.isArray(returnList)){
|
package/test/module/index.js
CHANGED
|
@@ -22,7 +22,7 @@ module.exports = (input)=>{
|
|
|
22
22
|
notModuleRegistrator.setRegistrators(regs);
|
|
23
23
|
expect(notModuleRegistrator.registrators.length).to.be.equal(0);
|
|
24
24
|
notModuleRegistrator.resetRegistrators();
|
|
25
|
-
expect(notModuleRegistrator.registrators.length).to.be.equal(
|
|
25
|
+
expect(notModuleRegistrator.registrators.length).to.be.equal(6);
|
|
26
26
|
});
|
|
27
27
|
|
|
28
28
|
it('with paths', ()=>{
|
package/test/notDomain.js
CHANGED
|
@@ -184,7 +184,7 @@ describe('notDomain', function() {
|
|
|
184
184
|
it('model name short', function() {
|
|
185
185
|
const route = 'Jungle';
|
|
186
186
|
const ctx = {
|
|
187
|
-
|
|
187
|
+
getByPath(){return null;}
|
|
188
188
|
};
|
|
189
189
|
const res = notDomain.prototype.getModel.call(ctx, route);
|
|
190
190
|
expect(res).to.be.null;
|
|
@@ -194,7 +194,7 @@ describe('notDomain', function() {
|
|
|
194
194
|
const id = Math.random();
|
|
195
195
|
const route = 'module//Jungle';
|
|
196
196
|
const ctx = {
|
|
197
|
-
|
|
197
|
+
getByPath(){return id;}
|
|
198
198
|
};
|
|
199
199
|
const res = notDomain.prototype.getModel.call(ctx, route);
|
|
200
200
|
expect(res).to.be.equal(id);
|
|
@@ -206,7 +206,7 @@ describe('notDomain', function() {
|
|
|
206
206
|
const id = Math.random();
|
|
207
207
|
const route = 'Jungle';
|
|
208
208
|
const ctx = {
|
|
209
|
-
|
|
209
|
+
getByPath(){return id;}
|
|
210
210
|
};
|
|
211
211
|
const res = notDomain.prototype.getModelFile.call(ctx, route);
|
|
212
212
|
expect(res).to.be.equal(id);
|
|
@@ -216,7 +216,7 @@ describe('notDomain', function() {
|
|
|
216
216
|
const id = Math.random();
|
|
217
217
|
const route = 'module//Jungle';
|
|
218
218
|
const ctx = {
|
|
219
|
-
|
|
219
|
+
getByPath(){return id;}
|
|
220
220
|
};
|
|
221
221
|
const res = notDomain.prototype.getModelFile.call(ctx, route);
|
|
222
222
|
expect(res).to.be.equal(id);
|
|
@@ -229,7 +229,7 @@ describe('notDomain', function() {
|
|
|
229
229
|
const id = Math.random();
|
|
230
230
|
const route = 'Jungle';
|
|
231
231
|
const ctx = {
|
|
232
|
-
|
|
232
|
+
getByPath(){return id;}
|
|
233
233
|
};
|
|
234
234
|
const res = notDomain.prototype.getModelSchema.call(ctx, route);
|
|
235
235
|
expect(res).to.be.equal(id);
|
|
@@ -239,7 +239,7 @@ describe('notDomain', function() {
|
|
|
239
239
|
const id = Math.random();
|
|
240
240
|
const route = 'module//Jungle';
|
|
241
241
|
const ctx = {
|
|
242
|
-
|
|
242
|
+
getByPath(){return id;}
|
|
243
243
|
};
|
|
244
244
|
const res = notDomain.prototype.getModelSchema.call(ctx, route);
|
|
245
245
|
expect(res).to.be.equal(id);
|
|
@@ -252,7 +252,7 @@ describe('notDomain', function() {
|
|
|
252
252
|
const id = Math.random();
|
|
253
253
|
const route = 'Jungle';
|
|
254
254
|
const ctx = {
|
|
255
|
-
|
|
255
|
+
getByPath(){return id;}
|
|
256
256
|
};
|
|
257
257
|
const res = notDomain.prototype.getLogic.call(ctx, route);
|
|
258
258
|
expect(res).to.be.equal(id);
|
|
@@ -262,7 +262,7 @@ describe('notDomain', function() {
|
|
|
262
262
|
const id = Math.random();
|
|
263
263
|
const route = 'module//Jungle';
|
|
264
264
|
const ctx = {
|
|
265
|
-
|
|
265
|
+
getByPath(){return id;}
|
|
266
266
|
};
|
|
267
267
|
const res = notDomain.prototype.getLogic.call(ctx, route);
|
|
268
268
|
expect(res).to.be.equal(id);
|
|
@@ -274,7 +274,7 @@ describe('notDomain', function() {
|
|
|
274
274
|
const id = Math.random();
|
|
275
275
|
const route = 'Jungle';
|
|
276
276
|
const ctx = {
|
|
277
|
-
|
|
277
|
+
getByPath(){return id;}
|
|
278
278
|
};
|
|
279
279
|
const res = notDomain.prototype.getLogicFile.call(ctx, route);
|
|
280
280
|
expect(res).to.be.equal(id);
|
|
@@ -284,7 +284,7 @@ describe('notDomain', function() {
|
|
|
284
284
|
const id = Math.random();
|
|
285
285
|
const route = 'module//Jungle';
|
|
286
286
|
const ctx = {
|
|
287
|
-
|
|
287
|
+
getByPath(){return id;}
|
|
288
288
|
};
|
|
289
289
|
const res = notDomain.prototype.getLogicFile.call(ctx, route);
|
|
290
290
|
expect(res).to.be.equal(id);
|
|
@@ -711,6 +711,10 @@ describe('notDomain', function() {
|
|
|
711
711
|
actions: {
|
|
712
712
|
count: 2,
|
|
713
713
|
list: ['user//list', 'role//list']
|
|
714
|
+
},
|
|
715
|
+
forms: {
|
|
716
|
+
count: 3,
|
|
717
|
+
list: ['user//listAll', 'user//list', 'role//list']
|
|
714
718
|
}
|
|
715
719
|
};
|
|
716
720
|
}
|
|
@@ -737,10 +741,18 @@ describe('notDomain', function() {
|
|
|
737
741
|
actions: {
|
|
738
742
|
count: 2,
|
|
739
743
|
list: ['user//list', 'role//list']
|
|
744
|
+
},
|
|
745
|
+
forms: {
|
|
746
|
+
count: 3,
|
|
747
|
+
list: ['user//listAll', 'user//list', 'role//list']
|
|
740
748
|
}
|
|
741
749
|
}
|
|
742
750
|
}
|
|
743
751
|
},
|
|
752
|
+
forms: {
|
|
753
|
+
count: 3,
|
|
754
|
+
list: ['not-user//user//listAll', 'not-user//user//list', 'not-user//role//list']
|
|
755
|
+
},
|
|
744
756
|
routes: {
|
|
745
757
|
count: 2,
|
|
746
758
|
list: ["not-user//user","not-user//role"]
|
package/test/notModule.js
CHANGED
|
@@ -468,6 +468,9 @@ describe('notModule', function() {
|
|
|
468
468
|
routes: {
|
|
469
469
|
userRoute: {}
|
|
470
470
|
},
|
|
471
|
+
forms: {
|
|
472
|
+
'route//action':{}
|
|
473
|
+
},
|
|
471
474
|
getModelsStatuses() {
|
|
472
475
|
return {
|
|
473
476
|
user: {
|
|
@@ -505,6 +508,10 @@ describe('notModule', function() {
|
|
|
505
508
|
actions: {
|
|
506
509
|
count: 1,
|
|
507
510
|
list: ['route//action']
|
|
511
|
+
},
|
|
512
|
+
forms: {
|
|
513
|
+
count: 1,
|
|
514
|
+
list: ['route//action']
|
|
508
515
|
}
|
|
509
516
|
});
|
|
510
517
|
});
|