@devops-flow/devops-flow-pipeline-detail 0.0.51 → 0.0.53
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/dist/PipelineFlowDetail.js +1 -1
- package/es/components/common/teambition/flow-job-btn/cardsMap.js +16 -4
- package/es/components/common/teambition/flow-job-btn/link/index.js +4 -2
- package/es/components/common/teambition/flow-job-btn/replaceHost.d.ts +1 -0
- package/es/components/common/teambition/flow-job-btn/replaceHost.js +14 -1
- package/es/components/common/teambition/flow-job-btn/state-info/index.js +4 -3
- package/es/components/common/teambition/pipeline-instance-new/StatusBar.js +2 -2
- package/es/components/detailMain/current/index.js +9 -12
- package/es/components/detailMain/recent/index.js +2 -2
- package/es/contexts/config.d.ts +1 -0
- package/es/contexts/config.js +3 -1
- package/es/index.js +1 -1
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
3
3
|
var _excluded = ["displayType", "type", "mode", "isAdmin"],
|
|
4
4
|
_excluded2 = ["displayType", "type"];
|
|
5
|
-
import React from 'react';
|
|
5
|
+
import React, { useContext } from 'react';
|
|
6
6
|
import ExecuteButton from "./execute-button";
|
|
7
7
|
import LogButton from "./log-btn";
|
|
8
8
|
import AuiTestSummaryButton from "./aui-test-summary";
|
|
@@ -24,6 +24,7 @@ import DebugButton from "./debug-button";
|
|
|
24
24
|
import ReleaseOrderButton from "./release-order";
|
|
25
25
|
import ChangeInfoButton from "./change-info-btn";
|
|
26
26
|
import { getFeature } from "../../../../utils";
|
|
27
|
+
import ConfigContext from "../../../../contexts/config";
|
|
27
28
|
export var ExecuteableButtons = ['EXECUTE'];
|
|
28
29
|
export var buildButtonComponentWrapper = function buildButtonComponentWrapper(_ref) {
|
|
29
30
|
var displayType = _ref.displayType,
|
|
@@ -32,13 +33,21 @@ export var buildButtonComponentWrapper = function buildButtonComponentWrapper(_r
|
|
|
32
33
|
_ref$isAdmin = _ref.isAdmin,
|
|
33
34
|
isAdmin = _ref$isAdmin === void 0 ? false : _ref$isAdmin,
|
|
34
35
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
36
|
+
var globalConfig = useContext(ConfigContext);
|
|
37
|
+
var _globalConfig$replace = globalConfig.replaceLinks,
|
|
38
|
+
reportLinkHost = _globalConfig$replace.report,
|
|
39
|
+
scanLinkHost = _globalConfig$replace.scan,
|
|
40
|
+
appStackHost = _globalConfig$replace.appstack;
|
|
41
|
+
|
|
35
42
|
// 独立组件的后端返回数据格式,和 Flow 不一致,需要要type类型判断,返回结果一样
|
|
36
43
|
if (type === 'LINK') {
|
|
37
44
|
return function (restProps) {
|
|
38
45
|
var Button = LinkButton[mode];
|
|
39
46
|
return Button ? /*#__PURE__*/React.createElement(Button, _extends({}, props, restProps, {
|
|
40
47
|
text: true,
|
|
41
|
-
id: restProps.key
|
|
48
|
+
id: restProps.key,
|
|
49
|
+
reportLinkHost: reportLinkHost,
|
|
50
|
+
appStackHost: appStackHost
|
|
42
51
|
})) : null;
|
|
43
52
|
};
|
|
44
53
|
}
|
|
@@ -47,7 +56,8 @@ export var buildButtonComponentWrapper = function buildButtonComponentWrapper(_r
|
|
|
47
56
|
var button = StateInfoButton[mode];
|
|
48
57
|
// 这个 Button 返回数组,不能当成 react 组件用
|
|
49
58
|
return button ? button(_extends({}, props, restProps, {
|
|
50
|
-
id: restProps.key
|
|
59
|
+
id: restProps.key,
|
|
60
|
+
scanLinkHost: scanLinkHost
|
|
51
61
|
})) : null;
|
|
52
62
|
};
|
|
53
63
|
}
|
|
@@ -61,6 +71,7 @@ export var buildButtonComponentWrapper = function buildButtonComponentWrapper(_r
|
|
|
61
71
|
return function (restProps) {
|
|
62
72
|
var Button = ExecuteButton[mode];
|
|
63
73
|
return Button ? /*#__PURE__*/React.createElement(Button, _extends({}, props, restProps, {
|
|
74
|
+
type: type,
|
|
64
75
|
id: restProps.key
|
|
65
76
|
})) : null;
|
|
66
77
|
};
|
|
@@ -98,7 +109,8 @@ export var buildButtonComponentWrapper = function buildButtonComponentWrapper(_r
|
|
|
98
109
|
var button = StateInfoButton[mode];
|
|
99
110
|
// 这个 Button 返回数组,不能当成 react 组件用
|
|
100
111
|
return button ? button(_extends({}, props, restProps, {
|
|
101
|
-
id: restProps.key
|
|
112
|
+
id: restProps.key,
|
|
113
|
+
scanLinkHost: scanLinkHost
|
|
102
114
|
})) : null;
|
|
103
115
|
};
|
|
104
116
|
case 'STAT_INFO_WITH_REDLINES':
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Button } from '@teamix/ui';
|
|
3
3
|
import { BaiscIconFont as Icon } from "../../icon-font";
|
|
4
|
-
import { replaceHostWithBase } from "../replaceHost";
|
|
4
|
+
import { replaceAppstack, replaceHostWithBase } from "../replaceHost";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* 按钮实现模板
|
|
8
8
|
*/
|
|
9
9
|
var LinkButton = function LinkButton(props) {
|
|
10
10
|
var url = props.params.url;
|
|
11
|
-
if (props.
|
|
11
|
+
if (props.name === '部署单详情') {
|
|
12
|
+
url = replaceAppstack(props.params.url, props.appStackHost);
|
|
13
|
+
} else if (props.reportLinkHost) {
|
|
12
14
|
url = replaceHostWithBase(props.params.url, props.reportLinkHost);
|
|
13
15
|
}
|
|
14
16
|
return /*#__PURE__*/React.createElement(Button, {
|
|
@@ -6,6 +6,19 @@ export var replaceHost = function replaceHost(url) {
|
|
|
6
6
|
return getUrlWithContextPath(path);
|
|
7
7
|
};
|
|
8
8
|
export var replaceHostWithBase = function replaceHostWithBase(url, newHost) {
|
|
9
|
+
var replaceUrls = ['testing.rdc.aliyun.com', 'flow.aliyun.com'];
|
|
9
10
|
var urlObj = new URL(url);
|
|
10
|
-
|
|
11
|
+
if (newHost && replaceUrls.some(function (item) {
|
|
12
|
+
return urlObj.host.includes(item);
|
|
13
|
+
})) {
|
|
14
|
+
return newHost + '/devops/getReport?reportPath=' + urlObj.pathname;
|
|
15
|
+
}
|
|
16
|
+
return url;
|
|
17
|
+
};
|
|
18
|
+
export var replaceAppstack = function replaceAppstack(url, newHost) {
|
|
19
|
+
var urlObj = new URL(url);
|
|
20
|
+
if (newHost) {
|
|
21
|
+
return newHost + urlObj.pathname;
|
|
22
|
+
}
|
|
23
|
+
return url;
|
|
11
24
|
};
|
|
@@ -7,7 +7,7 @@ import Avatar from "../../avatar";
|
|
|
7
7
|
import { BaiscIconFont } from "../../icon-font";
|
|
8
8
|
import intl from "../../../../../locale";
|
|
9
9
|
import "./index.scss";
|
|
10
|
-
import { replaceHost } from "../replaceHost";
|
|
10
|
+
import { replaceHost, replaceHostWithBase } from "../replaceHost";
|
|
11
11
|
import { CommonButton, StatInfoItem } from "../stat-info-s-common/common";
|
|
12
12
|
import confirmOpenReportDialog, { getTrustPipelineReportConfig } from "../stat-info-s-common/RememberConfirm";
|
|
13
13
|
var skippedOrOthers = function skippedOrOthers(stat) {
|
|
@@ -416,7 +416,8 @@ var StateInfoButton = function StateInfoButton(args) {
|
|
|
416
416
|
var data = args.data,
|
|
417
417
|
id = args.id,
|
|
418
418
|
name = args.name,
|
|
419
|
-
hasMore = args.hasMore
|
|
419
|
+
hasMore = args.hasMore,
|
|
420
|
+
scanLinkHost = args.scanLinkHost;
|
|
420
421
|
var statistic = JSON.parse(data);
|
|
421
422
|
if (statistic.QIXI) {
|
|
422
423
|
var url = statistic.QIXI.url;
|
|
@@ -439,7 +440,7 @@ var StateInfoButton = function StateInfoButton(args) {
|
|
|
439
440
|
}
|
|
440
441
|
var link = {
|
|
441
442
|
component: 'a',
|
|
442
|
-
href:
|
|
443
|
+
href: replaceHostWithBase(statistic._REPORT.url, scanLinkHost),
|
|
443
444
|
target: '_blank'
|
|
444
445
|
};
|
|
445
446
|
var prefix = hasMore ? name + " - " : '';
|
|
@@ -263,10 +263,10 @@ export var StatusBar = /*#__PURE__*/React.memo(function (props) {
|
|
|
263
263
|
className: "right"
|
|
264
264
|
}, /*#__PURE__*/React.createElement("ul", {
|
|
265
265
|
className: "info-list"
|
|
266
|
-
}, /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement(CommitsHistory, {
|
|
266
|
+
}, displayConfig.codeChange && /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement(CommitsHistory, {
|
|
267
267
|
sources: sources,
|
|
268
268
|
instance: instance
|
|
269
|
-
})), /*#__PURE__*/React.createElement("li", null, enablePackages && /*#__PURE__*/React.createElement(Packages, {
|
|
269
|
+
})), displayConfig.runningProduct && /*#__PURE__*/React.createElement("li", null, enablePackages && /*#__PURE__*/React.createElement(Packages, {
|
|
270
270
|
packages: packages
|
|
271
271
|
})), /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement(PipelineParams, {
|
|
272
272
|
dataSource: globalParams
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
3
3
|
var _excluded = ["loading", "onBuildNumberChange"];
|
|
4
|
-
import React, { useEffect, useState } from 'react';
|
|
4
|
+
import React, { useContext, useEffect, useState } from 'react';
|
|
5
5
|
import { Loading } from '@teamix/ui';
|
|
6
|
-
import exceed from "../../../utils/apimap";
|
|
7
6
|
import Loadable from "../../../utils/loadable";
|
|
8
7
|
import permissionUtil from "../../../utils/permissionUtil";
|
|
9
8
|
import intl from "../../../locale";
|
|
10
9
|
import "./index.scss";
|
|
10
|
+
import { GetLatestPipelineRun } from "../../../utils/api";
|
|
11
|
+
import ConfigContext from "../../../contexts/config";
|
|
11
12
|
var PipelineInstance = Loadable({
|
|
12
13
|
loader: function loader() {
|
|
13
14
|
return import("../../common/teambition/pipeline-instance-new");
|
|
@@ -43,19 +44,16 @@ var Current = function Current(_ref) {
|
|
|
43
44
|
var _useState4 = useState(false),
|
|
44
45
|
canEditPipeline = _useState4[0],
|
|
45
46
|
setCanEditPipeline = _useState4[1];
|
|
47
|
+
var globalConfig = useContext(ConfigContext);
|
|
48
|
+
var apiHost = globalConfig.replaceLinks.api;
|
|
46
49
|
var checkPipelinePermission = function checkPipelinePermission() {
|
|
47
50
|
permissionUtil.checkPermissionList([PERMISSION_PIPELINE_EXECUTE, PERMISSION_PIPELINE_EDIT], props.pipelineId, 'pipeline', window.AK_GLOBAL.currentUser.workid).then(function (data) {
|
|
48
51
|
setCanExecutePipeline(data[PERMISSION_PIPELINE_EXECUTE]);
|
|
49
52
|
setCanEditPipeline(data[PERMISSION_PIPELINE_EDIT]);
|
|
50
53
|
});
|
|
51
54
|
};
|
|
52
|
-
var
|
|
53
|
-
|
|
54
|
-
api: 'Pipeline.get.instance.latest',
|
|
55
|
-
params: {
|
|
56
|
-
pipelineId: pipelineId
|
|
57
|
-
}
|
|
58
|
-
}).then(function (res) {
|
|
55
|
+
var getLatestPipeline = function getLatestPipeline() {
|
|
56
|
+
GetLatestPipelineRun(pipelineId, apiHost).then(function (res) {
|
|
59
57
|
setLoading(false);
|
|
60
58
|
if (res.successful) {
|
|
61
59
|
var _res$object;
|
|
@@ -74,7 +72,6 @@ var Current = function Current(_ref) {
|
|
|
74
72
|
}, []);
|
|
75
73
|
useEffect(function () {
|
|
76
74
|
checkPipelinePermission();
|
|
77
|
-
getLatestPiepline();
|
|
78
75
|
}, [pipelineId]);
|
|
79
76
|
var flowInstVo = instance.flowInstVo;
|
|
80
77
|
if (parentLoading || loading) {
|
|
@@ -108,7 +105,7 @@ var Current = function Current(_ref) {
|
|
|
108
105
|
disabled: !canExecutePipeline || type,
|
|
109
106
|
notJump: true,
|
|
110
107
|
onRunPost: function onRunPost() {
|
|
111
|
-
return
|
|
108
|
+
return getLatestPipeline();
|
|
112
109
|
},
|
|
113
110
|
onRunPipeline: props.onRunPipeline
|
|
114
111
|
}))
|
|
@@ -121,7 +118,7 @@ var Current = function Current(_ref) {
|
|
|
121
118
|
disabled: !canExecutePipeline,
|
|
122
119
|
isAdmin: canEditPipeline,
|
|
123
120
|
onRefresh: function onRefresh() {
|
|
124
|
-
return
|
|
121
|
+
return getLatestPipeline();
|
|
125
122
|
},
|
|
126
123
|
isSystemPipeline: !!type
|
|
127
124
|
});
|
|
@@ -110,7 +110,7 @@ var Current = function Current(_ref) {
|
|
|
110
110
|
}),
|
|
111
111
|
disabled: !canExecutePipeline,
|
|
112
112
|
onRunPost: function onRunPost() {
|
|
113
|
-
return
|
|
113
|
+
return getLatestPipeline();
|
|
114
114
|
},
|
|
115
115
|
onRunPipeline: props.onRunPipeline,
|
|
116
116
|
notJump: true
|
|
@@ -125,7 +125,7 @@ var Current = function Current(_ref) {
|
|
|
125
125
|
disabled: !canExecutePipeline,
|
|
126
126
|
isAdmin: canEditPipeline,
|
|
127
127
|
onRefresh: function onRefresh() {
|
|
128
|
-
return
|
|
128
|
+
return getLatestPipeline();
|
|
129
129
|
},
|
|
130
130
|
displayConfig: props.displayConfig,
|
|
131
131
|
onPipelineStatusChanged: onPipelineStatusChanged,
|
package/es/contexts/config.d.ts
CHANGED
package/es/contexts/config.js
CHANGED
package/es/index.js
CHANGED
|
@@ -74,7 +74,7 @@ var enterFlowTrack = function enterFlowTrack() {
|
|
|
74
74
|
var lang = locale || window.FORCE && window.FORCE.locale || 'zh_CN';
|
|
75
75
|
var isEn = lang === 'en_US';
|
|
76
76
|
var setConfigDefault = function setConfigDefault(config) {
|
|
77
|
-
var keys = ['number', 'triggerMsg']; // 编号,触发信息
|
|
77
|
+
var keys = ['number', 'triggerMsg', 'codeChange', 'runningProduct']; // 编号,触发信息
|
|
78
78
|
return keys.reduce(function (pre, cur) {
|
|
79
79
|
pre[cur] = config && typeof config[cur] === 'boolean' ? config[cur] : true;
|
|
80
80
|
return pre;
|