@nocobase/plugin-workflow-manual 1.7.0-beta.1 → 1.7.0-beta.3

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.
@@ -8,7 +8,7 @@
8
8
  */
9
9
 
10
10
  module.exports = {
11
- "@nocobase/client": "1.7.0-beta.1",
11
+ "@nocobase/client": "1.7.0-beta.3",
12
12
  "react": "18.2.0",
13
13
  "@formily/react": "2.3.0",
14
14
  "@formily/antd-v5": "1.1.9",
@@ -18,13 +18,14 @@ module.exports = {
18
18
  "dayjs": "1.11.10",
19
19
  "react-i18next": "11.18.6",
20
20
  "lodash": "4.17.21",
21
- "@nocobase/plugin-workflow": "1.7.0-beta.1",
22
- "@nocobase/utils": "1.7.0-beta.1",
23
- "@nocobase/server": "1.7.0-beta.1",
24
- "@nocobase/actions": "1.7.0-beta.1",
25
- "@nocobase/resourcer": "1.7.0-beta.1",
26
- "@nocobase/test": "1.7.0-beta.1",
27
- "@nocobase/plugin-workflow-test": "1.7.0-beta.1",
21
+ "@nocobase/plugin-workflow": "1.7.0-beta.3",
22
+ "@nocobase/utils": "1.7.0-beta.3",
23
+ "@nocobase/server": "1.7.0-beta.3",
24
+ "@nocobase/actions": "1.7.0-beta.3",
25
+ "@nocobase/resourcer": "1.7.0-beta.3",
26
+ "@nocobase/test": "1.7.0-beta.3",
27
+ "@nocobase/plugin-workflow-test": "1.7.0-beta.3",
28
28
  "@formily/core": "2.3.0",
29
- "@nocobase/database": "1.7.0-beta.1"
29
+ "@nocobase/database": "1.7.0-beta.3",
30
+ "sequelize": "6.35.2"
30
31
  };
@@ -0,0 +1,36 @@
1
+ {
2
+ "Manual": "Manuell",
3
+ "Could be used for manually submitting data, and determine whether to continue or exit. Workflow will generate a todo item for assigned user when it reaches a manual node, and continue processing after user submits the form.": "Kann für die manuelle Übermittlung von Daten verwendet werden und bestimmt, ob fortgefahren oder beendet werden soll. Der Workflow generiert ein To-Do-Element für den zugewiesenen Benutzer, wenn er einen manuellen Knoten erreicht, und setzt die Verarbeitung fort, nachdem der Benutzer das Formular abgesendet hat.",
4
+ "Values preset in this form will override user submitted ones when continue or reject.": "Die in diesem Formular voreingestellten Werte überschreiben die vom Benutzer übermittelten Werte beim Fortfahren oder Ablehnen.",
5
+ "Assignee": "Beauftragter",
6
+ "Assignees": "Beauftragte",
7
+ "User interface": "Benutzeroberfläche",
8
+ "Configure user interface": "Benutzeroberfläche konfigurieren",
9
+ "View user interface": "Benutzeroberfläche anzeigen",
10
+ "Separately": "Getrennt",
11
+ "Each user has own task": "Jeder Benutzer hat eine eigene Aufgabe",
12
+ "Collaboratively": "Kollaborativ",
13
+ "Everyone shares one task": "Alle teilen sich eine Aufgabe",
14
+ "Negotiation": "Verhandlung",
15
+ "All pass": "Alle bestehen",
16
+ "Everyone should pass": "Jeder sollte bestehen",
17
+ "Any pass": "Beliebiger Bestehen",
18
+ "Anyone pass": "Jeder kann bestehen",
19
+ "Field name existed in form": "Feldname existiert bereits im Formular",
20
+ "Continue the process": "Den Prozess fortsetzen",
21
+ "Terminate the process": "Den Prozess beenden",
22
+ "Save temporarily": "Temporär speichern",
23
+ "Custom form": "Benutzerdefiniertes Formular",
24
+ "Data record": "Datensatz",
25
+ "Create record form": "Formular zum Erstellen von Datensätzen",
26
+ "Update record form": "Formular zum Aktualisieren von Datensätzen",
27
+ "Filter settings": "Filtereinstellungen",
28
+ "Workflow todos": "Workflow-Aufgaben",
29
+ "Task node": "Aufgabenknoten",
30
+ "Unprocessed": "Unbearbeitet",
31
+ "Please check one of your update record form, and add at least one filter condition in form settings.": "Bitte überprüfen Sie eines Ihrer Formulare zur Aktualisierung von Datensätzen und fügen Sie in den Formulareinstellungen mindestens eine Filterbedingung hinzu.",
32
+ "My manual tasks": "Meine manuellen Aufgaben",
33
+ "Task title": "Aufgabentitel",
34
+ "Title of each task item. Default to node title.": "Titel jedes Aufgabenelements. Standardmäßig der Knotentitel.",
35
+ "Task": "Aufgabe"
36
+ }
@@ -0,0 +1,30 @@
1
+ {
2
+ "Manual": "Manual",
3
+ "Could be used for manually submitting data, and determine whether to continue or exit. Workflow will generate a todo item for assigned user when it reaches a manual node, and continue processing after user submits the form.": "Could be used for manually submitting data, and determine whether to continue or exit. Workflow will generate a todo item for assigned user when it reaches a manual node, and continue processing after user submits the form.",
4
+ "Values preset in this form will override user submitted ones when continue or reject.": "Values preset in this form will override user submitted ones when continue or reject.",
5
+ "Assignee": "Assignee",
6
+ "Assignees": "Assignees",
7
+ "User interface": "User interface",
8
+ "Configure user interface": "Configure user interface",
9
+ "View user interface": "View user interface",
10
+ "Separately": "Separately",
11
+ "Each user has own task": "Each user has own task",
12
+ "Collaboratively": "Collaboratively",
13
+ "Everyone shares one task": "Everyone shares one task",
14
+ "Negotiation": "Negotiation",
15
+ "All pass": "All pass",
16
+ "Everyone should pass": "Everyone should pass",
17
+ "Any pass": "Any pass",
18
+ "Anyone pass": "Anyone pass",
19
+ "Field name existed in form": "Field name existed in form",
20
+ "Continue the process": "Continue the process",
21
+ "Terminate the process": "Terminate the process",
22
+ "Save temporarily": "Save temporarily",
23
+ "Custom form": "Custom form",
24
+ "Data record": "Data record",
25
+ "Create record form": "Create record form",
26
+ "Update record form": "Update record form",
27
+ "Filter settings": "Filter settings",
28
+ "Workflow todos": "Workflow todos",
29
+ "Task": "Task"
30
+ }
@@ -0,0 +1,124 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ var __create = Object.create;
11
+ var __defProp = Object.defineProperty;
12
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
13
+ var __getOwnPropNames = Object.getOwnPropertyNames;
14
+ var __getProtoOf = Object.getPrototypeOf;
15
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
16
+ var __export = (target, all) => {
17
+ for (var name in all)
18
+ __defProp(target, name, { get: all[name], enumerable: true });
19
+ };
20
+ var __copyProps = (to, from, except, desc) => {
21
+ if (from && typeof from === "object" || typeof from === "function") {
22
+ for (let key of __getOwnPropNames(from))
23
+ if (!__hasOwnProp.call(to, key) && key !== except)
24
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
25
+ }
26
+ return to;
27
+ };
28
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
29
+ // If the importer is in node compatibility mode or this is not an ESM
30
+ // file that has been converted to a CommonJS file using a Babel-
31
+ // compatible transform (i.e. "__esModule" has not been set), then set
32
+ // "default" to the CommonJS "module.exports" for node compatibility.
33
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
34
+ mod
35
+ ));
36
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
37
+ var change_table_name_exports = {};
38
+ __export(change_table_name_exports, {
39
+ default: () => change_table_name_default
40
+ });
41
+ module.exports = __toCommonJS(change_table_name_exports);
42
+ var import_sequelize = require("sequelize");
43
+ var import_server = require("@nocobase/server");
44
+ var import_workflowManualTasks = __toESM(require("../collections/workflowManualTasks"));
45
+ class change_table_name_default extends import_server.Migration {
46
+ appVersion = "<1.7.0";
47
+ on = "beforeLoad";
48
+ async up() {
49
+ const { db } = this.context;
50
+ const queryInterface = db.sequelize.getQueryInterface();
51
+ const usersJobsCollection = db.collection({
52
+ ...import_workflowManualTasks.default,
53
+ name: "users_jobs"
54
+ });
55
+ const workflowManualTasksCollection = db.collection({
56
+ ...import_workflowManualTasks.default
57
+ });
58
+ const oldTableName = usersJobsCollection.getTableNameWithSchema();
59
+ const oldTableNameWithQuotes = usersJobsCollection.getRealTableName(true);
60
+ const newTableName = workflowManualTasksCollection.getTableNameWithSchema();
61
+ const newTableNameWithQuotes = workflowManualTasksCollection.getRealTableName(true);
62
+ const exists = await queryInterface.tableExists(oldTableName);
63
+ if (!exists) {
64
+ return;
65
+ }
66
+ const constraints = await queryInterface.showConstraint(oldTableName);
67
+ await db.sequelize.transaction(
68
+ {
69
+ isolationLevel: import_sequelize.Transaction.ISOLATION_LEVELS.SERIALIZABLE
70
+ },
71
+ async (transaction) => {
72
+ const newExists = await queryInterface.tableExists(newTableName, { transaction });
73
+ if (newExists) {
74
+ await queryInterface.dropTable(newTableName, { transaction });
75
+ }
76
+ if (this.db.isPostgresCompatibleDialect()) {
77
+ await db.sequelize.query(
78
+ `ALTER TABLE ${oldTableNameWithQuotes} RENAME TO "${db.options.tablePrefix || ""}${db.options.underscored ? "workflow_manual_tasks" : "workflowManualTasks"}";`,
79
+ {
80
+ transaction
81
+ }
82
+ );
83
+ } else {
84
+ await queryInterface.renameTable(oldTableName, newTableName, { transaction });
85
+ }
86
+ if (this.db.isPostgresCompatibleDialect()) {
87
+ const primaryKeys = constraints.filter((item) => item.constraintType === "PRIMARY KEY");
88
+ if (primaryKeys.length) {
89
+ for (const primaryKey of primaryKeys) {
90
+ await queryInterface.removeConstraint(newTableName, primaryKey.constraintName, { transaction });
91
+ }
92
+ }
93
+ } else if (this.db.isMySQLCompatibleDialect()) {
94
+ await db.sequelize.query(`ALTER TABLE ${newTableNameWithQuotes} DROP PRIMARY KEY, ADD PRIMARY KEY (id)`, {
95
+ transaction
96
+ });
97
+ }
98
+ const indexes = await queryInterface.showIndex(newTableName, { transaction });
99
+ const oldIndexPrefix = `${db.options.tablePrefix || ""}users_jobs`;
100
+ const newIndexPrefix = `${db.options.tablePrefix || ""}workflow_manual_tasks`;
101
+ for (const item of indexes) {
102
+ if (item.name.startsWith(oldIndexPrefix)) {
103
+ if (this.db.isPostgresCompatibleDialect()) {
104
+ await db.sequelize.query(
105
+ `ALTER INDEX ${db.options.schema ? `"${db.options.schema}".` : ""}"${item.name}" RENAME TO "${item.name.replace(oldIndexPrefix, newIndexPrefix)}";`,
106
+ { transaction }
107
+ );
108
+ } else if (this.db.isMySQLCompatibleDialect()) {
109
+ await db.sequelize.query(
110
+ `ALTER TABLE ${newTableNameWithQuotes} RENAME INDEX ${item.name} TO ${item.name.replace(
111
+ oldIndexPrefix,
112
+ newIndexPrefix
113
+ )};`,
114
+ { transaction }
115
+ );
116
+ }
117
+ }
118
+ }
119
+ }
120
+ );
121
+ db.removeCollection("users_jobs");
122
+ db.removeCollection("workflowManualTasks");
123
+ }
124
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import { Migration } from '@nocobase/server';
10
+ export default class extends Migration {
11
+ appVersion: string;
12
+ on: string;
13
+ up(): Promise<void>;
14
+ }
@@ -0,0 +1,57 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __export = (target, all) => {
15
+ for (var name in all)
16
+ __defProp(target, name, { get: all[name], enumerable: true });
17
+ };
18
+ var __copyProps = (to, from, except, desc) => {
19
+ if (from && typeof from === "object" || typeof from === "function") {
20
+ for (let key of __getOwnPropNames(from))
21
+ if (!__hasOwnProp.call(to, key) && key !== except)
22
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
+ }
24
+ return to;
25
+ };
26
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
+ var remove_m2m_fields_exports = {};
28
+ __export(remove_m2m_fields_exports, {
29
+ default: () => remove_m2m_fields_default
30
+ });
31
+ module.exports = __toCommonJS(remove_m2m_fields_exports);
32
+ var import_server = require("@nocobase/server");
33
+ class remove_m2m_fields_default extends import_server.Migration {
34
+ appVersion = "<1.7.0";
35
+ on = "afterLoad";
36
+ async up() {
37
+ const { db } = this.context;
38
+ await db.sequelize.transaction(async (transaction) => {
39
+ const FieldRepo = db.getCollection("fields").repository;
40
+ await FieldRepo.destroy({
41
+ filter: {
42
+ collectionName: "users",
43
+ name: "jobs"
44
+ },
45
+ transaction
46
+ });
47
+ await FieldRepo.destroy({
48
+ filter: {
49
+ collectionName: "jobs",
50
+ name: "users"
51
+ },
52
+ transaction
53
+ });
54
+ db.removeCollection("fields");
55
+ });
56
+ }
57
+ }
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "displayName.zh-CN": "工作流:人工处理节点",
5
5
  "description": "Could be used for workflows which some of decisions are made by users.",
6
6
  "description.zh-CN": "用于人工控制部分决策的流程。",
7
- "version": "1.7.0-beta.1",
7
+ "version": "1.7.0-beta.3",
8
8
  "license": "AGPL-3.0",
9
9
  "main": "./dist/server/index.js",
10
10
  "homepage": "https://docs.nocobase.com/handbook/workflow-manual",
@@ -30,7 +30,7 @@
30
30
  "@nocobase/test": "1.x",
31
31
  "@nocobase/utils": "1.x"
32
32
  },
