@steedos/standard-object-database 2.3.0-beta.4 → 2.3.0-beta.8

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.
@@ -15,5 +15,79 @@ module.exports = {
15
15
  },
16
16
  customizeVisible: function(object_name, record_id, record_permissions, record){
17
17
  return Creator.baseObject.actions.standard_new.visible() && record.is_system;
18
+ },
19
+ standard_new: function (object_name, record_id, fields){
20
+ var object = Creator.getObject(object_name);
21
+ var gridName = this.action.gridName;
22
+ // var isRelated = this.action.isRelated;
23
+ var relatedFieldName = this.action.relatedFieldName;
24
+ var masterRecordId = this.action.masterRecordId;
25
+ var initialValues = this.action.initialValues
26
+ if(!initialValues){
27
+ initialValues = {};
28
+ initialValues[relatedFieldName] = masterRecordId
29
+ }
30
+ const appId = Session.get("app_id");
31
+ const page = Steedos.Page.getPage('form', appId, object_name);
32
+ const title = t('New') + ' ' + object.label;
33
+ if (page && page.schema) {
34
+ const options = {
35
+ gridName: gridName
36
+ };
37
+ const fullScreenProps = {
38
+ width: "unset",
39
+ style: {
40
+ top: "50px",
41
+ bottom: "50px",
42
+ left: "50px",
43
+ right: "50px",
44
+ padding: "0px",
45
+ margin: "0px",
46
+ width: "unset"
47
+ },
48
+ className: "absolute"
49
+ };
50
+ Steedos.Page.render(SteedosUI.Modal, page, Object.assign({}, options, {
51
+ appId: appId,
52
+ objectName: object_name,
53
+ title: title,
54
+ data: initialValues,
55
+ }), {
56
+ props: fullScreenProps
57
+ });
58
+ }
59
+ },
60
+ standard_edit: function (object_name, record_id, fields){
61
+ var object = Creator.getObject(object_name);
62
+ var gridName = this.action.gridName;
63
+ const appId = Session.get("app_id");
64
+ const page = Steedos.Page.getPage('form', appId, object_name, record_id);
65
+ const title = t('Edit') + ' ' + object.label;
66
+ if (page && page.schema) {
67
+ const options = {
68
+ gridName: gridName
69
+ };
70
+ const fullScreenProps = {
71
+ width: "unset",
72
+ style: {
73
+ top: "50px",
74
+ bottom: "50px",
75
+ left: "50px",
76
+ right: "50px",
77
+ padding: "0px",
78
+ margin: "0px",
79
+ width: "unset"
80
+ },
81
+ className: "absolute"
82
+ };
83
+ Steedos.Page.render(SteedosUI.Modal, page, Object.assign({}, options, {
84
+ appId: appId,
85
+ objectName: object_name,
86
+ title: title,
87
+ recordId: record_id
88
+ }), {
89
+ props: fullScreenProps
90
+ });
91
+ }
18
92
  }
19
93
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steedos/standard-object-database",
3
- "version": "2.3.0-beta.4",
3
+ "version": "2.3.0-beta.8",
4
4
  "main": "package.service.js",
5
5
  "private": false,
6
6
  "publishConfig": {
@@ -12,5 +12,5 @@
12
12
  "description": "steedos package",
13
13
  "repository": {},
14
14
  "license": "MIT",
15
- "gitHead": "04dec60fc62988742fcf63181d26f584f5995196"
15
+ "gitHead": "d0bfd52568ee68e3af0f251c06bd8169e823851f"
16
16
  }