Skip to content

Commit

Permalink
Merge pull request #434 from netresj/feature_select_commitid
Browse files Browse the repository at this point in the history
コミットidを選択する際に、コミッター、コメントを表示するように変更
  • Loading branch information
ozota1 committed Dec 21, 2020
2 parents 9388315 + 27fcd93 commit 9fdc7b2
Showing 1 changed file with 37 additions and 1 deletion.
38 changes: 37 additions & 1 deletion web-pages/src/components/selector/KqiGitSelector.vue
Expand Up @@ -129,7 +129,13 @@
<el-option
v-for="item in commits"
:key="item.commitId"
:label="item.commitId"
:label="
createCommitIdAndComment(
item.commitId,
item.committerName,
item.comment,
)
"
:value="item"
/>
</el-select>
Expand Down Expand Up @@ -326,6 +332,36 @@ export default {
}
this.$emit('input', gitModel)
},
// コミットidとコミットメッセージを組み合わせたメッセージを生成する
createCommitIdAndComment(commitId, committerName, comment) {
if (comment === null || comment.length === 0) {
return (
commitId.slice(0, 10) +
',,, (コミッター:' +
committerName +
', コメント: なし)'
)
} else if (comment.length <= 20) {
return (
commitId.slice(0, 10) +
',,, (コミッター:' +
committerName +
', コメント: ' +
comment +
')'
)
} else {
return (
commitId.slice(0, 10) +
',,, (コミッター:' +
committerName +
', コメント: ' +
comment.slice(0, 20) +
',,,)'
)
}
},
},
}
</script>
Expand Down

0 comments on commit 9fdc7b2

Please sign in to comment.