not-node 6.3.40 → 6.3.42
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
CHANGED
package/src/core/locales/ru.json
CHANGED
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"field_UUID_label": "UUID",
|
|
54
54
|
"field_UUID_placeholder": "UUID",
|
|
55
55
|
"crud_create_action_waiting": "Создание записи...",
|
|
56
|
-
"
|
|
56
|
+
"crud_create_action_form_title": "Добавление",
|
|
57
57
|
"crud_create_action_form_description": "Добавить новый документ",
|
|
58
58
|
"crud_read_action_waiting": "Чтение записи...",
|
|
59
59
|
"crud_read_action_form_title": "Детали",
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
import { MODULE_NAME } from "../../const.js";
|
|
1
2
|
import Validators from "../common/validators.js";
|
|
2
3
|
import { Frame } from "not-bulma";
|
|
3
4
|
const { notCRUD } = Frame;
|
|
4
5
|
|
|
5
|
-
const MODULE_NAME = "<%- ModuleName %>";
|
|
6
6
|
const MODEL_NAME = "<%- ModelName %>";
|
|
7
7
|
|
|
8
8
|
const LABELS = {
|
|
9
|
-
plural:
|
|
10
|
-
single:
|
|
9
|
+
plural: `${MODULE_NAME}:${MODEL_NAME}_label_plural`,
|
|
10
|
+
single: `${MODULE_NAME}:${MODEL_NAME}_label_single`,
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
class nc<%- ModelName %>Common extends notCRUD {
|
|
@@ -44,7 +44,7 @@ class nc<%- ModelName %>Common extends notCRUD {
|
|
|
44
44
|
<% for (let fieldName of fields){ %>
|
|
45
45
|
{
|
|
46
46
|
path: ":<%- fieldName %>",
|
|
47
|
-
title:
|
|
47
|
+
title: `${MODULE_NAME}:<%- `${modelName}_field_${fieldName}_label` %>`,
|
|
48
48
|
searchable: true,
|
|
49
49
|
sortable: true,
|
|
50
50
|
},
|
|
@@ -56,17 +56,17 @@ class nc<%- ModelName %>Common extends notCRUD {
|
|
|
56
56
|
preprocessor: (value) => {
|
|
57
57
|
return [
|
|
58
58
|
{
|
|
59
|
-
action: this.goDetails
|
|
59
|
+
action: ()=>this.goDetails(value),
|
|
60
60
|
title: "Подробнее",
|
|
61
61
|
size: "small",
|
|
62
62
|
},
|
|
63
63
|
{
|
|
64
|
-
action: this.goUpdate
|
|
64
|
+
action: ()=>this.goUpdate(value),
|
|
65
65
|
title: "Изменить",
|
|
66
66
|
size: "small",
|
|
67
67
|
},
|
|
68
68
|
{
|
|
69
|
-
action: this.goDelete
|
|
69
|
+
action: ()=>this.goDelete(value),
|
|
70
70
|
color: "danger",
|
|
71
71
|
title: "Удалить",
|
|
72
72
|
size: "small",
|
|
@@ -94,3 +94,4 @@ class nc<%- ModelName %>Common extends notCRUD {
|
|
|
94
94
|
|
|
95
95
|
export default nc<%- ModelName %>Common;
|
|
96
96
|
|
|
97
|
+
|
|
@@ -1,29 +1,24 @@
|
|
|
1
|
+
const { MODULE_NAME } = require("../const");
|
|
2
|
+
const { firstLetterToLower } = require("not-node").Common;
|
|
1
3
|
const ACTION_SIGNATURES = require('not-node/src/auth/const').ACTION_SIGNATURES;
|
|
4
|
+
const MODEL_NAME = "<%- ModelName %>";
|
|
5
|
+
const modelName = firstLetterToLower(MODEL_NAME);
|
|
6
|
+
|
|
2
7
|
const FIELDS = [
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
<% } %>
|
|
11
|
-
<% } %>
|
|
12
|
-
<% if (ownage){ %>
|
|
13
|
-
["owner", "not-node//owner"],
|
|
14
|
-
["ownerModel", "not-node//ownerModel"],
|
|
15
|
-
<% } %>
|
|
16
|
-
<% if (dates){ %>
|
|
17
|
-
["createdAt", "not-node//createdAt"],
|
|
18
|
-
["updatedAt", "not-node//updatedAt"],
|
|
19
|
-
<% } %>
|
|
8
|
+
["_id", "not-node//_id"],
|
|
9
|
+
<% if (increment){ %>["<%- modelName %>ID", "not-node//ID"],<% } %>
|
|
10
|
+
<% if (fields && Array.isArray(fields)) { %><% for(let field of fields){ %>"<%- field %>",<% } %><% } %>
|
|
11
|
+
<% if (ownage){ %>["owner", "not-node//owner"],
|
|
12
|
+
["ownerModel", "not-node//ownerModel"],<% } %>
|
|
13
|
+
<% if (dates){ %> ["createdAt", "not-node//createdAt"],
|
|
14
|
+
["updatedAt", "not-node//updatedAt"],<% } %>
|
|
20
15
|
];
|
|
21
16
|
|
|
22
17
|
const actionNamePath = "/:actionName";
|
|
23
18
|
const idActionPath = "/:record[_id]/:actionName";
|
|
24
19
|
|
|
25
20
|
module.exports = {
|
|
26
|
-
model:
|
|
21
|
+
model: modelName,
|
|
27
22
|
url: "/api/:modelName",
|
|
28
23
|
fields: FIELDS,
|
|
29
24
|
privateFields: [],
|