@steedos/service-pages 3.0.0-beta.29 → 3.0.0-beta.32

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.
@@ -322,12 +322,9 @@
322
322
  this.containerList = [];
323
323
  this.pageName = null;
324
324
  return this.autorun(function(computation) {
325
- // console.log('autorun=====>computation:', computation)
326
- // Session.get("record_id");
327
325
  var container, e, lastData, ref, ref1, ref2, regions, schema, updateProps, updatePropsData;
328
326
  if(self.data.regions){
329
327
  regions = self.data.regions();
330
- // console.log('regions====>', regions, this.lastRegions);
331
328
  updateProps = true;
332
329
  if (regions.objectName !== ((ref = this.lastRegions) != null ? ref.objectName : void 0)) {
333
330
  updateProps = false;
@@ -7,7 +7,6 @@
7
7
  */
8
8
  module.exports = {
9
9
  customPage: function (object_name, record_id) {
10
- $(document.body).addClass('loading');
11
10
  let url = `/service/api/page/customPage`;
12
11
  let options = {
13
12
  type: 'post',
@@ -17,15 +16,13 @@ module.exports = {
17
16
  SteedosUI.notification.success({
18
17
  message: '页面已自定义。'
19
18
  });
20
- SteedosUI.router.go({}, "/app/" + Session.get("app_id") + "/" + object_name + "/view/" + data._id);
21
- $(document.body).removeClass('loading');
19
+ navigate("/app/admin/pages/view/" + data._id)
22
20
  },
23
21
  error: function (XMLHttpRequest, textStatus, errorThrown) {
24
22
  SteedosUI.notification.error({
25
23
  message: '操作失败',
26
24
  description: t(XMLHttpRequest.responseJSON.error),
27
25
  });
28
- $(document.body).removeClass('loading');
29
26
  }
30
27
  };
31
28
  Steedos.authRequest(url, options);
@@ -7,7 +7,6 @@
7
7
  */
8
8
  module.exports = {
9
9
  deploy: function (object_name, record_id) {
10
- $(document.body).addClass('loading');
11
10
  let url = `/service/api/page/deploy`;
12
11
  let options = {
13
12
  type: 'post',
@@ -18,15 +17,13 @@ module.exports = {
18
17
  message: '页面已发布。'
19
18
  });
20
19
  SteedosUI.reloadRecord(object_name, record_id);
21
- FlowRouter.reload();
22
- $(document.body).removeClass('loading');
20
+ window.location.reload();
23
21
  },
24
22
  error: function (XMLHttpRequest, textStatus, errorThrown) {
25
23
  SteedosUI.notification.error({
26
24
  message: '操作失败',
27
25
  description: t(XMLHttpRequest.responseJSON.error),
28
26
  });
29
- $(document.body).removeClass('loading');
30
27
  }
31
28
  };
32
29
  Steedos.authRequest(url, options);
@@ -8,12 +8,6 @@ module.exports = {
8
8
  perms = {};
9
9
  if (record_permissions) {
10
10
  perms = record_permissions;
11
- } else {
12
- record = Creator.getObjectRecord(object_name, record_id);
13
- record_permissions = Creator.getRecordPermissions(object_name, record, Meteor.userId());
14
- if (record_permissions) {
15
- perms = record_permissions;
16
- }
17
11
  }
18
12
  return perms["allowEdit"];
19
13
  }
@@ -16,7 +16,8 @@ module.exports = {
16
16
  }
17
17
  },
18
18
  viewPageVisible: function (object_name, record_id, permission, data) {
19
- var record = data && data.record;
20
- return record && record.type === 'app';
19
+ // var record = data && data.record;
20
+ // return record && record.type === 'app';
21
+ return false;
21
22
  }
22
23
  }
@@ -142,13 +142,13 @@
142
142
 
143
143
  if (objectName && pageType === "record") {
144
144
  const record = await axios.get(
145
- `${rootUrl}/api/v4/${objectName}?$orderby=modified&$top=1`,
145
+ `${rootUrl}/api/v1/${objectName}?$sort=modified&$top=1`,
146
146
  {
147
147
  withCredentials: true,
148
148
  headers: { Authorization: `Bearer ${tenantId},${authToken}` },
149
149
  }
150
150
  );
151
- const value = record?.data?.value;
151
+ const value = record?.data?.items;
152
152
  if (value?.length > 0) {
153
153
  schema.data.recordId = value[0]._id;
154
154
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steedos/service-pages",
3
- "version": "3.0.0-beta.29",
3
+ "version": "3.0.0-beta.32",
4
4
  "main": "package.service.js",
5
5
  "scripts": {},
6
6
  "license": "MIT",
@@ -8,7 +8,7 @@
8
8
  "publishConfig": {
9
9
  "access": "public"
10
10
  },
11
- "gitHead": "9a9a8b8bbab234f5d6666ca88063d53ad0cd2c4f",
11
+ "gitHead": "fcff940305b05294cce7c852009c04a769ae0df7",
12
12
  "dependencies": {
13
13
  "clone": "^2.1.2",
14
14
  "ejs": "^3.1.8"