Skip to content

Commit

Permalink
Bug: 流水线实例复制功能没有复制相应实例的参数值 issue TencentBlueKing#10580
Browse files Browse the repository at this point in the history
  • Loading branch information
lockiechen committed Aug 5, 2024
1 parent feceed5 commit 6d22fad
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,8 @@
},
copyAsTemplateInstance (pipeline) {
const pipelineName = (pipeline.pipelineName + '_copy').substring(0, 128)
const { templateId, projectId, templateVersion } = pipeline
window.top.location.href = `${location.origin}/console/pipeline/${projectId}/template/${templateId}/createInstance/${templateVersion}/${pipelineName}`
const { templateId, pipelineId, projectId, templateVersion } = pipeline
window.top.location.href = `${location.origin}/console/pipeline/${projectId}/template/${templateId}/createInstance/${templateVersion}/${pipelineName}?pipelineId=${pipelineId}`
},
afterRemovePipeline () {
this.$router.push({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -492,8 +492,8 @@ export default {
},
copyAsTemplateInstance (pipeline) {
const pipelineName = (pipeline.pipelineName + '_copy').substring(0, 128)
const { templateId, projectId, version } = pipeline
window.top.location.href = `${location.origin}/console/pipeline/${projectId}/template/${templateId}/createInstance/${version}/${pipelineName}`
const { templateId, pipelineId, projectId, version } = pipeline
window.top.location.href = `${location.origin}/console/pipeline/${projectId}/template/${templateId}/createInstance/${version}/${pipelineName}?pipelineId=${pipelineId}`
}
}
}
5 changes: 3 additions & 2 deletions src/frontend/devops-pipeline/src/views/template/instance.vue
Original file line number Diff line number Diff line change
Expand Up @@ -517,10 +517,11 @@
const route = {
name: 'createInstance',
params: {
projectId: this.projectId,
pipelineId: this.pipelineId,
curVersionId: this.currentVersionId,
pipelineName: (row.pipelineName + '_copy').substring(0, 128)
},
query: {
pipelineId: row.pipelineId
}
}
this.$router.push(route)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@
const hashVal = this.$route.hash.substr(1, this.$route.hash.length)
const pipeline = hashVal.split('&')
return pipeline
} else if (this.$route.query.pipelineId) {
return [this.$route.query.pipelineId]
}
return ''
}
Expand Down Expand Up @@ -309,13 +311,6 @@
},
async requestPipelineParams (pipeline, versionId) {
const { $store, loading } = this
const params = []
pipeline.forEach(item => {
params.push({
id: item
})
})
loading.isLoading = true
Expand All @@ -324,7 +319,9 @@
projectId: this.projectId,
templateId: this.templateId,
versionId: versionId,
params
params: pipeline.map(id => ({
id
}))
})
this.handlePipelineParams(res)
} catch (err) {
Expand Down

0 comments on commit 6d22fad

Please sign in to comment.