@steedos/service-pages 2.4.0-beta.8 → 2.4.0
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/main/default/client/builder.client.js +1 -39
- package/main/default/client/page.render.client.js +121 -242
- package/main/default/objects/pages/buttons/customPage.button.js +2 -1
- package/main/default/objects/pages/buttons/deploy.button.js +2 -1
- package/main/default/objects/pages/buttons/disable.button.js +2 -1
- package/main/default/objects/pages/buttons/enable.button.js +2 -1
- package/main/default/objects/pages/buttons/resetSchema.button.js +2 -1
- package/main/default/objects/pages/buttons/showDesign.button.js +1 -1
- package/main/default/objects/pages/fields/object_name.field.yml +3 -3
- package/main/default/objects/pages/fields/render_engine.field.yml +2 -2
- package/main/default/routes/page_design.router.js +3 -14
- package/main/default/triggers/pages_init.trigger.js +17 -1
- package/package.json +2 -2
- package/public/js/requirejs/@steedos/filters.js +0 -8
- package/public/js/requirejs/@steedos-builder/react.js +0 -8
- package/public/js/requirejs/@steedos-builder/sdk.js +0 -8
- package/public/js/requirejs/builder-react.js +0 -4
- package/public/js/requirejs/builder-sdk.js +0 -3
- package/public/js/requirejs/filters.js +0 -4
- package/public/js/requirejs/lodash.js +0 -3
- package/public/js/requirejs/react-dom.js +0 -3
- package/public/js/requirejs/react.js +0 -3
- package/public/js/requirejs/require.js +0 -2147
- package/public/logo.png +0 -0
|
@@ -42,55 +42,17 @@
|
|
|
42
42
|
return _innerWaitForThing(obj, path, func);
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
-
// window.SteedosMonacoEnvironment = window.MonacoEnvironment = {
|
|
46
|
-
// getWorkerUrl: function(workerId, label) {
|
|
47
|
-
// return `data:text/javascript;charset=utf-8,${encodeURIComponent(`
|
|
48
|
-
// self.MonacoEnvironment = {
|
|
49
|
-
// baseUrl: '/unpkg.com/monaco-editor/min/'
|
|
50
|
-
// };
|
|
51
|
-
// importScripts('/unpkg.com/monaco-editor/min/vs/base/worker/workerMain.js');`
|
|
52
|
-
// )}`;
|
|
53
|
-
// }
|
|
54
|
-
// };
|
|
55
|
-
|
|
56
|
-
// Object.defineProperty(window, 'MonacoEnvironment', {set: ()=>{}, get: ()=>window.SteedosMonacoEnvironment})
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
if (window.define)
|
|
60
|
-
window.define.amd = undefined;
|
|
61
|
-
|
|
62
|
-
// window.ReactDOM = ReactDom;
|
|
63
|
-
window.React17 = window.React;
|
|
64
|
-
window.ReactDOM17 = window.ReactDOM;
|
|
65
|
-
|
|
66
|
-
// const BuilderSDK = BuilderReact;
|
|
67
|
-
|
|
68
|
-
// window.BuilderReact = BuilderReact;
|
|
69
|
-
// window.BuilderSDK = BuilderSDK;
|
|
70
|
-
|
|
71
|
-
window.Builder = BuilderReact.Builder;
|
|
72
|
-
|
|
73
|
-
window.BuilderComponent = BuilderReact.BuilderComponent;
|
|
74
|
-
|
|
75
|
-
// window.builder = BuilderReact.builder;
|
|
76
|
-
|
|
77
45
|
Promise.all([
|
|
78
46
|
waitForThing(Creator, 'USER_CONTEXT'),
|
|
79
47
|
]).then(()=>{
|
|
80
48
|
Builder.set({
|
|
81
|
-
rootUrl: __meteor_runtime_config__.ROOT_URL,
|
|
82
|
-
unpkgUrl: Steedos.absoluteUrl('/unpkg.com'),
|
|
83
49
|
context: {
|
|
84
|
-
rootUrl:
|
|
50
|
+
rootUrl: Builder.settings.rootUrl,
|
|
85
51
|
tenantId: Creator.USER_CONTEXT.spaceId,
|
|
86
52
|
userId: Creator.USER_CONTEXT.userId,
|
|
87
53
|
authToken: Creator.USER_CONTEXT.user.authToken
|
|
88
54
|
}
|
|
89
55
|
})
|
|
90
|
-
// if(Meteor.settings.public.page && Meteor.settings.public.page.assetUrls){
|
|
91
|
-
// const defaultAssetsUrls = Meteor.settings.public.page.assetUrls.split(',')
|
|
92
|
-
// Builder.registerRemoteAssets(defaultAssetsUrls)
|
|
93
|
-
// }
|
|
94
56
|
|
|
95
57
|
window.postMessage({ type: "Builder.loaded" })
|
|
96
58
|
})
|
|
@@ -4,28 +4,6 @@
|
|
|
4
4
|
* @Description: 提供自定义page渲染能力, 供内部使用, 内容会迭代调整, 不对用户开放.
|
|
5
5
|
*/
|
|
6
6
|
;(function(){
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const withModalWrap = (component, provideProps) => {
|
|
10
|
-
return (props) => {
|
|
11
|
-
const ModalComponent = component;
|
|
12
|
-
return React.createElement(ModalComponent, props);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
const render = (component, componentProps, container, provideProps = {} ) => {
|
|
16
|
-
try {
|
|
17
|
-
const wrapComponent = withModalWrap(component, provideProps);
|
|
18
|
-
const contentEle = React.createElement(wrapComponent,{
|
|
19
|
-
...componentProps
|
|
20
|
-
});
|
|
21
|
-
setTimeout(()=>{
|
|
22
|
-
ReactDOM.render(contentEle, container);
|
|
23
|
-
}, 100)
|
|
24
|
-
} catch (error) {
|
|
25
|
-
console.log(`error`, error)
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
7
|
Steedos.Page = {
|
|
30
8
|
App: {},
|
|
31
9
|
Record: {},
|
|
@@ -58,12 +36,13 @@
|
|
|
58
36
|
|
|
59
37
|
Steedos.Page.getPage = function (type, appId, objectApiName, recordId, pageId) {
|
|
60
38
|
let objectInfo = null;
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
39
|
+
let searchParams = FlowRouter.current().queryParams;
|
|
40
|
+
|
|
41
|
+
const display = searchParams['display']
|
|
42
|
+
const listViewId = searchParams['listview_id']
|
|
43
|
+
const sideObject = searchParams['side_object']
|
|
44
|
+
const sideListviewId = searchParams['side_listview_id']
|
|
45
|
+
|
|
67
46
|
if(!objectApiName){
|
|
68
47
|
objectApiName = ''
|
|
69
48
|
}
|
|
@@ -74,34 +53,27 @@
|
|
|
74
53
|
pageId = ''
|
|
75
54
|
}
|
|
76
55
|
const formFactor = Steedos.isMobile() ? "SMALL" : "LARGE";
|
|
77
|
-
|
|
78
|
-
if
|
|
79
|
-
|
|
56
|
+
|
|
57
|
+
if(type != 'list' && type != 'record'){
|
|
58
|
+
const page = Steedos.authRequest(`/api/pageSchema/${type}?app=${appId}&objectApiName=${objectApiName}&recordId=${recordId}&pageId=${pageId}&formFactor=${formFactor}`, { async: false });
|
|
59
|
+
if (page && page.schema) {
|
|
60
|
+
return page;
|
|
61
|
+
}
|
|
80
62
|
}
|
|
81
|
-
|
|
63
|
+
|
|
64
|
+
if(type === 'list'){
|
|
82
65
|
return {
|
|
83
66
|
render_engine: 'amis',
|
|
84
67
|
name: 'steedosListviewPage',
|
|
85
|
-
schema:
|
|
86
|
-
"
|
|
87
|
-
|
|
88
|
-
"
|
|
89
|
-
|
|
90
|
-
"
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
"label": "列表视图",
|
|
95
|
-
"objectApiName": "${objectName}",
|
|
96
|
-
"columnsTogglable": false,
|
|
97
|
-
"listName": "all",
|
|
98
|
-
"id": "u:be7c6341cd11"
|
|
99
|
-
}
|
|
100
|
-
],
|
|
101
|
-
"regions": [
|
|
102
|
-
"body"
|
|
103
|
-
],
|
|
104
|
-
"id": "u:7b47b6042b0d"
|
|
68
|
+
schema:{
|
|
69
|
+
"name": `${objectApiName}-listview-${listViewId}`,
|
|
70
|
+
"type": "steedos-page-listview",
|
|
71
|
+
"showHeader": true,
|
|
72
|
+
"objectApiName": objectApiName,
|
|
73
|
+
"appId": appId,
|
|
74
|
+
"display": display,
|
|
75
|
+
"columnsTogglable": false,
|
|
76
|
+
"listName": "all",
|
|
105
77
|
}
|
|
106
78
|
}
|
|
107
79
|
}else if(type === 'record'){
|
|
@@ -109,36 +81,15 @@
|
|
|
109
81
|
render_engine: 'amis',
|
|
110
82
|
name: 'steedosRecordPage',
|
|
111
83
|
schema: {
|
|
112
|
-
"
|
|
113
|
-
"
|
|
114
|
-
"
|
|
115
|
-
"
|
|
116
|
-
"
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
appId: appId,
|
|
122
|
-
"id": "u:48d2c28eb755",
|
|
123
|
-
onEvent: {
|
|
124
|
-
"recordLoaded": {
|
|
125
|
-
"actions": [
|
|
126
|
-
{
|
|
127
|
-
"actionType": "reload",
|
|
128
|
-
"data": {
|
|
129
|
-
"name": `\${record.${objectInfo?.NAME_FIELD_KEY || 'name'}}`
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
]
|
|
133
|
-
}
|
|
134
|
-
},
|
|
135
|
-
}
|
|
136
|
-
],
|
|
137
|
-
"regions": [
|
|
138
|
-
"body"
|
|
139
|
-
],
|
|
140
|
-
"id": "u:d138f5276481"
|
|
141
|
-
}
|
|
84
|
+
"name": `${objectApiName}-recordDetail-${recordId}`,
|
|
85
|
+
"type": "steedos-page-record-detail",
|
|
86
|
+
"objectApiName": objectApiName,
|
|
87
|
+
"sideObject": sideObject,
|
|
88
|
+
"sideListviewId": sideListviewId,
|
|
89
|
+
"recordId": recordId,
|
|
90
|
+
"display": display,
|
|
91
|
+
"appId": appId,
|
|
92
|
+
}
|
|
142
93
|
}
|
|
143
94
|
|
|
144
95
|
}else if(type === 'related_list'){
|
|
@@ -221,24 +172,21 @@
|
|
|
221
172
|
},
|
|
222
173
|
body: [
|
|
223
174
|
{
|
|
224
|
-
"type": "panel",
|
|
225
|
-
"title": {
|
|
226
175
|
"type": "breadcrumb",
|
|
227
|
-
"source": "${$breadcrumb}"
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
}
|
|
176
|
+
"source": "${$breadcrumb}",
|
|
177
|
+
"className": "mx-4 my-2",
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
type: 'steedos-object-related-listview',
|
|
181
|
+
objectApiName: masterObject.name,
|
|
182
|
+
recordId: FlowRouter.getParam("record_id"),
|
|
183
|
+
relatedObjectApiName: objectApiName,
|
|
184
|
+
foreign_key: relatedKey,
|
|
185
|
+
relatedKey: relatedKey,
|
|
186
|
+
hiddenOn: "!!!this.$loaded",
|
|
187
|
+
"className": "mx-4",
|
|
188
|
+
// top: 5
|
|
189
|
+
}
|
|
242
190
|
,
|
|
243
191
|
// {
|
|
244
192
|
// type: 'steedos-object-related-listview',
|
|
@@ -257,55 +205,7 @@
|
|
|
257
205
|
}
|
|
258
206
|
|
|
259
207
|
Steedos.Page.render = function (root, page, data, options = {}) {
|
|
260
|
-
|
|
261
|
-
"inputs": [],
|
|
262
|
-
// "title": "loading",
|
|
263
|
-
"blocks": [
|
|
264
|
-
{
|
|
265
|
-
"@type": "@builder.io/sdk:Element",
|
|
266
|
-
"@version": 2,
|
|
267
|
-
"layerName": "Box",
|
|
268
|
-
"id": "builder-8070f86b1aed4e78a5878fa5c0d79e49",
|
|
269
|
-
"children": [
|
|
270
|
-
{
|
|
271
|
-
"@type": "@builder.io/sdk:Element",
|
|
272
|
-
"@version": 2,
|
|
273
|
-
"layerName": "Loading...\n...",
|
|
274
|
-
"id": "builder-4b16375a68dc4e49b4844843091bf91d",
|
|
275
|
-
"component": {
|
|
276
|
-
"name": "Text",
|
|
277
|
-
"options": {
|
|
278
|
-
"text": "<p>Loading...</p>\n"
|
|
279
|
-
}
|
|
280
|
-
},
|
|
281
|
-
"responsiveStyles": {
|
|
282
|
-
"large": {
|
|
283
|
-
"display": "flex",
|
|
284
|
-
"flexDirection": "column",
|
|
285
|
-
"position": "relative",
|
|
286
|
-
"flexShrink": "0",
|
|
287
|
-
"boxSizing": "border-box",
|
|
288
|
-
"marginTop": "20px",
|
|
289
|
-
"lineHeight": "normal",
|
|
290
|
-
"height": "auto",
|
|
291
|
-
"textAlign": "center"
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
],
|
|
296
|
-
"responsiveStyles": {
|
|
297
|
-
"large": {
|
|
298
|
-
"display": "flex",
|
|
299
|
-
"flexDirection": "column",
|
|
300
|
-
"position": "relative",
|
|
301
|
-
"flexShrink": "0",
|
|
302
|
-
"boxSizing": "border-box"
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
]
|
|
307
|
-
};
|
|
308
|
-
|
|
208
|
+
// console.log(`Steedos.Page.render`, root, page)
|
|
309
209
|
if (page.render_engine && page.render_engine != 'redash') {
|
|
310
210
|
|
|
311
211
|
let schema = typeof page.schema === 'string' ? JSON.parse(page.schema) : page.schema;
|
|
@@ -329,92 +229,33 @@
|
|
|
329
229
|
now: new Date(),
|
|
330
230
|
// mode: mode //由表单提供
|
|
331
231
|
},
|
|
332
|
-
scopeId: schema.name || schema.id
|
|
232
|
+
scopeId: schema.name || schema.id,
|
|
233
|
+
$scopeId : schema.name || schema.id
|
|
333
234
|
}
|
|
334
235
|
});
|
|
335
236
|
|
|
336
237
|
schema = lodash.defaultsDeep(defData , schema);
|
|
337
238
|
|
|
338
|
-
const pageContentData = {
|
|
339
|
-
"blocks": [
|
|
340
|
-
{
|
|
341
|
-
"@type": "@builder.io/sdk:Element",
|
|
342
|
-
"@version": 2,
|
|
343
|
-
"id": `builder-${page._id}`,
|
|
344
|
-
"component": {
|
|
345
|
-
"name": upperFirst(page.render_engine),
|
|
346
|
-
"options": {
|
|
347
|
-
"schema": schema,
|
|
348
|
-
"data": data,
|
|
349
|
-
"name": page.name,
|
|
350
|
-
"pageType": page.type
|
|
351
|
-
}
|
|
352
|
-
},
|
|
353
|
-
}
|
|
354
|
-
],
|
|
355
|
-
"inputs": [
|
|
356
|
-
]
|
|
357
|
-
}
|
|
358
|
-
|
|
359
239
|
const findComponent = (obj, componentName)=>{
|
|
360
240
|
return lodash.find(obj, {name : componentName})
|
|
361
241
|
}
|
|
362
242
|
|
|
363
243
|
if(!lodash.isFunction(root)){
|
|
364
244
|
//渲染loading
|
|
365
|
-
render(BuilderComponent, {
|
|
366
|
-
model: "page", content: {
|
|
367
|
-
"data": loadingContentData
|
|
368
|
-
}
|
|
369
|
-
}, root)
|
|
370
245
|
}
|
|
371
246
|
|
|
372
247
|
Promise.all([
|
|
373
|
-
waitForThing(window, '
|
|
248
|
+
waitForThing(window, 'renderAmis'),
|
|
374
249
|
waitForThing(Builder.components, upperFirst(page.render_engine), findComponent)
|
|
375
250
|
]).then(()=>{
|
|
376
251
|
//渲染page
|
|
252
|
+
// console.log(`renderAmis`, schema, data)
|
|
377
253
|
if(!lodash.isFunction(root)){
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
}else{
|
|
384
|
-
if(root === SteedosUI.Drawer){
|
|
385
|
-
data.drawerName = data.drawerName || lodash.uniqueId(`drawer-${page.object_name}`);
|
|
386
|
-
SteedosUI.Drawer(Object.assign({
|
|
387
|
-
name: data.drawerName,
|
|
388
|
-
title: data.title,
|
|
389
|
-
destroyOnClose: true,
|
|
390
|
-
maskClosable: false,
|
|
391
|
-
footer: null,
|
|
392
|
-
bodyStyle: {padding: "0px", paddingTop: "12px"},
|
|
393
|
-
children: React17.createElement(BuilderComponent, {
|
|
394
|
-
model: "page", content: {
|
|
395
|
-
"data": pageContentData
|
|
396
|
-
}
|
|
397
|
-
})
|
|
398
|
-
}, options.props)).show();
|
|
399
|
-
}else{
|
|
400
|
-
data.modalName = data.modalName || lodash.uniqueId(`modal-${page.object_name}`);
|
|
401
|
-
SteedosUI.Modal(Object.assign({
|
|
402
|
-
name: data.modalName,
|
|
403
|
-
title: data.title,
|
|
404
|
-
destroyOnClose: true,
|
|
405
|
-
maskClosable: false,
|
|
406
|
-
keyboard: false, // 禁止 esc 关闭
|
|
407
|
-
footer: null,
|
|
408
|
-
bodyStyle: {padding: "0px", paddingTop: "12px"},
|
|
409
|
-
children: React17.createElement(BuilderComponent, {
|
|
410
|
-
model: "page", content: {
|
|
411
|
-
"data": pageContentData
|
|
412
|
-
}
|
|
413
|
-
})
|
|
414
|
-
}, options.props)).show();
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
|
|
254
|
+
renderAmis(
|
|
255
|
+
root,
|
|
256
|
+
schema,
|
|
257
|
+
data,
|
|
258
|
+
)
|
|
418
259
|
}
|
|
419
260
|
});
|
|
420
261
|
}
|
|
@@ -473,6 +314,7 @@
|
|
|
473
314
|
if (!modalRoot) {
|
|
474
315
|
modalRoot = document.createElement('div');
|
|
475
316
|
modalRoot.setAttribute('id', rootId);
|
|
317
|
+
modalRoot.setAttribute('class', 'h-full')
|
|
476
318
|
$(".page-list-view-root")[0].appendChild(modalRoot);
|
|
477
319
|
}
|
|
478
320
|
|
|
@@ -499,6 +341,7 @@
|
|
|
499
341
|
if (!modalRoot) {
|
|
500
342
|
modalRoot = document.createElement('div');
|
|
501
343
|
modalRoot.setAttribute('id', rootId);
|
|
344
|
+
modalRoot.setAttribute('class', 'h-full')
|
|
502
345
|
$(".page-record-view-root")[0].appendChild(modalRoot);
|
|
503
346
|
}
|
|
504
347
|
|
|
@@ -727,11 +570,12 @@
|
|
|
727
570
|
let logoSrc = '';
|
|
728
571
|
const space = db.spaces.findOne(Steedos.getSpaceId())
|
|
729
572
|
if(space?.avatar){
|
|
730
|
-
logoSrc = Steedos.absoluteUrl(space.avatar)
|
|
573
|
+
logoSrc = Steedos.absoluteUrl('api/files/avatars/'+space.avatar)
|
|
731
574
|
}else if(space?.avatar_square){
|
|
732
|
-
logoSrc = Steedos.absoluteUrl(space.avatar_square)
|
|
575
|
+
logoSrc = Steedos.absoluteUrl('api/files/avatars/'+space.avatar_square)
|
|
733
576
|
}else{
|
|
734
577
|
var settings = Session.get("tenant_settings");
|
|
578
|
+
var avatar_url = "";
|
|
735
579
|
if(settings){
|
|
736
580
|
avatar_url = settings?.logo_square_url;
|
|
737
581
|
}
|
|
@@ -748,7 +592,10 @@
|
|
|
748
592
|
|
|
749
593
|
Steedos.Page.Header.render = function(appId, tabId){
|
|
750
594
|
let app = _.find(Session.get('app_menus'), {id: appId}) || {}
|
|
751
|
-
if
|
|
595
|
+
if(_.isEmpty(app)){
|
|
596
|
+
return ;
|
|
597
|
+
}
|
|
598
|
+
if (appId === 'admin' || (window.innerWidth < 768))
|
|
752
599
|
app.showSidebar = true;
|
|
753
600
|
if (app.showSidebar)
|
|
754
601
|
document.body.classList.add('sidebar')
|
|
@@ -756,12 +603,16 @@
|
|
|
756
603
|
document.body.classList.remove("sidebar")
|
|
757
604
|
if (window.innerWidth >= 768)
|
|
758
605
|
document.body.classList.add('sidebar-open')
|
|
759
|
-
if(app.showSidebar &&
|
|
606
|
+
if(app.showSidebar && FlowRouter.current().path.startsWith("/workflow")){
|
|
760
607
|
app = {id: 'workflow'}
|
|
761
608
|
}
|
|
609
|
+
if(FlowRouter.current().path.startsWith("/workflow")){
|
|
610
|
+
document.body.classList.remove("sidebar-open")
|
|
611
|
+
}
|
|
762
612
|
try {
|
|
763
613
|
const data = {
|
|
764
|
-
app
|
|
614
|
+
app,
|
|
615
|
+
isMobile: window.innerWidth <= 768
|
|
765
616
|
};
|
|
766
617
|
const page = Steedos.Page.Header.getPage(appId, tabId);
|
|
767
618
|
var rootId = "steedosGlobalHeaderRoot";
|
|
@@ -772,6 +623,7 @@
|
|
|
772
623
|
$(".steedos-global-header-root")[0].appendChild(modalRoot);
|
|
773
624
|
}
|
|
774
625
|
if (page.render_engine && page.render_engine != 'redash') {
|
|
626
|
+
// console.log("Steedos.Page.Header.render", appId, tabId, page)
|
|
775
627
|
return Steedos.Page.render($("#" + rootId)[0], page, Object.assign({}, data));
|
|
776
628
|
}
|
|
777
629
|
} catch (error) {
|
|
@@ -779,7 +631,7 @@
|
|
|
779
631
|
}
|
|
780
632
|
}
|
|
781
633
|
Steedos.Page.Header.getPage = function(appId, tabId){
|
|
782
|
-
const logoSrc = getSpaceLogo
|
|
634
|
+
const logoSrc = Tracker.nonreactive(getSpaceLogo);
|
|
783
635
|
return {
|
|
784
636
|
render_engine: 'amis',
|
|
785
637
|
name: 'steedosGlobalHeaderPage',
|
|
@@ -793,26 +645,45 @@
|
|
|
793
645
|
body: [
|
|
794
646
|
{
|
|
795
647
|
"type": "wrapper",
|
|
796
|
-
"className": "p-0
|
|
648
|
+
"className": "bg-white sticky p-0 top-0 z-40 w-full flex-none backdrop-blur transition-colors duration-500 lg:z-50 sm:shadow border-b-[3px] border-sky-500 border-solid steedos-header-container",
|
|
797
649
|
body: [
|
|
798
650
|
{
|
|
799
651
|
"type": "wrapper",
|
|
800
|
-
"className": 'flex w-full px-4 h-[50px] p-0 justify-between items-center',
|
|
652
|
+
"className": 'flex w-full px-4 h-[50px] p-0 justify-between items-center steedos-header-container-line-one',
|
|
801
653
|
"body": [
|
|
802
654
|
{
|
|
803
655
|
type: "wrapper",
|
|
804
656
|
className: 'p-0 flex flex-1 items-center',
|
|
805
657
|
body: [
|
|
806
658
|
{
|
|
807
|
-
"type": "
|
|
808
|
-
"
|
|
809
|
-
"
|
|
810
|
-
"
|
|
659
|
+
"type": "button",
|
|
660
|
+
"className": "toggle-sidebar flex items-center pr-4",
|
|
661
|
+
"hiddenOn": "${!isMobile}",
|
|
662
|
+
"onEvent": {
|
|
663
|
+
"click": {
|
|
664
|
+
"actions": [
|
|
665
|
+
{
|
|
666
|
+
"actionType": "custom",
|
|
667
|
+
"script": "document.body.classList.toggle('sidebar-open')",
|
|
668
|
+
}
|
|
669
|
+
]
|
|
670
|
+
}
|
|
671
|
+
},
|
|
672
|
+
"body": [
|
|
673
|
+
{
|
|
674
|
+
"type": "steedos-icon",
|
|
675
|
+
"category": "utility",
|
|
676
|
+
"name": "rows",
|
|
677
|
+
"colorVariant": "default",
|
|
678
|
+
"id": "u:afc3a08e8cf3",
|
|
679
|
+
"className": "slds-button_icon slds-global-header__icon"
|
|
680
|
+
}
|
|
681
|
+
],
|
|
811
682
|
},
|
|
812
683
|
{
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
684
|
+
"className": 'block h-10 w-auto mr-4',
|
|
685
|
+
"type": "tpl",
|
|
686
|
+
"tpl": `<a href='/app' class='flex items-center '><img class='block h-10 w-auto' src='${logoSrc}'></a>`,
|
|
816
687
|
},
|
|
817
688
|
],
|
|
818
689
|
},
|
|
@@ -825,7 +696,7 @@
|
|
|
825
696
|
{
|
|
826
697
|
"type": "button",
|
|
827
698
|
"className": "toggle-sidebar",
|
|
828
|
-
"
|
|
699
|
+
"visibleOn": "${AND(app.showSidebar,!isMobile)}",
|
|
829
700
|
"onEvent": {
|
|
830
701
|
"click": {
|
|
831
702
|
"actions": [
|
|
@@ -853,11 +724,11 @@
|
|
|
853
724
|
|
|
854
725
|
{
|
|
855
726
|
"type": "grid",
|
|
856
|
-
hiddenOn: "${
|
|
857
|
-
"className": 'steedos-context-bar
|
|
727
|
+
"hiddenOn": "${isMobile}",
|
|
728
|
+
"className": 'steedos-context-bar flex flex-nowrap h-10 leading-5 pl-4 mb-[-3px] steedos-header-container-line-two',
|
|
858
729
|
"columns": [
|
|
859
730
|
{
|
|
860
|
-
"columnClassName": "items-center
|
|
731
|
+
"columnClassName": "items-center flex pb-0",
|
|
861
732
|
"body": [
|
|
862
733
|
{
|
|
863
734
|
"type": "steedos-app-launcher",
|
|
@@ -869,13 +740,15 @@
|
|
|
869
740
|
"valign": "middle"
|
|
870
741
|
},
|
|
871
742
|
{
|
|
872
|
-
|
|
743
|
+
hiddenOn: "${app.showSidebar === true}",
|
|
744
|
+
"columnClassName": "flex overflow-hidden",
|
|
873
745
|
"body": [
|
|
874
746
|
{
|
|
875
747
|
"type": "steedos-app-menu",
|
|
876
748
|
"stacked": false,
|
|
877
749
|
showIcon: false,
|
|
878
750
|
"appId": "${app.id}",
|
|
751
|
+
hiddenOn: "${app.showSidebar === true}",
|
|
879
752
|
overflow: {
|
|
880
753
|
enable: false,
|
|
881
754
|
itemWidth: 80,
|
|
@@ -895,17 +768,23 @@
|
|
|
895
768
|
{
|
|
896
769
|
|
|
897
770
|
"type": "button",
|
|
898
|
-
"className": 'p-0 absolute inset-0 mt-[50px]',
|
|
771
|
+
"className": 'p-0 absolute inset-0 mt-[50px] sm:mt-[90px]',
|
|
899
772
|
hiddenOn: "${app.showSidebar != true}",
|
|
900
773
|
body: [{
|
|
901
774
|
type: "wrapper",
|
|
902
775
|
className: 'sidebar-wrapper px-0 pt-4 pb-16 fixed z-20 h-full ease-in-out duration-300 flex flex-col border-r overflow-y-auto bg-white border-slate-200 block -translate-x-0 sm:w-[220px] w-64',
|
|
903
776
|
body: [
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
777
|
+
{
|
|
778
|
+
"type": "steedos-app-launcher",
|
|
779
|
+
"className": "px-4 pb-4",
|
|
780
|
+
"visibleOn": "${isMobile}",
|
|
781
|
+
"showAppName": true
|
|
782
|
+
},
|
|
783
|
+
{
|
|
784
|
+
"type": "steedos-app-menu",
|
|
785
|
+
"stacked": true,
|
|
786
|
+
"appId": "${app.id}",
|
|
787
|
+
},
|
|
909
788
|
]
|
|
910
789
|
}],
|
|
911
790
|
"onEvent": {
|
|
@@ -30,7 +30,8 @@ module.exports = {
|
|
|
30
30
|
};
|
|
31
31
|
Steedos.authRequest(url, options);
|
|
32
32
|
},
|
|
33
|
-
customPageVisible: function (object_name, record_id, permission,
|
|
33
|
+
customPageVisible: function (object_name, record_id, permission, data) {
|
|
34
|
+
var record = data && data.record;
|
|
34
35
|
return record && record.is_system;
|
|
35
36
|
}
|
|
36
37
|
}
|
|
@@ -31,7 +31,8 @@ module.exports = {
|
|
|
31
31
|
};
|
|
32
32
|
Steedos.authRequest(url, options);
|
|
33
33
|
},
|
|
34
|
-
deployVisible: function (object_name, record_id, permission,
|
|
34
|
+
deployVisible: function (object_name, record_id, permission, data) {
|
|
35
|
+
var record = data && data.record;
|
|
35
36
|
return record && !record.is_system;
|
|
36
37
|
}
|
|
37
38
|
}
|
|
@@ -24,7 +24,8 @@ module.exports = {
|
|
|
24
24
|
};
|
|
25
25
|
Steedos.authRequest(url, options);
|
|
26
26
|
},
|
|
27
|
-
disableVisible: function (object_name, record_id, permission,
|
|
27
|
+
disableVisible: function (object_name, record_id, permission, data) {
|
|
28
|
+
var record = data && data.record;
|
|
28
29
|
return record && record.is_active && !record.is_system
|
|
29
30
|
}
|
|
30
31
|
}
|
|
@@ -24,7 +24,8 @@ module.exports = {
|
|
|
24
24
|
};
|
|
25
25
|
Steedos.authRequest(url, options);
|
|
26
26
|
},
|
|
27
|
-
enableVisible: function (object_name, record_id, permission,
|
|
27
|
+
enableVisible: function (object_name, record_id, permission, data) {
|
|
28
|
+
var record = data && data.record;
|
|
28
29
|
return record && !record.is_active && !record.is_system
|
|
29
30
|
}
|
|
30
31
|
}
|
|
@@ -41,7 +41,8 @@ module.exports = {
|
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
43
|
},
|
|
44
|
-
resetSchemaVisible: function (object_name, record_id, permission,
|
|
44
|
+
resetSchemaVisible: function (object_name, record_id, permission, data) {
|
|
45
|
+
var record = data && data.record;
|
|
45
46
|
return record && !record.is_system && record.type === 'form';
|
|
46
47
|
}
|
|
47
48
|
}
|