not-node 6.3.94 → 6.3.96
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/package.json +1 -1
- package/src/core/fields/ID.js +1 -0
- package/src/core/fields/_id.js +3 -0
- package/src/core/fields/active.js +2 -1
- package/src/core/fields/boolean.js +2 -1
- package/src/core/fields/codeName.js +2 -1
- package/src/core/fields/createdAt.js +1 -4
- package/src/core/fields/default.js +1 -0
- package/src/core/fields/description.js +2 -1
- package/src/core/fields/email.js +2 -1
- package/src/core/fields/enabled.js +1 -0
- package/src/core/fields/expiredAt.js +1 -4
- package/src/core/fields/height.js +1 -0
- package/src/core/fields/identity.js +1 -4
- package/src/core/fields/ip.js +2 -1
- package/src/core/fields/objectId.js +2 -4
- package/src/core/fields/owner.js +9 -4
- package/src/core/fields/ownerModel.js +2 -5
- package/src/core/fields/price.js +1 -0
- package/src/core/fields/requiredObject.js +1 -4
- package/src/core/fields/session.js +2 -1
- package/src/core/fields/size.js +1 -0
- package/src/core/fields/telephone.js +2 -1
- package/src/core/fields/title.js +2 -5
- package/src/core/fields/updatedAt.js +1 -4
- package/src/core/fields/userId.js +1 -0
- package/src/core/fields/uuid.js +2 -1
- package/src/core/fields/width.js +1 -0
- package/src/core/safety.protocols.js +22 -0
- package/src/fields/filter.js +83 -4
- package/src/form/transformers/__CLEAR__.js +3 -0
- package/src/form/transformers/index.js +1 -0
- package/test/filter.js +95 -2
- package/tmpl/files/module.server/layers/controllers/common/crud.ejs +53 -51
package/package.json
CHANGED
package/src/core/fields/ID.js
CHANGED
package/src/core/fields/_id.js
CHANGED
package/src/core/fields/email.js
CHANGED
package/src/core/fields/ip.js
CHANGED
|
@@ -5,9 +5,7 @@ module.exports = {
|
|
|
5
5
|
type: ObjectId,
|
|
6
6
|
required: true,
|
|
7
7
|
default: {},
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
read: ["@owner", "root", "admin"],
|
|
11
|
-
},
|
|
8
|
+
transformers: ["xss", "__CLEAR__"],
|
|
9
|
+
safe: require("../safety.protocols").ownerRootAdmin,
|
|
12
10
|
},
|
|
13
11
|
};
|
package/src/core/fields/owner.js
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
const Schema = require("mongoose").Schema;
|
|
2
|
+
const notFieldsFilter = require("../../fields/filter");
|
|
3
|
+
const { ownerRootAdmin } = require("../safety.protocols");
|
|
4
|
+
const { ACTION_SIGNATURES } = require("../../auth/const");
|
|
5
|
+
|
|
2
6
|
module.exports = {
|
|
3
7
|
model: {
|
|
4
8
|
type: Schema.Types.ObjectId,
|
|
5
9
|
refPath: "ownerModel",
|
|
6
10
|
required: false,
|
|
7
|
-
safe: {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
safe: notFieldsFilter.mergeSafetyProtocols(ownerRootAdmin, {
|
|
12
|
+
[ACTION_SIGNATURES.CREATE]: ["-@owner"],
|
|
13
|
+
[ACTION_SIGNATURES.UPDATE]: ["-@owner"],
|
|
14
|
+
[ACTION_SIGNATURES.DELETE]: ["-@owner"],
|
|
15
|
+
}),
|
|
11
16
|
},
|
|
12
17
|
ui: {
|
|
13
18
|
component: "UIHidden",
|
|
@@ -2,11 +2,8 @@ module.exports = {
|
|
|
2
2
|
model: {
|
|
3
3
|
type: String,
|
|
4
4
|
required: false,
|
|
5
|
-
safe:
|
|
6
|
-
|
|
7
|
-
read: ["@owner", "root", "admin"],
|
|
8
|
-
},
|
|
9
|
-
transformers: ['xss']
|
|
5
|
+
safe: require("../safety.protocols").ownerRootAdmin,
|
|
6
|
+
transformers: ["xss"],
|
|
10
7
|
},
|
|
11
8
|
ui: {
|
|
12
9
|
component: "UIHidden",
|
package/src/core/fields/price.js
CHANGED
package/src/core/fields/size.js
CHANGED
package/src/core/fields/title.js
CHANGED
|
@@ -9,10 +9,7 @@ module.exports = {
|
|
|
9
9
|
required: true,
|
|
10
10
|
searchable: true,
|
|
11
11
|
sortable: true,
|
|
12
|
-
safe:
|
|
13
|
-
|
|
14
|
-
read: ["@owner", "root", "admin"],
|
|
15
|
-
},
|
|
16
|
-
transformers: ['xss']
|
|
12
|
+
safe: require("../safety.protocols").ownerRootAdmin,
|
|
13
|
+
transformers: ["xss"],
|
|
17
14
|
},
|
|
18
15
|
};
|
package/src/core/fields/uuid.js
CHANGED
package/src/core/fields/width.js
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const { ACTION_SIGNATURES } = require("../auth/const");
|
|
2
|
+
|
|
3
|
+
module.exports.ownerRootAdmin = Object.freeze({
|
|
4
|
+
[ACTION_SIGNATURES.CREATE]: ["@owner", "root", "admin"],
|
|
5
|
+
[ACTION_SIGNATURES.READ]: ["@owner", "root", "admin"],
|
|
6
|
+
[ACTION_SIGNATURES.UPDATE]: ["@owner", "root", "admin"],
|
|
7
|
+
[ACTION_SIGNATURES.DELETE]: ["@owner", "root", "admin"],
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
module.exports.systemManageable = Object.freeze({
|
|
11
|
+
[ACTION_SIGNATURES.CREATE]: ["@system"],
|
|
12
|
+
[ACTION_SIGNATURES.READ]: ["@system", "@owner", "root", "admin"],
|
|
13
|
+
[ACTION_SIGNATURES.UPDATE]: ["@system"],
|
|
14
|
+
[ACTION_SIGNATURES.DELETE]: ["@system"],
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
module.exports.publicReadable = Object.freeze({
|
|
18
|
+
[ACTION_SIGNATURES.CREATE]: [],
|
|
19
|
+
[ACTION_SIGNATURES.READ]: ["@*"],
|
|
20
|
+
[ACTION_SIGNATURES.UPDATE]: [],
|
|
21
|
+
[ACTION_SIGNATURES.DELETE]: [],
|
|
22
|
+
});
|
package/src/fields/filter.js
CHANGED
|
@@ -5,7 +5,10 @@ const {
|
|
|
5
5
|
isNotEmptyString,
|
|
6
6
|
} = require("../common");
|
|
7
7
|
const { getSafeFieldsForRoleAction } = require("../auth/fields");
|
|
8
|
-
const {
|
|
8
|
+
const {
|
|
9
|
+
DEFAULT_USER_ROLE_FOR_GUEST,
|
|
10
|
+
ACTION_SIGNATURES,
|
|
11
|
+
} = require("../auth/const");
|
|
9
12
|
/**
|
|
10
13
|
* notFieldsFilter.filter(fields, getApp().getModelSchema(MODEL_NAME), {action});
|
|
11
14
|
*
|
|
@@ -125,9 +128,14 @@ class notFieldsFilter {
|
|
|
125
128
|
system
|
|
126
129
|
);
|
|
127
130
|
},
|
|
128
|
-
[SPECIAL_SET_UNSAFE]: ["salt", "password"],
|
|
131
|
+
[SPECIAL_SET_UNSAFE]: ["salt", "password", "session"],
|
|
129
132
|
[SPECIAL_SET_TIMESTAMPS]: ["createdAt", "updatedAt"],
|
|
130
|
-
[SPECIAL_SET_OWNAGE]:
|
|
133
|
+
[SPECIAL_SET_OWNAGE]: (schema) => {
|
|
134
|
+
const inSchema = Object.keys(schema);
|
|
135
|
+
return ["owner", "ownerId", "ownerModel"].filter((itm) =>
|
|
136
|
+
inSchema.includes(itm)
|
|
137
|
+
);
|
|
138
|
+
},
|
|
131
139
|
[SPECIAL_SET_VERSIONING]: [
|
|
132
140
|
"__version",
|
|
133
141
|
"__versions",
|
|
@@ -302,6 +310,10 @@ class notFieldsFilter {
|
|
|
302
310
|
return result;
|
|
303
311
|
}
|
|
304
312
|
|
|
313
|
+
static clearFromDuplicated(fields) {
|
|
314
|
+
return [...new Set(fields)];
|
|
315
|
+
}
|
|
316
|
+
|
|
305
317
|
/**
|
|
306
318
|
* Creates plain fields list from fields list with fields, synonyms, fields sets
|
|
307
319
|
* and exlude operations
|
|
@@ -320,7 +332,74 @@ class notFieldsFilter {
|
|
|
320
332
|
static filter(fieldsSet, schema = {}, mods = { action: undefined }) {
|
|
321
333
|
const fields = [...fieldsSet];
|
|
322
334
|
this.specialsToPlain(fields, schema, mods);
|
|
323
|
-
return this.removeExcludedFields(fields);
|
|
335
|
+
return this.clearFromDuplicated(this.removeExcludedFields(fields));
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
*
|
|
340
|
+
*
|
|
341
|
+
* @static
|
|
342
|
+
* @param {Object} base
|
|
343
|
+
* @param {Object} addition
|
|
344
|
+
* @return {Object}
|
|
345
|
+
* @memberof notFieldsFilter
|
|
346
|
+
*/
|
|
347
|
+
static mergeSafetyProtocols(base, addition) {
|
|
348
|
+
const result = {
|
|
349
|
+
[ACTION_SIGNATURES.CREATE]: [
|
|
350
|
+
...(base[ACTION_SIGNATURES.CREATE] || []),
|
|
351
|
+
],
|
|
352
|
+
[ACTION_SIGNATURES.READ]: [...(base[ACTION_SIGNATURES.READ] || [])],
|
|
353
|
+
[ACTION_SIGNATURES.UPDATE]: [
|
|
354
|
+
...(base[ACTION_SIGNATURES.UPDATE] || []),
|
|
355
|
+
],
|
|
356
|
+
[ACTION_SIGNATURES.DELETE]: [
|
|
357
|
+
...(base[ACTION_SIGNATURES.DELETE] || []),
|
|
358
|
+
],
|
|
359
|
+
};
|
|
360
|
+
for (const type of Object.keys(addition)) {
|
|
361
|
+
if (Array.isArray(addition[type])) {
|
|
362
|
+
addition[type].forEach((rule) => {
|
|
363
|
+
if (this.isExcludeOperation(rule)) {
|
|
364
|
+
const ruleToDelete = this.unmarkFieldToExlude(rule);
|
|
365
|
+
if (result[type].includes(ruleToDelete)) {
|
|
366
|
+
result[type].splice(
|
|
367
|
+
result[type].indexOf(ruleToDelete),
|
|
368
|
+
1
|
|
369
|
+
);
|
|
370
|
+
}
|
|
371
|
+
} else {
|
|
372
|
+
if (!result[type].includes(rule)) {
|
|
373
|
+
result[type].push(rule);
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
return Object.freeze(result);
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
static initSafetyProtocol(
|
|
383
|
+
create = [],
|
|
384
|
+
read = [],
|
|
385
|
+
update = [],
|
|
386
|
+
del = [],
|
|
387
|
+
all = []
|
|
388
|
+
) {
|
|
389
|
+
return this.mergeSafetyProtocols(
|
|
390
|
+
{
|
|
391
|
+
[ACTION_SIGNATURES.CREATE]: [...all],
|
|
392
|
+
[ACTION_SIGNATURES.READ]: [...all],
|
|
393
|
+
[ACTION_SIGNATURES.UPDATE]: [...all],
|
|
394
|
+
[ACTION_SIGNATURES.DELETE]: [...all],
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
[ACTION_SIGNATURES.CREATE]: [...create],
|
|
398
|
+
[ACTION_SIGNATURES.READ]: [...read],
|
|
399
|
+
[ACTION_SIGNATURES.UPDATE]: [...update],
|
|
400
|
+
[ACTION_SIGNATURES.DELETE]: [...del],
|
|
401
|
+
}
|
|
402
|
+
);
|
|
324
403
|
}
|
|
325
404
|
}
|
|
326
405
|
|
package/test/filter.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
const mongoose = require("mongoose");
|
|
2
2
|
const Schema = mongoose.Schema;
|
|
3
3
|
const expect = require("chai").expect,
|
|
4
|
-
notFieldsFilter = require("../src/fields/filter")
|
|
4
|
+
notFieldsFilter = require("../src/fields/filter"),
|
|
5
|
+
{ ACTION_SIGNATURES } = require("../src/auth/const"),
|
|
6
|
+
safetyProtocols = require("../src/core/safety.protocols");
|
|
5
7
|
|
|
6
8
|
const SCHEMA = () => {
|
|
7
9
|
return {
|
|
@@ -277,10 +279,101 @@ describe("Fields/notFieldsFilter", function () {
|
|
|
277
279
|
expect(result).to.be.deep.equal([
|
|
278
280
|
"id",
|
|
279
281
|
"name",
|
|
280
|
-
"name",
|
|
281
282
|
"username",
|
|
282
283
|
"country",
|
|
283
284
|
]);
|
|
284
285
|
});
|
|
285
286
|
});
|
|
287
|
+
|
|
288
|
+
describe("mergeSafetyProtocols", () => {
|
|
289
|
+
it("ownerRootAdmin + publicReadable", () => {
|
|
290
|
+
const result = notFieldsFilter.mergeSafetyProtocols(
|
|
291
|
+
safetyProtocols.ownerRootAdmin,
|
|
292
|
+
safetyProtocols.publicReadable
|
|
293
|
+
);
|
|
294
|
+
expect(result).to.be.deep.equal({
|
|
295
|
+
[ACTION_SIGNATURES.CREATE]: ["@owner", "root", "admin"],
|
|
296
|
+
[ACTION_SIGNATURES.READ]: ["@owner", "root", "admin", "@*"],
|
|
297
|
+
[ACTION_SIGNATURES.UPDATE]: ["@owner", "root", "admin"],
|
|
298
|
+
[ACTION_SIGNATURES.DELETE]: ["@owner", "root", "admin"],
|
|
299
|
+
});
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
it("ownerRootAdmin - @owner", () => {
|
|
303
|
+
const result = notFieldsFilter.mergeSafetyProtocols(
|
|
304
|
+
safetyProtocols.ownerRootAdmin,
|
|
305
|
+
{
|
|
306
|
+
[ACTION_SIGNATURES.CREATE]: ["-@owner"],
|
|
307
|
+
[ACTION_SIGNATURES.READ]: ["-@owner"],
|
|
308
|
+
[ACTION_SIGNATURES.UPDATE]: ["-@owner"],
|
|
309
|
+
[ACTION_SIGNATURES.DELETE]: ["-@owner"],
|
|
310
|
+
}
|
|
311
|
+
);
|
|
312
|
+
expect(result).to.be.deep.equal({
|
|
313
|
+
[ACTION_SIGNATURES.CREATE]: ["root", "admin"],
|
|
314
|
+
[ACTION_SIGNATURES.READ]: ["root", "admin"],
|
|
315
|
+
[ACTION_SIGNATURES.UPDATE]: ["root", "admin"],
|
|
316
|
+
[ACTION_SIGNATURES.DELETE]: ["root", "admin"],
|
|
317
|
+
});
|
|
318
|
+
});
|
|
319
|
+
});
|
|
320
|
+
|
|
321
|
+
describe("initSafetyProtocol", () => {
|
|
322
|
+
it("empty", () => {
|
|
323
|
+
const result = notFieldsFilter.initSafetyProtocol();
|
|
324
|
+
expect(result).to.be.deep.equal({
|
|
325
|
+
[ACTION_SIGNATURES.CREATE]: [],
|
|
326
|
+
[ACTION_SIGNATURES.READ]: [],
|
|
327
|
+
[ACTION_SIGNATURES.UPDATE]: [],
|
|
328
|
+
[ACTION_SIGNATURES.DELETE]: [],
|
|
329
|
+
});
|
|
330
|
+
});
|
|
331
|
+
|
|
332
|
+
it("all = user", () => {
|
|
333
|
+
const result = notFieldsFilter.initSafetyProtocol(
|
|
334
|
+
undefined,
|
|
335
|
+
undefined,
|
|
336
|
+
undefined,
|
|
337
|
+
undefined,
|
|
338
|
+
["user"]
|
|
339
|
+
);
|
|
340
|
+
expect(result).to.be.deep.equal({
|
|
341
|
+
[ACTION_SIGNATURES.CREATE]: ["user"],
|
|
342
|
+
[ACTION_SIGNATURES.READ]: ["user"],
|
|
343
|
+
[ACTION_SIGNATURES.UPDATE]: ["user"],
|
|
344
|
+
[ACTION_SIGNATURES.DELETE]: ["user"],
|
|
345
|
+
});
|
|
346
|
+
});
|
|
347
|
+
|
|
348
|
+
it("CRUD - @owner", () => {
|
|
349
|
+
const result = notFieldsFilter.initSafetyProtocol(
|
|
350
|
+
["@owner"],
|
|
351
|
+
["@owner"],
|
|
352
|
+
["@owner"],
|
|
353
|
+
["@owner"]
|
|
354
|
+
);
|
|
355
|
+
expect(result).to.be.deep.equal({
|
|
356
|
+
[ACTION_SIGNATURES.CREATE]: ["@owner"],
|
|
357
|
+
[ACTION_SIGNATURES.READ]: ["@owner"],
|
|
358
|
+
[ACTION_SIGNATURES.UPDATE]: ["@owner"],
|
|
359
|
+
[ACTION_SIGNATURES.DELETE]: ["@owner"],
|
|
360
|
+
});
|
|
361
|
+
});
|
|
362
|
+
|
|
363
|
+
it("D - -@owner, ALL - @owner, root, admin", () => {
|
|
364
|
+
const result = notFieldsFilter.initSafetyProtocol(
|
|
365
|
+
undefined,
|
|
366
|
+
undefined,
|
|
367
|
+
undefined,
|
|
368
|
+
["-@owner"],
|
|
369
|
+
["@owner", "root", "admin"]
|
|
370
|
+
);
|
|
371
|
+
expect(result).to.be.deep.equal({
|
|
372
|
+
[ACTION_SIGNATURES.CREATE]: ["@owner", "root", "admin"],
|
|
373
|
+
[ACTION_SIGNATURES.READ]: ["@owner", "root", "admin"],
|
|
374
|
+
[ACTION_SIGNATURES.UPDATE]: ["@owner", "root", "admin"],
|
|
375
|
+
[ACTION_SIGNATURES.DELETE]: ["root", "admin"],
|
|
376
|
+
});
|
|
377
|
+
});
|
|
378
|
+
});
|
|
286
379
|
});
|
|
@@ -6,29 +6,29 @@ import CRUDActionList from "not-bulma/src/frame/crud/actions/list";
|
|
|
6
6
|
const { notCRUD } = Frame;
|
|
7
7
|
|
|
8
8
|
const MODEL_NAME = "<%- ModelName %>";
|
|
9
|
-
|
|
9
|
+
const modelName = notCommon.lowerFirstLetter(MODEL_NAME);
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
const LABELS = {
|
|
12
12
|
plural: `${MODULE_NAME}:${modelName}_label_plural`,
|
|
13
13
|
single: `${MODULE_NAME}:${modelName}_label_single`,
|
|
14
|
-
|
|
14
|
+
};
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
Object.freeze(LABELS);
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
class nc<%- ModelName %>Common extends notCRUD {
|
|
19
|
+
static get MODULE_NAME(){
|
|
20
20
|
return MODULE_NAME;
|
|
21
|
-
|
|
21
|
+
}
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
static get MODEL_NAME(){
|
|
24
24
|
return MODEL_NAME;
|
|
25
|
-
|
|
25
|
+
}
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
static get LABELS(){
|
|
28
28
|
return LABELS;
|
|
29
|
-
|
|
29
|
+
}
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
constructor(app, params) {
|
|
32
32
|
super(app, `${MODULE_NAME}.${MODEL_NAME}`);
|
|
33
33
|
this.setModuleName(MODULE_NAME);
|
|
34
34
|
this.setModelName(MODEL_NAME);
|
|
@@ -36,59 +36,61 @@ const MODEL_NAME = "<%- ModelName %>";
|
|
|
36
36
|
this.setValidators(Validators);
|
|
37
37
|
this.setOptions("params", params);
|
|
38
38
|
this.setOptions("list", {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
interface: {
|
|
40
|
+
combined: true,
|
|
41
|
+
factory: this.make.<%- modelName %>,
|
|
42
42
|
},
|
|
43
43
|
endless: false,
|
|
44
44
|
preload: {},
|
|
45
45
|
sorter: {
|
|
46
|
-
|
|
46
|
+
id: -1,
|
|
47
47
|
},
|
|
48
48
|
showSearch: true,
|
|
49
49
|
idField: "_id",
|
|
50
50
|
fields: [
|
|
51
|
-
|
|
51
|
+
<% if (increment) { %>
|
|
52
52
|
{
|
|
53
|
-
|
|
53
|
+
path: ":<%- modelName %>ID",
|
|
54
54
|
title: "ID",
|
|
55
55
|
searchable: true,
|
|
56
56
|
sortable: true,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
57
|
+
},
|
|
58
|
+
<% } %>
|
|
59
|
+
<% for (let fieldName of fields){ %>
|
|
60
|
+
{
|
|
61
|
+
path: ":<%- fieldName[0] %>",
|
|
62
|
+
title: `${MODULE_NAME}:<%- `${modelName}_field_${fieldName[0]}_label` %>`,
|
|
63
|
+
searchable: true,
|
|
64
|
+
sortable: true,
|
|
65
|
+
},
|
|
66
|
+
<% } %>
|
|
67
|
+
{
|
|
68
|
+
path: ":_id",
|
|
69
|
+
title: "Действия",
|
|
70
|
+
type: "button",
|
|
71
|
+
preprocessor: (value) => CRUDActionList.createActionsButtons(this, value),
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
this.start();
|
|
77
|
+
return this;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
createDefault() {
|
|
81
|
+
let newRecord = this.getModel({
|
|
82
|
+
<% for (let fieldName of fields){ %><%- fieldName[0] %>: undefined,
|
|
83
|
+
<% } %>
|
|
84
|
+
});
|
|
85
|
+
return newRecord;
|
|
86
|
+
}
|
|
75
87
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
88
|
+
static getMenu(){
|
|
89
|
+
return notCRUD.getCommonMenu(nc<%- ModelName %>Common);
|
|
90
|
+
}
|
|
79
91
|
|
|
80
|
-
|
|
81
|
-
let newRecord = this.getModel({
|
|
82
|
-
<% for (let fieldName of fields){ %><%- fieldName[0] %>: undefined,
|
|
83
|
-
<% } %>
|
|
84
|
-
});
|
|
85
|
-
return newRecord;
|
|
86
|
-
}
|
|
92
|
+
}
|
|
87
93
|
|
|
88
|
-
|
|
89
|
-
return notCRUD.getCommonMenu(nc<%- ModelName %>Common);
|
|
90
|
-
}
|
|
94
|
+
export default nc<%- ModelName %>Common;
|
|
91
95
|
|
|
92
|
-
}
|
|
93
96
|
|
|
94
|
-
export default nc<%- ModelName %>Common;
|