From c27f706ab7466020255f2cf4153aa3f078eb493b Mon Sep 17 00:00:00 2001 From: yazhou Date: Fri, 11 Aug 2023 16:24:14 +0800 Subject: [PATCH] fix: fix jenkins user admin log Signed-off-by: yazhou --- .../Pipelines/Detail/Activity/index.jsx | 15 ++++++++++++++- .../containers/Pipelines/Detail/Branch/index.jsx | 8 +------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/pages/devops/containers/Pipelines/Detail/Activity/index.jsx b/src/pages/devops/containers/Pipelines/Detail/Activity/index.jsx index 90ec69e43a9..efddd629af4 100644 --- a/src/pages/devops/containers/Pipelines/Detail/Activity/index.jsx +++ b/src/pages/devops/containers/Pipelines/Detail/Activity/index.jsx @@ -291,7 +291,20 @@ export default class Activity extends React.Component { title: t('LAST_MESSAGE'), dataIndex: 'causes', width: '25%', - render: causes => get(causes, '[0].shortDescription', ''), + render: (causes, record) => { + let message = get(causes, '[0].shortDescription', '') + const creator = get( + record, + '_originData.metadata.annotations["devops.kubesphere.io/creator"]' + ) + if (!creator) { + return message + } + if (message === 'Started by user admin') { + message = message.replace('user admin', `user ${creator}`) + } + return message + }, }, { title: t('DURATION'), diff --git a/src/pages/devops/containers/Pipelines/Detail/Branch/index.jsx b/src/pages/devops/containers/Pipelines/Detail/Branch/index.jsx index d77a0158839..524628c2952 100644 --- a/src/pages/devops/containers/Pipelines/Detail/Branch/index.jsx +++ b/src/pages/devops/containers/Pipelines/Detail/Branch/index.jsx @@ -16,7 +16,7 @@ * along with KubeSphere Console. If not, see . */ -import { result, get, omit, isEmpty } from 'lodash' +import { get, omit, isEmpty } from 'lodash' import React from 'react' import { toJS } from 'mobx' import { observer, inject } from 'mobx-react' @@ -177,12 +177,6 @@ export default class Branch extends React.Component { width: '20%', render: weatherScore => , }, - { - title: t('LAST_MESSAGE'), - dataIndex: 'latestRun', - width: '20%', - render: latestRun => result(latestRun, 'causes[0].shortDescription', '-'), - }, { title: t('UPDATE_TIME_TCAP'), dataIndex: 'updateTime',