@devops-flow/devops-flow-pipeline-detail 0.0.55 → 0.0.56-beta.0

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.
@@ -36,7 +36,6 @@ export var buildButtonComponentWrapper = function buildButtonComponentWrapper(_r
36
36
  var globalConfig = useContext(ConfigContext);
37
37
  var _globalConfig$replace = globalConfig.replaceLinks,
38
38
  reportLinkHost = _globalConfig$replace.report,
39
- scanLinkHost = _globalConfig$replace.scan,
40
39
  appStackHost = _globalConfig$replace.appstack;
41
40
 
42
41
  // 独立组件的后端返回数据格式,和 Flow 不一致,需要要type类型判断,返回结果一样
@@ -57,7 +56,7 @@ export var buildButtonComponentWrapper = function buildButtonComponentWrapper(_r
57
56
  // 这个 Button 返回数组,不能当成 react 组件用
58
57
  return button ? button(_extends({}, props, restProps, {
59
58
  id: restProps.key,
60
- scanLinkHost: scanLinkHost
59
+ reportLinkHost: reportLinkHost
61
60
  })) : null;
62
61
  };
63
62
  }
@@ -110,7 +109,7 @@ export var buildButtonComponentWrapper = function buildButtonComponentWrapper(_r
110
109
  // 这个 Button 返回数组,不能当成 react 组件用
111
110
  return button ? button(_extends({}, props, restProps, {
112
111
  id: restProps.key,
113
- scanLinkHost: scanLinkHost
112
+ reportLinkHost: reportLinkHost
114
113
  })) : null;
115
114
  };
116
115
  case 'STAT_INFO_WITH_REDLINES':
@@ -1,4 +1,5 @@
1
1
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
2
+ import _extends from "@babel/runtime/helpers/extends";
2
3
  var _excluded = ["view"],
3
4
  _excluded2 = ["onClick", "id", "text"];
4
5
  /* eslint-disable react/no-array-index-key */
@@ -69,7 +70,8 @@ var SubTree = function SubTree(props) {
69
70
  treeIndex = props.treeIndex,
70
71
  instance = props.instance,
71
72
  job = props.job,
72
- setBuildId = props.setBuildId;
73
+ setBuildId = props.setBuildId,
74
+ buildId = props.buildId;
73
75
  var globalConfig = useContext(ConfigContext);
74
76
  var apiHeaderFn = globalConfig.apiHeaderFn;
75
77
  var _useState = useState([]),
@@ -140,6 +142,9 @@ var SubTree = function SubTree(props) {
140
142
  onSelect: function onSelect(args) {
141
143
  var key = args[0];
142
144
  var selectNode = JSON.parse(key);
145
+ if (selectNode.jobId !== buildId) {
146
+ setBuildId(selectNode.jobId);
147
+ }
143
148
  setSelectedNode(selectNode);
144
149
  _onSelect({
145
150
  nodeUrl: nodeUrl,
@@ -158,8 +163,10 @@ var SubTree = function SubTree(props) {
158
163
  disabled: true
159
164
  }, item.buildProcessNodes.map(function (node) {
160
165
  return /*#__PURE__*/React.createElement(TreeNode, {
161
- className: ["job-log-tree__node--" + node.status, node.nodeIndex === selectedNode.nodeIndex && treeIndex === current ? 'selected' : ''].join(' '),
162
- key: JSON.stringify(node),
166
+ className: ["job-log-tree__node--" + node.status, node.nodeIndex === selectedNode.nodeIndex && treeIndex === current && item.buildId === buildId ? 'selected' : ''].join(' '),
167
+ key: JSON.stringify(_extends({}, node, {
168
+ jobId: item.jobId
169
+ })),
163
170
  label: /*#__PURE__*/React.createElement("div", {
164
171
  className: "node-item"
165
172
  }, /*#__PURE__*/React.createElement(StatusAbleIcon, {
@@ -486,6 +493,7 @@ var LogButton = function LogButton(_ref) {
486
493
  setCurrent: setCurrentIndex,
487
494
  setPluginLogVisible: setPluginLogVisible,
488
495
  setBuildId: setBuildId,
496
+ buildId: buildId,
489
497
  lastTree: true
490
498
  })), !!pluginLogs.length && /*#__PURE__*/React.createElement("div", {
491
499
  className: "log-container__side__footer"
@@ -16,7 +16,7 @@ export var CommonButton = function CommonButton(_ref) {
16
16
  trustReport = _useState[0],
17
17
  setTrustReport = _useState[1];
18
18
  var globalConfig = useContext(ConfigContext);
19
- var scanHost = globalConfig.replaceLinks.scan;
19
+ var reportLinkHost = globalConfig.replaceLinks.report;
20
20
  function getTrustReport() {
21
21
  getTrustPipelineReportConfig().then(function (v) {
22
22
  setTrustReport(v);
@@ -34,7 +34,7 @@ export var CommonButton = function CommonButton(_ref) {
34
34
  });
35
35
  } else {
36
36
  var url = link.href;
37
- if (scanHost) url = replaceHostWithBase(url, scanHost);
37
+ if (reportLinkHost) url = replaceHostWithBase(url, reportLinkHost);
38
38
  window.open(url);
39
39
  }
40
40
  };
@@ -417,7 +417,7 @@ var StateInfoButton = function StateInfoButton(args) {
417
417
  id = args.id,
418
418
  name = args.name,
419
419
  hasMore = args.hasMore,
420
- scanLinkHost = args.scanLinkHost;
420
+ reportLinkHost = args.reportLinkHost;
421
421
  var statistic = JSON.parse(data);
422
422
  if (statistic.QIXI) {
423
423
  var url = statistic.QIXI.url;
@@ -440,7 +440,7 @@ var StateInfoButton = function StateInfoButton(args) {
440
440
  }
441
441
  var link = {
442
442
  component: 'a',
443
- href: replaceHostWithBase(statistic._REPORT.url, scanLinkHost),
443
+ href: replaceHostWithBase(statistic._REPORT.url, reportLinkHost),
444
444
  target: '_blank'
445
445
  };
446
446
  var prefix = hasMore ? name + " - " : '';
@@ -3,7 +3,6 @@ declare const ConfigContext: import("react").Context<{
3
3
  replaceLinks: {
4
4
  api: string;
5
5
  report: string;
6
- scan: string;
7
6
  appstack: string;
8
7
  };
9
8
  headers: {};
@@ -5,8 +5,7 @@ var ConfigContext = /*#__PURE__*/createContext({
5
5
  // api接口
6
6
  report: '',
7
7
  // 报告链接
8
- scan: '',
9
- // 扫描报告
8
+ // scan: '', // 扫描报告
10
9
  appstack: '' // 部署单链接
11
10
  },
12
11
  headers: {},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devops-flow/devops-flow-pipeline-detail",
3
- "version": "0.0.55",
3
+ "version": "0.0.56-beta.0",
4
4
  "description": "flow 流水线详情",
5
5
  "medusaName": "rdc-tb-cd-assets",
6
6
  "main": "dist/PipelineFlowDetail.js",
@@ -47,5 +47,6 @@
47
47
  "peerDependencies": {
48
48
  "react": "^18.0.0",
49
49
  "react-dom": "^18.0.0"
50
- }
50
+ },
51
+ "homepage": "https://unpkg.com/@devops-flow/devops-flow-pipeline-detail@0.0.56/build/index.html"
51
52
  }