33
- "gitHead": "374a1bc60b3d55fd8b532a57c8fe0423eed1d11e",
33
+ "gitHead": "8d52cb1d366a968f87c1cd3f98f55f24be3056a5",
34
34
  "keywords": [
35
35
  "Workflow"
36
36
  ]
@@ -1,66 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
-
10
- var __defProp = Object.defineProperty;
11
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
- var __getOwnPropNames = Object.getOwnPropertyNames;
13
- var __hasOwnProp = Object.prototype.hasOwnProperty;
14
- var __export = (target, all) => {
15
- for (var name in all)
16
- __defProp(target, name, { get: all[name], enumerable: true });
17
- };
18
- var __copyProps = (to, from, except, desc) => {
19
- if (from && typeof from === "object" || typeof from === "function") {
20
- for (let key of __getOwnPropNames(from))
21
- if (!__hasOwnProp.call(to, key) && key !== except)
22
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
- }
24
- return to;
25
- };
26
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
- var change_table_name_exports = {};
28
- __export(change_table_name_exports, {
29
- default: () => change_table_name_default
30
- });
31
- module.exports = __toCommonJS(change_table_name_exports);
32
- var import_server = require("@nocobase/server");
33
- class change_table_name_default extends import_server.Migration {
34
- appVersion = "<1.6.0";
35
- on = "beforeLoad";
36
- async up() {
37
- const { db } = this.context;
38
- const queryInterface = db.sequelize.getQueryInterface();
39
- await db.sequelize.transaction(async (transaction) => {
40
- const exists = await queryInterface.tableExists("users_jobs", { transaction });
41
- if (exists) {
42
- const newTableName = db.options.underscored ? "workflow_manual_tasks" : "workflowManualTasks";
43
- await queryInterface.renameTable("users_jobs", newTableName, { transaction });
44
- const indexes = await queryInterface.showIndex(newTableName, { transaction });
45
- for (const item of indexes) {
46
- if (item.name.startsWith("users_jobs")) {
47
- if (this.db.isPostgresCompatibleDialect()) {
48
- await db.sequelize.query(
49
- `ALTER INDEX "${item.name}" RENAME TO "${item.name.replace("users_jobs", "workflow_manual_tasks")}";`,
50
- { transaction }
51
- );
52
- } else if (this.db.isMySQLCompatibleDialect()) {
53
- await db.sequelize.query(
54
- `ALTER TABLE ${newTableName} RENAME INDEX ${item.name} TO ${item.name.replace(
55
- "users_jobs",
56
- "workflow_manual_tasks"
57
- )};`,
58
- { transaction }
59
- );
60
- }
61
- }
62
- }
63
- }
64
- });
65
- }
66
- }