@steedos/standard-ui 2.5.0-beta.19 → 2.5.0-beta.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -167,6 +167,7 @@ fields:
167
167
  label: Open with iframe
168
168
  defaultValue: false
169
169
  group: External Application
170
+ visible_on: "{{false}}"
170
171
  is_new_window:
171
172
  type: boolean
172
173
  label: Open in New Window
@@ -1,3 +1,10 @@
1
+ /*
2
+ * @Author: baozhoutao@steedos.com
3
+ * @Date: 2022-08-05 14:17:44
4
+ * @LastEditors: baozhoutao@steedos.com
5
+ * @LastEditTime: 2023-05-06 11:52:46
6
+ * @Description:
7
+ */
1
8
  const _ = require('underscore');
2
9
  const clone = require("clone");
3
10
  const objectql = require("@steedos/objectql");
@@ -38,37 +45,8 @@ module.exports = {
38
45
  let allApps = clone(await objectql.getAppConfigs(this.spaceId));
39
46
  let apps = {}
40
47
  _.each(allApps, function(app){
41
- if(app.is_creator){
48
+ if(app.is_creator || app.mobile){
42
49
  apps[app._id] = app
43
- }
44
- })
45
- i18n.translationApps(lng, apps)
46
- _.each(apps, function(app){
47
- app.name = app.label
48
- if(!_.find(self.data.values, function(item){return item.code === app._id || item._id === app._id})){
49
- self.data.values.push(Object.assign({code: app._id}, clone(app), baseRecord));
50
- }
51
- })
52
- // console.log(`find this.query`, self.query, objectql.getSteedosSchema().metadataDriver.find(self.data.values, this.query, spaceId))
53
- self.data.values = objectql.getSteedosSchema().metadataDriver.find(self.data.values, self.query, spaceId);
54
- }
55
- },
56
- afterAggregate: async function () {
57
- const { spaceId } = this;
58
- let query = InternalData.parserFilters(this.query.filters);
59
- let isSystem = query.is_system;
60
- if(!_.isEmpty(isSystem) || _.isBoolean(isSystem)){
61
- if(_.isObject(isSystem) && isSystem["$ne"]){
62
- return;
63
- }
64
- }
65
- if(_.isArray(this.data.values)){
66
- let lng = await getLng(this.userId);
67
- let self = this;
68
- let allApps = clone(await objectql.getAppConfigs(this.spaceId));
69
- let apps = {}
70
- _.each(allApps, function(app){
71
- if(app.is_creator){
72
50
  apps[app._id] = app
73
51
  }
74
52
  })
@@ -79,16 +57,10 @@ module.exports = {
79
57
  self.data.values.push(Object.assign({code: app._id}, clone(app), baseRecord));
80
58
  }
81
59
  })
60
+ self.data.values = objectql.getSteedosSchema().metadataDriver.find(self.data.values, self.query, spaceId);
82
61
  }
83
- // 获取的apps根据保存的值进行过滤
84
- // const allData = this.data.values;
85
- // const firstFilterKey = _.keys(query)[0];
86
- // this.data.values = _.filter(allData, (item)=>{
87
- // return item[firstFilterKey] === query[firstFilterKey];
88
- // })
89
- // console.log(`afterAggregate this.query`, this.query, objectql.getSteedosSchema().metadataDriver.find(this.data.values, this.query, spaceId))
90
- this.data.values = objectql.getSteedosSchema().metadataDriver.find(this.data.values, this.query, spaceId);
91
62
  },
63
+
92
64
  afterCount: async function () {
93
65
  try {
94
66
  this.query.fields.push('name');
@@ -104,32 +76,8 @@ module.exports = {
104
76
  if(id && _.isEmpty(this.data.values)){
105
77
  let lng = await getLng(this.userId);
106
78
  let app = await objectql.getAppConfig(id);
107
- // let allApps = clone(await objectql.getAppConfigs(this.spaceId));
108
- // let apps = {}
109
- // _.each(allApps, function(app){
110
- // if(app._id === id && app.is_creator){
111
- // apps[app._id] = app
112
- // }
113
- // })
114
79
  i18n.translationApp(lng, app._id, app)
115
80
  Object.assign(this.data.values, Object.assign({code: app._id}, clone(app), baseRecord))
116
- // let sefl = this;
117
- // _.each(apps, function(app){
118
- // app.name = app.label
119
- // Object.assign(sefl.data.values, Object.assign({code: app._id}, clone(app), baseRecord))
120
- // })
121
81
  }
122
- },
123
- // afterInsert: async function () {
124
- // const record = await this.getObject('apps').findOne(this.doc._id);
125
- // await objectql.addAppConfig(record, SERVICE_NAME)
126
- // },
127
- // afterUpdate: async function () {
128
- // const record = await this.getObject('apps').findOne(this.id);
129
- // await objectql.addAppConfig(record, SERVICE_NAME)
130
- // },
131
- // afterDelete: async function(){
132
- // let id = this.id;
133
- // objectql.removeApp(id)
134
- // }
82
+ }
135
83
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steedos/standard-ui",
3
- "version": "2.5.0-beta.19",
3
+ "version": "2.5.0-beta.20",
4
4
  "main": "package.service.js",
5
5
  "private": false,
6
6
  "publishConfig": {
@@ -12,5 +12,5 @@
12
12
  "description": "steedos package",
13
13
  "repository": {},
14
14
  "license": "MIT",
15
- "gitHead": "99f85803376a6096f0262ff47689572818bf655b"
15
+ "gitHead": "830af95dcc46ba3ac1abf237943d23e627feabaf"
16
16
  }