@steedos-labs/plugin-workflow 3.0.1-beta.5 → 3.0.1-beta.6
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/objects/process_delegation_rules.object.yml +5 -4
- package/main/default/pages/page_instance_view.page.amis.json +67 -0
- package/main/default/pages/page_instance_view.page.yml +9 -0
- package/main/default/routes/amis_form_design.router.js +1 -11
- package/main/default/routes/api_workflow_instance_permissions.router.js +40 -0
- package/main/default/routes/flow_form_design.router.js +1 -12
- package/package.json +1 -1
- package/public/workflow/index.css +7 -0
|
@@ -10,9 +10,10 @@ fields:
|
|
|
10
10
|
label: Client
|
|
11
11
|
reference_to: users
|
|
12
12
|
index: true
|
|
13
|
-
readonly:
|
|
14
|
-
defaultValue: "{
|
|
15
|
-
|
|
13
|
+
readonly: false
|
|
14
|
+
defaultValue: "${global.userId}"
|
|
15
|
+
amis:
|
|
16
|
+
"staticOn": "${!(global.user.is_space_admin|| ARRAYINCLUDES(global.user.roles,'organization_admin'))}"
|
|
16
17
|
name: from
|
|
17
18
|
is_name: true
|
|
18
19
|
filterable: true
|
|
@@ -39,7 +40,7 @@ fields:
|
|
|
39
40
|
enabled:
|
|
40
41
|
type: boolean
|
|
41
42
|
label: Enabled
|
|
42
|
-
defaultValue:
|
|
43
|
+
defaultValue: true
|
|
43
44
|
name: enabled
|
|
44
45
|
list_views:
|
|
45
46
|
all:
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "page",
|
|
3
|
+
"title": "Welcome to Steedos",
|
|
4
|
+
"body": [
|
|
5
|
+
{
|
|
6
|
+
"type": "wrapper",
|
|
7
|
+
"className": "steedos-instance-detail-wrapper m-0 p-0 flex-1 focus:outline-none lg:order-last sm:m-4 shadow sm:rounded",
|
|
8
|
+
"body": [
|
|
9
|
+
{
|
|
10
|
+
"type": "service",
|
|
11
|
+
"className": "h-full",
|
|
12
|
+
"body": [],
|
|
13
|
+
"id": "u:d6db0c84f150",
|
|
14
|
+
"dsType": "api",
|
|
15
|
+
"schemaApi": {
|
|
16
|
+
"method": "get",
|
|
17
|
+
"url": "/api/health_check?trace=${recordId}",
|
|
18
|
+
"adaptor": "const result = {data: {'type':'wrapper','className':'p-0 h-full','body':[{'type':'steedos-instance-detail','id':'u:40052b3812c1','label':'Instance Detail','instanceId':context.recordId,'boxName':context.side_listview_id}],'id':'u:829a40757f0a'}};console.log('result===>', result); return result;"
|
|
19
|
+
},
|
|
20
|
+
"visibleOn": "${permission === true}"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"id": "u:259e5e73a3e2",
|
|
24
|
+
"type": "tpl",
|
|
25
|
+
"tpl": "无权限",
|
|
26
|
+
"visibleOn": "${permission === false}"
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"id": "u:f101829e8710"
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"regions": [
|
|
33
|
+
"body"
|
|
34
|
+
],
|
|
35
|
+
"data": {},
|
|
36
|
+
"id": "u:d37465183f56",
|
|
37
|
+
"className": "steedos-instance-related-view-wrapper flex justify-center",
|
|
38
|
+
"bodyClassName": "p-0 flex flex-1 overflow-hidden h-full",
|
|
39
|
+
"name": "amis-root-workflow",
|
|
40
|
+
"initApi": {
|
|
41
|
+
"url": "http://127.0.0.1:8443/api/workflow/v2/instance/${recordId}/permission",
|
|
42
|
+
"method": "get",
|
|
43
|
+
"data": {},
|
|
44
|
+
"requestAdaptor": "",
|
|
45
|
+
"adaptor": "",
|
|
46
|
+
"messages": {},
|
|
47
|
+
"sendOn": "${recordId}"
|
|
48
|
+
},
|
|
49
|
+
"initFetch": null,
|
|
50
|
+
"asideResizor": false,
|
|
51
|
+
"pullRefresh": {
|
|
52
|
+
"disabled": true
|
|
53
|
+
},
|
|
54
|
+
"editorState": "default",
|
|
55
|
+
"css": {
|
|
56
|
+
".steedos-instance-related-view-wrapper > .antd-Page-content": {
|
|
57
|
+
"max-width": "1024px"
|
|
58
|
+
},
|
|
59
|
+
".steedos-global-header-root": {
|
|
60
|
+
"display": "none"
|
|
61
|
+
},
|
|
62
|
+
".creator-content-wrapper": {
|
|
63
|
+
"margin-top": "0px"
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"wrapperCustomStyle": {}
|
|
67
|
+
}
|
|
@@ -13,16 +13,6 @@ const fs = require('fs');
|
|
|
13
13
|
const _ = require('lodash');
|
|
14
14
|
const path = require('path');
|
|
15
15
|
|
|
16
|
-
const getPublicAssetUrls = function(assetUrls){
|
|
17
|
-
const values = _.map(_.split(assetUrls), (item)=>{
|
|
18
|
-
if(_.startsWith(item, '/')){
|
|
19
|
-
return Meteor.absoluteUrl(item) ;
|
|
20
|
-
}else{
|
|
21
|
-
return item;
|
|
22
|
-
}
|
|
23
|
-
})
|
|
24
|
-
return _.join(values, ',')
|
|
25
|
-
}
|
|
26
16
|
|
|
27
17
|
router.get('/api/amisFormDesign', requireAuthentication, async function (req, res) {
|
|
28
18
|
try {
|
|
@@ -32,7 +22,7 @@ router.get('/api/amisFormDesign', requireAuthentication, async function (req, re
|
|
|
32
22
|
let assetUrl = "";
|
|
33
23
|
let assetUrls = null;
|
|
34
24
|
if(process.env.STEEDOS_PUBLIC_PAGE_ASSETURLS && _.isString(process.env.STEEDOS_PUBLIC_PAGE_ASSETURLS)){
|
|
35
|
-
assetUrls =
|
|
25
|
+
assetUrls = process.env.STEEDOS_PUBLIC_PAGE_ASSETURLS.split(',');
|
|
36
26
|
assetUrl = `assetUrl=${assetUrls.join("&assetUrl=")}&`;
|
|
37
27
|
}else{
|
|
38
28
|
var fullPath = path.resolve(path.dirname(require.resolve('@steedos-ui/builder-widgets' + '/package.json')));
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
// @ts-check
|
|
3
|
+
const objectql = require('@steedos/objectql');
|
|
4
|
+
const express = require('express');
|
|
5
|
+
const router = express.Router();
|
|
6
|
+
const { requireAuthentication } = require("@steedos/auth");
|
|
7
|
+
const WorkflowManager = require('../manager/workflow_manager');
|
|
8
|
+
const _ = require('underscore');
|
|
9
|
+
const { getCollection } = require('../utils/collection');
|
|
10
|
+
|
|
11
|
+
router.get('/api/workflow/v2/instance/:instanceId/permission', requireAuthentication, async function (req, res) {
|
|
12
|
+
try {
|
|
13
|
+
const { instanceId } = req.params;
|
|
14
|
+
const userSession = req.user;
|
|
15
|
+
const current_user_info = userSession;
|
|
16
|
+
const current_user_id = current_user_info.userId;
|
|
17
|
+
const db = {
|
|
18
|
+
users: await getCollection('users'),
|
|
19
|
+
instances: await getCollection('instances')
|
|
20
|
+
}
|
|
21
|
+
const user = await db.users.findOne({_id: current_user_id});
|
|
22
|
+
const instance = await db.instances.findOne({_id: instanceId})
|
|
23
|
+
console.log(`user`, user)
|
|
24
|
+
console.log(`instance`, instance)
|
|
25
|
+
const permission = await WorkflowManager.hasInstancePermissions(user, instance)
|
|
26
|
+
res.status(200).send({
|
|
27
|
+
data: {
|
|
28
|
+
permission: permission
|
|
29
|
+
},
|
|
30
|
+
msg: "",
|
|
31
|
+
status: 0
|
|
32
|
+
});
|
|
33
|
+
} catch (e) {
|
|
34
|
+
console.log(`e`, e)
|
|
35
|
+
res.status(200).send({
|
|
36
|
+
errors: [{ errorMessage: e.message }]
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
exports.default = router;
|
|
@@ -10,22 +10,11 @@ const ejs = require('ejs');
|
|
|
10
10
|
const _ = require('lodash');
|
|
11
11
|
const objectql = require('@steedos/objectql');
|
|
12
12
|
|
|
13
|
-
const getPublicAssetUrls = function(assetUrls){
|
|
14
|
-
const values = _.map(_.split(assetUrls), (item)=>{
|
|
15
|
-
if(_.startsWith(item, '/')){
|
|
16
|
-
return Meteor.absoluteUrl(item) ;
|
|
17
|
-
}else{
|
|
18
|
-
return item;
|
|
19
|
-
}
|
|
20
|
-
})
|
|
21
|
-
return _.join(values, ',')
|
|
22
|
-
}
|
|
23
|
-
|
|
24
13
|
router.get('/api/workflow/form_design', auth.requireAuthentication, async function (req, res) {
|
|
25
14
|
try {
|
|
26
15
|
res.set('Content-Type', 'text/html');
|
|
27
16
|
const userSession = req.user;
|
|
28
|
-
let assetUrls =
|
|
17
|
+
let assetUrls = req.query.assetUrls;
|
|
29
18
|
const assetUrl = `assetUrl=${assetUrls.split(',').join("&assetUrl=")}&`;
|
|
30
19
|
|
|
31
20
|
// const dataContext = {
|
package/package.json
CHANGED