diff --git a/ee/sso-oidc/package.json b/ee/sso-oidc/package.json index 920c5dc762..a1c43464cd 100644 --- a/ee/sso-oidc/package.json +++ b/ee/sso-oidc/package.json @@ -1,6 +1,6 @@ { "name": "@steedos/ee_sso-oidc", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "main": "package.service.js", "scripts": { "build": "tsc" @@ -11,14 +11,14 @@ "access": "public" }, "dependencies": { - "@steedos/accounts": "2.5.17-beta.8", - "@steedos/objectql": "2.5.17-beta.8", - "@steedos/service-package-loader": "2.5.17-beta.8", + "@steedos/accounts": "2.5.17-beta.9", + "@steedos/objectql": "2.5.17-beta.9", + "@steedos/service-package-loader": "2.5.17-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": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/lerna.json b/lerna.json index a0a1a32da8..3baf454833 100644 --- a/lerna.json +++ b/lerna.json @@ -8,5 +8,5 @@ ], "useWorkspaces": true, "npmClient": "yarn", - "version": "2.5.17-beta.8" + "version": "2.5.17-beta.9" } diff --git a/packages/accounts/package.json b/packages/accounts/package.json index e37db1b906..69a79c63b0 100644 --- a/packages/accounts/package.json +++ b/packages/accounts/package.json @@ -1,7 +1,7 @@ { "name": "@steedos/accounts", "private": false, - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "main": "lib/index.js", "files": [ "/package.json", @@ -55,20 +55,20 @@ "validator": "^13.6.0" }, "devDependencies": { - "@steedos/auth": "2.5.17-beta.8", - "@steedos/meteor-bundle-runner": "2.5.17-beta.8", - "@steedos/objectql": "2.5.17-beta.8", + "@steedos/auth": "2.5.17-beta.9", + "@steedos/meteor-bundle-runner": "2.5.17-beta.9", + "@steedos/objectql": "2.5.17-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.17-beta.8", + "steedos-server": "2.5.17-beta.9", "typescript": "4.6.3" }, "publishConfig": { "access": "public" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/packages/auth/package.json b/packages/auth/package.json index 956ba33f23..10658b1621 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,7 +1,7 @@ { "name": "@steedos/auth", "private": false, - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "main": "lib/index.js", "scripts": { "watch": "tsc --watch", @@ -13,8 +13,8 @@ "access": "public" }, "dependencies": { - "@steedos/cachers": "2.5.17-beta.8", - "@steedos/objectql": "2.5.17-beta.8", + "@steedos/cachers": "2.5.17-beta.9", + "@steedos/objectql": "2.5.17-beta.9", "cookies": "^0.8.0", "express": "^4.16.4", "ismobilejs": "^1.1.1", @@ -25,5 +25,5 @@ "devDependencies": { "typescript": "4.6.3" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/packages/cachers/package.json b/packages/cachers/package.json index 5d264eef1c..4aab4c8c69 100644 --- a/packages/cachers/package.json +++ b/packages/cachers/package.json @@ -1,7 +1,7 @@ { "name": "@steedos/cachers", "private": false, - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "description": "", "main": "lib/index.js", "scripts": { @@ -19,5 +19,5 @@ "publishConfig": { "access": "public" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/packages/cli/package.json b/packages/cli/package.json index 89c35f0e0f..09f079ed83 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "steedos-cli", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "description": "Develop and run your enterprise apps in miniutes", "main": "dist/index.js", "scripts": { @@ -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.17-beta.8", - "@steedos/metadata-registrar": "2.5.17-beta.8", + "@steedos/metadata-core": "2.5.17-beta.9", + "@steedos/metadata-registrar": "2.5.17-beta.9", "archiver": "^5.0.2", "chalk": "2.4.2", "change-case": "^3.1.0", @@ -82,5 +82,5 @@ "publishConfig": { "access": "public" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/packages/client/package.json b/packages/client/package.json index 1f369374b9..c8e668e72b 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,7 +1,7 @@ { "private": false, "name": "@steedos/client", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "description": "client lib for steedos", "main": "lib/index.js", "scripts": { @@ -17,8 +17,8 @@ }, "license": "MIT", "dependencies": { - "@steedos/filters": "2.5.17-beta.8", + "@steedos/filters": "2.5.17-beta.9", "node-fetch": "^2.6.7" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/packages/core/package.json b/packages/core/package.json index 882b41a505..ceaf84213f 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,7 +1,7 @@ { "name": "@steedos/core", "private": false, - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "description": "", "main": "lib/index.js", "scripts": { @@ -14,15 +14,15 @@ "author": "", "license": "ISC", "dependencies": { - "@steedos/auth": "2.5.17-beta.8", - "@steedos/filters": "2.5.17-beta.8", - "@steedos/i18n": "2.5.17-beta.8", - "@steedos/metadata-core": "2.5.17-beta.8", - "@steedos/migrate": "2.5.17-beta.8", - "@steedos/objectql": "2.5.17-beta.8", - "@steedos/odata-v4-mongodb": "2.5.17-beta.8", - "@steedos/process": "2.5.17-beta.8", - "@steedos/standard-objects": "2.5.17-beta.8", + "@steedos/auth": "2.5.17-beta.9", + "@steedos/filters": "2.5.17-beta.9", + "@steedos/i18n": "2.5.17-beta.9", + "@steedos/metadata-core": "2.5.17-beta.9", + "@steedos/migrate": "2.5.17-beta.9", + "@steedos/objectql": "2.5.17-beta.9", + "@steedos/odata-v4-mongodb": "2.5.17-beta.9", + "@steedos/process": "2.5.17-beta.9", + "@steedos/standard-objects": "2.5.17-beta.9", "body-parser": "^1.18.1", "bunyan-sfdx-no-dtrace": "^1.8.2", "clone": "^2.1.2", @@ -45,7 +45,7 @@ "devDependencies": { "@salesforce/kit": "1.0.4", "@salesforce/ts-types": "1.1.2", - "@steedos/meteor-bundle-runner": "2.5.17-beta.8", + "@steedos/meteor-bundle-runner": "2.5.17-beta.9", "@types/express": "^4.16.1", "@types/node": "^11.10.4", "@types/underscore": "^1.8.13", @@ -57,5 +57,5 @@ "publishConfig": { "access": "public" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/packages/create-steedos-app/create-app.ts b/packages/create-steedos-app/create-app.ts index e753747e69..8c22449f44 100644 --- a/packages/create-steedos-app/create-app.ts +++ b/packages/create-steedos-app/create-app.ts @@ -229,14 +229,14 @@ export async function createApp({ * Default dependencies. */ const dependencies = [ - '@steedos/service-package-loader', - 'dotenv-flow', - 'moleculer-repl' + '@steedos/service-package-loader' ] /** * Default devDependencies. */ - const devDependencies = [] + const devDependencies = [ + 'moleculer-repl' + ] /** * TypeScript projects will have type definitions and other devDependencies. */ diff --git a/packages/create-steedos-app/package.json b/packages/create-steedos-app/package.json index ea374c1863..4c1cde1ec3 100644 --- a/packages/create-steedos-app/package.json +++ b/packages/create-steedos-app/package.json @@ -1,6 +1,6 @@ { "name": "create-steedos-app", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "keywords": [ "react", "steedos" @@ -49,5 +49,5 @@ "engines": { "node": ">=12.22.0" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/packages/create-steedos-app/templates/default/package.json b/packages/create-steedos-app/templates/default/package.json index 32e4fb8154..e80dfb08ce 100644 --- a/packages/create-steedos-app/templates/default/package.json +++ b/packages/create-steedos-app/templates/default/package.json @@ -13,5 +13,6 @@ "@steedos/service-package-loader": "^2.5" }, "devDependencies": { + "moleculer-repl": "^0.7.4" } } diff --git a/packages/create-steedos-package/package.json b/packages/create-steedos-package/package.json index 575de40db4..876fcd6c4a 100644 --- a/packages/create-steedos-package/package.json +++ b/packages/create-steedos-package/package.json @@ -1,6 +1,6 @@ { "name": "create-steedos-package", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "keywords": [ "steedos" ], @@ -39,5 +39,5 @@ "publishConfig": { "access": "public" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/packages/data-import/README.md b/packages/data-import/README.md index 70fcd9fb86..bdd8475923 100644 --- a/packages/data-import/README.md +++ b/packages/data-import/README.md @@ -1,20 +1,19 @@ ## 功能说明 - 此包是系统设置中的数据导入功能,可通过excel导入对象数据 -### 提供importData函数支持导入.data.json、.data.csv、.flow.json数据 +### 提供importData action 支持导入{objectname}.data.json、{objectname}.data.csv、{flowApiname}.flow.data.json数据 -- 比如在自定义的软件包package.service.js中监听系统初始化事件或者服务启动时调用importData导入软件包中的数据: +- 比如在自定义的软件包package.service.js中监听系统初始化事件调用importData导入软件包中的数据: ```js -const { importData } = require('@steedos/data-import') -const path = require('path') + module.exports = { /** * Events @@ -22,26 +21,85 @@ module.exports = { events: { // 系统初始化成功 'service-cloud-init.succeeded': async function (ctx) { - await importData(path.join(__dirname, 'main', 'default', 'data')); + await this.broker.call("~packages-@steedos/data-import.importData", { + data: { + "csv": csvData, + "json": jsonData, + "flow": flowData, + }, + spaceId, + onlyInsert: true, + }) } }, - /** - * Service started lifecycle event handler - */ - async started() { - await importData(path.join(__dirname, 'main', 'default', 'data')); - }, }; ``` -- importData 函数参数说明 +- importData action 参数说明 ```js /** - * - * @param {*} filePath 要导入数据的文件夹路径 - * @param {*} onlyInsert 仅导入,在导入数据之前先检查,如果存在任意一条记录,则不执行导入,默认true,如果是false, 则如果存在则执行更新操作。 - */ -export async function importData(filePath: string, onlyInsert: boolean = true) { - // 函数体 + * 参数示例: +{ + data: { + "csv": [{ objectName: 'warehouse', records: [ [Object] ]], + "json": [{ objectName: 'house', records: [ [Object] ]], + "flow": { flowApiName1: {}, flowApiName2: {} }, + }, + spaceId, + onlyInsert: true, +} + */ +"importData": { + params: { + data: { + type: "object", + props: { + csv: { + type: "array", + items: { + type: "object", + props: { + objectName: { type: "string" }, + records: { type: "array", items: "object" }, + } + }, + optional: true, + }, + json: { + type: "array", + items: { + type: "object", + props: { + objectName: { type: "string" }, + records: { type: "array", items: "object" }, + } + }, + optional: true, + }, + flow: { + type: "object", + optional: true, + }, + } + }, + spaceId: { type: "string" }, + onlyInsert: { type: "boolean", optional: true, default: true }, // 仅新增,在导入数据之前先检查,如果存在任意一条记录,则不执行导入,默认true,如果是false, 则如果存在则执行更新操作。 + }, + async handler(ctx) { + + } } -``` \ No newline at end of file +``` +## 使用mongodb cli 导出演示数据 +- json: 使用命令导出。例如: `mongoexport --uri="mongodb://192.168.3.31:27017/steedos-apps" --jsonArray --collection=contract_types --out=contract_types.data.json` +- csv: 使用命令导出。例如: `mongoexport --uri="mongodb://192.168.3.31:27017/steedos-apps" --collection=contract_types --type=csv --fields=name,code --out=contract_types.data.csv` + +## 编码要求 +json、csv中文件请使用`utf-8`编码 + +## 示例,导出合同模块数据, 进入`main\default\data`文件夹后执行以下命令 +``` +mongoexport --uri="mongodb://192.168.3.31:27017/steedos-apps" --collection=contract_types --type=csv --fields=name,code --out=contract_types.data.csv + +mongoexport --uri="mongodb://192.168.3.31:27017/steedos-apps" --jsonArray --collection=contracts --out=contracts.data.json +``` diff --git a/packages/data-import/package.json b/packages/data-import/package.json index 2789d85b21..a4d210654f 100644 --- a/packages/data-import/package.json +++ b/packages/data-import/package.json @@ -1,16 +1,16 @@ { "name": "@steedos/data-import", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "main": "lib/index.js", "license": "MIT", "scripts": { "build": "rm -rf ./lib && tsc" }, "dependencies": { - "@steedos/core": "2.5.17-beta.8", - "@steedos/metadata-api": "2.5.17-beta.8", - "@steedos/metadata-core": "2.5.17-beta.8", - "@steedos/objectql": "2.5.17-beta.8", + "@steedos/core": "2.5.17-beta.9", + "@steedos/metadata-api": "2.5.17-beta.9", + "@steedos/metadata-core": "2.5.17-beta.9", + "@steedos/objectql": "2.5.17-beta.9", "bson": "4.6.4", "csvtojson": "~2.0.10", "dotenv-flow": "^3.1.0", @@ -24,5 +24,5 @@ "publishConfig": { "access": "public" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/packages/data-import/package.service.js b/packages/data-import/package.service.js index bcb1978d94..1a222b9711 100644 --- a/packages/data-import/package.service.js +++ b/packages/data-import/package.service.js @@ -1,8 +1,8 @@ /* * @Author: baozhoutao@steedos.com * @Date: 2022-03-28 09:35:34 - * @LastEditors: baozhoutao@steedos.com - * @LastEditTime: 2022-11-09 11:53:36 + * @LastEditors: 孙浩林 sunhaolin@steedos.com + * @LastEditTime: 2023-10-27 12:09:49 * @Description: */ "use strict"; @@ -11,6 +11,7 @@ const packageName = project.name; const packageLoader = require('@steedos/service-package-loader'); const path = require('path'); const objectql = require('@steedos/objectql'); +const { importData } = require('./lib') /** * @typedef {import('moleculer').Context} Context Moleculer's Context * 软件包服务启动后也需要抛出事件。 @@ -24,10 +25,10 @@ module.exports = { */ settings: { packageInfo: { - path: path.join(__dirname, 'lib'), + path: path.join(__dirname, 'lib'), name: packageName, isPackage: false - } + } }, /** @@ -42,9 +43,11 @@ module.exports = { 'hasImportTemplates': { async handler(ctx) { const { objectName } = ctx.params; - const count = await objectql.getObject('queue_import').count({filters: [ - ['object_name', '=', objectName] - ]}); + const count = await objectql.getObject('queue_import').count({ + filters: [ + ['object_name', '=', objectName] + ] + }); return count > 0 } }, @@ -54,6 +57,59 @@ module.exports = { return records; } }, + /** + * 参数示例: + { + data: { + "csv": [{ objectName: 'warehouse', records: [ [Object] ]], + "json": [{ objectName: 'house', records: [ [Object] ]], + "flow": { flowApiName1: {}, flowApiName2: {} }, + }, + spaceId, + onlyInsert: true, + } + */ + "importData": { + params: { + data: { + type: "object", + props: { + csv: { + type: "array", + items: { + type: "object", + props: { + objectName: { type: "string" }, + records: { type: "array", items: "object" }, + } + }, + optional: true, + }, + json: { + type: "array", + items: { + type: "object", + props: { + objectName: { type: "string" }, + records: { type: "array", items: "object" }, + } + }, + optional: true, + }, + flow: { + type: "object", + optional: true, + }, + } + }, + spaceId: { type: "string" }, + onlyInsert: { type: "boolean", optional: true, default: true }, + }, + async handler(ctx) { + const { data, spaceId, onlyInsert } = ctx.params; + await importData(data, onlyInsert, spaceId) + } + } }, /** diff --git a/packages/data-import/src/imports/ImportFlow.ts b/packages/data-import/src/imports/ImportFlow.ts index 1bff9ab0ac..22235807b1 100644 --- a/packages/data-import/src/imports/ImportFlow.ts +++ b/packages/data-import/src/imports/ImportFlow.ts @@ -1,3 +1,11 @@ +/* + * @Author: 孙浩林 sunhaolin@steedos.com + * @Date: 2022-07-15 18:16:49 + * @LastEditors: 孙浩林 sunhaolin@steedos.com + * @LastEditTime: 2023-10-26 14:49:19 + * @FilePath: /steedos-platform-2.3/packages/data-import/src/imports/ImportFlow.ts + * @Description: + */ import { DbManager } from '@steedos/metadata-api/lib/util/dbManager' import { flowsToDb } from '@steedos/metadata-api/lib/metadata/collection/flow' // import { checkNameEquals } from '@steedos/metadata-api/lib/util/check_name_equals' @@ -59,10 +67,9 @@ export default class ImportFlow implements Base { return flows; } - async fileRecordsToDB(filePath: string) { + async fileRecordsToDB(flows: object) { const dbManager = new DbManager(this.userSession); try { - const flows = await this.readFile(filePath); await dbManager.connect(); const session = await dbManager.startSession(); try { diff --git a/packages/data-import/src/imports/ImportJson.ts b/packages/data-import/src/imports/ImportJson.ts index f302542f79..d6699dc1f0 100644 --- a/packages/data-import/src/imports/ImportJson.ts +++ b/packages/data-import/src/imports/ImportJson.ts @@ -6,7 +6,7 @@ import { syncMatchFiles } from '@steedos/metadata-core'; const path = require('path'); const fs = require("fs"); import { EJSON } from 'bson' -import { formatResults, preCreateCollection } from '..'; +import { formatResults, preCreateCollection, readFileResult } from '..'; const transactionOptions: any = { readPreference: 'primary', @@ -53,15 +53,14 @@ export default class ImportJson implements Base { return results } - async fileRecordsToDB(filePath: string) { + async fileRecordsToDB(jsonData: readFileResult[]) { const userSession = this.userSession const { spaceId, userId, company_id, company_ids } = userSession var dbManager = new DbManager(userSession); const now = new Date() try { - let results: any = await this.readFile(filePath); - results = formatResults(results, userSession) + let results = formatResults(jsonData, userSession) await dbManager.connect(); diff --git a/packages/data-import/src/index.ts b/packages/data-import/src/index.ts index aff59dba46..9c7935654c 100644 --- a/packages/data-import/src/index.ts +++ b/packages/data-import/src/index.ts @@ -5,8 +5,9 @@ import ImportJson from './imports/ImportJson' import ImportCsv from './imports/ImportCsv' import ImportFlow from './imports/ImportFlow' import { userSessionType } from './types' +import _ from 'lodash' -export async function getUserSession(spaceId?: string): Promise { +export async function getUserSession(spaceId?: string): Promise { var dbManager = new DbManager({}); const now = new Date() try { @@ -56,23 +57,33 @@ export async function preCreateCollection(dbManager, results: readFileResult[]) for (const result of results) { const objectName = result.objectName if (!collectionsMap[objectName]) { - await db.createCollection(objectName, options) + try { + await db.createCollection(objectName, options) + } catch (error) { + // DO NOTHING + } } } } -type readFileResult = { +export type readFileResult = { readonly objectName: string, readonly records: any[] } +export type importDataType = { + csv: readFileResult[], + json: readFileResult[], + flow: object, +} + /** * 将数据中的${space_id}替换为spaceId值 * @param results * @param userSession * @returns new results */ -export function formatResults (results: readFileResult[], userSession: userSessionType): readFileResult[] { +export function formatResults(results: readFileResult[], userSession: userSessionType): readFileResult[] { const { spaceId, userId } = userSession return JSON.parse(JSON.stringify(results).replace(/\${space_id}/g, spaceId).replace(/\${space_owner_id}/g, userId)) } @@ -82,23 +93,31 @@ export function formatResults (results: readFileResult[], userSession: userSessi * @param {*} filePath 要导入数据的文件夹路径 * @param {*} onlyInsert 仅导入,在导入数据之前先检查,如果存在任意一条记录,则不执行导入 */ -export async function importData(filePath: string, onlyInsert: boolean = true, spaceId?: string) { +export async function importData(data: importDataType, onlyInsert: boolean = true, spaceId?: string) { const userSession = await getUserSession(spaceId) if (isEmpty(userSession)) { return; } + + if (_.isEmpty(data)) { + return; + } + const importer = { csv: new ImportCsv(userSession), json: new ImportJson(userSession), flow: new ImportFlow(userSession) } + const csvData = data?.csv + const jsonData = data?.json + const flowData = data?.flow + if (onlyInsert) { var dbManager = new DbManager(userSession); try { await dbManager.connect(); //检查csv数据是否存在 - const csvData = await importer.csv.readFile(filePath); for (const result of csvData) { for (let record of result.records) { const dbRecord = await dbManager.findOne(result.objectName, { _id: record._id }, true); @@ -108,18 +127,16 @@ export async function importData(filePath: string, onlyInsert: boolean = true, s } } //检查json数据是否存在 - const jsonData = await importer.json.readFile(filePath); for (const result of jsonData) { - for (let record of result.records) { - const dbRecord = await dbManager.findOne(result.objectName, { _id: record._id }, true); - if (dbRecord) { - throw new Error(`停止导入数据:${result.objectName}对象的${record._id}记录已存在`); - } + const objectName = result.objectName; + const records = result.records; + const recordsIds = _.map(records, '_id'); + const dbRecords = await dbManager.find(objectName, { _id: { $in: recordsIds } }, false, 0, { projection: { _id: 1 } }); + if (dbRecords.length > 0) { + throw new Error(`停止导入数据:${result.objectName}对象已存在${dbRecords.length}条记录`); } } //检查flow数据是否存在 - const flowData = await importer.flow.readFile(filePath); - for (const formName in flowData) { var form = flowData[formName]; @@ -140,7 +157,7 @@ export async function importData(filePath: string, onlyInsert: boolean = true, s await dbManager.close(); } } - importer.csv.fileRecordsToDB(filePath); - importer.json.fileRecordsToDB(filePath); - importer.flow.fileRecordsToDB(filePath); + importer.csv.fileRecordsToDB(csvData); + importer.json.fileRecordsToDB(jsonData); + importer.flow.fileRecordsToDB(flowData); } \ No newline at end of file diff --git a/packages/filters/package.json b/packages/filters/package.json index c53c9167d8..756ca5d611 100644 --- a/packages/filters/package.json +++ b/packages/filters/package.json @@ -1,7 +1,7 @@ { "name": "@steedos/filters", "private": false, - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "description": "filters lib for steedos", "main": "lib/index.js", "files": [ @@ -36,5 +36,5 @@ "publishConfig": { "access": "public" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/packages/formula/package.json b/packages/formula/package.json index ba2750f68e..5d170331f7 100644 --- a/packages/formula/package.json +++ b/packages/formula/package.json @@ -1,6 +1,6 @@ { "name": "@steedos/formula", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "description": "Salesforce Formula Parser", "main": "lib/formulon.js", "files": [ @@ -46,5 +46,5 @@ "publishConfig": { "access": "public" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/packages/i18n/package.json b/packages/i18n/package.json index 0b76d2a6b5..296fbd1363 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -1,7 +1,7 @@ { "name": "@steedos/i18n", "private": false, - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "description": "", "main": "lib/index.js", "scripts": { @@ -11,7 +11,7 @@ "author": "", "license": "ISC", "dependencies": { - "@steedos/cachers": "2.5.17-beta.8", + "@steedos/cachers": "2.5.17-beta.9", "i18next": "^19.3.4", "i18next-sprintf-postprocessor": "^0.2.2", "underscore": "1.13.4" @@ -22,5 +22,5 @@ "publishConfig": { "access": "public" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/packages/metadata-api/package.json b/packages/metadata-api/package.json index de262acad2..0ece980eb6 100644 --- a/packages/metadata-api/package.json +++ b/packages/metadata-api/package.json @@ -1,6 +1,6 @@ { "name": "@steedos/metadata-api", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "description": "", "main": "lib/index.js", "files": [ @@ -21,10 +21,10 @@ "access": "public" }, "dependencies": { - "@steedos/auth": "2.5.17-beta.8", - "@steedos/core": "2.5.17-beta.8", - "@steedos/metadata-core": "2.5.17-beta.8", - "@steedos/objectql": "2.5.17-beta.8", + "@steedos/auth": "2.5.17-beta.9", + "@steedos/core": "2.5.17-beta.9", + "@steedos/metadata-core": "2.5.17-beta.9", + "@steedos/objectql": "2.5.17-beta.9", "chalk": "^4.1.0", "clone": "2.1.2", "compressing": "^1.5.1", @@ -36,9 +36,9 @@ "underscore": "^1.11.0" }, "devDependencies": { - "@steedos/service-meteor-package-loader": "2.5.17-beta.8", + "@steedos/service-meteor-package-loader": "2.5.17-beta.9", "javascript-obfuscator": "^2.9.1", "typescript": "4.6.3" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/packages/metadata-api/src/util/dbManager.ts b/packages/metadata-api/src/util/dbManager.ts index 88a82a3ae3..029990374e 100644 --- a/packages/metadata-api/src/util/dbManager.ts +++ b/packages/metadata-api/src/util/dbManager.ts @@ -59,17 +59,19 @@ export class DbManager { return await this.client.db().collection(collectionName).insertOne(doc, {session: this.session}); } - async insertMany(collectionName:string, docs:any[]) { - for(var i=0; i", @@ -9,5 +9,5 @@ "publishConfig": { "access": "public" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/packages/standard-objects/admin.app.yml b/packages/standard-objects/admin.app.yml index 3c00ff9b07..b321a2661b 100644 --- a/packages/standard-objects/admin.app.yml +++ b/packages/standard-objects/admin.app.yml @@ -242,12 +242,6 @@ admin_menus: - admin object_name: workflow_rule parent: process_automation - - _id: object_validation_rules - name: Object Validation Rules - permission_sets: - - admin - object_name: object_validation_rules - parent: process_automation - _id: workflow_actions name: Workflow Actions permission_sets: diff --git a/packages/standard-objects/objectTranslations/cms_files.en/cms_files.en.objectTranslation.yml b/packages/standard-objects/objectTranslations/cms_files.en/cms_files.en.objectTranslation.yml index aa50adb278..2f800b511f 100644 --- a/packages/standard-objects/objectTranslations/cms_files.en/cms_files.en.objectTranslation.yml +++ b/packages/standard-objects/objectTranslations/cms_files.en/cms_files.en.objectTranslation.yml @@ -28,7 +28,7 @@ fields: description: listviews: all: - label: + label: all actions: standard_new: label: New diff --git a/packages/standard-objects/objectTranslations/cms_files.zh-CN/cms_files.zh-CN.objectTranslation.yml b/packages/standard-objects/objectTranslations/cms_files.zh-CN/cms_files.zh-CN.objectTranslation.yml index fed3bd5a11..4a09740582 100644 --- a/packages/standard-objects/objectTranslations/cms_files.zh-CN/cms_files.zh-CN.objectTranslation.yml +++ b/packages/standard-objects/objectTranslations/cms_files.zh-CN/cms_files.zh-CN.objectTranslation.yml @@ -28,7 +28,7 @@ fields: description: listviews: all: - label: + label: 所有 actions: standard_new: label: 新建 diff --git a/packages/standard-objects/package.json b/packages/standard-objects/package.json index 55b245eae2..bf27c4f3ad 100644 --- a/packages/standard-objects/package.json +++ b/packages/standard-objects/package.json @@ -1,7 +1,7 @@ { "name": "@steedos/standard-objects", "private": false, - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "description": "Standard objects for steedos", "main": "index.js", "license": "Apache", @@ -9,13 +9,13 @@ "publishConfig": { "access": "public" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149", + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946", "dependencies": { - "@steedos/auth": "2.5.17-beta.8", - "@steedos/core": "2.5.17-beta.8", - "@steedos/filters": "2.5.17-beta.8", - "@steedos/i18n": "2.5.17-beta.8", - "@steedos/metadata-core": "2.5.17-beta.8", - "@steedos/metadata-registrar": "2.5.17-beta.8" + "@steedos/auth": "2.5.17-beta.9", + "@steedos/core": "2.5.17-beta.9", + "@steedos/filters": "2.5.17-beta.9", + "@steedos/i18n": "2.5.17-beta.9", + "@steedos/metadata-core": "2.5.17-beta.9", + "@steedos/metadata-registrar": "2.5.17-beta.9" } } diff --git a/packages/standard-objects/translations/en.translation.yml b/packages/standard-objects/translations/en.translation.yml index 7f0d3523a4..2cccfbaf4b 100644 --- a/packages/standard-objects/translations/en.translation.yml +++ b/packages/standard-objects/translations/en.translation.yml @@ -90,7 +90,7 @@ CustomTabs: admin_objects: Objects admin_datasources: External Data Sources admin_queue_import: Data Import - admin_pages: Mini Pages + admin_pages: Micro Pages admin_tabs: Tabs admin_queries: Queries admin_charts: Charts diff --git a/packages/steedos-plugin-schema-builder/package.json b/packages/steedos-plugin-schema-builder/package.json index 7c35bbe08e..85e161664c 100644 --- a/packages/steedos-plugin-schema-builder/package.json +++ b/packages/steedos-plugin-schema-builder/package.json @@ -1,6 +1,6 @@ { "name": "@steedos/steedos-plugin-schema-builder", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "description": "Add Schema Builder to Steedos Object Manager.", "main": "index.js", "author": "", @@ -10,5 +10,5 @@ "access": "public" }, "homepage": "https://github.com/steedos/steedos-platform/tree/master/packages/steedos-plugin-schema-builder", - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/packages/workflow/package.json b/packages/workflow/package.json index 9b88f7ec8f..15b8640506 100644 --- a/packages/workflow/package.json +++ b/packages/workflow/package.json @@ -1,6 +1,6 @@ { "name": "@steedos/workflow", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "main": "index.js", "repository": "https://github.com/steedos/steedos-platform/packages/workflow.git", "author": "sunhaolin ", @@ -10,17 +10,17 @@ "access": "public" }, "dependencies": { - "@steedos/auth": "2.5.17-beta.8", - "@steedos/objectql": "2.5.17-beta.8", + "@steedos/auth": "2.5.17-beta.9", + "@steedos/objectql": "2.5.17-beta.9", "@steedos/steedos-plugin-workflow": "^2.1.3", "body-parser": "^1.19.0", "express": "^4.17.1", "underscore": "^1.9.1" }, "devDependencies": { - "@steedos/core": "2.5.17-beta.8", - "@steedos/meteor-bundle-runner": "2.5.17-beta.8", - "steedos-server": "2.5.17-beta.8" + "@steedos/core": "2.5.17-beta.9", + "@steedos/meteor-bundle-runner": "2.5.17-beta.9", + "steedos-server": "2.5.17-beta.9" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/server/package.json b/server/package.json index 7dd9e8ee0f..bdfcf37794 100644 --- a/server/package.json +++ b/server/package.json @@ -1,6 +1,6 @@ { "name": "steedos-server", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "main": "index.js", "files": [ "/bundle/programs/server/app", @@ -19,18 +19,18 @@ }, "dependencies": { "@babel/runtime": "7.12.18", - "@steedos/accounts": "2.5.17-beta.8", - "@steedos/auth": "2.5.17-beta.8", - "@steedos/core": "2.5.17-beta.8", - "@steedos/filters": "2.5.17-beta.8", - "@steedos/i18n": "2.5.17-beta.8", - "@steedos/meteor-bundle-dependencies": "2.5.17-beta.8", - "@steedos/meteor-bundle-runner": "2.5.17-beta.8", - "@steedos/objectql": "2.5.17-beta.8", - "@steedos/odata-v4-mongodb": "2.5.17-beta.8", - "@steedos/odata-v4-parser": "2.5.17-beta.8", - "@steedos/process": "2.5.17-beta.8", - "@steedos/standard-objects": "2.5.17-beta.8", + "@steedos/accounts": "2.5.17-beta.9", + "@steedos/auth": "2.5.17-beta.9", + "@steedos/core": "2.5.17-beta.9", + "@steedos/filters": "2.5.17-beta.9", + "@steedos/i18n": "2.5.17-beta.9", + "@steedos/meteor-bundle-dependencies": "2.5.17-beta.9", + "@steedos/meteor-bundle-runner": "2.5.17-beta.9", + "@steedos/objectql": "2.5.17-beta.9", + "@steedos/odata-v4-mongodb": "2.5.17-beta.9", + "@steedos/odata-v4-parser": "2.5.17-beta.9", + "@steedos/process": "2.5.17-beta.9", + "@steedos/standard-objects": "2.5.17-beta.9", "@steedos/webapp": "2.2.25", "basic-auth": "^2.0.1", "bcryptjs": "^2.4.3", @@ -86,5 +86,5 @@ "xiaomi-push": "^1.0.0", "xml2js": "^0.4.19" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/services/service-accounts/package.json b/services/service-accounts/package.json index f98cf7518a..99e4a34a9e 100644 --- a/services/service-accounts/package.json +++ b/services/service-accounts/package.json @@ -1,6 +1,6 @@ { "name": "@steedos/service-accounts", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "main": "package.service.js", "license": "MIT", "dependencies": { @@ -10,5 +10,5 @@ "publishConfig": { "access": "public" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/services/service-ancillary/package.json b/services/service-ancillary/package.json index bb379155ef..ab98436e56 100644 --- a/services/service-ancillary/package.json +++ b/services/service-ancillary/package.json @@ -1,6 +1,6 @@ { "name": "@steedos/service-ancillary", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "description": "", "main": "package.service.js", "scripts": { @@ -17,5 +17,5 @@ "express-xml-bodyparser": "0.3.0", "xml2js": "0.4.23" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/services/service-api/package.json b/services/service-api/package.json index 6337c11585..b3025bc4ea 100644 --- a/services/service-api/package.json +++ b/services/service-api/package.json @@ -1,13 +1,13 @@ { "name": "@steedos/service-api", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "main": "index.js", "license": "MIT", "dependencies": { - "@steedos/auth": "2.5.17-beta.8", - "@steedos/router": "2.5.17-beta.8", - "@steedos/service-object-graphql": "2.5.17-beta.8", - "@steedos/service-ui": "2.5.17-beta.8", + "@steedos/auth": "2.5.17-beta.9", + "@steedos/router": "2.5.17-beta.9", + "@steedos/service-object-graphql": "2.5.17-beta.9", + "@steedos/service-ui": "2.5.17-beta.9", "graphql": "^15.8.0", "graphql-iso-date": "^3.6.1", "graphql-type-json": "^0.3.2", @@ -22,7 +22,7 @@ "publishConfig": { "access": "public" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149", + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946", "devDependencies": { "@types/graphql-iso-date": "^3.4.0", "@types/react-dev-utils": "^9.0.11" diff --git a/services/service-cachers-manager/package.json b/services/service-cachers-manager/package.json index 54b92668ac..d860ab48b9 100644 --- a/services/service-cachers-manager/package.json +++ b/services/service-cachers-manager/package.json @@ -1,15 +1,15 @@ { "name": "@steedos/service-cachers-manager", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "main": "package.service.js", "license": "MIT", "private": false, "dependencies": { - "@steedos/cachers": "2.5.17-beta.8", - "@steedos/metadata-registrar": "2.5.17-beta.8" + "@steedos/cachers": "2.5.17-beta.9", + "@steedos/metadata-registrar": "2.5.17-beta.9" }, "publishConfig": { "access": "public" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/services/service-charts/package.json b/services/service-charts/package.json index 702d06d8e5..5a8c9bd545 100644 --- a/services/service-charts/package.json +++ b/services/service-charts/package.json @@ -1,7 +1,7 @@ { "name": "@steedos/service-charts", "private": false, - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "description": "Connect to the database and execute custom queries.", "main": "package.service.js", "repository": { @@ -17,9 +17,9 @@ "pub_next": "npm publish --tag next --registry https://registry.npmjs.org && start https://npm.taobao.org/sync/@steedos/app-admin" }, "devDependencies": { - "@steedos/service-metadata-server": "2.5.17-beta.8", - "@steedos/service-package-loader": "2.5.17-beta.8", - "@steedos/service-steedos-server": "2.5.17-beta.8", + "@steedos/service-metadata-server": "2.5.17-beta.9", + "@steedos/service-package-loader": "2.5.17-beta.9", + "@steedos/service-steedos-server": "2.5.17-beta.9", "cross-env": "^7.0.3", "dotenv-flow": "^3.2.0", "ioredis": "^4.22.0", @@ -34,7 +34,7 @@ "publishConfig": { "access": "public" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149", + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946", "dependencies": { "duration": "^0.2.2", "json2csv": "5.0.6", diff --git a/services/service-community/package.json b/services/service-community/package.json index 24328c619d..4e76600d2b 100644 --- a/services/service-community/package.json +++ b/services/service-community/package.json @@ -1,7 +1,7 @@ { "name": "@steedos/service-community", "main": "package.service.js", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "private": false, "repository": "https://github.com/steedos/steedos-platform.git", "description": "", @@ -11,27 +11,27 @@ "author": "steedos", "license": "MIT", "dependencies": { - "@steedos/ee_sso-oidc": "2.5.17-beta.8", - "@steedos/service-analytics": "2.5.17-beta.8", - "@steedos/service-ancillary": "2.5.17-beta.8", - "@steedos/service-charts": "2.5.17-beta.8", - "@steedos/service-i18n": "2.5.17-beta.8", - "@steedos/service-identity-jwt": "2.5.17-beta.8", - "@steedos/service-metadata-server": "2.5.17-beta.8", - "@steedos/service-mongodb-server": "2.5.17-beta.8", - "@steedos/service-objectql": "2.5.17-beta.8", - "@steedos/service-package-loader": "2.5.17-beta.8", - "@steedos/service-package-registry": "2.5.17-beta.8", - "@steedos/service-package-tool": "2.5.17-beta.8", - "@steedos/service-pages": "2.5.17-beta.8", - "@steedos/service-rest": "2.5.17-beta.8", - "@steedos/service-saas": "2.5.17-beta.8", - "@steedos/service-sentry": "2.5.17-beta.8", - "@steedos/service-sidecar": "2.5.17-beta.8", - "@steedos/service-steedos-server": "2.5.17-beta.8", - "@steedos/steedos-plugin-schema-builder": "2.5.17-beta.8", - "@steedos/unpkg": "2.5.17-beta.8", - "@steedos/workflow_time_trigger": "2.5.17-beta.8", + "@steedos/ee_sso-oidc": "2.5.17-beta.9", + "@steedos/service-analytics": "2.5.17-beta.9", + "@steedos/service-ancillary": "2.5.17-beta.9", + "@steedos/service-charts": "2.5.17-beta.9", + "@steedos/service-i18n": "2.5.17-beta.9", + "@steedos/service-identity-jwt": "2.5.17-beta.9", + "@steedos/service-metadata-server": "2.5.17-beta.9", + "@steedos/service-mongodb-server": "2.5.17-beta.9", + "@steedos/service-objectql": "2.5.17-beta.9", + "@steedos/service-package-loader": "2.5.17-beta.9", + "@steedos/service-package-registry": "2.5.17-beta.9", + "@steedos/service-package-tool": "2.5.17-beta.9", + "@steedos/service-pages": "2.5.17-beta.9", + "@steedos/service-rest": "2.5.17-beta.9", + "@steedos/service-saas": "2.5.17-beta.9", + "@steedos/service-sentry": "2.5.17-beta.9", + "@steedos/service-sidecar": "2.5.17-beta.9", + "@steedos/service-steedos-server": "2.5.17-beta.9", + "@steedos/steedos-plugin-schema-builder": "2.5.17-beta.9", + "@steedos/unpkg": "2.5.17-beta.9", + "@steedos/workflow_time_trigger": "2.5.17-beta.9", "aliyun-sdk": "1.12.3", "async-retry": "^1.3.1", "axios": "^0.21.1", @@ -64,7 +64,7 @@ "randomcolor": "^0.6.2", "randomstring": "^1.2.1", "redlock": "^4.2.0", - "steedos-cli": "2.5.17-beta.8", + "steedos-cli": "2.5.17-beta.9", "tslib": "^2.4.0", "validator": "^13.6.0" }, @@ -72,5 +72,5 @@ "publishConfig": { "access": "public" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/services/service-fields-indexs/package.json b/services/service-fields-indexs/package.json index 94cebf937f..e41a7f4264 100644 --- a/services/service-fields-indexs/package.json +++ b/services/service-fields-indexs/package.json @@ -1,6 +1,6 @@ { "name": "@steedos/service-fields-indexs", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "main": "package.service.js", "license": "MIT", "dependencies": { @@ -10,5 +10,5 @@ "publishConfig": { "access": "public" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/services/service-files/package.json b/services/service-files/package.json index 74785400a0..56e4cf77b8 100644 --- a/services/service-files/package.json +++ b/services/service-files/package.json @@ -1,6 +1,6 @@ { "name": "@steedos/service-files", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "main": "package.service.js", "scripts": {}, "license": "MIT", @@ -15,5 +15,5 @@ "mkdirp": "^1.0.4", "moment": "^2.29.1" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/services/service-i18n/package.json b/services/service-i18n/package.json index 328e0616ce..90b10b5d28 100644 --- a/services/service-i18n/package.json +++ b/services/service-i18n/package.json @@ -1,7 +1,7 @@ { "name": "@steedos/service-i18n", "main": "package.service.js", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "private": false, "repository": "https://github.com/steedos/steedos-platform.git", "description": "", @@ -14,5 +14,5 @@ "publishConfig": { "access": "public" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/services/service-identity-jwt/package.json b/services/service-identity-jwt/package.json index 8c8e52a136..e79f715c45 100644 --- a/services/service-identity-jwt/package.json +++ b/services/service-identity-jwt/package.json @@ -1,6 +1,6 @@ { "name": "@steedos/service-identity-jwt", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "main": "package.service.js", "keywords": [ "steedos" @@ -11,7 +11,7 @@ "description": "steedos package", "repository": {}, "dependencies": { - "@steedos/accounts": "2.5.17-beta.8", + "@steedos/accounts": "2.5.17-beta.9", "express": "4.18.1", "jsonwebtoken": "8.5.1", "passport": "^0.6.0", @@ -22,5 +22,5 @@ "publishConfig": { "access": "public" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/services/service-metadata-apps/package.json b/services/service-metadata-apps/package.json index bbc4951d75..1d67860e6d 100644 --- a/services/service-metadata-apps/package.json +++ b/services/service-metadata-apps/package.json @@ -1,6 +1,6 @@ { "name": "@steedos/service-metadata-apps", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "description": "", "main": "lib/apps.service.js", "scripts": { @@ -19,8 +19,8 @@ "author": "", "license": "MIT", "dependencies": { - "@steedos/i18n": "2.5.17-beta.8", - "@steedos/objectql": "2.5.17-beta.8", + "@steedos/i18n": "2.5.17-beta.9", + "@steedos/objectql": "2.5.17-beta.9", "dotenv-flow": "^3.1.0", "ioredis": "^4.22.0", "lodash": "^4.17.21", @@ -34,5 +34,5 @@ "publishConfig": { "access": "public" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/services/service-metadata-layouts/package.json b/services/service-metadata-layouts/package.json index 82b95b296c..739f0a54fb 100644 --- a/services/service-metadata-layouts/package.json +++ b/services/service-metadata-layouts/package.json @@ -1,6 +1,6 @@ { "name": "@steedos/service-metadata-layouts", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "description": "", "main": "lib/layouts.service.js", "scripts": { @@ -33,5 +33,5 @@ "publishConfig": { "access": "public" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/services/service-metadata-objects/package.json b/services/service-metadata-objects/package.json index 02c90f3ab2..b38fa5a333 100644 --- a/services/service-metadata-objects/package.json +++ b/services/service-metadata-objects/package.json @@ -1,6 +1,6 @@ { "name": "@steedos/service-metadata-objects", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "description": "", "main": "lib/objects.service.js", "scripts": { @@ -20,9 +20,9 @@ "license": "MIT", "dependencies": { "@salesforce/ts-types": "1.1.2", - "@steedos/formula": "2.5.17-beta.8", - "@steedos/i18n": "2.5.17-beta.8", - "@steedos/metadata-registrar": "2.5.17-beta.8", + "@steedos/formula": "2.5.17-beta.9", + "@steedos/i18n": "2.5.17-beta.9", + "@steedos/metadata-registrar": "2.5.17-beta.9", "dotenv-flow": "^3.1.0", "ioredis": "^4.22.0", "lodash": "^4.17.21", @@ -37,5 +37,5 @@ "publishConfig": { "access": "public" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/services/service-metadata-permissionsets/package.json b/services/service-metadata-permissionsets/package.json index f8ab42fbd9..8f4af4801c 100644 --- a/services/service-metadata-permissionsets/package.json +++ b/services/service-metadata-permissionsets/package.json @@ -1,6 +1,6 @@ { "name": "@steedos/service-metadata-permissionsets", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "description": "", "main": "lib/permissionsets.service.js", "scripts": { @@ -32,5 +32,5 @@ "publishConfig": { "access": "public" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/services/service-metadata-server/package.json b/services/service-metadata-server/package.json index e3fc0cc2ed..28d6d9cbf4 100644 --- a/services/service-metadata-server/package.json +++ b/services/service-metadata-server/package.json @@ -1,22 +1,22 @@ { "name": "@steedos/service-metadata-server", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "main": "index.js", "license": "MIT", "scripts": { "build": "rm -rf ./lib && tsc" }, "dependencies": { - "@steedos/objectql": "2.5.17-beta.8", - "@steedos/service-metadata": "2.5.17-beta.8", - "@steedos/service-metadata-apps": "2.5.17-beta.8", - "@steedos/service-metadata-layouts": "2.5.17-beta.8", - "@steedos/service-metadata-objects": "2.5.17-beta.8", - "@steedos/service-metadata-permissionsets": "2.5.17-beta.8", - "@steedos/service-metadata-tabs": "2.5.17-beta.8", - "@steedos/service-metadata-translations": "2.5.17-beta.8", - "@steedos/service-metadata-triggers": "2.5.17-beta.8", - "@steedos/service-packages": "2.5.17-beta.8", + "@steedos/objectql": "2.5.17-beta.9", + "@steedos/service-metadata": "2.5.17-beta.9", + "@steedos/service-metadata-apps": "2.5.17-beta.9", + "@steedos/service-metadata-layouts": "2.5.17-beta.9", + "@steedos/service-metadata-objects": "2.5.17-beta.9", + "@steedos/service-metadata-permissionsets": "2.5.17-beta.9", + "@steedos/service-metadata-tabs": "2.5.17-beta.9", + "@steedos/service-metadata-translations": "2.5.17-beta.9", + "@steedos/service-metadata-triggers": "2.5.17-beta.9", + "@steedos/service-packages": "2.5.17-beta.9", "lodash": "^4.17.21", "underscore": "1.13.4" }, @@ -27,5 +27,5 @@ "publishConfig": { "access": "public" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/services/service-metadata-tabs/package.json b/services/service-metadata-tabs/package.json index 841c7b90ef..41cbf94cdd 100644 --- a/services/service-metadata-tabs/package.json +++ b/services/service-metadata-tabs/package.json @@ -1,6 +1,6 @@ { "name": "@steedos/service-metadata-tabs", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "description": "", "main": "lib/tabs.service.js", "scripts": { @@ -32,5 +32,5 @@ "publishConfig": { "access": "public" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/services/service-metadata-translations/package.json b/services/service-metadata-translations/package.json index 89e7cb941d..db4b56a776 100644 --- a/services/service-metadata-translations/package.json +++ b/services/service-metadata-translations/package.json @@ -1,6 +1,6 @@ { "name": "@steedos/service-metadata-translations", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "description": "", "main": "lib/translations.service.js", "scripts": { @@ -19,7 +19,7 @@ "author": "", "license": "MIT", "dependencies": { - "@steedos/metadata-registrar": "2.5.17-beta.8", + "@steedos/metadata-registrar": "2.5.17-beta.9", "dotenv-flow": "^3.1.0", "ioredis": "^4.22.0", "lodash": "^4.17.21", @@ -33,5 +33,5 @@ "publishConfig": { "access": "public" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/services/service-metadata-triggers/package.json b/services/service-metadata-triggers/package.json index 927cb8195b..5d1f03c204 100644 --- a/services/service-metadata-triggers/package.json +++ b/services/service-metadata-triggers/package.json @@ -1,6 +1,6 @@ { "name": "@steedos/service-metadata-triggers", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "description": "", "main": "lib/triggers2.service.js", "scripts": { @@ -33,5 +33,5 @@ "publishConfig": { "access": "public" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/services/service-metadata/package.json b/services/service-metadata/package.json index c05f0c6b16..b87000b5de 100644 --- a/services/service-metadata/package.json +++ b/services/service-metadata/package.json @@ -1,6 +1,6 @@ { "name": "@steedos/service-metadata", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "description": "", "main": "lib/metadata.service.js", "scripts": { @@ -18,7 +18,7 @@ "author": "", "license": "MIT", "dependencies": { - "@steedos/metadata-registrar": "2.5.17-beta.8", + "@steedos/metadata-registrar": "2.5.17-beta.9", "dotenv-flow": "^3.1.0", "ioredis": "^4.22.0", "lodash": "^4.17.21", @@ -33,5 +33,5 @@ "publishConfig": { "access": "public" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/services/service-meteor-package-loader/package.json b/services/service-meteor-package-loader/package.json index e5a5686aad..f5d6200dc1 100644 --- a/services/service-meteor-package-loader/package.json +++ b/services/service-meteor-package-loader/package.json @@ -1,6 +1,6 @@ { "name": "@steedos/service-meteor-package-loader", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "description": "", "main": "index.js", "scripts": { @@ -10,10 +10,10 @@ "author": "", "license": "MIT", "dependencies": { - "@steedos/metadata-core": "2.5.17-beta.8", - "@steedos/objectql": "2.5.17-beta.8", - "@steedos/router": "2.5.17-beta.8", - "@steedos/service-package-loader": "2.5.17-beta.8", + "@steedos/metadata-core": "2.5.17-beta.9", + "@steedos/objectql": "2.5.17-beta.9", + "@steedos/router": "2.5.17-beta.9", + "@steedos/service-package-loader": "2.5.17-beta.9", "clone": "^2.1.2", "moleculer": "^0.14.25", "underscore": "^1.12.0" @@ -25,5 +25,5 @@ "publishConfig": { "access": "public" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/services/service-mongodb-server/package.json b/services/service-mongodb-server/package.json index 15ea7fe6ba..03db0d141d 100644 --- a/services/service-mongodb-server/package.json +++ b/services/service-mongodb-server/package.json @@ -1,6 +1,6 @@ { "name": "@steedos/service-mongodb-server", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "main": "index.js", "license": "MIT", "dependencies": { @@ -10,5 +10,5 @@ "publishConfig": { "access": "public" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/services/service-node-red/package.json b/services/service-node-red/package.json index be41f1abaf..b35a6cef61 100644 --- a/services/service-node-red/package.json +++ b/services/service-node-red/package.json @@ -1,6 +1,6 @@ { "name": "@steedos/service-node-red", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "main": "index.js", "scripts": { "start": "moleculer-runner --repl --hot ./index.js" @@ -13,5 +13,5 @@ "publishConfig": { "access": "public" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/services/service-object-graphql/package.json b/services/service-object-graphql/package.json index 5c6371d0c2..7d9723a062 100644 --- a/services/service-object-graphql/package.json +++ b/services/service-object-graphql/package.json @@ -1,6 +1,6 @@ { "name": "@steedos/service-object-graphql", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "main": "package.service.js", "private": false, "publishConfig": { @@ -15,12 +15,12 @@ "description": "steedos package", "repository": {}, "license": "MIT", - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149", + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946", "dependencies": { - "@steedos/filters": "2.5.17-beta.8", - "@steedos/i18n": "2.5.17-beta.8", - "@steedos/objectql": "2.5.17-beta.8", - "@steedos/service-object-mixin": "2.5.17-beta.8", + "@steedos/filters": "2.5.17-beta.9", + "@steedos/i18n": "2.5.17-beta.9", + "@steedos/objectql": "2.5.17-beta.9", + "@steedos/service-object-mixin": "2.5.17-beta.9", "graphql": "^15.8.0", "graphql-parse-resolve-info": "^4.12.3", "moleculer": "^0.14.25", diff --git a/services/service-object-mixin/package.json b/services/service-object-mixin/package.json index a69b8605d5..8adb386564 100644 --- a/services/service-object-mixin/package.json +++ b/services/service-object-mixin/package.json @@ -1,6 +1,6 @@ { "name": "@steedos/service-object-mixin", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "main": "package.service.js", "private": false, "publishConfig": { @@ -13,5 +13,5 @@ "description": "steedos package", "repository": {}, "license": "MIT", - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/services/service-objectql/package.json b/services/service-objectql/package.json index 066aab8e85..0685072104 100644 --- a/services/service-objectql/package.json +++ b/services/service-objectql/package.json @@ -1,6 +1,6 @@ { "name": "@steedos/service-objectql", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "main": "package.service.js", "private": false, "publishConfig": { @@ -13,8 +13,8 @@ "description": "steedos package", "repository": {}, "license": "MIT", - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149", + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946", "dependencies": { - "@steedos/objectql": "2.5.17-beta.8" + "@steedos/objectql": "2.5.17-beta.9" } } diff --git a/services/service-package-loader/index.js b/services/service-package-loader/index.js index d1a6cd7932..f5bdff4cde 100644 --- a/services/service-package-loader/index.js +++ b/services/service-package-loader/index.js @@ -28,6 +28,8 @@ const getPackageYmlData = (packagePath)=>{ return packageYmlData; } +const methods = require('./lib/methods') + /** * @typedef {import('moleculer').Context} Context Moleculer's Context */ @@ -73,8 +75,11 @@ module.exports = { } }, "space.initialized": { - async handler() { + async handler(ctx) { await this.loadDataOnServiceStarted(); + const spaceDoc = ctx.params + // 扫描main/default/data文件夹 + await this.importData(path.join(this.settings.packageInfo.path, 'main', 'default', 'data'), true, spaceDoc._id); } } }, @@ -83,6 +88,8 @@ module.exports = { * Methods */ methods: { + ...methods, + checkPackageMetadataFiles: async function (packagePath) { if(this.core){ diff --git a/services/service-package-loader/package.json b/services/service-package-loader/package.json index c5ca99c32c..66a5b582e7 100644 --- a/services/service-package-loader/package.json +++ b/services/service-package-loader/package.json @@ -1,6 +1,6 @@ { "name": "@steedos/service-package-loader", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "description": "", "main": "index.js", "scripts": { @@ -10,12 +10,14 @@ "author": "", "license": "MIT", "dependencies": { - "@steedos/metadata-core": "2.5.17-beta.8", - "@steedos/metadata-registrar": "2.5.17-beta.8", - "@steedos/router": "2.5.17-beta.8", - "@steedos/service-object-mixin": "2.5.17-beta.8", + "@steedos/metadata-core": "2.5.17-beta.9", + "@steedos/metadata-registrar": "2.5.17-beta.9", + "@steedos/router": "2.5.17-beta.9", + "@steedos/service-object-mixin": "2.5.17-beta.9", "clone": "^2.1.2", + "csvtojson": "~2.0.10", "moleculer": "^0.14.25", + "node-xlsx": "^0.16.1", "underscore": "^1.12.0" }, "devDependencies": { @@ -25,5 +27,5 @@ "publishConfig": { "access": "public" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/services/service-package-loader/src/imports/Base.ts b/services/service-package-loader/src/imports/Base.ts new file mode 100644 index 0000000000..7f1d8ea7dd --- /dev/null +++ b/services/service-package-loader/src/imports/Base.ts @@ -0,0 +1,11 @@ +/* + * @Author: 孙浩林 sunhaolin@steedos.com + * @Date: 2023-10-26 10:31:50 + * @LastEditors: 孙浩林 sunhaolin@steedos.com + * @LastEditTime: 2023-10-26 10:41:08 + * @FilePath: /steedos-platform-2.3/services/service-package-loader/src/imports/Base.ts + * @Description: + */ +export interface Base { + readFile(filePath: string, options?: any): any +} \ No newline at end of file diff --git a/services/service-package-loader/src/imports/ImportCsv.ts b/services/service-package-loader/src/imports/ImportCsv.ts new file mode 100644 index 0000000000..51e688fbe4 --- /dev/null +++ b/services/service-package-loader/src/imports/ImportCsv.ts @@ -0,0 +1,30 @@ +/* + * @Author: 孙浩林 sunhaolin@steedos.com + * @Date: 2023-10-26 10:31:50 + * @LastEditors: 孙浩林 sunhaolin@steedos.com + * @LastEditTime: 2023-10-26 10:51:00 + * @FilePath: /steedos-platform-2.3/services/service-package-loader/src/imports/ImportCsv.ts + * @Description: + */ +import ImportJson from './ImportJson'; +import csv = require('csvtojson'); +import path = require('path'); +import { syncMatchFiles } from '@steedos/metadata-core'; + +export default class ImportCsv extends ImportJson { + + async readFile(filePath: string): Promise }>> { + let results: any = [] + const filePatten = [ + path.join(filePath, "**", "*.data.csv"), + "!" + path.join(filePath, "node_modules"), + ] + const matchedPaths: [string] = syncMatchFiles(filePatten); + for (const matchedPath of matchedPaths) { + let records = await csv().fromFile(matchedPath); + let objectName = path.basename(matchedPath).split('.')[0]; + results.push({ objectName: objectName, records: records }); + } + return results + } +} \ No newline at end of file diff --git a/services/service-package-loader/src/imports/ImportExcel.ts b/services/service-package-loader/src/imports/ImportExcel.ts new file mode 100644 index 0000000000..a976bb72b1 --- /dev/null +++ b/services/service-package-loader/src/imports/ImportExcel.ts @@ -0,0 +1,28 @@ +/* + * @Author: 孙浩林 sunhaolin@steedos.com + * @Date: 2023-10-26 10:31:50 + * @LastEditors: 孙浩林 sunhaolin@steedos.com + * @LastEditTime: 2023-10-26 10:44:27 + * @FilePath: /steedos-platform-2.3/services/service-package-loader/src/imports/ImportExcel.ts + * @Description: + */ +import xlsx from 'node-xlsx'; +import { Base } from './Base'; + +export default class ImportExcel implements Base { + + readFile(filePath: string, options: any = {}): { datas: Array, headers: Array } { + const { sheetIndex = 0, headerIndex = 0 } = options; + let workbook = xlsx.parse(filePath, { + cellDates: true, + }); + const data = workbook[sheetIndex].data; + const headers = data[headerIndex]; + const datas = data.slice(1); + return { + headers, + datas + }; + } + +} \ No newline at end of file diff --git a/services/service-package-loader/src/imports/ImportFlow.ts b/services/service-package-loader/src/imports/ImportFlow.ts new file mode 100644 index 0000000000..9e01f1df9d --- /dev/null +++ b/services/service-package-loader/src/imports/ImportFlow.ts @@ -0,0 +1,53 @@ +/* + * @Author: 孙浩林 sunhaolin@steedos.com + * @Date: 2023-10-26 10:31:50 + * @LastEditors: 孙浩林 sunhaolin@steedos.com + * @LastEditTime: 2023-10-26 10:46:25 + * @FilePath: /steedos-platform-2.3/services/service-package-loader/src/imports/ImportFlow.ts + * @Description: + */ +import { loadFile, syncMatchFiles } from '@steedos/metadata-core'; +import { Base } from './Base'; +import path = require('path'); +import _ = require('lodash'); + +export default class ImportFlow implements Base { + + readFile(filePath: string): any { + const filePatten = [ + path.join(filePath, "**", "*.flow.data.json"), + "!" + path.join(filePath, "node_modules"), + ] + const matchedPaths: [string] = syncMatchFiles(filePatten); + let flows = {}; + for (let k = 0; k < matchedPaths.length; k++) { + let matchedPath = matchedPaths[k]; + let json = loadFile(matchedPath); + let formName = matchedPath.substring(matchedPath.lastIndexOf('/') + 1, matchedPath.indexOf('.flow')); + let form = {}; + try { + if (json) { + + let flowKeys = _.keys(json); + for (let m in flowKeys) { + let key = flowKeys[m]; + if (typeof key === 'function') { + continue; + } + let val = json[key]; + if (typeof val === 'function') { + json[key] = val.toString(); + } + form[key] = json[key]; + } + flows[formName] = json; + } + } catch (error) { + console.error('loadFlows error', matchedPath, error); + throw error + } + } + return flows; + } + +} \ No newline at end of file diff --git a/services/service-package-loader/src/imports/ImportJson.ts b/services/service-package-loader/src/imports/ImportJson.ts new file mode 100644 index 0000000000..b1da07209e --- /dev/null +++ b/services/service-package-loader/src/imports/ImportJson.ts @@ -0,0 +1,33 @@ +/* + * @Author: 孙浩林 sunhaolin@steedos.com + * @Date: 2023-10-26 10:31:50 + * @LastEditors: 孙浩林 sunhaolin@steedos.com + * @LastEditTime: 2023-10-26 10:48:39 + * @FilePath: /steedos-platform-2.3/services/service-package-loader/src/imports/ImportJson.ts + * @Description: + */ +import { each } from 'lodash'; +import { Base } from './Base'; +import { syncMatchFiles } from '@steedos/metadata-core'; +import path = require('path'); +import fs = require("fs"); + +export default class ImportJson implements Base { + + async readFile(filePath: string): Promise }>> { + let results: any = [] + const filePatten = [ + path.join(filePath, "**", "*.data.json"), + "!" + path.join(filePath, "**", "*.flow.data.json"), + "!" + path.join(filePath, "node_modules")]; + + const matchedPaths: [string] = syncMatchFiles(filePatten); + each(matchedPaths, (matchedPath: string) => { + let records = JSON.parse(fs.readFileSync(matchedPath, 'utf8').normalize('NFC')); + let objectName = path.basename(matchedPath).split('.')[0]; + results.push({ objectName: objectName, records: records }); + }) + return results + } + +} \ No newline at end of file diff --git a/services/service-package-loader/src/methods/importData.ts b/services/service-package-loader/src/methods/importData.ts new file mode 100644 index 0000000000..2f6325f937 --- /dev/null +++ b/services/service-package-loader/src/methods/importData.ts @@ -0,0 +1,45 @@ +/* + * @Author: 孙浩林 sunhaolin@steedos.com + * @Date: 2023-10-26 10:22:14 + * @LastEditors: 孙浩林 sunhaolin@steedos.com + * @LastEditTime: 2023-10-27 12:12:57 + * @FilePath: /steedos-platform-2.3/services/service-package-loader/src/methods/importData.ts + * @Description: + */ +import ImportJson from '../imports/ImportJson'; +import ImportCsv from '../imports/ImportCsv' +import ImportFlow from '../imports/ImportFlow' + +import fs = require('fs'); + +export async function handler(filePath: string, onlyInsert: boolean, spaceId: string) { + if (!filePath) { + return + } + if (!fs.existsSync(filePath)) { + return + } + + const importer = { + csv: new ImportCsv(), + json: new ImportJson(), + flow: new ImportFlow() + } + + const csvData = await importer.csv.readFile(filePath); + + const jsonData = await importer.json.readFile(filePath); + + const flowData = await importer.flow.readFile(filePath); + + await this.broker.call("~packages-@steedos/data-import.importData", { + data: { + "csv": csvData, + "json": jsonData, + "flow": flowData, + }, + spaceId, + onlyInsert: true, + }) + +} diff --git a/services/service-package-loader/src/methods/index.ts b/services/service-package-loader/src/methods/index.ts new file mode 100644 index 0000000000..29bc128ac6 --- /dev/null +++ b/services/service-package-loader/src/methods/index.ts @@ -0,0 +1,9 @@ +/* + * @Author: 孙浩林 sunhaolin@steedos.com + * @Date: 2023-10-26 10:21:50 + * @LastEditors: 孙浩林 sunhaolin@steedos.com + * @LastEditTime: 2023-10-26 10:40:43 + * @FilePath: /steedos-platform-2.3/services/service-package-loader/src/methods/index.ts + * @Description: + */ +export * as importData from './importData'; \ No newline at end of file diff --git a/services/service-package-registry/package.json b/services/service-package-registry/package.json index 1ff61e007e..dc09d6c06c 100644 --- a/services/service-package-registry/package.json +++ b/services/service-package-registry/package.json @@ -1,6 +1,6 @@ { "name": "@steedos/service-package-registry", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "description": "", "main": "package.service.js", "scripts": { @@ -9,11 +9,11 @@ "author": "", "license": "ISC", "dependencies": { - "@steedos/auth": "2.5.17-beta.8", - "@steedos/core": "2.5.17-beta.8", - "@steedos/metadata-core": "2.5.17-beta.8", - "@steedos/objectql": "2.5.17-beta.8", - "@steedos/service-package-loader": "2.5.17-beta.8", + "@steedos/auth": "2.5.17-beta.9", + "@steedos/core": "2.5.17-beta.9", + "@steedos/metadata-core": "2.5.17-beta.9", + "@steedos/objectql": "2.5.17-beta.9", + "@steedos/service-package-loader": "2.5.17-beta.9", "fs-extra": "8.1.0", "i18next": "20.3.2", "json-stringify-safe": "5.0.1", @@ -31,5 +31,5 @@ "publishConfig": { "access": "public" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/services/service-package-tool/package.json b/services/service-package-tool/package.json index 688fbb5a4f..2fe9127b9d 100644 --- a/services/service-package-tool/package.json +++ b/services/service-package-tool/package.json @@ -1,6 +1,6 @@ { "name": "@steedos/service-package-tool", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "description": "", "main": "package.service.js", "scripts": { @@ -9,11 +9,11 @@ "author": "", "license": "ISC", "dependencies": { - "@steedos/auth": "2.5.17-beta.8", - "@steedos/core": "2.5.17-beta.8", - "@steedos/metadata-core": "2.5.17-beta.8", - "@steedos/objectql": "2.5.17-beta.8", - "@steedos/service-package-loader": "2.5.17-beta.8", + "@steedos/auth": "2.5.17-beta.9", + "@steedos/core": "2.5.17-beta.9", + "@steedos/metadata-core": "2.5.17-beta.9", + "@steedos/objectql": "2.5.17-beta.9", + "@steedos/service-package-loader": "2.5.17-beta.9", "fs-extra": "8.1.0", "i18next": "20.3.2", "json-stringify-safe": "5.0.1", @@ -31,5 +31,5 @@ "publishConfig": { "access": "public" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/services/service-packages/package.json b/services/service-packages/package.json index ca6545217c..53c1113dae 100644 --- a/services/service-packages/package.json +++ b/services/service-packages/package.json @@ -1,6 +1,6 @@ { "name": "@steedos/service-packages", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "main": "index.js", "scripts": {}, "license": "MIT", @@ -8,5 +8,5 @@ "publishConfig": { "access": "public" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/services/service-pages/main/default/applications/app_charts.app.yml b/services/service-pages/main/default/applications/app_charts.app.yml index 0ba451bc28..f6f5ccb8cd 100644 --- a/services/service-pages/main/default/applications/app_charts.app.yml +++ b/services/service-pages/main/default/applications/app_charts.app.yml @@ -12,7 +12,7 @@ admin_menus: permission_sets: - admin - _id: pages - name: Mini Pages + name: Micro Pages object_name: pages parent: user_interface sort: 300 diff --git a/services/service-pages/main/default/objectTranslations/pages.en/pages.en.objectTranslation.yml b/services/service-pages/main/default/objectTranslations/pages.en/pages.en.objectTranslation.yml index cd64fca41a..faf1e26a74 100644 --- a/services/service-pages/main/default/objectTranslations/pages.en/pages.en.objectTranslation.yml +++ b/services/service-pages/main/default/objectTranslations/pages.en/pages.en.objectTranslation.yml @@ -1,5 +1,5 @@ name: pages -label: Mini Page +label: Micro Pages description: fields: dashboard_filters_enabled: diff --git a/services/service-pages/main/default/translations/en.translation.yml b/services/service-pages/main/default/translations/en.translation.yml index 1bbe6c89ed..48bd7a7034 100644 --- a/services/service-pages/main/default/translations/en.translation.yml +++ b/services/service-pages/main/default/translations/en.translation.yml @@ -4,7 +4,7 @@ CustomApplications: description: null CustomLabels: menu_user_interface: User Interface - menu_pages: Mini Page + menu_pages: Micro Pages page_assignments_error_not_allowed_to_application_pages: Prohibit assigning permissions to application pages page_assignments_error_organization_default_already_exists: Authorization for 'Organization Default Settings' already exists page_assignments_error_application_default_already_exists: Authorization for 'Application Default Settings' already exists diff --git a/services/service-pages/package.json b/services/service-pages/package.json index eeb643def6..6055a644eb 100644 --- a/services/service-pages/package.json +++ b/services/service-pages/package.json @@ -1,6 +1,6 @@ { "name": "@steedos/service-pages", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "main": "package.service.js", "scripts": {}, "license": "MIT", @@ -8,7 +8,7 @@ "publishConfig": { "access": "public" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149", + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946", "dependencies": { "ejs": "^3.1.8" } diff --git a/services/service-plugin-amis/main/default/pages/apps_form.page.amis.json b/services/service-plugin-amis/main/default/pages/apps_form.page.amis.json index d9ec590dc5..3948b55f18 100644 --- a/services/service-plugin-amis/main/default/pages/apps_form.page.amis.json +++ b/services/service-plugin-amis/main/default/pages/apps_form.page.amis.json @@ -1,42 +1,304 @@ { - "type": "page", - "title": "Welcome to Steedos", - "body": [ - { - "type": "steedos-object-form", - "className": "sm:border sm:rounded sm:border-gray-300 bg-white p-4", - "label": "对象表单", - "objectApiName": "apps", - "recordId": "${recordId}", - "mode": "edit", - "fieldsExtend": "{\n \"tab_items\": {\n \"amis\": {\n \"name\": \"tab_items\",\n \"type\": \"crud\",\n \"source\": \"\\${tab_items}\",\n \"strictMode\": true,\n \"affixHeader\": false,\n \"editable\": true,\n \"addable\": false,\n \"removable\": true,\n \"draggable\": false,\n \"headerToolbarClassName\": \"px-1 pb-3\",\n \"columns\": [\n {\n \"name\": \"index\",\n \"label\": \"\\${'apps.apps_form.tab_number'| t}\",\n \"type\": \"tpl\",\n \"tpl\": \"\\${index+1}\",\n \"className\": \"w-10\",\n \"id\": \"u:c59784421c37\"\n },\n {\n \"name\": \"tab_name_label\",\n \"label\": \"\\${'apps.apps_form.tab' | t}\",\n \"type\": \"tpl\",\n \"id\": \"u:b95c69a1cd84\",\n \"tpl\": \"\\${tabs_options|filter:value:equals:tab_name|pick:label}\"\n },\n {\n \"name\": \"group\",\n \"label\": \"\\${'apps.apps_form.tab_grouping' | t}\",\n \"id\": \"u:e532b1949676\",\n \"quickEdit\": {\n \"type\": \"select\",\n \"name\": \"group\",\n \"className\": \"m-0\",\n \"onEvent\": {\n \"change\": {\n \"actions\": [\n {\n \"actionType\": \"custom\",\n \"script\": \"const tabGroupKey = \\\"group\\\";const getTabsSortFun = function (groupNames) { return function (m, n) { var tempM = !!m[tabGroupKey] ? 1 : 0; var tempN = !!n[tabGroupKey] ? 1 : 0; if (!m[tabGroupKey] || !n[tabGroupKey]) { return tempM - tempN; } return groupNames.indexOf(m[tabGroupKey]) - groupNames.indexOf(n[tabGroupKey]); };};const quickEidtSaveForTab = function (input, prop_name) { const currentPropValue = input.value; const rowValue = input.__super; const formValue = input.__super.__super.__super; const tab_name = rowValue.tab_name; rowValue[prop_name] = currentPropValue; delete rowValue.index; let newTabs = formValue.tab_items.map(function (item) { if (item.tab_name == tab_name) { return Object.assign({}, item, rowValue); } else { return item; } }); const tabGroups = input.__super.__super.tab_groups; const groupNames = _.compact(_.map(tabGroups, \\\"group_name\\\")); if (groupNames && groupNames.length) { newTabs.sort(getTabsSortFun(groupNames)); } return { tab_items: newTabs }};const eventData = event.data;const newTabTtemsProp = quickEidtSaveForTab(eventData, \\\"group\\\");setTimeout(function () { doAction({ actionType: 'setValue', componentId: \\\"object_form\\\", args: { value: newTabTtemsProp } });},300);\"\n }\n ]\n }\n },\n \"source\": \"\\${tab_groups|pick:group_name}\",\n \"checkAll\": false,\n \"selectFirst\": false,\n \"searchable\": true,\n \"clearable\": true,\n \"id\": \"u:8b3d6979e884\",\n \"multiple\": false,\n \"mode\": \"inline\"\n },\n \"placeholder\": \"-\"\n },\n {\n \"name\": \"tab_name_desktop\",\n \"label\": \"\\${'apps.apps_form.tab_desktop' | t}\",\n \"type\": \"tpl\",\n \"id\": \"u:b95c69a1cd84\",\n \"tpl\": \"\\${tabs_options|filter:value:equals:tab_name|first|pick:desktop|isTrue:'✔':'✘'}\",\n \"placeholder\": \"-\",\n \"remark\": \"\\${'apps.apps_form.tab_desktop_remark' | t}\"\n },\n {\n \"name\": \"tab_name_mobile\",\n \"label\": \"\\${'apps.apps_form.tab_mobile' | t}\",\n \"type\": \"tpl\",\n \"id\": \"u:b95c69a1cd84\",\n \"tpl\": \"\\${tabs_options|filter:value:equals:tab_name|first|pick:mobile|isTrue:'✔':'✘'}\",\n \"placeholder\": \"-\",\n \"remark\": \"\\${'apps.apps_form.tab_mobile_remark' | t}\"\n }\n ],\n \"headerToolbar\": [\n {\n \"type\": \"service\",\n \"id\": \"tabs-options-service\",\n \"body\": [\n {\n \"type\": \"button\",\n \"id\": \"u:a35a2276145d\",\n \"label\": \"${'apps.apps_form.tab_generate' | t}\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"script\": \"const appId = null; const page = Steedos.Page.getPage('app', appId, null, null, 'generate_object_tabs'); if (page && page.schema) { const pageSchema = JSON.parse(page.schema); let formSchema = pageSchema.body[0]; formSchema.canAccessSuperData = false; formSchema.wrapWithPanel = false; formSchema.className = 'steedos-amis-form'; const title = t('apps.apps_form.tab_generate_title'); doAction({ 'actionType': 'dialog', 'dialog': { 'type': 'dialog', 'title': title, 'body': formSchema, 'size': 'lg' } }); }\",\n \"actionType\": \"custom\"\n }\n ],\n \"weight\": 0\n }\n },\n \"tpl\": \"内容\"\n },\n {\n \"type\": \"button\",\n \"label\": \"${'apps.apps_form.tab_set' | t}\",\n \"id\": \"u:853b890ab524\",\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"${'apps.apps_form.tab_set' | t}\",\n \"body\": [\n {\n \"type\": \"transfer\",\n \"name\": \"picked_tabs\",\n \"value\": \"\\${tab_items|pick:tab_name}\",\n \"sortable\": true,\n \"source\": \"\\${tabs_options}\",\n \"searchable\": true,\n \"id\": \"u:f2d36873abd1\"\n }\n ],\n \"onEvent\": {\n \"confirm\": {\n \"actions\": [\n {\n \"actionType\": \"custom\",\n \"script\": \"const tabGroupKey = 'group';const getTabsSortFun = function (groupNames) { return function (m, n) { var tempM = !!m[tabGroupKey] ? 1 : 0; var tempN = !!n[tabGroupKey] ? 1 : 0; if (!m[tabGroupKey] || !n[tabGroupKey]) { return tempM - tempN; } return groupNames.indexOf(m[tabGroupKey]) - groupNames.indexOf(n[tabGroupKey]); };};const clearTabs = function (input) { return { tab_items: [] }};const convertDataForTabs = function (input) { let pickedTabs = input.picked_tabs || []; const superTabs = _.keyBy(input.__super.__super.tab_items, 'tab_name'); if (typeof pickedTabs === 'string') { pickedTabs = pickedTabs.split(','); } const tabOptions = _.keyBy(input.__super.tabs_options, 'value'); const convertedTabs = pickedTabs.map(function (tab_name) { const superTab = superTabs[tab_name]; if (superTab) { return superTab; } else { const tabOption = tabOptions[tab_name]; return { tab_name: tab_name, group: tabOption.group } } }); const tabGroups = input.__super.__super.tab_groups; const groupNames = _.compact(_.map(tabGroups, 'group_name')); if (groupNames && groupNames.length) { convertedTabs.sort(getTabsSortFun(groupNames)); } return { tab_items: convertedTabs }};const eventData = event.data;doAction({ actionType: 'setValue', componentId: 'object_form', args: { value: convertDataForTabs(eventData) }});doAction({ actionType: 'setValue', componentId: 'tabs-options-service', args: { value: convertDataForTabs(eventData) }});\"\n }\n ]\n }\n },\n \"size\": \"lg\",\n \"id\": \"u:9c93896a73cf\",\n \"closeOnEsc\": false,\n \"closeOnOutside\": false,\n \"showCloseButton\": true,\n \"showErrorMsg\": true,\n \"showLoading\": true,\n \"dataMapSwitch\": false\n }\n },\n {\n \"type\": \"button\",\n \"label\": \"${'apps.apps_form.tab_grouping_set' | t}\",\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"title\": \"${'apps.apps_form.tab_grouping_set' | t}\",\n \"body\": [\n {\n \"type\": \"input-table\",\n \"name\": \"setting_groups\",\n \"value\": \"\\${tab_groups}\",\n \"addable\": true,\n \"draggable\": true,\n \"editable\": true,\n \"needConfirm\": false,\n \"columns\": [\n {\n \"name\": \"group_name\",\n \"label\": \"${'apps.apps_form.tab_grouping_name' | t}\",\n \"id\": \"u:383c7744b499\"\n },\n {\n \"name\": \"default_open\",\n \"label\": \"${'apps.apps_form.tab_grouping_open' | t}\",\n \"id\": \"u:7a243c84ed66\",\n \"type\": \"checkbox\",\n \"value\": true\n }\n ],\n \"removable\": true,\n \"id\": \"setting_groups\"\n }\n ],\n \"onEvent\": {\n \"confirm\": {\n \"actions\": [\n {\n \"actionType\": \"custom\",\n \"script\": \"const tabGroupKey = 'group';const getTabsSortFun = function (groupNames) { return function (m, n) { var tempM = !!m[tabGroupKey] ? 1 : 0; var tempN = !!n[tabGroupKey] ? 1 : 0; if (!m[tabGroupKey] || !n[tabGroupKey]) { return tempM - tempN; } return groupNames.indexOf(m[tabGroupKey]) - groupNames.indexOf(n[tabGroupKey]); };};const clearTabs = function (input) { return { tab_items: [] }};const convertDataForGroups = function(input) { const settingGroups = input.setting_groups || []; const convertedGroups = _.uniqBy(settingGroups.map(function (item) { return { group_name: item.group_name, default_open: item.default_open } }), 'group_name'); const groupNames = _.compact(_.map(convertedGroups, 'group_name')); const tab_items = input.tab_items; tab_items?.sort(getTabsSortFun(groupNames)); return { tab_groups: convertedGroups, tab_items: tab_items }};const eventData = event.data;doAction({ actionType: 'setValue', componentId: 'object_form', args: { value: convertDataForGroups(eventData) }});\"\n }\n ]\n }\n },\n \"type\": \"dialog\",\n \"size\": \"lg\",\n \"id\": \"setting_groups\",\n \"closeOnEsc\": false,\n \"closeOnOutside\": false,\n \"showCloseButton\": true,\n \"showErrorMsg\": true,\n \"showLoading\": true,\n \"dataMapSwitch\": false\n },\n \"id\": \"u:111b043b193c\"\n }\n ],\n \"messages\": \"\",\n \"api\": {\n \"method\": \"post\",\n \"url\": \"\\${context.rootUrl}/graphql\",\n \"adaptor\": \" let data = payload.data; data.tabs_options = []; if (data.options && data.options.length) { data.tabs_options = data.options.map(function (option) { option.label = option.label + '(' + option.value + ')'; return option; }); } if (!api.body.recordId) { const defaultValues = { is_creator: true, mobile: true, visible: true, sort: 9100 } ;data = Object.assign({}, data, defaultValues); } delete data.options ;payload.data = data; return payload; \",\n \"data\": {\n \"query\": \"{options:tabs{_id label:label value:name,type,object,desktop,mobile}}\",\n \"recordId\": \"\\${recordId}\"\n },\n \"headers\": {\n \"Authorization\": \"Bearer \\${context.tenantId},\\${context.authToken}\"\n }\n }\n }\n ]\n }\n },\n \"objects\": {\n \"amis\": {\n \"name\": \"objects\",\n \"type\": \"select\",\n \"className\": \"m-0\",\n \"labelClassName\": \"text-left\",\n \"id\": \"u:4e5047e44905\",\n \"joinValues\": false,\n \"extractValue\": true,\n \"labelField\": \"label\",\n \"valueField\": \"value\",\n \"multiple\": true,\n \"checkAll\": false,\n \"searchable\": true,\n \"menuTpl\": \"\",\n \"source\": {\n \"method\": \"get\",\n \"url\": \"${context.rootUrl}/service/api/amis-metadata-objects/objects/options\",\n \"headers\": {\n \"Authorization\": \"Bearer ${context.tenantId},${context.authToken}\"\n }\n },\n \"autoComplete\": \"\"\n }\n },\n \"mobile_objects\": {\n \"amis\": {\n \"name\": \"mobile_objects\",\n \"type\": \"select\",\n \"className\": \"m-0\",\n \"labelClassName\": \"text-left\",\n \"id\": \"u:cfaeb2f857a8\",\n \"joinValues\": false,\n \"extractValue\": true,\n \"labelField\": \"label\",\n \"valueField\": \"value\",\n \"multiple\": true,\n \"checkAll\": false,\n \"searchable\": true,\n \"menuTpl\": \"\",\n \"source\": {\n \"method\": \"get\",\n \"url\": \"${context.rootUrl}/service/api/amis-metadata-objects/objects/options\",\n \"messages\": {},\n \"headers\": {\n \"Authorization\": \"Bearer ${context.tenantId},${context.authToken}\"\n }\n },\n \"autoComplete\": \"\"\n }\n }\n}", - "enableTabs": true, - "debug": false, - "initApiRequestAdaptor": "", - "initApiAdaptor": "var data = payload.data;\nif (data.tab_items && !_.isArray(data.tab_items)) {\n // 数据库中存储的是对象格式而不是数组,转换为数组用于界面显示\n let arrTabItems = [];\n _.each(data.tab_items, function (n, k) {\n n.tab_name = k;\n delete n.index;\n arrTabItems.push(n);\n });\n data.tab_items = arrTabItems;\n}\nif (data._id && !data.tab_items) {\n const tabOptions = data.tabs_options || [];\n const tabItems = [];\n // 把应用中原来tabs属性值添加到新的tab_items属性的默认值中\n if (data.tabs && data.tabs.length) {\n data.tabs.forEach(function (item) {\n tabItems.push({ tab_name: item });\n });\n }\n const pushObjectsToTabItems = function (objects) {\n objects.forEach(function (item) {\n // 已经有绑定到指定对象的选项卡就不添加\n let existObjectItem = !!tabItems.find(function (tabItem) {\n return !!tabOptions.find(function (option) {\n return tabItem.tab_name === tabItem.value && option.object === item;\n });\n });\n if (existObjectItem) {\n return;\n }\n // 找到指向指定对象的选项卡\n let tempOption = tabOptions.find(function (option) {\n return option.type === \"object\" && option.object === item;\n });\n if (!tempOption) {\n return;\n }\n // 选项卡名称如果重复了就不添加\n let existTabItem = !!tabItems.find(function (tabItem) {\n return tabItem.tab_name === tempOption.value;\n });\n if (existTabItem) {\n return;\n }\n if (tempOption) {\n tabItems.push({ tab_name: tempOption.value });\n }\n });\n }\n // 把应用中原来objects属性值添加到新的tab_items属性的默认值中\n if (data.objects && data.objects.length) {\n pushObjectsToTabItems(data.objects);\n }\n // 把应用中原来mobile_objects属性值添加到新的tab_items属性的默认值中\n if (data.mobile_objects && data.mobile_objects.length) {\n pushObjectsToTabItems(data.mobile_objects);\n }\n data.tab_items = tabItems;\n}\n\npayload.data = data;\ndelete payload.extensions;\nreturn payload;\n ", - "apiRequestAdaptor": "delete formData.tabs_options;\nconst recordId = formData.recordId;\n\n// 新加字段tab_items,值同步回传到老字段tabs中兼容老UI界面\nformData.tabs = [];\nif (formData.tab_items && formData.tab_items.length) { \n formData.tabs = formData.tab_items.map(function (item) { return item.tab_name; });\n}\n\n/*\ntab_items存储为:\ntab_items: {\n test1:{\n group:\"xxx\"\n },\n test3:{\n group:\"yyy\"\n }\n}\n而不是:\ntab_items: [\n {\n \"index\":1,\n \"group\":\"xxx\"\n },\n {\n \"index\":2,\n \"group\":\"yyy\"\n }\n]\n*/\nif (formData.tab_items) { \n formData.tab_items = _.keyBy(formData.tab_items, \"tab_name\")\n let tempIndex = 0;\n _.each(formData.tab_items, function (n, k) {\n tempIndex++;\n n.index = tempIndex;\n delete n.tab_name;\n });\n}\n\nquery = `mutation{record: ${objectName}__insert(doc: {__saveData}){_id}}`;\nif(recordId){\n query = `mutation{record: ${objectName}__update(id: \"${recordId}\", doc: {__saveData}){_id}}`;\n};\n__saveData = JSON.stringify(JSON.stringify(formData));\n\napi.data = {query: query.replace('{__saveData}', __saveData)};\nreturn api;\n", - "apiAdaptor": "", - "form": { - "id": "object_form" + "type": "page", + "title": "Welcome to Steedos", + "body": [ + { + "type": "steedos-object-form", + "className": "sm:border sm:rounded sm:border-gray-300 bg-white p-4", + "label": "对象表单", + "objectApiName": "apps", + "recordId": "${recordId}", + "mode": "edit", + "fieldsExtend": { + "tab_items": { + "amis": { + "name": "tab_items", + "type": "crud", + "source": "${tab_items}", + "strictMode": true, + "affixHeader": false, + "editable": true, + "addable": false, + "removable": true, + "draggable": false, + "headerToolbarClassName": "px-1 pb-3", + "columns": [ + { + "name": "index", + "label": "${'apps.apps_form.tab_number'| t}", + "type": "tpl", + "tpl": "${index+1}", + "className": "w-10", + "id": "u:c59784421c37" + }, + { + "name": "tab_name_label", + "label": "${'apps.apps_form.tab' | t}", + "type": "tpl", + "id": "u:b95c69a1cd84", + "tpl": "${tabs_options|filter:value:equals:tab_name|pick:label}" + }, + { + "name": "group", + "label": "${'apps.apps_form.tab_grouping' | t}", + "id": "u:e532b1949676", + "quickEdit": { + "type": "select", + "name": "group", + "className": "m-0", + "onEvent": { + "change": { + "actions": [ + { + "actionType": "custom", + "script": "const tabGroupKey = \"group\";const getTabsSortFun = function (groupNames) { return function (m, n) { var tempM = !!m[tabGroupKey] ? 1 : 0; var tempN = !!n[tabGroupKey] ? 1 : 0; if (!m[tabGroupKey] || !n[tabGroupKey]) { return tempM - tempN; } return groupNames.indexOf(m[tabGroupKey]) - groupNames.indexOf(n[tabGroupKey]); };};const quickEidtSaveForTab = function (input, prop_name) { const currentPropValue = input.value; const rowValue = input.__super; const formValue = input.__super.__super.__super; const tab_name = rowValue.tab_name; rowValue[prop_name] = currentPropValue; delete rowValue.index; let newTabs = formValue.tab_items.map(function (item) { if (item.tab_name == tab_name) { return Object.assign({}, item, rowValue); } else { return item; } }); const tabGroups = input.__super.__super.tab_groups; const groupNames = _.compact(_.map(tabGroups, \"group_name\")); if (groupNames && groupNames.length) { newTabs.sort(getTabsSortFun(groupNames)); } return { tab_items: newTabs }};const eventData = event.data;const newTabTtemsProp = quickEidtSaveForTab(eventData, \"group\");setTimeout(function () { doAction({ actionType: 'setValue', componentId: \"object_form\", args: { value: newTabTtemsProp } });},300);" + } + ] + } + }, + "source": "${tab_groups|pick:group_name}", + "checkAll": false, + "selectFirst": false, + "searchable": true, + "clearable": true, + "id": "u:8b3d6979e884", + "multiple": false, + "mode": "inline" + }, + "placeholder": "-" + }, + { + "name": "tab_name_desktop", + "label": "${'apps.apps_form.tab_desktop' | t}", + "type": "tpl", + "id": "u:b95c69a1cd84", + "tpl": "${tabs_options|filter:value:equals:tab_name|first|pick:desktop|isTrue:'✔':'✘'}", + "placeholder": "-", + "remark": "${'apps.apps_form.tab_desktop_remark' | t}" + }, + { + "name": "tab_name_mobile", + "label": "${'apps.apps_form.tab_mobile' | t}", + "type": "tpl", + "id": "u:b95c69a1cd84", + "tpl": "${tabs_options|filter:value:equals:tab_name|first|pick:mobile|isTrue:'✔':'✘'}", + "placeholder": "-", + "remark": "${'apps.apps_form.tab_mobile_remark' | t}" + } + ], + "headerToolbar": [ + { + "type": "service", + "id": "tabs-options-service", + "body": [ + { + "type": "button", + "id": "u:a35a2276145d", + "label": "${'apps.apps_form.tab_generate' | t}", + "onEvent": { + "click": { + "actions": [ + { + "script": "const appId = null; const page = Steedos.Page.getPage('app', appId, null, null, 'generate_object_tabs'); if (page && page.schema) { const pageSchema = JSON.parse(page.schema); let formSchema = pageSchema.body[0]; formSchema.canAccessSuperData = false; formSchema.wrapWithPanel = false; formSchema.className = 'steedos-amis-form'; const title = t('apps.apps_form.tab_generate_title'); doAction({ 'actionType': 'dialog', 'dialog': { 'type': 'dialog', 'title': title, 'body': formSchema, 'size': 'lg' } }); }", + "actionType": "custom" + } + ], + "weight": 0 + } + }, + "tpl": "内容" + }, + { + "type": "button", + "label": "${'apps.apps_form.tab_set' | t}", + "id": "u:853b890ab524", + "actionType": "dialog", + "dialog": { + "type": "dialog", + "title": "${'apps.apps_form.tab_set' | t}", + "body": [ + { + "type": "transfer", + "name": "picked_tabs", + "value": "${tab_items|pick:tab_name}", + "sortable": true, + "source": "${tabs_options}", + "searchable": true, + "id": "u:f2d36873abd1" + } + ], + "onEvent": { + "confirm": { + "actions": [ + { + "actionType": "custom", + "script": "const tabGroupKey = 'group';const getTabsSortFun = function (groupNames) { return function (m, n) { var tempM = !!m[tabGroupKey] ? 1 : 0; var tempN = !!n[tabGroupKey] ? 1 : 0; if (!m[tabGroupKey] || !n[tabGroupKey]) { return tempM - tempN; } return groupNames.indexOf(m[tabGroupKey]) - groupNames.indexOf(n[tabGroupKey]); };};const clearTabs = function (input) { return { tab_items: [] }};const convertDataForTabs = function (input) { let pickedTabs = input.picked_tabs || []; const superTabs = _.keyBy(input.__super.__super.tab_items, 'tab_name'); if (typeof pickedTabs === 'string') { pickedTabs = pickedTabs.split(','); } const tabOptions = _.keyBy(input.__super.tabs_options, 'value'); const convertedTabs = pickedTabs.map(function (tab_name) { const superTab = superTabs[tab_name]; if (superTab) { return superTab; } else { const tabOption = tabOptions[tab_name]; return { tab_name: tab_name, group: tabOption.group } } }); const tabGroups = input.__super.__super.tab_groups; const groupNames = _.compact(_.map(tabGroups, 'group_name')); if (groupNames && groupNames.length) { convertedTabs.sort(getTabsSortFun(groupNames)); } return { tab_items: convertedTabs }};const eventData = event.data;doAction({ actionType: 'setValue', componentId: 'object_form', args: { value: convertDataForTabs(eventData) }});doAction({ actionType: 'setValue', componentId: 'tabs-options-service', args: { value: convertDataForTabs(eventData) }});" + } + ] + } + }, + "size": "lg", + "id": "u:9c93896a73cf", + "closeOnEsc": false, + "closeOnOutside": false, + "showCloseButton": true, + "showErrorMsg": true, + "showLoading": true, + "dataMapSwitch": false + } + }, + { + "type": "button", + "label": "${'apps.apps_form.tab_grouping_set' | t}", + "actionType": "dialog", + "dialog": { + "title": "${'apps.apps_form.tab_grouping_set' | t}", + "body": [ + { + "type": "input-table", + "name": "setting_groups", + "value": "${tab_groups}", + "addable": true, + "draggable": true, + "editable": true, + "needConfirm": false, + "columns": [ + { + "name": "group_name", + "label": "${'apps.apps_form.tab_grouping_name' | t}", + "id": "u:383c7744b499" + }, + { + "name": "default_open", + "label": "${'apps.apps_form.tab_grouping_open' | t}", + "id": "u:7a243c84ed66", + "type": "checkbox", + "value": true + } + ], + "removable": true, + "id": "setting_groups" + } + ], + "onEvent": { + "confirm": { + "actions": [ + { + "actionType": "custom", + "script": "const tabGroupKey = 'group';const getTabsSortFun = function (groupNames) { return function (m, n) { var tempM = !!m[tabGroupKey] ? 1 : 0; var tempN = !!n[tabGroupKey] ? 1 : 0; if (!m[tabGroupKey] || !n[tabGroupKey]) { return tempM - tempN; } return groupNames.indexOf(m[tabGroupKey]) - groupNames.indexOf(n[tabGroupKey]); };};const clearTabs = function (input) { return { tab_items: [] }};const convertDataForGroups = function(input) { const settingGroups = input.setting_groups || []; const convertedGroups = _.uniqBy(settingGroups.map(function (item) { return { group_name: item.group_name, default_open: item.default_open } }), 'group_name'); const groupNames = _.compact(_.map(convertedGroups, 'group_name')); const tab_items = input.tab_items; tab_items?.sort(getTabsSortFun(groupNames)); return { tab_groups: convertedGroups, tab_items: tab_items }};const eventData = event.data;doAction({ actionType: 'setValue', componentId: 'object_form', args: { value: convertDataForGroups(eventData) }});" + } + ] + } + }, + "type": "dialog", + "size": "lg", + "id": "setting_groups", + "closeOnEsc": false, + "closeOnOutside": false, + "showCloseButton": true, + "showErrorMsg": true, + "showLoading": true, + "dataMapSwitch": false + }, + "id": "u:111b043b193c" + } + ], + "messages": "", + "api": { + "method": "post", + "url": "${context.rootUrl}/graphql", + "adaptor": " let data = payload.data; data.tabs_options = []; if (data.options && data.options.length) { data.tabs_options = data.options.map(function (option) { option.label = option.label + '(' + option.value + ')'; return option; }); } if (!api.body.recordId) { const defaultValues = { is_creator: true, mobile: true, visible: true, sort: 9100 } ;data = Object.assign({}, data, defaultValues); } delete data.options ;payload.data = data; return payload; ", + "data": { + "query": "{options:tabs{_id label:label value:name,type,object,desktop,mobile}}", + "recordId": "${recordId}" + }, + "headers": { + "Authorization": "Bearer ${context.tenantId},${context.authToken}" + } + } + } + ] + } }, - "id": "u:e1c1a841d373" - } - ], - "regions": [ - "body" - ], - "data": { - "objectName": "apps", - "initialValues": { + "objects": { + "amis": { + "name": "objects", + "type": "select", + "className": "m-0", + "labelClassName": "text-left", + "id": "u:4e5047e44905", + "joinValues": false, + "extractValue": true, + "labelField": "label", + "valueField": "value", + "multiple": true, + "checkAll": false, + "searchable": true, + "menuTpl": "", + "source": { + "method": "get", + "url": "${context.rootUrl}/service/api/amis-metadata-objects/objects/options", + "headers": { + "Authorization": "Bearer ${context.tenantId},${context.authToken}" + } + }, + "autoComplete": "" + } + }, + "mobile_objects": { + "amis": { + "name": "mobile_objects", + "type": "select", + "className": "m-0", + "labelClassName": "text-left", + "id": "u:cfaeb2f857a8", + "joinValues": false, + "extractValue": true, + "labelField": "label", + "valueField": "value", + "multiple": true, + "checkAll": false, + "searchable": true, + "menuTpl": "", + "source": { + "method": "get", + "url": "${context.rootUrl}/service/api/amis-metadata-objects/objects/options", + "messages": {}, + "headers": { + "Authorization": "Bearer ${context.tenantId},${context.authToken}" + } + }, + "autoComplete": "" + } + } + }, + "enableTabs": true, + "debug": false, + "initApiRequestAdaptor": "", + "initApiAdaptor": "var data = payload.data;\nif (data.tab_items && !_.isArray(data.tab_items)) {\n // 数据库中存储的是对象格式而不是数组,转换为数组用于界面显示\n let arrTabItems = [];\n _.each(data.tab_items, function (n, k) {\n n.tab_name = k;\n delete n.index;\n arrTabItems.push(n);\n });\n data.tab_items = arrTabItems;\n}\nif (data._id && !data.tab_items) {\n const tabOptions = data.tabs_options || [];\n const tabItems = [];\n // 把应用中原来tabs属性值添加到新的tab_items属性的默认值中\n if (data.tabs && data.tabs.length) {\n data.tabs.forEach(function (item) {\n tabItems.push({ tab_name: item });\n });\n }\n const pushObjectsToTabItems = function (objects) {\n objects.forEach(function (item) {\n // 已经有绑定到指定对象的选项卡就不添加\n let existObjectItem = !!tabItems.find(function (tabItem) {\n return !!tabOptions.find(function (option) {\n return tabItem.tab_name === tabItem.value && option.object === item;\n });\n });\n if (existObjectItem) {\n return;\n }\n // 找到指向指定对象的选项卡\n let tempOption = tabOptions.find(function (option) {\n return option.type === \"object\" && option.object === item;\n });\n if (!tempOption) {\n return;\n }\n // 选项卡名称如果重复了就不添加\n let existTabItem = !!tabItems.find(function (tabItem) {\n return tabItem.tab_name === tempOption.value;\n });\n if (existTabItem) {\n return;\n }\n if (tempOption) {\n tabItems.push({ tab_name: tempOption.value });\n }\n });\n }\n // 把应用中原来objects属性值添加到新的tab_items属性的默认值中\n if (data.objects && data.objects.length) {\n pushObjectsToTabItems(data.objects);\n }\n // 把应用中原来mobile_objects属性值添加到新的tab_items属性的默认值中\n if (data.mobile_objects && data.mobile_objects.length) {\n pushObjectsToTabItems(data.mobile_objects);\n }\n data.tab_items = tabItems;\n}\n\npayload.data = data;\ndelete payload.extensions;\nreturn payload;\n ", + "apiRequestAdaptor": "delete formData.tabs_options;\nconst recordId = formData.recordId;\n\n// 新加字段tab_items,值同步回传到老字段tabs中兼容老UI界面\nformData.tabs = [];\nif (formData.tab_items && formData.tab_items.length) { \n formData.tabs = formData.tab_items.map(function (item) { return item.tab_name; });\n}\n\n/*\ntab_items存储为:\ntab_items: {\n test1:{\n group:\"xxx\"\n },\n test3:{\n group:\"yyy\"\n }\n}\n而不是:\ntab_items: [\n {\n \"index\":1,\n \"group\":\"xxx\"\n },\n {\n \"index\":2,\n \"group\":\"yyy\"\n }\n]\n*/\nif (formData.tab_items) { \n formData.tab_items = _.keyBy(formData.tab_items, \"tab_name\")\n let tempIndex = 0;\n _.each(formData.tab_items, function (n, k) {\n tempIndex++;\n n.index = tempIndex;\n delete n.tab_name;\n });\n}\n\nquery = `mutation{record: ${objectName}__insert(doc: {__saveData}){_id}}`;\nif(recordId){\n query = `mutation{record: ${objectName}__update(id: \"${recordId}\", doc: {__saveData}){_id}}`;\n};\n__saveData = JSON.stringify(JSON.stringify(formData));\n\napi.data = {query: query.replace('{__saveData}', __saveData)};\nreturn api;\n", + "apiAdaptor": "", + "form": { + "id": "object_form" }, - "appId": "builder", - "title": "", - "context": { - "rootUrl": "http://127.0.0.1:5800", - "tenantId": "649bd0e96d6ec67c19dca38f", - "userId": "30e565d1-f2d3-4bb7-8895-8a16ab436c1a", - "authToken": "b65ec19a85dcf7899b663b85f65c606c05e2ab73d86482c299904d9ebdc81211c0cd407df26ac43fbfea20" - } - }, - "id": "u:de840f3523f2" - } \ No newline at end of file + "id": "u:e1c1a841d373", + "tabsMode": "line" + } + ], + "regions": [ + "body" + ], + "data": { + "objectName": "apps", + "initialValues": {}, + "appId": "builder", + "title": "", + "context": { + "rootUrl": "http://127.0.0.1:5800", + "tenantId": "64a4d6dd7fe9acaf8c330a37", + "userId": "683e09cd-8482-4034-bd29-5a30643e6c0f", + "authToken": "2906ff4353c25cfe291352f899ba3446aa5577f3de7ad60e1aa500c60dee7ca6fb446412f1c9693775b4cc" + } + }, + "id": "u:de840f3523f2" +} \ No newline at end of file diff --git a/services/service-plugin-amis/main/default/services/metadata/objects.service.js b/services/service-plugin-amis/main/default/services/metadata/objects.service.js index 3ee631104c..a24cd7911b 100644 --- a/services/service-plugin-amis/main/default/services/metadata/objects.service.js +++ b/services/service-plugin-amis/main/default/services/metadata/objects.service.js @@ -121,20 +121,34 @@ module.exports = { const fieldsOptions = await this.getObjectFieldsOptions(ctx); const userSession = ctx.meta.user; const lng = userSession.language || "zh-CN"; + const objectName = ctx.params.objectName; + const object = await objectql.getSteedosSchema().getObject(objectName); + const objectConfig = object.toConfig(); + const fields = objectConfig.fields; + + // image、file、lookup、master_detail、select 不参与排序 + let ascChildren = []; + _.forEach(fieldsOptions, (opt)=>{ + if(["image","file","lookup","master_detail","select"].indexOf(fields[opt.value].type)<0){ + ascChildren.push({label: `${opt.label}(${steedosI18n.t('asc', {}, lng)})`, value: `${opt.value}:asc`}) + } + }) + let descChildren = []; + _.forEach(fieldsOptions, (opt)=>{ + if(["image","file","lookup","master_detail","select"].indexOf(fields[opt.value].type)<0){ + descChildren.push({label: `${opt.label}(${steedosI18n.t('desc', {}, lng)})`, value: `${opt.value}:desc`}) + } + }) const options = [ { label: steedosI18n.t('asc', {}, lng), searchable: true, - children: _.map(fieldsOptions, (opt)=>{ - return {label: `${opt.label}(${steedosI18n.t('asc', {}, lng)})`, value: `${opt.value}:asc`} - }) + children: ascChildren }, { label: steedosI18n.t('desc', {}, lng), searchable: true, - children: _.map(fieldsOptions, (opt)=>{ - return {label: `${opt.label}(${steedosI18n.t('desc', {}, lng)})`, value: `${opt.value}:desc`} - }) + children: descChildren } ]; diff --git a/services/service-plugin-amis/package.json b/services/service-plugin-amis/package.json index 589ae5dc3e..19ba001f7f 100644 --- a/services/service-plugin-amis/package.json +++ b/services/service-plugin-amis/package.json @@ -1,6 +1,6 @@ { "name": "@steedos/service-plugin-amis", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "main": "package.service.js", "scripts": { "build": "yarn build:tailwind-base && yarn build:tailwind", @@ -13,7 +13,7 @@ "publishConfig": { "access": "public" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149", + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946", "devDependencies": { "tailwindcss": "3.2.4" } diff --git a/services/service-push/package.json b/services/service-push/package.json index 1a5532201a..0d925ec96e 100644 --- a/services/service-push/package.json +++ b/services/service-push/package.json @@ -1,6 +1,6 @@ { "name": "@steedos/service-push", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "description": "A Steedos App", "main": "package.service.js", "license": "MIT", @@ -9,5 +9,5 @@ "access": "public" }, "scripts": {}, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/services/service-rest/package.json b/services/service-rest/package.json index 984b4c73cf..07aeeec095 100644 --- a/services/service-rest/package.json +++ b/services/service-rest/package.json @@ -1,6 +1,6 @@ { "name": "@steedos/service-rest", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "main": "package.service.js", "private": false, "publishConfig": { @@ -16,9 +16,9 @@ "repository": {}, "license": "MIT", "dependencies": { - "@steedos/objectql": "2.5.17-beta.8", - "@steedos/service-object-mixin": "2.5.17-beta.8", + "@steedos/objectql": "2.5.17-beta.9", + "@steedos/service-object-mixin": "2.5.17-beta.9", "lodash": "^4.17.21" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/services/service-saas/package.json b/services/service-saas/package.json index 38334bedde..11ac9e518e 100644 --- a/services/service-saas/package.json +++ b/services/service-saas/package.json @@ -1,6 +1,6 @@ { "name": "@steedos/service-saas", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "main": "package.service.js", "private": false, "publishConfig": { @@ -12,5 +12,5 @@ "description": "steedos package", "repository": {}, "license": "MIT", - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/services/service-sentry/package.json b/services/service-sentry/package.json index 5c1950fed8..87dc489c2c 100644 --- a/services/service-sentry/package.json +++ b/services/service-sentry/package.json @@ -1,6 +1,6 @@ { "name": "@steedos/service-sentry", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "main": "package.service.js", "license": "MIT", "dependencies": { @@ -12,5 +12,5 @@ "publishConfig": { "access": "public" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/services/service-sidercar/package.json b/services/service-sidercar/package.json index d55de0b7cb..910c21f2c8 100644 --- a/services/service-sidercar/package.json +++ b/services/service-sidercar/package.json @@ -1,6 +1,6 @@ { "name": "@steedos/service-sidecar", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "main": "index.js", "license": "MIT", "dependencies": { @@ -13,5 +13,5 @@ "publishConfig": { "access": "public" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/services/service-steedos-server/package.json b/services/service-steedos-server/package.json index c3c5125161..2244bf5a02 100644 --- a/services/service-steedos-server/package.json +++ b/services/service-steedos-server/package.json @@ -1,46 +1,46 @@ { "name": "@steedos/service-steedos-server", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "main": "index.js", "license": "MIT", "dependencies": { - "@steedos/accounts": "2.5.17-beta.8", - "@steedos/core": "2.5.17-beta.8", - "@steedos/data-import": "2.5.17-beta.8", - "@steedos/metadata-api": "2.5.17-beta.8", - "@steedos/meteor-bundle-runner": "2.5.17-beta.8", - "@steedos/plugin-company": "2.5.17-beta.8", - "@steedos/service-accounts": "2.5.17-beta.8", - "@steedos/service-api": "2.5.17-beta.8", - "@steedos/service-cachers-manager": "2.5.17-beta.8", - "@steedos/service-charts": "2.5.17-beta.8", - "@steedos/service-fields-indexs": "2.5.17-beta.8", - "@steedos/service-files": "2.5.17-beta.8", - "@steedos/service-meteor-package-loader": "2.5.17-beta.8", - "@steedos/service-pages": "2.5.17-beta.8", - "@steedos/service-plugin-amis": "2.5.17-beta.8", - "@steedos/service-ui": "2.5.17-beta.8", - "@steedos/service-workflow": "2.5.17-beta.8", - "@steedos/standard-collaboration": "2.5.17-beta.8", - "@steedos/standard-object-database": "2.5.17-beta.8", - "@steedos/standard-permission": "2.5.17-beta.8", - "@steedos/standard-process": "2.5.17-beta.8", - "@steedos/standard-process-approval": "2.5.17-beta.8", - "@steedos/standard-space": "2.5.17-beta.8", - "@steedos/standard-ui": "2.5.17-beta.8", - "@steedos/unpkg": "2.5.17-beta.8", - "@steedos/webapp-accounts": "2.5.17-beta.8", - "@steedos/webapp-public": "2.5.17-beta.8", - "@steedos/workflow": "2.5.17-beta.8", + "@steedos/accounts": "2.5.17-beta.9", + "@steedos/core": "2.5.17-beta.9", + "@steedos/data-import": "2.5.17-beta.9", + "@steedos/metadata-api": "2.5.17-beta.9", + "@steedos/meteor-bundle-runner": "2.5.17-beta.9", + "@steedos/plugin-company": "2.5.17-beta.9", + "@steedos/service-accounts": "2.5.17-beta.9", + "@steedos/service-api": "2.5.17-beta.9", + "@steedos/service-cachers-manager": "2.5.17-beta.9", + "@steedos/service-charts": "2.5.17-beta.9", + "@steedos/service-fields-indexs": "2.5.17-beta.9", + "@steedos/service-files": "2.5.17-beta.9", + "@steedos/service-meteor-package-loader": "2.5.17-beta.9", + "@steedos/service-pages": "2.5.17-beta.9", + "@steedos/service-plugin-amis": "2.5.17-beta.9", + "@steedos/service-ui": "2.5.17-beta.9", + "@steedos/service-workflow": "2.5.17-beta.9", + "@steedos/standard-collaboration": "2.5.17-beta.9", + "@steedos/standard-object-database": "2.5.17-beta.9", + "@steedos/standard-permission": "2.5.17-beta.9", + "@steedos/standard-process": "2.5.17-beta.9", + "@steedos/standard-process-approval": "2.5.17-beta.9", + "@steedos/standard-space": "2.5.17-beta.9", + "@steedos/standard-ui": "2.5.17-beta.9", + "@steedos/unpkg": "2.5.17-beta.9", + "@steedos/webapp-accounts": "2.5.17-beta.9", + "@steedos/webapp-public": "2.5.17-beta.9", + "@steedos/workflow": "2.5.17-beta.9", "dotenv-flow": "^3.2.0", "moleculer": "^0.14.25", "moleculer-db": "^0.8.4", "moleculer-web": "^0.10.4", - "steedos-server": "2.5.17-beta.8" + "steedos-server": "2.5.17-beta.9" }, "private": false, "publishConfig": { "access": "public" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/services/service-ui/package.json b/services/service-ui/package.json index d2c94a988c..15281c098d 100644 --- a/services/service-ui/package.json +++ b/services/service-ui/package.json @@ -1,6 +1,6 @@ { "name": "@steedos/service-ui", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "main": "package.service.js", "keywords": [ "steedos" @@ -11,9 +11,9 @@ "description": "steedos package", "repository": {}, "dependencies": { - "@steedos/core": "2.5.17-beta.8", - "@steedos/i18n": "2.5.17-beta.8", - "@steedos/objectql": "2.5.17-beta.8", + "@steedos/core": "2.5.17-beta.9", + "@steedos/i18n": "2.5.17-beta.9", + "@steedos/objectql": "2.5.17-beta.9", "express": "4.18.1" }, "license": "MIT", @@ -21,5 +21,5 @@ "publishConfig": { "access": "public" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/services/service-workflow/package.json b/services/service-workflow/package.json index a6f92418bb..03c46f2f71 100644 --- a/services/service-workflow/package.json +++ b/services/service-workflow/package.json @@ -1,11 +1,11 @@ { "name": "@steedos/service-workflow", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "main": "package.service.js", "license": "MIT", "dependencies": { - "@steedos/service-object-graphql": "2.5.17-beta.8", - "@steedos/workflow": "2.5.17-beta.8", + "@steedos/service-object-graphql": "2.5.17-beta.9", + "@steedos/workflow": "2.5.17-beta.9", "lodash": "^4.17.21", "node-schedule": "^2.0.0" }, @@ -13,5 +13,5 @@ "publishConfig": { "access": "public" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/services/standard-cms/package.json b/services/standard-cms/package.json index c9c2b51774..ec143925ba 100644 --- a/services/standard-cms/package.json +++ b/services/standard-cms/package.json @@ -1,6 +1,6 @@ { "name": "@steedos/standard-cms", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "main": "package.service.js", "private": false, "publishConfig": { @@ -12,5 +12,5 @@ "description": "steedos package", "repository": {}, "license": "MIT", - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/services/standard-collaboration/package.json b/services/standard-collaboration/package.json index 60e0cbabf3..5db2b517bf 100644 --- a/services/standard-collaboration/package.json +++ b/services/standard-collaboration/package.json @@ -1,6 +1,6 @@ { "name": "@steedos/standard-collaboration", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "main": "package.service.js", "private": false, "publishConfig": { @@ -12,5 +12,5 @@ "description": "steedos package", "repository": {}, "license": "MIT", - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/services/standard-object-database/package.json b/services/standard-object-database/package.json index cb52ae27c0..49bb62e4df 100644 --- a/services/standard-object-database/package.json +++ b/services/standard-object-database/package.json @@ -1,6 +1,6 @@ { "name": "@steedos/standard-object-database", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "main": "package.service.js", "private": false, "publishConfig": { @@ -15,5 +15,5 @@ }, "repository": {}, "license": "MIT", - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/services/standard-permission/package.json b/services/standard-permission/package.json index c5356ef0cf..c3183e28bf 100644 --- a/services/standard-permission/package.json +++ b/services/standard-permission/package.json @@ -1,6 +1,6 @@ { "name": "@steedos/standard-permission", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "main": "package.service.js", "private": false, "publishConfig": { @@ -12,5 +12,5 @@ "description": "steedos package", "repository": {}, "license": "MIT", - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/services/standard-process-approval/package.json b/services/standard-process-approval/package.json index 3dde7a50ef..1b9a599372 100644 --- a/services/standard-process-approval/package.json +++ b/services/standard-process-approval/package.json @@ -1,6 +1,6 @@ { "name": "@steedos/standard-process-approval", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "main": "package.service.js", "private": false, "publishConfig": { @@ -10,10 +10,10 @@ "steedos" ], "dependencies": { - "@steedos/process": "2.5.17-beta.8" + "@steedos/process": "2.5.17-beta.9" }, "description": "steedos package", "repository": {}, "license": "MIT", - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/services/standard-space/main/default/objectTranslations/organizations.en/organizations.en.objectTranslation.yml b/services/standard-space/main/default/objectTranslations/organizations.en/organizations.en.objectTranslation.yml index 055f03e751..ddefd5ad40 100644 --- a/services/standard-space/main/default/objectTranslations/organizations.en/organizations.en.objectTranslation.yml +++ b/services/standard-space/main/default/objectTranslations/organizations.en/organizations.en.objectTranslation.yml @@ -51,6 +51,10 @@ groups: listviews: all: label: All Departments + lookup: + label: Lookup Departments + effective: + label: Effective Departments actions: standard_query: label: Search diff --git a/services/standard-space/main/default/objectTranslations/organizations.zh-CN/organizations.zh-CN.objectTranslation.yml b/services/standard-space/main/default/objectTranslations/organizations.zh-CN/organizations.zh-CN.objectTranslation.yml index 0f2a2f07ec..0d1e844386 100644 --- a/services/standard-space/main/default/objectTranslations/organizations.zh-CN/organizations.zh-CN.objectTranslation.yml +++ b/services/standard-space/main/default/objectTranslations/organizations.zh-CN/organizations.zh-CN.objectTranslation.yml @@ -51,6 +51,10 @@ groups: listviews: all: label: 所有 + lookup: + label: 相关 + effective: + label: 有效部门 actions: standard_query: label: 查找 diff --git a/services/standard-space/main/default/objects/organizations/listviews/effective.listview.yml b/services/standard-space/main/default/objects/organizations/listviews/effective.listview.yml new file mode 100644 index 0000000000..b4555dc041 --- /dev/null +++ b/services/standard-space/main/default/objects/organizations/listviews/effective.listview.yml @@ -0,0 +1,10 @@ +name: effective +columns: + - name + - sort_no +label: Effective Departments +filters: ["hidden","<>",true] +filter_scope: space +sort: + - field_name: sort_no + order: desc diff --git a/services/standard-space/main/default/objects/organizations/listviews/lookup.listview.yml b/services/standard-space/main/default/objects/organizations/listviews/lookup.listview.yml new file mode 100644 index 0000000000..3adabf7b37 --- /dev/null +++ b/services/standard-space/main/default/objects/organizations/listviews/lookup.listview.yml @@ -0,0 +1,9 @@ +name: lookup +columns: + - name + - sort_no +label: Lookup Departments +filter_scope: space +sort: + - field_name: sort_no + order: desc diff --git a/services/standard-space/package.json b/services/standard-space/package.json index cb310c99bf..7d62f10e62 100644 --- a/services/standard-space/package.json +++ b/services/standard-space/package.json @@ -1,6 +1,6 @@ { "name": "@steedos/standard-space", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "main": "package.service.js", "private": false, "publishConfig": { @@ -10,11 +10,11 @@ "steedos" ], "dependencies": { - "@steedos/objectql": "2.5.17-beta.8", - "@steedos/service-meteor-package-loader": "2.5.17-beta.8" + "@steedos/objectql": "2.5.17-beta.9", + "@steedos/service-meteor-package-loader": "2.5.17-beta.9" }, "description": "steedos package", "repository": {}, "license": "MIT", - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/services/standard-ui/package.json b/services/standard-ui/package.json index c2b86588fd..2ff7835ce3 100644 --- a/services/standard-ui/package.json +++ b/services/standard-ui/package.json @@ -1,6 +1,6 @@ { "name": "@steedos/standard-ui", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "main": "package.service.js", "private": false, "publishConfig": { @@ -12,5 +12,5 @@ "description": "steedos package", "repository": {}, "license": "MIT", - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/services/workflow_time_trigger/package.json b/services/workflow_time_trigger/package.json index 34abf31f1a..200ff5f64c 100644 --- a/services/workflow_time_trigger/package.json +++ b/services/workflow_time_trigger/package.json @@ -1,6 +1,6 @@ { "name": "@steedos/workflow_time_trigger", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "main": "package.service.js", "scripts": {}, "license": "MIT", @@ -12,5 +12,5 @@ "eval": "0.1.8", "node-schedule": "2.1.0" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/steedos-packages/service-analytics/package.json b/steedos-packages/service-analytics/package.json index 8195ed0f3f..a407200be6 100644 --- a/steedos-packages/service-analytics/package.json +++ b/steedos-packages/service-analytics/package.json @@ -1,6 +1,6 @@ { "name": "@steedos/service-analytics", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "main": "package.service.js", "description": "Analytics for product", "scripts": {}, @@ -9,5 +9,5 @@ "publishConfig": { "access": "public" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/steedos-packages/standard-process/package.json b/steedos-packages/standard-process/package.json index 73b3001e13..e9dbba4d7d 100644 --- a/steedos-packages/standard-process/package.json +++ b/steedos-packages/standard-process/package.json @@ -1,6 +1,6 @@ { "name": "@steedos/standard-process", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "main": "package.service.js", "scripts": {}, "license": "MIT", @@ -11,5 +11,5 @@ "dependencies": { "lodash": "^4.17.21" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/steedos-packages/unpkg/package.json b/steedos-packages/unpkg/package.json index 425045a5f0..ebda005825 100644 --- a/steedos-packages/unpkg/package.json +++ b/steedos-packages/unpkg/package.json @@ -1,6 +1,6 @@ { "name": "@steedos/unpkg", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "main": "package.service.js", "scripts": {}, "license": "MIT", @@ -8,5 +8,5 @@ "publishConfig": { "access": "public" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/steedos-packages/webapp-accounts/package.json b/steedos-packages/webapp-accounts/package.json index 51d7334672..8e468508b1 100644 --- a/steedos-packages/webapp-accounts/package.json +++ b/steedos-packages/webapp-accounts/package.json @@ -1,6 +1,6 @@ { "name": "@steedos/webapp-accounts", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "main": "package.service.js", "scripts": {}, "files": [ @@ -15,5 +15,5 @@ "dependencies": { "lodash": "^4.17.21" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/steedos-packages/webapp-desktop/package.json b/steedos-packages/webapp-desktop/package.json index 65fb00274f..0cd9049d79 100644 --- a/steedos-packages/webapp-desktop/package.json +++ b/steedos-packages/webapp-desktop/package.json @@ -1,6 +1,6 @@ { "name": "@steedos/webapp-desktop", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "description": "A Steedos App", "main": "package.service.js", "license": "MIT", @@ -9,5 +9,5 @@ "access": "public" }, "scripts": {}, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" } diff --git a/steedos-packages/webapp-public/package.json b/steedos-packages/webapp-public/package.json index 059f2ffeaf..1e27c7c4c7 100644 --- a/steedos-packages/webapp-public/package.json +++ b/steedos-packages/webapp-public/package.json @@ -1,6 +1,6 @@ { "name": "@steedos/webapp-public", - "version": "2.5.17-beta.8", + "version": "2.5.17-beta.9", "main": "package.service.js", "description": "public assets for steedos", "scripts": {}, @@ -12,5 +12,5 @@ "dependencies": { "lodash": "^4.17.21" }, - "gitHead": "a4bfc7089af2c007f24f6a2c50e39248968be149" + "gitHead": "a7e9f116971d37d386d71bc8ed84e15dcc5d7946" }