@nocobase/plugin-workflow-cc 2.2.44 → 2.2.46
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/dist/externalVersion.js +11 -11
- package/dist/server/actions.js +20 -23
- package/package.json +2 -2
package/dist/externalVersion.js
CHANGED
|
@@ -9,22 +9,22 @@
|
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
11
|
"react": "18.2.0",
|
|
12
|
-
"@nocobase/client": "2.2.
|
|
13
|
-
"@nocobase/plugin-workflow": "2.2.
|
|
12
|
+
"@nocobase/client": "2.2.46",
|
|
13
|
+
"@nocobase/plugin-workflow": "2.2.46",
|
|
14
14
|
"react-i18next": "11.18.6",
|
|
15
15
|
"antd-style": "3.7.1",
|
|
16
16
|
"antd": "5.24.2",
|
|
17
17
|
"react-router-dom": "6.30.1",
|
|
18
18
|
"lodash": "4.18.1",
|
|
19
|
-
"@nocobase/flow-engine": "2.2.
|
|
20
|
-
"@nocobase/client-v2": "2.2.
|
|
19
|
+
"@nocobase/flow-engine": "2.2.46",
|
|
20
|
+
"@nocobase/client-v2": "2.2.46",
|
|
21
21
|
"@ant-design/icons": "5.6.1",
|
|
22
22
|
"ahooks": "3.7.8",
|
|
23
|
-
"@nocobase/utils": "2.2.
|
|
24
|
-
"@nocobase/plugin-ui-schema-storage": "2.2.
|
|
25
|
-
"@nocobase/actions": "2.2.
|
|
26
|
-
"@nocobase/server": "2.2.
|
|
27
|
-
"@nocobase/database": "2.2.
|
|
28
|
-
"@nocobase/data-source-manager": "2.2.
|
|
29
|
-
"@nocobase/plugin-notification-manager": "2.2.
|
|
23
|
+
"@nocobase/utils": "2.2.46",
|
|
24
|
+
"@nocobase/plugin-ui-schema-storage": "2.2.46",
|
|
25
|
+
"@nocobase/actions": "2.2.46",
|
|
26
|
+
"@nocobase/server": "2.2.46",
|
|
27
|
+
"@nocobase/database": "2.2.46",
|
|
28
|
+
"@nocobase/data-source-manager": "2.2.46",
|
|
29
|
+
"@nocobase/plugin-notification-manager": "2.2.46"
|
|
30
30
|
};
|
package/dist/server/actions.js
CHANGED
|
@@ -41,12 +41,30 @@ __export(actions_exports, {
|
|
|
41
41
|
module.exports = __toCommonJS(actions_exports);
|
|
42
42
|
var import_actions = __toESM(require("@nocobase/actions"));
|
|
43
43
|
var import_plugin_workflow = require("@nocobase/plugin-workflow");
|
|
44
|
+
var import_constants = require("../common/constants");
|
|
44
45
|
var import_tempAssociationFields = require("./tempAssociationFields");
|
|
45
46
|
const mergeAppends = (appends, required) => {
|
|
46
47
|
const result = /* @__PURE__ */ new Set([...appends || []]);
|
|
47
48
|
required.forEach((item) => result.add(item));
|
|
48
49
|
return Array.from(result);
|
|
49
50
|
};
|
|
51
|
+
async function updateReadStatus(context, next, readAt) {
|
|
52
|
+
context.action.mergeParams({
|
|
53
|
+
filter: {
|
|
54
|
+
userId: context.state.currentUser.id,
|
|
55
|
+
...readAt && { status: import_constants.TASK_STATUS.UNREAD }
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
const { filterByTk, filter } = context.action.params;
|
|
59
|
+
context.body = await context.db.getRepository("workflowCcTasks").update({
|
|
60
|
+
filterByTk,
|
|
61
|
+
filter,
|
|
62
|
+
values: { status: readAt ? import_constants.TASK_STATUS.READ : import_constants.TASK_STATUS.UNREAD, readAt },
|
|
63
|
+
context
|
|
64
|
+
});
|
|
65
|
+
context.status = 200;
|
|
66
|
+
await next();
|
|
67
|
+
}
|
|
50
68
|
const workflowCcTasks = {
|
|
51
69
|
async get(context, next) {
|
|
52
70
|
(0, import_plugin_workflow.sanitizeWorkflowTaskReadParams)(context);
|
|
@@ -81,35 +99,14 @@ const workflowCcTasks = {
|
|
|
81
99
|
return context.throw(403, "You do not have permission to access this task");
|
|
82
100
|
}
|
|
83
101
|
}
|
|
84
|
-
context
|
|
85
|
-
filterByTk,
|
|
86
|
-
filter: {
|
|
87
|
-
userId: context.state.currentUser.id,
|
|
88
|
-
status: 0
|
|
89
|
-
},
|
|
90
|
-
values: {
|
|
91
|
-
status: 1,
|
|
92
|
-
readAt: /* @__PURE__ */ new Date()
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
return import_actions.default.update(context, next);
|
|
102
|
+
return updateReadStatus(context, next, /* @__PURE__ */ new Date());
|
|
96
103
|
},
|
|
97
104
|
async unread(context, next) {
|
|
98
105
|
const { filterByTk } = context.action.params;
|
|
99
106
|
if (!filterByTk) {
|
|
100
107
|
return context.throw(400, "filterByTk is required for unread action");
|
|
101
108
|
}
|
|
102
|
-
context
|
|
103
|
-
filterByTk,
|
|
104
|
-
filter: {
|
|
105
|
-
userId: context.state.currentUser.id
|
|
106
|
-
},
|
|
107
|
-
values: {
|
|
108
|
-
status: 0,
|
|
109
|
-
readAt: null
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
return import_actions.default.update(context, next);
|
|
109
|
+
return updateReadStatus(context, next, null);
|
|
113
110
|
}
|
|
114
111
|
};
|
|
115
112
|
function make(name, mod) {
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"homepage.ru-RU": "https://docs-ru.nocobase.com/handbook/workflow-cc",
|
|
11
11
|
"homepage.zh-CN": "https://docs-cn.nocobase.com/handbook/workflow-cc",
|
|
12
12
|
"license": "Apache-2.0",
|
|
13
|
-
"version": "2.2.
|
|
13
|
+
"version": "2.2.46",
|
|
14
14
|
"main": "dist/server/index.js",
|
|
15
15
|
"peerDependencies": {
|
|
16
16
|
"@nocobase/actions": "2.x",
|
|
@@ -30,5 +30,5 @@
|
|
|
30
30
|
"keywords": [
|
|
31
31
|
"Workflow"
|
|
32
32
|
],
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "ca2ca462526e39c219a09fa65625f77879ac5249"
|
|
34
34
|
}
|