@steedos/service-pages 2.2.4 → 2.2.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.
|
@@ -14,7 +14,7 @@ function upperFirst(str) {
|
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
Steedos.Page.getPage = function(type, appId, objectApiName, recordId){
|
|
17
|
-
if(objectApiName){
|
|
17
|
+
if(type != 'list' && objectApiName){
|
|
18
18
|
const objectInfo = Creator.getObject(Session.get("object_name"));
|
|
19
19
|
if(objectInfo.version < 2){
|
|
20
20
|
return ;
|
|
@@ -44,7 +44,10 @@ Steedos.Page.render = function (root, page, data) {
|
|
|
44
44
|
"schema": typeof page.schema === 'string' ? JSON.parse(page.schema) : page.schema,
|
|
45
45
|
"data": Object.assign({}, data,{
|
|
46
46
|
rootUrl: __meteor_runtime_config__.ROOT_URL,
|
|
47
|
-
|
|
47
|
+
tenantId: Creator.USER_CONTEXT.spaceId,
|
|
48
|
+
userId: Creator.USER_CONTEXT.userId,
|
|
49
|
+
authToken: Creator.USER_CONTEXT.user.authToken,
|
|
50
|
+
user: Creator.USER_CONTEXT.user
|
|
48
51
|
})
|
|
49
52
|
}
|
|
50
53
|
},
|
|
@@ -167,6 +170,23 @@ Steedos.Page.RelatedListview.render = function(template, objectApiName){
|
|
|
167
170
|
};
|
|
168
171
|
|
|
169
172
|
Steedos.Page.Form.StandardNew.render = function(appId, objectApiName, tilte, initialValues){
|
|
173
|
+
|
|
174
|
+
const page = Steedos.Page.getPage('form', appId, objectApiName);
|
|
175
|
+
if(page && page.schema){
|
|
176
|
+
const elementId = `list-action-custom-${objectApiName}-standard_new`;
|
|
177
|
+
if($(`#${elementId}`).length === 0){
|
|
178
|
+
const listActionsElements = $(".grid-info-actions");
|
|
179
|
+
listActionsElements.prepend(`<div id="${elementId}"></div>`)
|
|
180
|
+
}
|
|
181
|
+
return Steedos.Page.render($(`#${elementId}`)[0], page, {
|
|
182
|
+
appId: appId,
|
|
183
|
+
objectName: objectApiName,
|
|
184
|
+
tilte: tilte,
|
|
185
|
+
initialValues: initialValues,
|
|
186
|
+
page: page
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
|
|
170
190
|
SteedosUI.showModal(stores.ComponentRegistry.components.ObjectForm, {
|
|
171
191
|
name: `${objectApiName}_standard_new_form`,
|
|
172
192
|
objectApiName: objectApiName,
|
|
@@ -187,6 +207,23 @@ Steedos.Page.Form.StandardNew.render = function(appId, objectApiName, tilte, ini
|
|
|
187
207
|
};
|
|
188
208
|
|
|
189
209
|
Steedos.Page.Form.StandardEdit.render = function(appId, objectApiName, tilte, recordId){
|
|
210
|
+
|
|
211
|
+
const page = Steedos.Page.getPage('form', appId, objectApiName, recordId);
|
|
212
|
+
if(page && page.schema){
|
|
213
|
+
const elementId = `list-action-custom-${objectApiName}-standard_edit`;
|
|
214
|
+
if($(`#${elementId}`).length === 0){
|
|
215
|
+
const listActionsElements = $(".grid-info-actions");
|
|
216
|
+
listActionsElements.prepend(`<div id="${elementId}"></div>`)
|
|
217
|
+
}
|
|
218
|
+
return Steedos.Page.render($(`#${elementId}`)[0], page, {
|
|
219
|
+
appId: appId,
|
|
220
|
+
objectName: objectApiName,
|
|
221
|
+
tilte: tilte,
|
|
222
|
+
recordId: recordId,
|
|
223
|
+
page: page
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
|
|
190
227
|
return SteedosUI.showModal(stores.ComponentRegistry.components.ObjectForm, {
|
|
191
228
|
name: `${objectApiName}_standard_edit_form`,
|
|
192
229
|
objectApiName: objectApiName,
|
|
@@ -85,7 +85,7 @@ module.exports = {
|
|
|
85
85
|
*/
|
|
86
86
|
methods: {
|
|
87
87
|
getDefaultSchema: {
|
|
88
|
-
async handler(type, app, objectApiName,
|
|
88
|
+
async handler(type, app, objectApiName, recordId, formFactor, userSession) {
|
|
89
89
|
if (process.env.DEFAULT_PAGE_RENDER) {
|
|
90
90
|
return await this.broker.call(`${process.env.DEFAULT_PAGE_RENDER}.getDefaultSchema`, {type, app, objectApiName, recordId, formFactor}, {
|
|
91
91
|
meta: {
|
|
@@ -102,7 +102,7 @@ module.exports = {
|
|
|
102
102
|
if (type === 'list' || type === 'record' || type === 'form') {
|
|
103
103
|
filters.push(['object_name', '=', objectApiName]);
|
|
104
104
|
}
|
|
105
|
-
return await objectql.getObject('pages').find({ filters: filters });
|
|
105
|
+
return await objectql.getObject('pages').find({ filters: filters, sort: 'modified desc' });
|
|
106
106
|
}
|
|
107
107
|
},
|
|
108
108
|
getAssignments: {
|
|
@@ -116,7 +116,7 @@ module.exports = {
|
|
|
116
116
|
}else{
|
|
117
117
|
filters.push(['desktop','=', true])
|
|
118
118
|
}
|
|
119
|
-
return await objectql.getObject("page_assignments").find({ filters: filters });
|
|
119
|
+
return await objectql.getObject("page_assignments").find({ filters: filters, sort: 'modified desc' });
|
|
120
120
|
}
|
|
121
121
|
},
|
|
122
122
|
getAppProfileAssignment: {
|
|
@@ -161,8 +161,6 @@ module.exports = {
|
|
|
161
161
|
* 2 如果已指定,则应用程序默认设置 页面分配会覆盖组织默认设置。
|
|
162
162
|
* 3 应用程序、记录类型和简档, 分配会覆盖组织和应用程序默认设置。
|
|
163
163
|
*
|
|
164
|
-
* TODO form factors "LARGE","SMALL"
|
|
165
|
-
* TODO 页面分配有多条时的优先级处理(始终是最新的分配生效)。
|
|
166
164
|
*/
|
|
167
165
|
async handler(type, app, objectApiName, recordId, formFactor, userSession) {
|
|
168
166
|
|
|
@@ -202,7 +200,7 @@ module.exports = {
|
|
|
202
200
|
}
|
|
203
201
|
const defaultSchema = await this.getDefaultSchema(type, app, objectApiName, recordId, formFactor, userSession);
|
|
204
202
|
if(defaultSchema){
|
|
205
|
-
return {schema: defaultSchema}
|
|
203
|
+
return { render_engine: process.env.DEFAULT_PAGE_RENDER , schema: defaultSchema}
|
|
206
204
|
}
|
|
207
205
|
}
|
|
208
206
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos/service-pages",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.5",
|
|
4
4
|
"main": "package.service.js",
|
|
5
5
|
"scripts": {},
|
|
6
6
|
"license": "MIT",
|
|
@@ -11,5 +11,5 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@builder.io/react": "^1.1.50"
|
|
13
13
|
},
|
|
14
|
-
"gitHead": "
|
|
14
|
+
"gitHead": "260131162c3eb25ec8d51e915b773610c7b2653c"
|
|
15
15
|
}
|