Skip to content

Commit

Permalink
【PAC】feat:新增代码库详情页 #8118
Browse files Browse the repository at this point in the history
  • Loading branch information
mingshewhe committed Oct 30, 2023
1 parent 573d44d commit 6fa553c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,8 @@ enum class CodeEventType {
SHELVE_COMMIT,
SHELVE_DELETE,
SHELVE_SUBMIT;

companion object {
const val MESSAGE_CODE_PREFIX = "EVENT_TYPE"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ class RepoPipelineRefDao {
ids: List<Long>
): List<TRepositoryPipelineRefRecord> {
return with(TRepositoryPipelineRef.T_REPOSITORY_PIPELINE_REF) {
dslContext.selectFrom(this).where(ID.`in`(ids)).fetch()
dslContext.selectFrom(this).where(ID.`in`(ids)).orderBy(EVENT_TYPE.desc()).fetch()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import com.tencent.devops.common.api.util.JsonUtil
import com.tencent.devops.common.client.Client
import com.tencent.devops.common.pipeline.pojo.element.ElementProp
import com.tencent.devops.common.pipeline.pojo.element.ElementPropType
import com.tencent.devops.common.pipeline.pojo.element.trigger.enums.CodeEventType
import com.tencent.devops.common.web.utils.I18nUtil
import com.tencent.devops.repository.constant.RepositoryMessageCode.TRIGGER_CONDITION_PREFIX
import com.tencent.devops.repository.dao.RepoPipelineRefDao
Expand Down Expand Up @@ -227,7 +228,10 @@ class RepoPipelineService @Autowired constructor(
repositoryHashId = HashUtil.encodeOtherLongId(it.repositoryId),
atomCode = it.atomCode,
triggerType = it.triggerType,
eventType = it.eventType,
eventType = I18nUtil.getCodeLanMessage(
messageCode = "${CodeEventType.MESSAGE_CODE_PREFIX}_${it.eventType}",
defaultMessage = it.eventType,
),
taskParams = JsonUtil.to(it.taskParams, object : TypeReference<Map<String, Any>>() {}),
triggerCondition = it.triggerCondition?.let { condition ->
translateCondition(condition)
Expand Down
2 changes: 1 addition & 1 deletion support-files/i18n/repository/message_zh_CN.properties
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ trigger.condition.fromBranches=来源分支
trigger.condition.includeSourceBranchName=源分支
trigger.condition.excludeSourceBranchName=排除的源分支
trigger.condition.relativePath=相对路径
trigger.condition.includeCrState=CR状态
trigger.condition.includeCrState=评审状态
trigger.condition.includeCrState.approving=评审中
trigger.condition.includeCrState.approved=评审通过
trigger.condition.includeCrState.change_denied=评审被拒绝
Expand Down

0 comments on commit 6fa553c

Please sign in to comment.