Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Nov 19, 2023
2 parents d56ce70 + 365b08a commit ca50129
Show file tree
Hide file tree
Showing 103 changed files with 575 additions and 435 deletions.
25 changes: 25 additions & 0 deletions creator/packages/steedos-workflow/client/lib/1_form_formula.js
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,31 @@ Form_formula.getNextStepsFromCondition = function(step, autoFormDoc, fields){

};

/**
*
* @param {string} script
* @param {object} autoFormDoc
* @param {object} fields
* @returns
*/
Form_formula.runFormulaScript = function (script, autoFormDoc, fields) {
Form_formula.field_values = Form_formula.init_formula_values(fields, autoFormDoc);

var conditionStr = script.toString();
conditionStr = conditionStr.replace(/\=/g, "==").replace(/\>==/g, ">=").replace(/\<==/g, "<=").replace(/\======/g, "===").replace(/\====/g, "==");
conditionStr = Form_formula.prependPrefixForFormula("Form_formula.field_values", conditionStr);

try {
if (eval(conditionStr.replace(/[\r\n]+/g, '\\n'))) {
return true
}
} catch (err) {
console.log("脚本[" + conditionStr + "]执行异常:" + err.message);
}

return false;
};

/**
* 获得公式需要用到的初始值
* 输入:fields, values, applicant
Expand Down
63 changes: 63 additions & 0 deletions creator/packages/steedos-workflow/client/lib/approve_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,72 @@ ApproveManager.getNextSteps = function(instance, currentStep, judge, autoFormDoc
if (currentStep.step_type == "counterSign" && rev_nextSteps.length > 1 && !currentStep.oneClickRejection) {
rev_nextSteps = [];
}

// 如果步骤的 always_enter_step (始终进入此步骤(默认选中,历史流程如果未配置,也是选中)) 值为false,那么需要运行脚本 enter_step_condition (步骤条件)
// 如结果中包含条件节点则需要继续计算条件节点下一步
const needRemoveSteps = {}, needAddSteps = {};
for (const step of rev_nextSteps) {
ApproveManager.caculateNextStepsByEnterStepCondition(step, autoFormDoc, fields, needRemoveSteps, needAddSteps)
}
if (!_.isEmpty(needRemoveSteps) && !_.isEmpty(needAddSteps)) {
for (const id in needAddSteps) {
if (Object.hasOwnProperty.call(needAddSteps, id)) {
const index = rev_nextSteps.findIndex(item => item.id == id)
if (-1 === index) {
rev_nextSteps.push(needAddSteps[id])
}
}
}
for (const id in needRemoveSteps) {
if (Object.hasOwnProperty.call(needRemoveSteps, id)) {
const index = rev_nextSteps.findIndex(item => item.id == id)
if (-1 != index) {
rev_nextSteps.splice(index, 1)
}
}
}
var conditionNextSteps = new Array();
rev_nextSteps.forEach(function(nextStep, idx) {
if (nextStep.step_type == "condition") {
if(!judge && nextStep.step_type == 'sign'){
judge = 'approved'
}
conditionNextSteps = conditionNextSteps.concat(ApproveManager.getNextSteps(instance, nextStep, judge, autoFormDoc, fields, showSkipStep));
// 移除条件节点
rev_nextSteps.splice(idx, 1)
}
})
rev_nextSteps = rev_nextSteps.concat(conditionNextSteps);
//去除重复
rev_nextSteps = rev_nextSteps.uniqById();
}

return rev_nextSteps;
};

ApproveManager.caculateNextStepsByEnterStepCondition = function(step, autoFormDoc, fields, needRemoveSteps = {}, needAddSteps = {}) {
if (false === step.always_enter_step) {
let enterStepCondition = step.enter_step_condition
let result = Form_formula.runFormulaScript(enterStepCondition, autoFormDoc, fields)
if (false === result) {
needRemoveSteps[step.id] = step;
if (step.lines && step.lines.length > 0) {
const toStepIds = step.lines.map(function(s){ return s.to_step})
for (const stepId of toStepIds) {
const s = WorkflowManager.getInstanceStep(stepId)
if (s) {
ApproveManager.caculateNextStepsByEnterStepCondition(s, autoFormDoc, fields, needRemoveSteps, needAddSteps)
}
}
}
} else {
needAddSteps[step.id] = step;
}
} else {
needAddSteps[step.id] = step;
}
}

ApproveManager.getStepApproveUsers = function(instance, nextStepId){

var nextStepUsers = new Array();
Expand Down
10 changes: 5 additions & 5 deletions ee/sso-oidc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@steedos/ee_sso-oidc",
"version": "2.5.20-beta.8",
"version": "2.5.20-beta.9",
"main": "package.service.js",
"scripts": {
"build": "tsc"
Expand All @@ -11,14 +11,14 @@
"access": "public"
},
"dependencies": {
"@steedos/accounts": "2.5.20-beta.8",
"@steedos/objectql": "2.5.20-beta.8",
"@steedos/service-package-loader": "2.5.20-beta.8",
"@steedos/accounts": "2.5.20-beta.9",
"@steedos/objectql": "2.5.20-beta.9",
"@steedos/service-package-loader": "2.5.20-beta.9",
"@techpass/passport-openidconnect": "^0.3.2",
"express": "4.18.1",
"node-fetch": "^2.6.7",
"passport": "^0.6.0",
"request-ip": "^2.2.0"
},
"gitHead": "9501bbf23858aa74a7bb9dcf53f3c7ce4dc765b1"
"gitHead": "b04fd383c7f469ba970a52744a3778ae58ab4425"
}
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
],
"useWorkspaces": true,
"npmClient": "yarn",
"version": "2.5.20-beta.8"
"version": "2.5.20-beta.9"
}
12 changes: 6 additions & 6 deletions packages/accounts/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@steedos/accounts",
"private": false,
"version": "2.5.20-beta.8",
"version": "2.5.20-beta.9",
"main": "lib/index.js",
"files": [
"/package.json",
Expand Down Expand Up @@ -55,20 +55,20 @@
"validator": "^13.6.0"
},
"devDependencies": {
"@steedos/auth": "2.5.20-beta.8",
"@steedos/meteor-bundle-runner": "2.5.20-beta.8",
"@steedos/objectql": "2.5.20-beta.8",
"@steedos/auth": "2.5.20-beta.9",
"@steedos/meteor-bundle-runner": "2.5.20-beta.9",
"@steedos/objectql": "2.5.20-beta.9",
"@types/dotenv-flow": "^3.0.0",
"@types/node": "12.6.8",
"cross-env": "^7.0.3",
"dotenv": "^8.2.0",
"dotenv-flow": "^3.1.0",
"nodemon": "^2.0.19",
"steedos-server": "2.5.20-beta.8",
"steedos-server": "2.5.20-beta.9",
"typescript": "4.6.3"
},
"publishConfig": {
"access": "public"
},
"gitHead": "9501bbf23858aa74a7bb9dcf53f3c7ce4dc765b1"
"gitHead": "b04fd383c7f469ba970a52744a3778ae58ab4425"
}
8 changes: 4 additions & 4 deletions packages/auth/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@steedos/auth",
"private": false,
"version": "2.5.20-beta.8",
"version": "2.5.20-beta.9",
"main": "lib/index.js",
"scripts": {
"watch": "tsc --watch",
Expand All @@ -13,8 +13,8 @@
"access": "public"
},
"dependencies": {
"@steedos/cachers": "2.5.20-beta.8",
"@steedos/objectql": "2.5.20-beta.8",
"@steedos/cachers": "2.5.20-beta.9",
"@steedos/objectql": "2.5.20-beta.9",
"cookies": "^0.8.0",
"express": "^4.16.4",
"ismobilejs": "^1.1.1",
Expand All @@ -25,5 +25,5 @@
"devDependencies": {
"typescript": "4.6.3"
},
"gitHead": "9501bbf23858aa74a7bb9dcf53f3c7ce4dc765b1"
"gitHead": "b04fd383c7f469ba970a52744a3778ae58ab4425"
}
4 changes: 2 additions & 2 deletions packages/cachers/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@steedos/cachers",
"private": false,
"version": "2.5.20-beta.8",
"version": "2.5.20-beta.9",
"description": "",
"main": "lib/index.js",
"scripts": {
Expand All @@ -19,5 +19,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "9501bbf23858aa74a7bb9dcf53f3c7ce4dc765b1"
"gitHead": "b04fd383c7f469ba970a52744a3778ae58ab4425"
}
8 changes: 4 additions & 4 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "steedos-cli",
"version": "2.5.20-beta.8",
"version": "2.5.20-beta.9",
"description": "Develop and run your enterprise apps in miniutes",
"main": "dist/index.js",
"scripts": {
Expand Down Expand Up @@ -38,8 +38,8 @@
"@oclif/command": "^1.8.16",
"@oclif/config": "^1.8.3",
"@oclif/plugin-help": "^5.1.12",
"@steedos/metadata-core": "2.5.20-beta.8",
"@steedos/metadata-registrar": "2.5.20-beta.8",
"@steedos/metadata-core": "2.5.20-beta.9",
"@steedos/metadata-registrar": "2.5.20-beta.9",
"archiver": "^5.0.2",
"chalk": "2.4.2",
"change-case": "^3.1.0",
Expand Down Expand Up @@ -82,5 +82,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "9501bbf23858aa74a7bb9dcf53f3c7ce4dc765b1"
"gitHead": "b04fd383c7f469ba970a52744a3778ae58ab4425"
}
6 changes: 3 additions & 3 deletions packages/client/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": false,
"name": "@steedos/client",
"version": "2.5.20-beta.8",
"version": "2.5.20-beta.9",
"description": "client lib for steedos",
"main": "lib/index.js",
"scripts": {
Expand All @@ -17,8 +17,8 @@
},
"license": "MIT",
"dependencies": {
"@steedos/filters": "2.5.20-beta.8",
"@steedos/filters": "2.5.20-beta.9",
"node-fetch": "^2.6.7"
},
"gitHead": "9501bbf23858aa74a7bb9dcf53f3c7ce4dc765b1"
"gitHead": "b04fd383c7f469ba970a52744a3778ae58ab4425"
}
24 changes: 12 additions & 12 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@steedos/core",
"private": false,
"version": "2.5.20-beta.8",
"version": "2.5.20-beta.9",
"description": "",
"main": "lib/index.js",
"scripts": {
Expand All @@ -14,15 +14,15 @@
"author": "",
"license": "ISC",
"dependencies": {
"@steedos/auth": "2.5.20-beta.8",
"@steedos/filters": "2.5.20-beta.8",
"@steedos/i18n": "2.5.20-beta.8",
"@steedos/metadata-core": "2.5.20-beta.8",
"@steedos/migrate": "2.5.20-beta.8",
"@steedos/objectql": "2.5.20-beta.8",
"@steedos/odata-v4-mongodb": "2.5.20-beta.8",
"@steedos/process": "2.5.20-beta.8",
"@steedos/standard-objects": "2.5.20-beta.8",
"@steedos/auth": "2.5.20-beta.9",
"@steedos/filters": "2.5.20-beta.9",
"@steedos/i18n": "2.5.20-beta.9",
"@steedos/metadata-core": "2.5.20-beta.9",
"@steedos/migrate": "2.5.20-beta.9",
"@steedos/objectql": "2.5.20-beta.9",
"@steedos/odata-v4-mongodb": "2.5.20-beta.9",
"@steedos/process": "2.5.20-beta.9",
"@steedos/standard-objects": "2.5.20-beta.9",
"body-parser": "^1.18.1",
"bunyan-sfdx-no-dtrace": "^1.8.2",
"clone": "^2.1.2",
Expand All @@ -45,7 +45,7 @@
"devDependencies": {
"@salesforce/kit": "1.0.4",
"@salesforce/ts-types": "1.1.2",
"@steedos/meteor-bundle-runner": "2.5.20-beta.8",
"@steedos/meteor-bundle-runner": "2.5.20-beta.9",
"@types/express": "^4.16.1",
"@types/node": "^11.10.4",
"@types/underscore": "^1.8.13",
Expand All @@ -57,5 +57,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "9501bbf23858aa74a7bb9dcf53f3c7ce4dc765b1"
"gitHead": "b04fd383c7f469ba970a52744a3778ae58ab4425"
}
4 changes: 2 additions & 2 deletions packages/create-steedos-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-steedos-app",
"version": "2.5.20-beta.8",
"version": "2.5.20-beta.9",
"keywords": [
"react",
"steedos"
Expand Down Expand Up @@ -49,5 +49,5 @@
"engines": {
"node": ">=14"
},
"gitHead": "9501bbf23858aa74a7bb9dcf53f3c7ce4dc765b1"
"gitHead": "b04fd383c7f469ba970a52744a3778ae58ab4425"
}
4 changes: 2 additions & 2 deletions packages/create-steedos-package/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-steedos-package",
"version": "2.5.20-beta.8",
"version": "2.5.20-beta.9",
"keywords": [
"steedos"
],
Expand Down Expand Up @@ -39,5 +39,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "9501bbf23858aa74a7bb9dcf53f3c7ce4dc765b1"
"gitHead": "b04fd383c7f469ba970a52744a3778ae58ab4425"
}
12 changes: 6 additions & 6 deletions packages/data-import/package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"name": "@steedos/data-import",
"version": "2.5.20-beta.8",
"version": "2.5.20-beta.9",
"main": "lib/index.js",
"license": "MIT",
"scripts": {
"build": "rm -rf ./lib && tsc"
},
"dependencies": {
"@steedos/core": "2.5.20-beta.8",
"@steedos/metadata-api": "2.5.20-beta.8",
"@steedos/metadata-core": "2.5.20-beta.8",
"@steedos/objectql": "2.5.20-beta.8",
"@steedos/core": "2.5.20-beta.9",
"@steedos/metadata-api": "2.5.20-beta.9",
"@steedos/metadata-core": "2.5.20-beta.9",
"@steedos/objectql": "2.5.20-beta.9",
"bson": "4.6.4",
"csvtojson": "~2.0.10",
"dotenv-flow": "^3.1.0",
Expand All @@ -24,5 +24,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "9501bbf23858aa74a7bb9dcf53f3c7ce4dc765b1"
"gitHead": "b04fd383c7f469ba970a52744a3778ae58ab4425"
}
4 changes: 2 additions & 2 deletions packages/filters/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@steedos/filters",
"private": false,
"version": "2.5.20-beta.8",
"version": "2.5.20-beta.9",
"description": "filters lib for steedos",
"main": "lib/index.js",
"files": [
Expand Down Expand Up @@ -36,5 +36,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "9501bbf23858aa74a7bb9dcf53f3c7ce4dc765b1"
"gitHead": "b04fd383c7f469ba970a52744a3778ae58ab4425"
}
Loading

0 comments on commit ca50129

Please sign in to comment.