diff --git a/src/forge/Issues/Pages/details.jsx b/src/forge/Issues/Pages/details.jsx index ac2b4b137..1ae7de470 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 474131b5b..73927dbb3 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/forge/Server/measurement/componet/stack.jsx b/src/forge/Server/measurement/componet/stack.jsx index fd9edcf03..203c45bda 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 cfd2f8a44..15f7210b6 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:"通过分析每月的长期对项目做出贡献的公司贡献者数量对长期公司贡献者数量指标进行度量"}, diff --git a/src/modules/modals/npsModal.jsx b/src/modules/modals/npsModal.jsx index 373815a2f..ebfb043e5 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} >