@steedos/service-pages 2.4.0-beta.4 → 2.4.0-beta.40
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 -251
- 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,71 +53,34 @@
|
|
|
74
53
|
pageId = ''
|
|
75
54
|
}
|
|
76
55
|
const formFactor = Steedos.isMobile() ? "SMALL" : "LARGE";
|
|
77
|
-
|
|
78
|
-
if
|
|
79
|
-
return page;
|
|
80
|
-
}
|
|
81
|
-
else if(type === 'list'){
|
|
56
|
+
|
|
57
|
+
if(type === 'list'){
|
|
82
58
|
return {
|
|
83
59
|
render_engine: 'amis',
|
|
84
60
|
name: 'steedosListviewPage',
|
|
85
|
-
schema:
|
|
86
|
-
"type": "page",
|
|
87
|
-
|
|
88
|
-
"
|
|
89
|
-
|
|
90
|
-
"
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
showHeader: true,
|
|
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"
|
|
61
|
+
schema:{
|
|
62
|
+
"type": "steedos-page-listview",
|
|
63
|
+
"showHeader": true,
|
|
64
|
+
"objectApiName": objectApiName,
|
|
65
|
+
"appId": appId,
|
|
66
|
+
"display": display,
|
|
67
|
+
"columnsTogglable": false,
|
|
68
|
+
"listName": "all",
|
|
105
69
|
}
|
|
106
70
|
}
|
|
107
71
|
}else if(type === 'record'){
|
|
108
72
|
return {
|
|
109
73
|
render_engine: 'amis',
|
|
110
74
|
name: 'steedosRecordPage',
|
|
111
|
-
bodyClassName: 'p-3',
|
|
112
75
|
schema: {
|
|
113
|
-
"type": "page",
|
|
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
|
-
}
|
|
76
|
+
"type": "steedos-page-record-detail",
|
|
77
|
+
"objectApiName": objectApiName,
|
|
78
|
+
"sideObject": sideObject,
|
|
79
|
+
"sideListviewId": sideListviewId,
|
|
80
|
+
"recordId": recordId,
|
|
81
|
+
"display": display,
|
|
82
|
+
"appId": appId,
|
|
83
|
+
}
|
|
142
84
|
}
|
|
143
85
|
|
|
144
86
|
}else if(type === 'related_list'){
|
|
@@ -221,24 +163,21 @@
|
|
|
221
163
|
},
|
|
222
164
|
body: [
|
|
223
165
|
{
|
|
224
|
-
"type": "panel",
|
|
225
|
-
"title": {
|
|
226
166
|
"type": "breadcrumb",
|
|
227
|
-
"source": "${$breadcrumb}"
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
}
|
|
167
|
+
"source": "${$breadcrumb}",
|
|
168
|
+
"className": "mx-4 my-2",
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
type: 'steedos-object-related-listview',
|
|
172
|
+
objectApiName: masterObject.name,
|
|
173
|
+
recordId: FlowRouter.getParam("record_id"),
|
|
174
|
+
relatedObjectApiName: objectApiName,
|
|
175
|
+
foreign_key: relatedKey,
|
|
176
|
+
relatedKey: relatedKey,
|
|
177
|
+
hiddenOn: "!!!this.$loaded",
|
|
178
|
+
"className": "mx-4",
|
|
179
|
+
// top: 5
|
|
180
|
+
}
|
|
242
181
|
,
|
|
243
182
|
// {
|
|
244
183
|
// type: 'steedos-object-related-listview',
|
|
@@ -257,55 +196,7 @@
|
|
|
257
196
|
}
|
|
258
197
|
|
|
259
198
|
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
|
-
|
|
199
|
+
console.log(`Steedos.Page.render`, root, page)
|
|
309
200
|
if (page.render_engine && page.render_engine != 'redash') {
|
|
310
201
|
|
|
311
202
|
let schema = typeof page.schema === 'string' ? JSON.parse(page.schema) : page.schema;
|
|
@@ -329,92 +220,32 @@
|
|
|
329
220
|
now: new Date(),
|
|
330
221
|
// mode: mode //由表单提供
|
|
331
222
|
},
|
|
332
|
-
scopeId: schema.name || schema.id
|
|
223
|
+
scopeId: schema.name || schema.id,
|
|
224
|
+
$scopeId : schema.name || schema.id
|
|
333
225
|
}
|
|
334
226
|
});
|
|
335
227
|
|
|
336
228
|
schema = lodash.defaultsDeep(defData , schema);
|
|
337
229
|
|
|
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
230
|
const findComponent = (obj, componentName)=>{
|
|
360
231
|
return lodash.find(obj, {name : componentName})
|
|
361
232
|
}
|
|
362
233
|
|
|
363
234
|
if(!lodash.isFunction(root)){
|
|
364
235
|
//渲染loading
|
|
365
|
-
render(BuilderComponent, {
|
|
366
|
-
model: "page", content: {
|
|
367
|
-
"data": loadingContentData
|
|
368
|
-
}
|
|
369
|
-
}, root)
|
|
370
236
|
}
|
|
371
237
|
|
|
372
238
|
Promise.all([
|
|
373
|
-
waitForThing(window, '
|
|
239
|
+
waitForThing(window, 'renderAmis'),
|
|
374
240
|
waitForThing(Builder.components, upperFirst(page.render_engine), findComponent)
|
|
375
241
|
]).then(()=>{
|
|
376
242
|
//渲染page
|
|
377
243
|
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
|
-
|
|
244
|
+
renderAmis(
|
|
245
|
+
root,
|
|
246
|
+
schema,
|
|
247
|
+
data,
|
|
248
|
+
)
|
|
418
249
|
}
|
|
419
250
|
});
|
|
420
251
|
}
|
|
@@ -473,6 +304,7 @@
|
|
|
473
304
|
if (!modalRoot) {
|
|
474
305
|
modalRoot = document.createElement('div');
|
|
475
306
|
modalRoot.setAttribute('id', rootId);
|
|
307
|
+
modalRoot.setAttribute('class', 'h-full')
|
|
476
308
|
$(".page-list-view-root")[0].appendChild(modalRoot);
|
|
477
309
|
}
|
|
478
310
|
|
|
@@ -499,6 +331,7 @@
|
|
|
499
331
|
if (!modalRoot) {
|
|
500
332
|
modalRoot = document.createElement('div');
|
|
501
333
|
modalRoot.setAttribute('id', rootId);
|
|
334
|
+
modalRoot.setAttribute('class', 'h-full')
|
|
502
335
|
$(".page-record-view-root")[0].appendChild(modalRoot);
|
|
503
336
|
}
|
|
504
337
|
|
|
@@ -727,11 +560,12 @@
|
|
|
727
560
|
let logoSrc = '';
|
|
728
561
|
const space = db.spaces.findOne(Steedos.getSpaceId())
|
|
729
562
|
if(space?.avatar){
|
|
730
|
-
logoSrc = Steedos.absoluteUrl(space.avatar)
|
|
563
|
+
logoSrc = Steedos.absoluteUrl('api/files/avatars/'+space.avatar)
|
|
731
564
|
}else if(space?.avatar_square){
|
|
732
|
-
logoSrc = Steedos.absoluteUrl(space.avatar_square)
|
|
565
|
+
logoSrc = Steedos.absoluteUrl('api/files/avatars/'+space.avatar_square)
|
|
733
566
|
}else{
|
|
734
567
|
var settings = Session.get("tenant_settings");
|
|
568
|
+
var avatar_url = "";
|
|
735
569
|
if(settings){
|
|
736
570
|
avatar_url = settings?.logo_square_url;
|
|
737
571
|
}
|
|
@@ -747,19 +581,28 @@
|
|
|
747
581
|
}
|
|
748
582
|
|
|
749
583
|
Steedos.Page.Header.render = function(appId, tabId){
|
|
750
|
-
|
|
751
|
-
if
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
584
|
+
let app = _.find(Session.get('app_menus'), {id: appId}) || {}
|
|
585
|
+
if(_.isEmpty(app)){
|
|
586
|
+
return ;
|
|
587
|
+
}
|
|
588
|
+
if (appId === 'admin' || (window.innerWidth < 768))
|
|
589
|
+
app.showSidebar = true;
|
|
590
|
+
if (app.showSidebar)
|
|
591
|
+
document.body.classList.add('sidebar')
|
|
592
|
+
else
|
|
593
|
+
document.body.classList.remove("sidebar")
|
|
594
|
+
if (window.innerWidth >= 768)
|
|
595
|
+
document.body.classList.add('sidebar-open')
|
|
596
|
+
if(app.showSidebar && window.location.pathname.startsWith("/workflow")){
|
|
597
|
+
app = {id: 'workflow'}
|
|
598
|
+
}
|
|
599
|
+
if(window.location.pathname.startsWith("/workflow")){
|
|
600
|
+
document.body.classList.remove("sidebar-open")
|
|
758
601
|
}
|
|
759
|
-
|
|
760
602
|
try {
|
|
761
603
|
const data = {
|
|
762
|
-
app
|
|
604
|
+
app,
|
|
605
|
+
isMobile: window.innerWidth <= 768
|
|
763
606
|
};
|
|
764
607
|
const page = Steedos.Page.Header.getPage(appId, tabId);
|
|
765
608
|
var rootId = "steedosGlobalHeaderRoot";
|
|
@@ -777,7 +620,7 @@
|
|
|
777
620
|
}
|
|
778
621
|
}
|
|
779
622
|
Steedos.Page.Header.getPage = function(appId, tabId){
|
|
780
|
-
const logoSrc = getSpaceLogo
|
|
623
|
+
const logoSrc = Tracker.nonreactive(getSpaceLogo);
|
|
781
624
|
return {
|
|
782
625
|
render_engine: 'amis',
|
|
783
626
|
name: 'steedosGlobalHeaderPage',
|
|
@@ -791,26 +634,45 @@
|
|
|
791
634
|
body: [
|
|
792
635
|
{
|
|
793
636
|
"type": "wrapper",
|
|
794
|
-
"className": "p-0
|
|
637
|
+
"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",
|
|
795
638
|
body: [
|
|
796
639
|
{
|
|
797
640
|
"type": "wrapper",
|
|
798
|
-
"className": 'flex w-full px-4 h-[50px] p-0 justify-between items-center',
|
|
641
|
+
"className": 'flex w-full px-4 h-[50px] p-0 justify-between items-center steedos-header-container-line-one',
|
|
799
642
|
"body": [
|
|
800
643
|
{
|
|
801
644
|
type: "wrapper",
|
|
802
645
|
className: 'p-0 flex flex-1 items-center',
|
|
803
646
|
body: [
|
|
804
647
|
{
|
|
805
|
-
"type": "
|
|
806
|
-
"
|
|
807
|
-
"
|
|
808
|
-
"
|
|
648
|
+
"type": "button",
|
|
649
|
+
"className": "toggle-sidebar flex items-center pr-4",
|
|
650
|
+
"hiddenOn": "${!isMobile}",
|
|
651
|
+
"onEvent": {
|
|
652
|
+
"click": {
|
|
653
|
+
"actions": [
|
|
654
|
+
{
|
|
655
|
+
"actionType": "custom",
|
|
656
|
+
"script": "document.body.classList.toggle('sidebar-open')",
|
|
657
|
+
}
|
|
658
|
+
]
|
|
659
|
+
}
|
|
660
|
+
},
|
|
661
|
+
"body": [
|
|
662
|
+
{
|
|
663
|
+
"type": "steedos-icon",
|
|
664
|
+
"category": "utility",
|
|
665
|
+
"name": "rows",
|
|
666
|
+
"colorVariant": "default",
|
|
667
|
+
"id": "u:afc3a08e8cf3",
|
|
668
|
+
"className": "slds-button_icon slds-global-header__icon"
|
|
669
|
+
}
|
|
670
|
+
],
|
|
809
671
|
},
|
|
810
672
|
{
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
673
|
+
"className": 'block h-10 w-auto mr-4',
|
|
674
|
+
"type": "tpl",
|
|
675
|
+
"tpl": `<a href='/app' class='flex items-center '><img class='block h-10 w-auto' src='${logoSrc}'></a>`,
|
|
814
676
|
},
|
|
815
677
|
],
|
|
816
678
|
},
|
|
@@ -823,7 +685,7 @@
|
|
|
823
685
|
{
|
|
824
686
|
"type": "button",
|
|
825
687
|
"className": "toggle-sidebar",
|
|
826
|
-
"
|
|
688
|
+
"visibleOn": "${AND(app.showSidebar,!isMobile)}",
|
|
827
689
|
"onEvent": {
|
|
828
690
|
"click": {
|
|
829
691
|
"actions": [
|
|
@@ -851,11 +713,11 @@
|
|
|
851
713
|
|
|
852
714
|
{
|
|
853
715
|
"type": "grid",
|
|
854
|
-
hiddenOn: "${
|
|
855
|
-
"className": 'steedos-context-bar
|
|
716
|
+
"hiddenOn": "${isMobile}",
|
|
717
|
+
"className": 'steedos-context-bar flex flex-nowrap h-10 leading-5 pl-4 mb-[-3px] steedos-header-container-line-two',
|
|
856
718
|
"columns": [
|
|
857
719
|
{
|
|
858
|
-
"columnClassName": "items-center
|
|
720
|
+
"columnClassName": "items-center flex pb-0",
|
|
859
721
|
"body": [
|
|
860
722
|
{
|
|
861
723
|
"type": "steedos-app-launcher",
|
|
@@ -867,13 +729,15 @@
|
|
|
867
729
|
"valign": "middle"
|
|
868
730
|
},
|
|
869
731
|
{
|
|
870
|
-
|
|
732
|
+
hiddenOn: "${app.showSidebar === true}",
|
|
733
|
+
"columnClassName": "flex overflow-hidden",
|
|
871
734
|
"body": [
|
|
872
735
|
{
|
|
873
736
|
"type": "steedos-app-menu",
|
|
874
737
|
"stacked": false,
|
|
875
738
|
showIcon: false,
|
|
876
739
|
"appId": "${app.id}",
|
|
740
|
+
hiddenOn: "${app.showSidebar === true}",
|
|
877
741
|
overflow: {
|
|
878
742
|
enable: false,
|
|
879
743
|
itemWidth: 80,
|
|
@@ -893,17 +757,23 @@
|
|
|
893
757
|
{
|
|
894
758
|
|
|
895
759
|
"type": "button",
|
|
896
|
-
"className": 'p-0 absolute inset-0 mt-[50px]',
|
|
760
|
+
"className": 'p-0 absolute inset-0 mt-[50px] sm:mt-[90px]',
|
|
897
761
|
hiddenOn: "${app.showSidebar != true}",
|
|
898
762
|
body: [{
|
|
899
763
|
type: "wrapper",
|
|
900
|
-
className: 'sidebar-wrapper
|
|
764
|
+
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',
|
|
901
765
|
body: [
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
766
|
+
{
|
|
767
|
+
"type": "steedos-app-launcher",
|
|
768
|
+
"className": "px-4 pb-4",
|
|
769
|
+
"visibleOn": "${isMobile}",
|
|
770
|
+
"showAppName": true
|
|
771
|
+
},
|
|
772
|
+
{
|
|
773
|
+
"type": "steedos-app-menu",
|
|
774
|
+
"stacked": true,
|
|
775
|
+
"appId": "${app.id}",
|
|
776
|
+
},
|
|
907
777
|
]
|
|
908
778
|
}],
|
|
909
779
|
"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
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
showDesign: function (object_name, record_id) {
|
|
3
3
|
// Steedos.openWindow();
|
|
4
|
-
document.location = Steedos.absoluteUrl(`/api/pageDesign?pageId=${record_id}`);
|
|
4
|
+
document.location = Steedos.absoluteUrl(`/api/pageDesign?pageId=${record_id}&assetUrls=${Builder.settings.assetUrls}`);
|
|
5
5
|
},
|
|
6
6
|
showDesignVisible: function (object_name, record_id, record_permissions) {
|
|
7
7
|
var perms, record;
|