@devops-flow/devops-flow-pipeline-detail 0.0.48 → 0.0.50

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.
Binary file
@@ -40,7 +40,7 @@ export var PipelineJobs = /*#__PURE__*/React.memo(function (props) {
40
40
  var stageIds = instance.stageGroup.flat();
41
41
  jobsInAllStages = stageIds.map(function (stageId) {
42
42
  var stageName = stages[stageId].name;
43
- var jobsInThisStage = stages[stageId].components.map(function (job) {
43
+ var jobsInThisStage = stages[stageId].stageInfo.jobs.map(function (job) {
44
44
  var depsObj = JSON.parse(job.deps || '[]');
45
45
  return {
46
46
  id: job.jobSign,
@@ -9,6 +9,7 @@ export function transformOldPipelineRun(flowInstVo) {
9
9
  var oldStageItem = flowInstVo.stages[oldStageId];
10
10
  // A: 老版一个 stage 中的若干 component (job), 具有先后依赖的关系
11
11
  var oldStageJobsNode = oldStageItem.stageInfo.jobs.map(function (job, index, ary) {
12
+ var _job$actions$;
12
13
  var isFirst = index === 0;
13
14
  var dependsOn;
14
15
  if (isFirst) {
@@ -25,7 +26,7 @@ export function transformOldPipelineRun(flowInstVo) {
25
26
  stageId: oldGroup.id,
26
27
  stageName: stageName,
27
28
  job: job,
28
- switchManual: index === 0 && job.actions && job.actions[0].type == "ExecutePipelineJobRun"
29
+ switchManual: index === 0 && (job === null || job === void 0 ? void 0 : (_job$actions$ = job.actions[0]) === null || _job$actions$ === void 0 ? void 0 : _job$actions$.type) === 'ExecutePipelineJobRun'
29
30
  }
30
31
  };
31
32
  });
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { Result } from '@teamix/ui';
3
3
  import { Perf } from '@alife/yunxiao-common';
4
4
  import "./index.scss";
5
+ import none from "../../../../assets/img-src/none.png";
5
6
  var MessagePage = function MessagePage(_ref) {
6
7
  var title = _ref.title,
7
8
  message = _ref.message,
@@ -9,7 +10,7 @@ var MessagePage = function MessagePage(_ref) {
9
10
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Result, {
10
11
  title: title,
11
12
  desc: message,
12
- img: 'none',
13
+ img: none,
13
14
  size: "medium",
14
15
  className: "message-page",
15
16
  extra: extra
@@ -8,6 +8,36 @@
8
8
 
9
9
  .message-page {
10
10
  margin-top: 100px;
11
+
12
+ &>.container {
13
+ display: flex;
14
+ flex-direction: column;
15
+ align-items: center;
16
+
17
+ &>.image {
18
+ width: 200px;
19
+ height: 200px;
20
+ margin: 0;
21
+
22
+ &>img {
23
+ width: 100%;
24
+ height: 100%;
25
+ }
26
+ }
27
+
28
+ &>.info {
29
+ text-align: center;
30
+
31
+ &>.title {
32
+ font-size: 18px;
33
+ color: var(--color-text1-4,#292929);
34
+ }
35
+ &>.desc {
36
+ font-size: 14px;
37
+ color: var(--color-text-light, #999);
38
+ }
39
+ }
40
+ }
11
41
  }
12
42
 
13
43
  .error-page {
@@ -303,7 +303,7 @@ var PipelineInstance = function PipelineInstance(props) {
303
303
  onDoubleClick: function onDoubleClick() {
304
304
  return console.log(instance);
305
305
  }
306
- }, "#", instance.instNumber), /*#__PURE__*/React.createElement(StatusAbleLabel, {
306
+ }, "#", instance.pipelineRunId), /*#__PURE__*/React.createElement(StatusAbleLabel, {
307
307
  withIcon: true,
308
308
  status: instance.status,
309
309
  resultStatus: instance.resultStatus
@@ -22,7 +22,8 @@ export var StatusBar = /*#__PURE__*/React.memo(function (props) {
22
22
  packages = props.packages,
23
23
  globalParams = props.globalParams,
24
24
  sources = props.sources,
25
- haveHistoryPip = props.haveHistoryPip;
25
+ haveHistoryPip = props.haveHistoryPip,
26
+ displayConfig = props.displayConfig;
26
27
 
27
28
  // appstack中支持mini和detail两种模式,默认mini
28
29
  var _useState = useState(!window.__isEmbedInAppstack || getLocalStorageCache('FLOW_PIPELINE_RUN_DETAIL_VISIBLE') === true),
@@ -36,12 +37,12 @@ export var StatusBar = /*#__PURE__*/React.memo(function (props) {
36
37
  className: PREFIX + "__status_mini " + (haveHistoryPip ? PREFIX + "__status_haveHistory" : '')
37
38
  }, !detailVisible && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
38
39
  className: "label-wrap"
39
- }, /*#__PURE__*/React.createElement("span", {
40
+ }, displayConfig.number && /*#__PURE__*/React.createElement("span", {
40
41
  className: "build-num",
41
42
  onDoubleClick: function onDoubleClick() {
42
43
  return console.log(instance);
43
44
  }
44
- }, "#", instance.instNumber), /*#__PURE__*/React.createElement("span", {
45
+ }, "#", instance.pipelineRunId), /*#__PURE__*/React.createElement("span", {
45
46
  className: "status-label " + instance.status.toLowerCase()
46
47
  }, /*#__PURE__*/React.createElement(StatusIcon, {
47
48
  status: instance.status,
@@ -171,12 +172,12 @@ export var StatusBar = /*#__PURE__*/React.memo(function (props) {
171
172
  }
172
173
  }, /*#__PURE__*/React.createElement("div", {
173
174
  className: "label-wrap"
174
- }, /*#__PURE__*/React.createElement("span", {
175
+ }, displayConfig.number && /*#__PURE__*/React.createElement("span", {
175
176
  className: "build-num",
176
177
  onDoubleClick: function onDoubleClick() {
177
178
  return console.log(instance);
178
179
  }
179
- }, "#", instance.instNumber), /*#__PURE__*/React.createElement("span", {
180
+ }, "#", instance.pipelineRunId), /*#__PURE__*/React.createElement("span", {
180
181
  className: "status-label " + instance.status.toLowerCase()
181
182
  }, /*#__PURE__*/React.createElement(StatusIcon, {
182
183
  status: instance.status,
@@ -203,7 +204,7 @@ export var StatusBar = /*#__PURE__*/React.memo(function (props) {
203
204
  defaultMessage: '取消运行'
204
205
  })))), /*#__PURE__*/React.createElement("div", {
205
206
  className: "info-wrap"
206
- }, /*#__PURE__*/React.createElement("span", {
207
+ }, displayConfig.triggerMsg && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
207
208
  className: "info-label"
208
209
  }, intl.get({
209
210
  id: 'rdc-tb-cd-assets.teambition.pipeline-instance-new.StatusBar.TriggerInformation',
@@ -215,7 +216,7 @@ export var StatusBar = /*#__PURE__*/React.memo(function (props) {
215
216
  }), /*#__PURE__*/React.createElement(Divider, {
216
217
  direction: "ver",
217
218
  className: "info-divider"
218
- }), /*#__PURE__*/React.createElement("span", {
219
+ })), /*#__PURE__*/React.createElement("span", {
219
220
  className: "info-label"
220
221
  }, intl.get({
221
222
  id: 'rdc-tb-cd-assets.teambition.pipeline-instance-new.StatusBar.StartTime',
@@ -2,7 +2,6 @@
2
2
  import React, { useState, useCallback } from 'react';
3
3
  import dayjs from 'dayjs';
4
4
  import relativeTime from 'dayjs/plugin/relativeTime';
5
- // import CommitsHistory from './commits';
6
5
  import intl from "../../../../locale";
7
6
  import { Perf } from '@alife/yunxiao-common';
8
7
  import "./index.scss";
@@ -10,34 +9,7 @@ import { PREFIX } from "./constants";
10
9
  import { StatusBar } from "./StatusBar";
11
10
  import { SourceElement } from "./SourceElement";
12
11
  import InstanceFlow from "../flow-new";
13
-
14
- // const InstanceFlow = Loadable({
15
- // loader: () => import('../flow-new'),
16
- // });
17
-
18
12
  dayjs.extend(relativeTime);
19
- // 定时器
20
- var interval;
21
- var timer;
22
- function fixDataFlow(branchRepoInfo, sourcesObj) {
23
- var branchRepoInfoObj = JSON.parse(branchRepoInfo);
24
- sourcesObj.forEach(function (ele) {
25
- var matchedBranch = branchRepoInfoObj.find(function (it) {
26
- return it.sign === ele.sign;
27
- });
28
- if (matchedBranch && !ele.data.aoneFlow) {
29
- if (matchedBranch.featureBranchs) {
30
- matchedBranch.featureBranchs.forEach(
31
- // eslint-disable-next-line no-return-assign
32
- function (it) {
33
- return it.status = 'INTEGRATING';
34
- });
35
- }
36
- ele.data.branch = '--';
37
- ele.data.aoneFlow = JSON.stringify(matchedBranch);
38
- }
39
- });
40
- }
41
13
  var PipelineInstance = function PipelineInstance(props) {
42
14
  var pipelineId = props.pipelineId,
43
15
  disabled = props.disabled,
@@ -49,7 +21,8 @@ var PipelineInstance = function PipelineInstance(props) {
49
21
  noPadding = _props$noPadding === void 0 ? false : _props$noPadding,
50
22
  haveHistoryPip = props.haveHistoryPip,
51
23
  onRefresh = props.onRefresh,
52
- instance = props.instance;
24
+ instance = props.instance,
25
+ displayConfig = props.displayConfig;
53
26
  var _useState = useState(false),
54
27
  releaseInfoVisible = _useState[0],
55
28
  setReleaseInfoVisible = _useState[1];
@@ -107,7 +80,8 @@ var PipelineInstance = function PipelineInstance(props) {
107
80
  packages: packages,
108
81
  globalParams: globalParams,
109
82
  sources: sources,
110
- haveHistoryPip: haveHistoryPip
83
+ haveHistoryPip: haveHistoryPip,
84
+ displayConfig: displayConfig
111
85
  }), /*#__PURE__*/React.createElement("div", {
112
86
  className: PREFIX + " " + (noPadding ? 'no-padding' : '')
113
87
  }, /*#__PURE__*/React.createElement("div", {
@@ -121,6 +121,7 @@ $status-height: 78px;
121
121
  color: var(--color-text1-4, #292929);
122
122
  line-height: 24px;
123
123
  font-weight: 500;
124
+ margin-right: 8px;
124
125
  }
125
126
  .cancel-btn {
126
127
  margin-left: 12px;
@@ -144,7 +145,6 @@ $status-height: 78px;
144
145
  line-height: 32px;
145
146
  border-radius: 4px;
146
147
  font-size: 14px;
147
- margin-left: 12px;
148
148
  align-items: center;
149
149
  &-icon {
150
150
  flex: none;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- declare const TBDetailMain: ({ loading, type, pipelineId, pipelineRunId, onRunPipeline, onBuildNumberChange, changeConfig, onPipelineStatusChanged, haveHistoryPip, }: {
2
+ declare const TBDetailMain: ({ loading, type, pipelineId, pipelineRunId, onRunPipeline, onBuildNumberChange, changeConfig, onPipelineStatusChanged, haveHistoryPip, displayConfig }: {
3
3
  loading: any;
4
4
  type: any;
5
5
  pipelineId: any;
@@ -9,5 +9,6 @@ declare const TBDetailMain: ({ loading, type, pipelineId, pipelineRunId, onRunPi
9
9
  changeConfig: any;
10
10
  onPipelineStatusChanged: any;
11
11
  haveHistoryPip: any;
12
+ displayConfig: any;
12
13
  }) => JSX.Element;
13
14
  export default TBDetailMain;
@@ -15,7 +15,8 @@ var TBDetailMain = function TBDetailMain(_ref) {
15
15
  onBuildNumberChange = _ref.onBuildNumberChange,
16
16
  changeConfig = _ref.changeConfig,
17
17
  onPipelineStatusChanged = _ref.onPipelineStatusChanged,
18
- haveHistoryPip = _ref.haveHistoryPip;
18
+ haveHistoryPip = _ref.haveHistoryPip,
19
+ displayConfig = _ref.displayConfig;
19
20
  return /*#__PURE__*/React.createElement(Suspense, {
20
21
  fallback: /*#__PURE__*/React.createElement(React.Fragment, null)
21
22
  }, /*#__PURE__*/React.createElement(Recent, {
@@ -24,6 +25,7 @@ var TBDetailMain = function TBDetailMain(_ref) {
24
25
  pipelineId: pipelineId,
25
26
  pipelineRunId: pipelineRunId,
26
27
  haveHistoryPip: haveHistoryPip,
28
+ displayConfig: displayConfig,
27
29
  onBuildNumberChange: onBuildNumberChange,
28
30
  onRunPipeline: onRunPipeline,
29
31
  changeConfig: changeConfig,
@@ -127,6 +127,7 @@ var Current = function Current(_ref) {
127
127
  onRefresh: function onRefresh() {
128
128
  return getLatestPiepline();
129
129
  },
130
+ displayConfig: props.displayConfig,
130
131
  onPipelineStatusChanged: onPipelineStatusChanged,
131
132
  haveHistoryPip: haveHistoryPip
132
133
  });
package/es/index.js CHANGED
@@ -73,10 +73,18 @@ var enterFlowTrack = function enterFlowTrack() {
73
73
  };
74
74
  var lang = locale || window.FORCE && window.FORCE.locale || 'zh_CN';
75
75
  var isEn = lang === 'en_US';
76
+ var setConfigDefault = function setConfigDefault(config) {
77
+ var keys = ['number', 'triggerMsg']; // 编号,触发信息
78
+ return keys.reduce(function (pre, cur) {
79
+ pre[cur] = config && typeof config[cur] === 'boolean' ? config[cur] : true;
80
+ return pre;
81
+ }, {});
82
+ };
76
83
  var App = function App(props) {
77
84
  var pipelineId = props.pipelineId,
78
85
  pipelineRunId = props.pipelineRunId,
79
- apiHost = props.apiHost;
86
+ apiHost = props.apiHost,
87
+ displayConfig = props.displayConfig;
80
88
  return /*#__PURE__*/React.createElement(ConfigProvider, {
81
89
  locale: isEn ? enUS : zhCN
82
90
  }, /*#__PURE__*/React.createElement(ConfigContext.Provider, {
@@ -88,6 +96,7 @@ var App = function App(props) {
88
96
  }, /*#__PURE__*/React.createElement(AsyncDetail, {
89
97
  pipelineId: pipelineId,
90
98
  pipelineRunId: pipelineRunId,
99
+ displayConfig: setConfigDefault(displayConfig),
91
100
  location: window.location
92
101
  }))));
93
102
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devops-flow/devops-flow-pipeline-detail",
3
- "version": "0.0.48",
3
+ "version": "0.0.50",
4
4
  "description": "flow 流水线详情",
5
5
  "medusaName": "rdc-tb-cd-assets",
6
6
  "main": "dist/PipelineFlowDetail.js",