diff --git a/src/frontend/devops-pipeline/src/components/Stages/AtomList.vue b/src/frontend/devops-pipeline/src/components/Stages/AtomList.vue index 5b98de97e0f..b62c969d0bb 100755 --- a/src/frontend/devops-pipeline/src/components/Stages/AtomList.vue +++ b/src/frontend/devops-pipeline/src/components/Stages/AtomList.vue @@ -10,7 +10,7 @@ @click.stop="showPropertyPanel(index)" >
- + @@ -78,7 +78,10 @@ - {{ $t('editPage.addAtom') }} + + {{ $t('editPage.addAtom') }} + + @@ -633,7 +636,7 @@ margin-right: 6px; } } - + .quality-item { height: 24px; line-height: 20px; @@ -771,6 +774,15 @@ background-color: white; cursor: pointer; z-index: 3; + span { + width: 76%; + display: flex; + justify-content: space-between; + align-items: center; + } + .error-icon { + color: $iconFailColor; + } .add-plus-icon { @include add-plus-icon($fontLigtherColor, $fontLigtherColor, white, 18px, true); @include add-plus-icon-hover($primaryColor, $primaryColor, white); @@ -779,8 +791,7 @@ @extend .atom-item; position: static; border-style: dashed; - color: $borderWeightColor; - border-color: $borderWeightColor; + border-color: $dangerColor; border-width: 1px; .add-plus-icon { margin: 12px 13px; diff --git a/src/frontend/devops-pipeline/src/store/modules/atom/getters.js b/src/frontend/devops-pipeline/src/store/modules/atom/getters.js index 16d4e36b8a6..161f7f9556e 100755 --- a/src/frontend/devops-pipeline/src/store/modules/atom/getters.js +++ b/src/frontend/devops-pipeline/src/store/modules/atom/getters.js @@ -168,10 +168,11 @@ export default { let timerTriggerCount = 0 let remoteTriggerCount = 0 + if (pipelineSetting && !pipelineSetting.pipelineName) { throw new Error(window.pipelineVue.$i18n && window.pipelineVue.$i18n.t('settings.emptyPipelineName')) } - + if (pipelineSetting && pipelineSetting.buildNumRule && !/^[\w-{}() +?.:$"]{1,256}$/.test(pipelineSetting.buildNumRule)) { throw new Error(window.pipelineVue.$i18n && window.pipelineVue.$i18n.t('settings.correctBuildNumber')) } @@ -190,6 +191,16 @@ export default { const allContainers = getters.getAllContainers(stages) + // 当前所有插件element + const elementsMap = allContainers.reduce(function (prev, cur) { + prev.push(...cur.elements) + return prev + }, []) + + if (elementsMap.some(element => !element.atomCode)) { + throw new Error(window.pipelineVue.$i18n && window.pipelineVue.$i18n.t('storeMap.PleaseSelectAtom')) + } + if (allContainers.some(container => container.isError)) { throw new Error(window.pipelineVue.$i18n && window.pipelineVue.$i18n.t('storeMap.correctPipeline')) } diff --git a/src/frontend/locale/pipeline/en-US.json b/src/frontend/locale/pipeline/en-US.json index 81a5af4bb59..354a561eec9 100644 --- a/src/frontend/locale/pipeline/en-US.json +++ b/src/frontend/locale/pipeline/en-US.json @@ -894,6 +894,7 @@ "jobLimit": "单个stage下的job数量不能大于", "atomLimit": "单个job下的插件数量不能大于", "correctPipeline": " Please enter the correct pipeline", + "PleaseSelectAtom": "Please select the Atom first", "oneCodecc": " Only one codecc plugin is allowed added to pipeline", "oneManualTrigger": " Only one manually-triggered plugin can exist in pipeline", "oneTimerTrigger": " Only one timer-triggered plugin can exist in pipeline ", diff --git a/src/frontend/locale/pipeline/zh-CN.json b/src/frontend/locale/pipeline/zh-CN.json index 5b040b7fc0f..fc967a9d972 100644 --- a/src/frontend/locale/pipeline/zh-CN.json +++ b/src/frontend/locale/pipeline/zh-CN.json @@ -897,6 +897,7 @@ "jobLimit": "单个stage下的job数量不能大于", "atomLimit": "单个job下的插件数量不能大于", "correctPipeline": "请输入正确的流水线", + "PleaseSelectAtom": "请先选择插件", "oneCodecc": "只允许一个代码扫描插件", "oneManualTrigger": "流水线不允许超过一个手动触发插件", "oneTimerTrigger": "流水线不允许超过一个定时触发插件",