Skip to content

Commit

Permalink
一个可运行版本 #7120
Browse files Browse the repository at this point in the history
  • Loading branch information
baozhoutao committed Jan 18, 2025
1 parent 2b2190f commit e2f10a3
Show file tree
Hide file tree
Showing 276 changed files with 6,016 additions and 729 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"docker:db": "docker-compose up mongodb mongodb-init redis nats",
"i18n": "lerna run i18n",
"start": "steedos start --config steedos.config.js",
"sync": "lerna exec --no-private -- cnpm sync \\$LERNA_PACKAGE_NAME"
"sync": "lerna exec --no-private -- cnpm sync \\$LERNA_PACKAGE_NAME",
"repl": "moleculer-runner --config steedos.config.js --repl"
},
"resolutions": {
"@salesforce/ts-types": "1.1.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/data-import/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@steedos/data-import",
"version": "3.0.0-beta.2",
"main": "lib/index.js",
"main": "package.service.js",
"license": "MIT",
"scripts": {
"build": "rm -rf ./lib && tsc"
Expand Down
6 changes: 5 additions & 1 deletion packages/objectql/src/types/object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1603,7 +1603,8 @@ export class SteedosObjectType extends SteedosObjectProperties {
}

async getRecordView(userSession, context: any = {}) {
let versionsMap = {}
try {
let versionsMap = {}
if (global['HAS_LICENSE_SERVICE']) {
versionsMap = {
[PLATFORM_ENTERPRISE]: await broker.call(`${LICENSE_SERVICE}.isPlatformEnterprise`, { spaceId: userSession.spaceId }),
Expand Down Expand Up @@ -1831,6 +1832,9 @@ export class SteedosObjectType extends SteedosObjectProperties {
}

return objectConfig;
} catch (error) {
console.log(error)
}
}

async getDefaultRecordView(userSession){
Expand Down
16 changes: 7 additions & 9 deletions services/service-api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,12 @@ module.exports = {
use: [
function (req, res, next) {
// 如果service-object-grapqhl未结算完成,则提示服务未就绪,刷新重试
if (!this.projectStarted) {
const message = 'service is not ready, please refresh later.';
res.writeHead(503, { 'Content-Type': 'application/json' });
res.end(JSON.stringify({ status: 1, msg: message, data: {}, errors: [{ message: message }] }));
return;
}
// if (!this.projectStarted) {
// const message = 'service is not ready, please refresh later.';
// res.writeHead(503, { 'Content-Type': 'application/json' });
// res.end(JSON.stringify({ status: 1, msg: message, data: {}, errors: [{ message: message }] }));
// return;
// }
next();
}
],
Expand Down Expand Up @@ -1045,9 +1045,8 @@ module.exports = {
}
},
async started() {

console.log('started', this.name)
this.broker.createService(require("@steedos/service-ui"));

// if (this.settings.server != true && this.settings.steedos_api_port){
// /* istanbul ignore next */
// await new this.Promise((resolve, reject) => {
Expand All @@ -1063,7 +1062,6 @@ module.exports = {
this.broker.waitForServices('~packages-@steedos/service-ui').then(() => {
this.app.use("/", this.express());
})

global.SteedosApi = {
express: this.express
}
Expand Down
36 changes: 18 additions & 18 deletions services/service-cachers-manager/metadata-cachers.service.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
* @Author: [email protected]
* @Date: 2024-03-22 14:37:50
* @LastEditors: 孙浩林 sunhaolin@steedos.com
* @LastEditTime: 2024-05-18 13:31:28
* @LastEditors: baozhoutao@steedos.com
* @LastEditTime: 2025-01-17 14:21:33
* @Description: 由于 collection observe 在 steedos-server.started 事件中被触发报错需要 Fiber ,添加Fiber 后, 不报错,但是无法订阅到数据. 所以单写服务处理此问题.
*
*/
Expand All @@ -23,26 +23,26 @@ module.exports = {
/**
* Dependencies
*/
dependencies: ['steedos-server'],
dependencies: [],

events: {
'$packages.changed': function(){
this.loadMetadataWorkflows();
this.loadMetadataValidationRule();
this.loadMetadataObjectFunctions();
// this.loadMetadataWorkflows();
// this.loadMetadataValidationRule();
// this.loadMetadataObjectFunctions();

}
},

actions:{
find: function(ctx){
const { metadataName, filters, spaceId } = ctx.params;
const res = this[`${_.camelCase(metadataName)}Cacher`].find(filters, spaceId);
return res;
const res = this[`${_.camelCase(metadataName)}Cacher`]?.find(filters, spaceId);
return res || [];
},
get: function(ctx){
const { _id } = ctx.params;
return this[`${_.camelCase(metadataName)}Cacher`].get(_id)
return this[`${_.camelCase(metadataName)}Cacher`]?.get(_id)
}
},

Expand Down Expand Up @@ -88,23 +88,23 @@ module.exports = {
},

async started() {
this.actionFieldUpdatesCacher = new ActionFieldUpdateCacher()
// this.actionFieldUpdatesCacher = new ActionFieldUpdateCacher()

this.workflowOutboundMessagesCacher = new WorkflowOutboundMessageCacher();
// this.workflowOutboundMessagesCacher = new WorkflowOutboundMessageCacher();

this.workflowNotificationsCacher = new WorkflowNotificationCacher();
// this.workflowNotificationsCacher = new WorkflowNotificationCacher();

this.workflowRuleCacher = new WorkflowRuleCacher();
// this.workflowRuleCacher = new WorkflowRuleCacher();

this.objectValidationRulesCacher = new ObjectValidationRulesCacher()
// this.objectValidationRulesCacher = new ObjectValidationRulesCacher()

this.settingsCacher = new SettingsCacher();
// this.settingsCacher = new SettingsCacher();

this.objectWebhooksCacher = new ObjectWebhookCacher();
// this.objectWebhooksCacher = new ObjectWebhookCacher();

this.objectFunctionsCacher = new ObjectFunctionsCacher();
// this.objectFunctionsCacher = new ObjectFunctionsCacher();

await this.loadMetadataWorkflows()
// await this.loadMetadataWorkflows()
},

async stopped(){
Expand Down
5 changes: 3 additions & 2 deletions services/service-cachers-manager/package.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: [email protected]
* @Date: 2022-03-28 09:35:35
* @LastEditors: [email protected]
* @LastEditTime: 2024-03-22 14:40:23
* @LastEditTime: 2025-01-17 14:20:54
* @Description: 维护内存缓存
*/
"use strict";
Expand All @@ -13,6 +13,7 @@ const cachers = require('@steedos/cachers');
const auth = require('@steedos/auth');
const { getObject } = require('@steedos/objectql');
const register = require('@steedos/metadata-registrar');
const _ = require('underscore');
/**
* @typedef {import('moleculer').Context} Context Moleculer's Context
* 软件包服务启动后也需要抛出事件。
Expand All @@ -31,7 +32,7 @@ module.exports = {
/**
* Dependencies
*/
dependencies: [],
dependencies: ['metadata'],
methods: {
// 加载mo action规则的triggers
loadActionTriggers: async function (broker) {
Expand Down
4 changes: 0 additions & 4 deletions services/service-charts/package.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,12 +334,8 @@ module.exports = {
let publicPath = require.resolve("@steedos/service-charts/package.json");
publicPath = publicPath.replace("package.json", 'webapp');
let routerPath = "";
if (__meteor_runtime_config__.ROOT_URL_PATH_PREFIX) {
routerPath = __meteor_runtime_config__.ROOT_URL_PATH_PREFIX;
}
const cacheTime = 86400000 * 1; // one day
router.use(`${routerPath}/builder`, express.static(publicPath, { maxAge: cacheTime }));
// WebApp.rawConnectHandlers.use(router);
} catch (error) {
console.error(error)
this.settings.initBuilderRouter = false;
Expand Down
4 changes: 2 additions & 2 deletions services/service-community/package.service.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
* @Author: [email protected]
* @Date: 2022-07-20 21:31:37
* @LastEditors: sunhaolin@hotoa.com
* @LastEditTime: 2023-06-12 17:31:40
* @LastEditors: baozhoutao@steedos.com
* @LastEditTime: 2025-01-15 17:43:55
* @Description:
*/
"use strict";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: organizations
label: Organizational Structures
description:
fields:
name:
label: Name
help:
description:
fullname:
label: Full Name
help:
description:
parent:
label: Superior Organization
help:
description:
parents:
label: All Superior Organization
help:
description:
children:
label: Subordinate Organization
help:
description:
sort_no:
label: Sort Number
help:
description:
users:
label: Organization Users
help:
description:
company_id:
label: Main Division
help:
description:
company_ids:
label: All Divisions
help:
description:
is_company:
label: is Division
help:
description:
hidden:
label: Hidden
help:
description:
groups:
systemfields: systemfields
listviews:
all:
label: All Organizations
lookup:
label: Lookup Organization
effective:
label: Effective Organizations
actions:
standard_query:
label: Search
addSubOrganization:
label: Add a Branch
CustomLabels:
organizations_group_系统: System
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: organizations
label: 组织机构
description:
fields:
name:
label: 名称
help:
description:
fullname:
label: 组织全称
help:
description:
parent:
label: 上级组织
help:
description:
parents:
label: 上级组织
help:
description:
children:
label: 下级组织
help:
description:
sort_no:
label: 排序号
help:
description:
users:
label: 成员
help:
description:
company_id:
label: 所属分部
help:
description:
company_ids:
label: 所属分部
help:
description:
is_company:
label: 分部级
help:
description:
hidden:
label: 隐藏
help:
description:
groups:
systemfields: systemfields
listviews:
all:
label: 所有
lookup:
label: 相关
effective:
label: 有效组织
actions:
standard_query:
label: 查找
addSubOrganization:
label: 添加子组织
CustomLabels:
organizations_group_系统: 系统
Loading

0 comments on commit e2f10a3

Please sign in to comment.