Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: project pipeline table add source file field #4135

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions conf/dop/i18n/cp/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,8 @@ zh:
exitProjectConfirm: 退出当前项目后,将不再有项目协作权限,如要再次加入需要项目管理员邀请,请确认是否退出?
searchAppName: 搜索应用名
unfinishedIssue: 未完成的事项
sourceFile: 源文件

en:
issue-manage: issue manage
issue: issue
Expand Down Expand Up @@ -628,3 +630,4 @@ en:
exitProjectConfirm: After exiting the current project, you will no longer have project collaboration permission. If you want to join again, you need to be invited by the project administrator. Are you sure you want to exit?
searchAppName: Search app name
unfinishedIssue: Unfinished issue
sourceFile: source file
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ type PipelineTable struct {
}

const (
ColumnPipelineName table.ColumnKey = "pipeline"
ColumnPipelineName table.ColumnKey = "pipelineName"
ColumnPipeline table.ColumnKey = "pipeline"
ColumnPipelineStatus table.ColumnKey = "pipelineStatus"
ColumnCostTime table.ColumnKey = "costTime"
ColumnApplicationName table.ColumnKey = "applicationName"
Expand All @@ -76,6 +77,7 @@ const (
ColumnPipelineID table.ColumnKey = "pipelineID"
ColumnMoreOperations table.ColumnKey = "moreOperations"
ColumnSource table.ColumnKey = "source"
ColumnSourceFile table.ColumnKey = "sourceFile"
ColumnProcess table.ColumnKey = "process"
ColumnIcon table.ColumnKey = "icon"

Expand Down Expand Up @@ -132,9 +134,10 @@ func (p *PipelineTable) RegisterInitializeOp() (opFunc cptype.OperationFunc) {
func (p *PipelineTable) SetTableColumns() table.ColumnsInfo {
return table.ColumnsInfo{
Merges: map[table.ColumnKey]table.MergedColumn{
ColumnSource: {[]table.ColumnKey{ColumnApplicationName, ColumnIcon, ColumnBranch}},
ColumnSource: {[]table.ColumnKey{ColumnApplicationName, ColumnIcon, ColumnBranch}},
ColumnPipeline: {[]table.ColumnKey{ColumnPipelineName, ColumnSourceFile}},
},
Orders: []table.ColumnKey{ColumnPipelineName, ColumnSource, ColumnPipelineStatus, ColumnProcess, ColumnCostTime,
Orders: []table.ColumnKey{ColumnPipeline, ColumnSource, ColumnSourceFile, ColumnPipelineStatus, ColumnProcess, ColumnCostTime,
ColumnExecutor, ColumnStartTime, ColumnCreateTime, ColumnCreator, ColumnPipelineID, ColumnMoreOperations},
ColumnsMap: map[table.ColumnKey]table.Column{
ColumnPipelineName: {Title: cputil.I18n(p.sdk.Ctx, string(ColumnPipelineName))},
Expand All @@ -150,7 +153,9 @@ func (p *PipelineTable) SetTableColumns() table.ColumnsInfo {
ColumnPipelineID: {Title: cputil.I18n(p.sdk.Ctx, string(ColumnPipelineID)), Hidden: true},
ColumnCreateTime: {Title: cputil.I18n(p.sdk.Ctx, string(ColumnCreateTime)), EnableSort: true, Hidden: true},
ColumnSource: {Title: cputil.I18n(p.sdk.Ctx, string(ColumnSource))},
ColumnSourceFile: {Title: cputil.I18n(p.sdk.Ctx, string(ColumnSourceFile))},
ColumnIcon: {Title: cputil.I18n(p.sdk.Ctx, string(ColumnIcon))},
ColumnPipeline: {Title: cputil.I18n(p.sdk.Ctx, string(ColumnPipeline))},
},
}
}
Expand Down Expand Up @@ -383,6 +388,9 @@ func (p *PipelineTable) SetTableRows() []table.Row {
ColumnMoreOperations: table.NewMoreOperationsCell(commodel.MoreOperations{
Ops: p.SetTableMoreOpItem(v, definitionYmlSourceMap, ymlSourceMapCronMap),
}).Build(),
ColumnSourceFile: table.NewTextCell(func() string {
return v.FileName
}()).Build(),
ColumnIcon: table.NewIconCell(commodel.Icon{
Type: "branch",
}).Build(),
Expand Down