@next-core/brick-kit 2.117.1 → 2.117.4

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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,41 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.117.4](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.117.3...@next-core/brick-kit@2.117.4) (2022-04-11)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * bg bricks should have no slot ([0c93d41](https://github.com/easyops-cn/next-core/commit/0c93d417da911b5b7d012d81f73bdeeadbf4f9d2))
12
+ * no menu for template preview ([6f5ed88](https://github.com/easyops-cn/next-core/commit/6f5ed88002f61f105a6e2ab87481ffab2bbb0616))
13
+
14
+
15
+
16
+
17
+
18
+ ## [2.117.3](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.117.2...@next-core/brick-kit@2.117.3) (2022-04-08)
19
+
20
+
21
+ ### Bug Fixes
22
+
23
+ * fix getMenu later ([ebe69b9](https://github.com/easyops-cn/next-core/commit/ebe69b99e565e53d2e649bf6facc601b5cd0d544))
24
+ * update unit test ([104f0d1](https://github.com/easyops-cn/next-core/commit/104f0d1f0b9b741759743095b1e7d34294999803))
25
+
26
+
27
+
28
+
29
+
30
+ ## [2.117.2](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.117.1...@next-core/brick-kit@2.117.2) (2022-04-07)
31
+
32
+
33
+ ### Bug Fixes
34
+
35
+ * support service name ([63b8f0b](https://github.com/easyops-cn/next-core/commit/63b8f0be85d4d213e8fd308beec84d0bbdee210d))
36
+
37
+
38
+
39
+
40
+
6
41
  ## [2.117.1](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.117.0...@next-core/brick-kit@2.117.1) (2022-04-07)
7
42
 
8
43
 
@@ -5641,6 +5641,7 @@
5641
5641
  ext_fields,
5642
5642
  name,
5643
5643
  namespace,
5644
+ serviceName,
5644
5645
  responseWrapper,
5645
5646
  version,
5646
5647
  isFileType
@@ -5654,7 +5655,7 @@
5654
5655
  var {
5655
5656
  url,
5656
5657
  args
5657
- } = getTransformedUriAndRestArgs(uri, originalArgs, name, namespace, version);
5658
+ } = getTransformedUriAndRestArgs(uri, originalArgs, name, namespace, serviceName, version);
5658
5659
  return isFileType ? [fileName, {
5659
5660
  url,
5660
5661
  method,
@@ -5670,8 +5671,8 @@
5670
5671
  }, ...args];
5671
5672
  }
5672
5673
 
5673
- function getTransformedUriAndRestArgs(uri, originalArgs, name, namespace, version) {
5674
- var prefix = version ? "api/gateway/".concat(namespace, ".").concat(name, "@").concat(version) : "api/gateway/api_service.".concat(namespace, ".").concat(name);
5674
+ function getTransformedUriAndRestArgs(uri, originalArgs, name, namespace, serviceName, version) {
5675
+ var prefix = version ? serviceName ? "api/gateway/".concat(serviceName) : "api/gateway/".concat(namespace, ".").concat(name, "@").concat(version) : "api/gateway/api_service.".concat(namespace, ".").concat(name);
5675
5676
  var restArgs = originalArgs.slice();
5676
5677
  var transformedUri = uri.replace(/:([^/]+)/g, () => restArgs.shift());
5677
5678
  return {
@@ -5704,6 +5705,7 @@
5704
5705
  ext_fields,
5705
5706
  name: api.name,
5706
5707
  namespace: api.namespace,
5708
+ serviceName: api.serviceName,
5707
5709
  version: api.version,
5708
5710
  isFileType: (contract === null || contract === void 0 ? void 0 : (_contract$response = contract.response) === null || _contract$response === void 0 ? void 0 : _contract$response.type) === "file",
5709
5711
  responseWrapper
@@ -5737,7 +5739,7 @@
5737
5739
  var {
5738
5740
  list
5739
5741
  } = yield InstanceApi_postSearchV3("FLOW_BUILDER_API_CONTRACT@EASYOPS", {
5740
- fields: ["name", "namespaceId", "endpoint", "response", "version"],
5742
+ fields: ["name", "namespaceId", "endpoint", "response", "version", "serviceName"],
5741
5743
  query: {
5742
5744
  namespaceId: {
5743
5745
  $eq: namespaceName
@@ -5749,11 +5751,12 @@
5749
5751
  });
5750
5752
 
5751
5753
  if ((_list$ = list[0]) !== null && _list$ !== void 0 && _list$.instanceId) {
5752
- var _list$2;
5754
+ var _list$2, _list$3;
5753
5755
 
5754
5756
  return {
5755
5757
  name: list[0].name,
5756
5758
  namespace: (_list$2 = list[0]) === null || _list$2 === void 0 ? void 0 : _list$2.namespaceId,
5759
+ serviceName: (_list$3 = list[0]) === null || _list$3 === void 0 ? void 0 : _list$3.serviceName,
5757
5760
  version: list[0].version,
5758
5761
  contract: {
5759
5762
  endpoint: list[0].endpoint,
@@ -5768,6 +5771,7 @@
5768
5771
  return {
5769
5772
  name: contract.name,
5770
5773
  namespace: contract.namespaceId,
5774
+ serviceName: contract.serviceName,
5771
5775
  version: contract.version,
5772
5776
  contract: {
5773
5777
  endpoint: contract.endpoint,
@@ -5788,6 +5792,7 @@
5788
5792
  return {
5789
5793
  name: contractData.name,
5790
5794
  namespace: (_contractData$namespa = contractData.namespace) === null || _contractData$namespa === void 0 ? void 0 : (_contractData$namespa2 = _contractData$namespa[0]) === null || _contractData$namespa2 === void 0 ? void 0 : _contractData$namespa2.name,
5795
+ serviceName: contractData.serviceName,
5791
5796
  version: contractData.version,
5792
5797
  contract: {
5793
5798
  endpoint: contractData.endpoint,
@@ -6674,7 +6679,6 @@
6674
6679
 
6675
6680
  var CUSTOM_API_PROVIDER = "brick-kit.provider-custom-api";
6676
6681
  function processExtFields(ext_fields) {
6677
-
6678
6682
  var hasFields = type => {
6679
6683
  return ext_fields.some(item => item.source === type);
6680
6684
  };
@@ -8002,7 +8006,9 @@
8002
8006
  path: previewPath,
8003
8007
  bricks: [_objectSpread__default["default"]({
8004
8008
  brick: templateId
8005
- }, lodash.pick(settings, "properties"))]
8009
+ }, lodash.pick(settings, "properties"))],
8010
+ menu: false,
8011
+ exact: true
8006
8012
  };
8007
8013
 
8008
8014
  if (previewRouteIndex === -1) {
@@ -8944,8 +8950,8 @@
8944
8950
  yield _this.preFetchMenu(route.context);
8945
8951
  yield _this.mountRoutes(route.routes, slotId, mountRoutesResult);
8946
8952
  } else if (isRouteConfOfBricks(route) && Array.isArray(route.bricks)) {
8947
- yield _this.mountBricks(route.bricks, matched.match, slotId, mountRoutesResult);
8948
- yield _this.preFetchMenu(route); // analytics data (page_view event)
8953
+ yield _this.preFetchMenu(route);
8954
+ yield _this.mountBricks(route.bricks, matched.match, slotId, mountRoutesResult); // analytics data (page_view event)
8949
8955
 
8950
8956
  if (route.analyticsData) {
8951
8957
  mountRoutesResult.analyticsData = computeRealValue(route.analyticsData, context, true);
@@ -9226,6 +9232,8 @@
9226
9232
  }
9227
9233
 
9228
9234
  if (expandedBrickConf.bg) {
9235
+ // A bg brick has no slotId.
9236
+ brick.slotId = undefined;
9229
9237
  appendBrick(brick, _this6.kernel.mountPoints.bg);
9230
9238
  } else {
9231
9239
  if (expandedBrickConf.portal) {
@@ -10163,7 +10171,9 @@
10163
10171
  path: "${APP.homepage}/_dev_only_/template-preview/:templateId",
10164
10172
  bricks: [{
10165
10173
  brick: "span"
10166
- }]
10174
+ }],
10175
+ menu: false,
10176
+ exact: true
10167
10177
  }), undefined, mountRoutesResult);
10168
10178
  } catch (error) {
10169
10179
  // eslint-disable-next-line no-console