From cab19f6a46dfc9429c97415d0b9a38d4bf815b89 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Tue, 3 Dec 2024 14:04:01 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=BC=80=E6=BA=90=E5=BA=A6=E9=87=8F-?= =?UTF-8?q?=E9=95=BF=E6=9C=9F=E8=B4=A1=E7=8C=AE=E8=80=85=E7=A8=B3=E5=AE=9A?= =?UTF-8?q?=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Server/measurement/componet/stack.jsx | 5 +---- src/forge/Server/measurement/config.js | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/forge/Server/measurement/componet/stack.jsx b/src/forge/Server/measurement/componet/stack.jsx index fd9edcf0..203c45bd 100644 --- a/src/forge/Server/measurement/componet/stack.jsx +++ b/src/forge/Server/measurement/componet/stack.jsx @@ -43,7 +43,7 @@ function Stack({name,data , type , pieData}){ if(list && list.length > 0){ let values = []; const monthList = list.map(obj => obj.month); - values = list.map(obj => Math.round(obj[type] || obj["count"] || obj['commits_number'] || 0)); + values = list.map(obj => parseFloat(obj[type] || obj["count"] || obj['commits_number'] || 0).toFixed(2)); Init(monthList,values); } },[list]) @@ -59,9 +59,6 @@ function Stack({name,data , type , pieData}){ trigger: 'axis' }, color:['#5871FF',"#FFBE38"], - // legend: { - // data: ['Email', 'Union Ads'] - // }, grid: { left: '3%', right: '4%', diff --git a/src/forge/Server/measurement/config.js b/src/forge/Server/measurement/config.js index cfd2f8a4..15f7210b 100644 --- a/src/forge/Server/measurement/config.js +++ b/src/forge/Server/measurement/config.js @@ -57,7 +57,7 @@ export const detailByName={ 活跃开发者占比:{desc:"通过分析每个月活跃的个体贡献者数量对个体贡献者数量指标进行度量",descTitle:"个体贡献者数量"},//个体贡献者数量 项目活跃度:{desc:"不同类型的贡献者每月/周给master分支的贡献次数",month:true,user_login:true,descTitle:"所有个体开发者贡献历史"},//所有个体开发者贡献历史 长期贡献者占比:{desc:"通过分析每个月活跃的长期个体贡献者数量对长期个体贡献者数量指标进行度量",descTitle:"长期个体贡献者数量"},//长期个体贡献者数量 - 长期贡献者稳定性:{desc:"通过分析具体的即将流失的长期贡献者流失概率对个体贡献者流失预测指标进行度量",bar:true,descTitle:"个体贡献者流失预测"},//个体贡献者流失预测 + 长期贡献者稳定性:{desc:"通过分析具体的即将流失的长期贡献者流失概率对个体贡献者流失预测指标进行度量",user_login:true,bar:true,descTitle:"个体贡献者流失预测"},//个体贡献者流失预测 公司贡献者数量:{desc:"通过分析每月做出了贡献的公司贡献者数量对公司贡献者数量指标进行度量"}, 长期公司贡献者数量:{desc:"通过分析每月的长期对项目做出贡献的公司贡献者数量对长期公司贡献者数量指标进行度量"}, From d3cb74b7f694e158f431792e326eea86e57acf94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E6=80=9D?= <2897217417@qq.com> Date: Thu, 23 Jan 2025 10:29:38 +0800 Subject: [PATCH 2/2] =?UTF-8?q?nps=E8=B0=83=E7=A0=94=E4=B8=B0=E5=AF=8C?= =?UTF-8?q?=E9=80=89=E9=A1=B9=E3=80=81=E4=BF=AE=E5=A4=8D=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E3=80=81issue=E6=9C=AA=E8=A7=A6=E5=8F=91?= =?UTF-8?q?=E5=BC=B9=E7=AA=97bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Issues/Pages/details.jsx | 4 +++- src/forge/Issues/Pages/new.jsx | 3 ++- src/modules/modals/npsModal.jsx | 27 +++++++++++++++----------- src/modules/tpm/TPMIndex.css | 31 +++++++++++++++++++++--------- src/modules/tpm/TPMIndexHOC.js | 6 +++--- 5 files changed, 46 insertions(+), 25 deletions(-) diff --git a/src/forge/Issues/Pages/details.jsx b/src/forge/Issues/Pages/details.jsx index ac2b4b13..1ae7de47 100644 --- a/src/forge/Issues/Pages/details.jsx +++ b/src/forge/Issues/Pages/details.jsx @@ -59,7 +59,7 @@ function Details(props){ const permission = props && props.projectDetail && props.projectDetail.permission; let colors = ["#1abcb1","#28be6c","#e67e22","#db3d1d"]; - const {projectDetail , open_blockchain ,current_user } = props; + const {projectDetail , open_blockchain ,current_user, showNpsModal } = props; useEffect(()=>{ if(pathname === `/${owner}/${projectsId}/issues/${index}/copy`){ setEdit(true); @@ -284,6 +284,7 @@ function Details(props){ setEdit(false); // 刷新操作记录 setCommentReload(Math.random()); + showNpsModal("submitIssue", 1); } }).catch(error=>{}) }else{ @@ -310,6 +311,7 @@ function Details(props){ window.scrollTo(0,0); props.showNotification("疑修复制成功!"); props.history.push(`/${owner}/${projectsId}/issues/${result.data.project_issues_index}`); + showNpsModal("createIssue", 1); } }).catch(error=>{}) } diff --git a/src/forge/Issues/Pages/new.jsx b/src/forge/Issues/Pages/new.jsx index 474131b5..73927dbb 100644 --- a/src/forge/Issues/Pages/new.jsx +++ b/src/forge/Issues/Pages/new.jsx @@ -10,7 +10,7 @@ import axios from 'axios'; function New(props){ // history search 是否含有意见反馈标识 - const {location:{search}, projectDetail} = props; + const {location:{search}, projectDetail, showNpsModal} = props; const feedBack = search && search.indexOf('type=feedback') !== -1; // 里程碑id const milepostId = props.match.params.milepostId; @@ -200,6 +200,7 @@ function New(props){ window.scrollTo(0,0); props.showNotification("疑修创建成功!"); props.history.push(`/${owner}/${projectsId}/issues/${result.data.project_issues_index}`); + showNpsModal("createIssue", 1); } }).catch(error=>{}) } diff --git a/src/modules/modals/npsModal.jsx b/src/modules/modals/npsModal.jsx index 373815a2..ebfb043e 100644 --- a/src/modules/modals/npsModal.jsx +++ b/src/modules/modals/npsModal.jsx @@ -1,4 +1,4 @@ -import { Button, Checkbox, Input, Modal } from 'antd'; +import { Button, Checkbox, Divider, Input, Modal } from 'antd'; import axios from 'axios'; import React, { useState } from 'react'; @@ -12,16 +12,20 @@ function NpmModal(props){ // 提交按钮失效 const [disabled, setDisabled] = useState(false); const arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; + const list = [ + "代码库基本功能", "疑修", "合并请求", "流水线引擎", "维基Wiki", "数据集", "特色专区", "BOT功能", "跨平台同步服务", "代码溯源及扫描服务", "开源软件健康度量服务", "HiAgent", "非常满意,没有需要吐槽的功能" + ] // 提交意见 function submit(){ setDisabled(true); - axios.post(`/nps.json`,{ + const params = { action_type: npsActionType, action_id: npsActionId, score: activeGrade, memo:`${checkGroupValue && checkGroupValue.length !== 0 ? checkGroupValue.toString() + "。" : ''}${inputValue ? inputValue : ''}` - }).then((response) => { + } + axios.post(`/nps.json`, params).then((response) => { if (response.data) { setVisible(false); setSuccess(true); @@ -44,20 +48,21 @@ function NpmModal(props){ footer={(activeGrade || activeGrade === 0) ? : null} >