From 74a6afbcae1d995367a34154692948096648bc76 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Thu, 5 Sep 2024 17:29:06 +0800 Subject: [PATCH] * [refac] delete unused code. --- .../test/lib/linkstory.ui.class.php | 35 -------------- module/testtask/model.php | 48 ------------------- module/tutorial/config/guides.php | 36 -------------- module/tutorial/model.php | 15 ------ 4 files changed, 134 deletions(-) delete mode 100644 module/tutorial/config/guides.php diff --git a/module/productplan/test/lib/linkstory.ui.class.php b/module/productplan/test/lib/linkstory.ui.class.php index 08ffc3a5ab..e50c32177d 100644 --- a/module/productplan/test/lib/linkstory.ui.class.php +++ b/module/productplan/test/lib/linkstory.ui.class.php @@ -56,39 +56,4 @@ class linkStoryTester extends tester $viewPage = $this->initForm('productplan', 'view', $planID, 'appIframe-product'); return ($viewPage->dom->checkInfoStory === false) ? $this->success('移除全部需求成功') : $this->failed('移除全部需求失败'); } - /** - * 移除单个需求 - * unlink story - * - * @param $planID - * @return mixed - */ - public function unLinkStory($planID) - { - $form = $this->initForm('productplan', 'view', $planID, 'appIframe-product'); - $linkNum = (int) explode(' ', $form->dom->linkNum->getText())[1];//计划当前关联的需求数 - $form->dom->unlinkFirBtn->click();//移除第一个需求 - $form->wait(1); - $form->dom->confirm->click();//弹窗中点确认 - $form->wait(1); - $viewPage = $this->initForm('productplan', 'view', $planID, 'appIframe-product'); - $linkNumAfter = (int) explode(' ', $viewPage->dom->linkNum->getText())[1];//计划移除需求后,关联的需求数 - return ($linkNum -1 == $linkNumAfter) ? $this->success('移除单个需求成功') : $this->failed('移除单个需求失败'); - } - /** - * 移除全部需求 - * unlink allstory - * - * @param $planID - * @return mixed - */ - public function unLinkAllStory($planID) - { - $form = $this->initForm('productplan', 'view', $planID, 'appIframe-product'); - $form->wait(1); - $form->dom->selectAllLink->click();//全选需求 - $form->dom->btn($this->lang->productplan->unlinkStoryAB)->click();//点击移除 - $viewPage = $this->initForm('productplan', 'view', $planID, 'appIframe-product'); - return ($viewPage->dom->checkInfo === false) ? $this->success('移除全部需求成功') : $this->failed('移除全部需求失败'); - } } diff --git a/module/testtask/model.php b/module/testtask/model.php index bb684d3c74..ba57f75e71 100755 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -1098,54 +1098,6 @@ class testtaskModel extends model return array($runs, $scenes); } - /** - * 获取用例以及场景数据。 - * Get cases with scenes data. - * - * @param int $productID - * @param array $runs - * @access public - * @return array - */ - public function getSceneCases($productID, $runs) - { - $scenes = $this->dao->select('*')->from(TABLE_SCENE) - ->where('deleted')->eq('0') - ->andWhere('product')->eq($productID) - ->orderBy('grade_desc, sort_asc') - ->fetchAll('id'); - - $displayScenes = array(); - foreach($runs as $run) - { - if(!empty($run->scene)) $displayScenes[] = $run->scene; - $run->parent = !empty($run->scene) ? 'scene-' . $scenes[$run->scene]->id : 0; - $run->isScene = false; - } - - foreach($scenes as $scene) - { - foreach($displayScenes as $displayScene) - { - if(str_contains($scene->path, $displayScene . ',')) - { - $displayScenes += explode(',', trim($scene->path, ',')); - } - } - } - - $displayScenes = array_unique($displayScenes); - foreach($scenes as $id => $scene) - { - if(!in_array($id, $displayScenes)) unset($scenes[$id]); - $scene->parent = !empty($scene->parent) ? 'scene-' . $scene->parent : 0; - $scene->id = 'scene-' . $scene->id; - $scene->isScene = true; - } - - return array($runs, $scenes); - } - /** * 获取一个测试单关联的用例。 * Get cases associated with a testtask. diff --git a/module/tutorial/config/guides.php b/module/tutorial/config/guides.php deleted file mode 100644 index 28bad1fc9c..0000000000 --- a/module/tutorial/config/guides.php +++ /dev/null @@ -1,36 +0,0 @@ -name = 'manageAccount'; -$manageAccount->title = '账号管理'; -$manageAccount->icon = 'cog-outline text-primary'; -$manageAccount->type = 'starter'; -$manageAccount->modules = 'admin,company,dept'; -$manageAccount->app = 'admin'; -$manageAccount->tasks = array(); - -$manageAccount->tasks['manageDepts'] = array(); -$manageAccount->tasks['manageDepts']['name'] = 'manageDepts'; -$manageAccount->tasks['manageDepts']['title'] = '部门维护'; -$manageAccount->tasks['manageDepts']['steps'] = array(); -$manageAccount->tasks['manageDepts']['steps'][] = array('type' => 'openApp', 'app' => 'admin', 'title' => '点击后台', 'desc' => '您可以在这里维护管理账号,进行各类配置项的设置 。'); -$manageAccount->tasks['manageDepts']['steps'][] = array('type' => 'click', 'page' => 'admin-index', 'target' => '#settings .setting-box[data-id="company"]', 'title' => '点击人员管理', 'desc' => '您可以在这里维护部门、添加人员和分组配置权限。'); -$manageAccount->tasks['manageDepts']['steps'][] = array('type' => 'clickNavbar', 'page' => 'company-browse', 'target' => 'dept', 'title' => '点击部门', 'desc' => '您可以在这里进行部门维护。'); -$manageAccount->tasks['manageDepts']['steps'][] = array('type' => 'form', 'page' => 'dept-browse', 'target' => '#mainContentCell', 'title' => '填写部门信息', 'desc' => '可以修改和新加部门,点击左侧部门树切换要修改的部门。'); -$manageAccount->tasks['manageDepts']['steps'][] = array('type' => 'saveForm', 'page' => 'dept-browse', 'target' => '#mainContentCell', 'title' => '点击保存', 'desc' => '保存后可以在左侧目录中看到。'); - -$manageAccount->tasks['addUser'] = array(); -$manageAccount->tasks['addUser']['name'] = 'addUser'; -$manageAccount->tasks['addUser']['title'] = '添加人员'; -$manageAccount->tasks['addUser']['startUrl'] = array('dept', 'browse'); -$manageAccount->tasks['addUser']['steps'] = array(); -$manageAccount->tasks['addUser']['steps'][] = array('type' => 'clickNavbar', 'page' => 'dept-browse', 'target' => 'browseUser', 'title' => '点击用户', 'desc' => '你可以在这里添加公司人员。'); -$manageAccount->tasks['addUser']['steps'][] = array('type' => 'click', 'page' => 'company-browse', 'target' => '#actionBar .create-user-btn', 'title' => '点击添加人员', 'desc' => '你可以在这里添加公司人员。'); -$manageAccount->tasks['addUser']['steps'][] = array('type' => 'form', 'page' => 'user-create', 'title' => '输入人员信息', 'desc' => '请输入必填项'); -$manageAccount->tasks['addUser']['steps'][] = array('type' => 'saveForm', 'page' => 'user-create', 'title' => '保存人员信息', 'desc' => '保存后可以在人员列表中查看。'); - -$config->tutorial->guides = array(); -$config->tutorial->guides[$manageAccount->name] = $manageAccount; - -if($config->systemMode == 'light') unset($config->tutorial->guides[$managePrograms->name]); diff --git a/module/tutorial/model.php b/module/tutorial/model.php index 764f44c73e..ea6984675c 100644 --- a/module/tutorial/model.php +++ b/module/tutorial/model.php @@ -12,21 +12,6 @@ declare(strict_types=1); */ class tutorialModel extends model { - /** - * 获取当前所在的教程和任务。 - * Get guide and task. - * - * @access public - * @return bool - */ - public function getGuideTaskName() - { - if(empty($_SERVER['HTTP_X_ZIN_TUTORIAL'])) return array('guide' => '', 'guideTask' => ''); - - list($guide, $guideTask, $guideStepIndex) = explode('-', $_SERVER['HTTP_X_ZIN_TUTORIAL']); - return array('guide' => $guide, 'guideTask' => $guideTask); - } - /** * 检查新手模式配置。 * Check novice mode config.