From 84b74a00a0f6ea7d65b2dc339b111b3edea9b565 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Wed, 22 May 2024 17:09:40 +0800 Subject: [PATCH] + Add tips for gitea and gogs mr. --- module/mr/control.php | 2 +- module/mr/lang/de.php | 1 + module/mr/lang/en.php | 1 + module/mr/lang/fr.php | 1 + module/mr/lang/zh-cn.php | 1 + module/mr/ui/actions.html.php | 2 ++ 6 files changed, 7 insertions(+), 1 deletion(-) diff --git a/module/mr/control.php b/module/mr/control.php index 9136ffb170..12e276a01c 100644 --- a/module/mr/control.php +++ b/module/mr/control.php @@ -331,8 +331,8 @@ class mr extends control $this->view->title = $this->lang->mr->view; $this->view->MR = $MR; - $this->view->repoID = $MR->repoID; $this->view->rawMR = isset($rawMR) ? $rawMR : false; + $this->view->repo = $this->loadModel('repo')->getByID($MR->repoID); $this->view->reviewer = $this->loadModel('user')->getById($MR->assignee); $this->view->actions = $this->loadModel('action')->getList('mr', $MRID); $this->view->compile = $compile; diff --git a/module/mr/lang/de.php b/module/mr/lang/de.php index 793ad8f6cc..c378b7e590 100644 --- a/module/mr/lang/de.php +++ b/module/mr/lang/de.php @@ -77,6 +77,7 @@ $lang->mr->acceptTip = 'Please approve this MR before merge'; $lang->mr->conflictsTip = 'This merge request has conflicts, cannot be merged'; $lang->mr->noChangesTip = 'Source branch and target branch have no changes, cannot be merged'; $lang->mr->compileTip = 'This merge request pipeline build is not successful, cannot be merged'; +$lang->mr->notifyTip = 'This merge request has conflicts or no changes, cannot be merged'; $lang->mr->branchUpdateTip = 'Branch has been updated, execute pipeline'; $lang->mr->repeatedOperation = 'Do not repeat operations'; diff --git a/module/mr/lang/en.php b/module/mr/lang/en.php index 6042f8dcd1..32e66263d3 100644 --- a/module/mr/lang/en.php +++ b/module/mr/lang/en.php @@ -81,6 +81,7 @@ $lang->mr->acceptTip = 'Please approve this MR before merge'; $lang->mr->conflictsTip = 'This merge request has conflicts, cannot be merged'; $lang->mr->noChangesTip = 'Source branch and target branch have no changes, cannot be merged'; $lang->mr->compileTip = 'This merge request pipeline build is not successful, cannot be merged'; +$lang->mr->notifyTip = 'This merge request has conflicts or no changes, cannot be merged'; $lang->mr->branchUpdateTip = 'Branch has been updated, execute pipeline'; $lang->mr->repeatedOperation = 'Do not repeat operations'; diff --git a/module/mr/lang/fr.php b/module/mr/lang/fr.php index 2a4a36c8a7..7e94abfb59 100644 --- a/module/mr/lang/fr.php +++ b/module/mr/lang/fr.php @@ -77,6 +77,7 @@ $lang->mr->acceptTip = 'Please approve this MR before merge'; $lang->mr->conflictsTip = 'This merge request has conflicts, cannot be merged'; $lang->mr->noChangesTip = 'Source branch and target branch have no changes, cannot be merged'; $lang->mr->compileTip = 'This merge request pipeline build is not successful, cannot be merged'; +$lang->mr->notifyTip = 'This merge request has conflicts or no changes, cannot be merged'; $lang->mr->branchUpdateTip = 'Branch has been updated, execute pipeline'; $lang->mr->repeatedOperation = 'Do not repeat operations'; diff --git a/module/mr/lang/zh-cn.php b/module/mr/lang/zh-cn.php index 6ab7b20d2e..7955254114 100644 --- a/module/mr/lang/zh-cn.php +++ b/module/mr/lang/zh-cn.php @@ -81,6 +81,7 @@ $lang->mr->acceptTip = '评审通过后才能合并'; $lang->mr->conflictsTip = '该合并请求存在冲突,无法评审通过'; $lang->mr->noChangesTip = '源分支与目标分支没有变化,无法评审通过'; $lang->mr->compileTip = '该合并请求流水线构建未成功,无法评审通过'; +$lang->mr->notifyTip = '存在冲突或分支间没有变化,无法评审通过'; $lang->mr->branchUpdateTip = '分支有更新,可执行流水线'; $lang->mr->repeatedOperation = '请勿重复操作'; diff --git a/module/mr/ui/actions.html.php b/module/mr/ui/actions.html.php index ae056d0f1a..b77c99f57a 100644 --- a/module/mr/ui/actions.html.php +++ b/module/mr/ui/actions.html.php @@ -53,6 +53,8 @@ foreach($config->mr->view->operateList as $operate) if($compileNotSuccess) $action['hint'] = $lang->mr->compileTip; if($hasNoChange) $action['hint'] = $lang->mr->noChangesTip; if($hasConflict) $action['hint'] = $lang->mr->conflictsTip; + + if(in_array(strtolower($repo->SCM), array('gogs', 'gitea'))) $action['hint'] = $lang->mr->notifyTip; } } }