diff --git a/src/redux/reducers/Progress/TaskAnalytics.js b/src/redux/reducers/Progress/TaskAnalytics.js index f66b3f17a..d41c2f526 100644 --- a/src/redux/reducers/Progress/TaskAnalytics.js +++ b/src/redux/reducers/Progress/TaskAnalytics.js @@ -2,7 +2,6 @@ import C from "../../constants"; let initialState = { data: [], - originalData: [], }; const diffAnnotationReview = (payload) => { @@ -14,7 +13,11 @@ const diffAnnotationReview = (payload) => { languages: (value?.language), annotation_cumulative_tasks_count: (value?.ann_cumulative_tasks_count), review_cumulative_tasks_count: (value?.rew_cumulative_tasks_count), - diff_annotation_review: (value?.ann_cumulative_tasks_count - value?.rew_cumulative_tasks_count) + sup_cumulative_tasks_count : (value?.sup_cumulative_tasks_count), + diff_annotation_rev_sup: (value?.ann_cumulative_tasks_count - value?.rew_cumulative_tasks_count-value?.sup_cumulative_tasks_count), + diff_annotation_rev: (value?.ann_cumulative_tasks_count - value?.rew_cumulative_tasks_count), + diff_annotation_sup: (value?.ann_cumulative_tasks_count - value?.sup_cumulative_tasks_count), + diff_rev:(value?.rew_cumulative_tasks_count-value?.sup_cumulative_tasks_count), }; }) }) @@ -29,8 +32,7 @@ const reducer = (state = initialState, action) => { switch (action.type) { case C.FETCH_TASK_ANALYTICS_DATA: const data = diffAnnotationReview(action.payload); - return { ...state, originalData: action.payload, data }; - + return { ...state, data }; default: return { diff --git a/src/redux/reducers/WorkspaceDetails/GetTaskAnalytics.js b/src/redux/reducers/WorkspaceDetails/GetTaskAnalytics.js index 55522d0b5..5d8c04844 100644 --- a/src/redux/reducers/WorkspaceDetails/GetTaskAnalytics.js +++ b/src/redux/reducers/WorkspaceDetails/GetTaskAnalytics.js @@ -15,7 +15,11 @@ const diffAnnotationReview = (payload) => { languages: (value?.language), annotation_cumulative_tasks_count: (value?.ann_cumulative_tasks_count), review_cumulative_tasks_count: (value?.rew_cumulative_tasks_count), - diff_annotation_review: (value?.ann_cumulative_tasks_count - value?.rew_cumulative_tasks_count) + sup_cumulative_tasks_count : (value?.sup_cumulative_tasks_count), + diff_annotation_rev_sup: (value?.ann_cumulative_tasks_count - value?.rew_cumulative_tasks_count-value?.sup_cumulative_tasks_count), + diff_annotation_rev: (value?.ann_cumulative_tasks_count - value?.rew_cumulative_tasks_count), + diff_annotation_sup: (value?.ann_cumulative_tasks_count - value?.sup_cumulative_tasks_count), + diff_rev:(value?.rew_cumulative_tasks_count-value?.sup_cumulative_tasks_count), }; }) }) diff --git a/src/ui/pages/container/Progress/MetaAnalytics/MetaAnalytics.jsx b/src/ui/pages/container/Progress/MetaAnalytics/MetaAnalytics.jsx index 7cdd01f43..3a2832515 100644 --- a/src/ui/pages/container/Progress/MetaAnalytics/MetaAnalytics.jsx +++ b/src/ui/pages/container/Progress/MetaAnalytics/MetaAnalytics.jsx @@ -231,9 +231,9 @@ export default function MetaAnalytics(props) { {/* */} - - - + + - Total Sentance Count + Total Annotated Count {totalSentanceCount && @@ -117,7 +117,7 @@ export default function SentanceCountMetaAnalyticsChart(props) { - Total Annotation Sentance Count + Pending Review Count {totalAnnotationSentanceCount && @@ -126,7 +126,7 @@ export default function SentanceCountMetaAnalyticsChart(props) { - Total Quality/Reviewed Sentance Count + Review Completed Count {totalReviewSentanceCount && @@ -218,4 +218,4 @@ export default function SentanceCountMetaAnalyticsChart(props) { ) -} \ No newline at end of file +} diff --git a/src/ui/pages/container/Progress/MetaAnalytics/WordCountMetaAnalyticsChart.jsx b/src/ui/pages/container/Progress/MetaAnalytics/WordCountMetaAnalyticsChart.jsx index 0241b19c4..a522b8fc9 100644 --- a/src/ui/pages/container/Progress/MetaAnalytics/WordCountMetaAnalyticsChart.jsx +++ b/src/ui/pages/container/Progress/MetaAnalytics/WordCountMetaAnalyticsChart.jsx @@ -15,8 +15,6 @@ import { export default function WordCountMetaAnalyticsChart(props) { const {analyticsData,graphCategory} = props - console.log(analyticsData); - const classes = DatasetStyle(); const [totalWordCount, setTotalWordCount] = useState(); const [totalAnnotationWordCount, setTotalAnnotationWordCount] = useState(); @@ -214,7 +212,7 @@ export default function WordCountMetaAnalyticsChart(props) { - Total Word Count + Total Annotated Count {totalWordCount && @@ -223,7 +221,7 @@ export default function WordCountMetaAnalyticsChart(props) { - Total Annotation Word Count + Pending Review Count {totalAnnotationWordCount && @@ -232,7 +230,7 @@ export default function WordCountMetaAnalyticsChart(props) { - Total Quality/Reviewed Word Count + Review Completed Count {totalReviewWordCount && diff --git a/src/ui/pages/container/Progress/TaskAnalytics/AudioTaskAnalyticsChart.jsx b/src/ui/pages/container/Progress/TaskAnalytics/AudioTaskAnalyticsChart.jsx index 6c1c81700..683b74c1a 100644 --- a/src/ui/pages/container/Progress/TaskAnalytics/AudioTaskAnalyticsChart.jsx +++ b/src/ui/pages/container/Progress/TaskAnalytics/AudioTaskAnalyticsChart.jsx @@ -13,6 +13,7 @@ import { Tooltip, Legend, ResponsiveContainer, + Checkbox, Label, } from "recharts"; import ResponsiveChartContainer from "../../../component/common/ResponsiveChartContainer" @@ -21,11 +22,13 @@ import ResponsiveChartContainer from "../../../component/common/ResponsiveChartC function AudioTaskAnalyticsChart(props) { const classes = DatasetStyle(); const dispatch = useDispatch(); - const { analyticsData } = props; + const { analyticsData ,annotationChecked,reviewChecked,supercheckChecked} = props; const [totalTaskCount, setTotalTaskCount] = useState(); const [totalAnnotationTasksCount, setTotalAnnotationTasksCount] = useState(); const [totalReviewTasksCount, setTotalReviewTasksCount] = useState(); + const [totalSuperCheckTasksCount, setTotalSuperCheckTasksCount] = useState(); const [data, setData] = useState([]); + const [annRev,setAnnRev] = useState(); useEffect(() => { analyticsData?.sort( @@ -37,22 +40,27 @@ function AudioTaskAnalyticsChart(props) { let allAnnotatorCumulativeTasksCount = 0; let allReviewCumulativeTasksCount = 0; + let allSuperCheckCumulativeTasksCount = 0; var languages; analyticsData?.map((element, index) => { allAnnotatorCumulativeTasksCount += element.annotation_cumulative_tasks_count; allReviewCumulativeTasksCount += element.review_cumulative_tasks_count; + allSuperCheckCumulativeTasksCount += element.sup_cumulative_tasks_count; languages = element.languages; }); setTotalAnnotationTasksCount(allAnnotatorCumulativeTasksCount); setTotalReviewTasksCount(allReviewCumulativeTasksCount); + setTotalSuperCheckTasksCount(allSuperCheckCumulativeTasksCount) setTotalTaskCount( - allAnnotatorCumulativeTasksCount + allReviewCumulativeTasksCount + allAnnotatorCumulativeTasksCount + allReviewCumulativeTasksCount+allSuperCheckCumulativeTasksCount ); - }, [analyticsData]); + setAnnRev(allAnnotatorCumulativeTasksCount + allReviewCumulativeTasksCount) + }, [analyticsData]); const CustomTooltip = ({ active, payload, label }) => { + if (active && payload && payload.length) { return (
@@ -65,29 +73,77 @@ function AudioTaskAnalyticsChart(props) { payload[0].payload.annotation_cumulative_tasks_count ) : 0 - }`} -

+ }`}

+ {annotationChecked&&!reviewChecked&&!supercheckChecked?(

{`Annotation : ${ - payload[0].payload.diff_annotation_review + payload[0].payload.annotation_cumulative_tasks_count ? new Intl.NumberFormat("en").format( - payload[0].payload.diff_annotation_review + payload[0].payload.annotation_cumulative_tasks_count ) : 0 - }`} -

{`Review : ${ + }`}

):annotationChecked&&reviewChecked&&!supercheckChecked?(

+ {`Annotation : ${ + payload[0].payload.diff_annotation_rev + ? new Intl.NumberFormat("en").format( + payload[0].payload.diff_annotation_rev + ) + : 0 + }`}

):annotationChecked&&reviewChecked&&supercheckChecked?(

+ {`Annotation : ${ + payload[0].payload.diff_annotation_rev_sup + ? new Intl.NumberFormat("en").format( + payload[0].payload.diff_annotation_rev_sup + ) + : 0 + }`}

):null} + + + + + {reviewChecked&&!annotationChecked&&!supercheckChecked?(

{`Review : ${ + payload[0].payload.diff_rev + ? new Intl.NumberFormat("en").format( + payload[0].payload.diff_rev + ) + : 0 + }`}

):annotationChecked&&reviewChecked&&!supercheckChecked?(

{`Review : ${ payload[0].payload.review_cumulative_tasks_count ? new Intl.NumberFormat("en").format( payload[0].payload.review_cumulative_tasks_count ) : 0 - }`}

-

-

+ }`}

):annotationChecked&&reviewChecked&&supercheckChecked?(

{`Review : ${ + payload[0].payload.diff_rev + ? new Intl.NumberFormat("en").format( + payload[0].payload.diff_rev + ) + : 0 + }`}

):null} + + + + + + + {supercheckChecked&&!reviewChecked&&!annotationChecked?(

{`SuperCheck : ${ + payload[0].payload.sup_cumulative_tasks_count + ? new Intl.NumberFormat("en").format( + payload[0].payload.sup_cumulative_tasks_count + ) + : 0 + }`}

):annotationChecked&&reviewChecked&&supercheckChecked?(

{`SuperCheck : ${ + payload[0].payload.sup_cumulative_tasks_count + ? new Intl.NumberFormat("en").format( + payload[0].payload.sup_cumulative_tasks_count + ) + : 0 + }`}

):null}

); } + return null; }; @@ -97,7 +153,7 @@ function AudioTaskAnalyticsChart(props) { {`Tasks Dashboard - ${analyticsData[0].projectType}`} - Count of Annotated and Reviewed Audio Data + Count of Annotated , Reviewed and SuperChecked Audio Data @@ -113,34 +169,84 @@ function AudioTaskAnalyticsChart(props) { > Tasks Dashboard
-
- - - Total Tasks Count + + {annotationChecked? + + Total Annotated Tasks + + + {totalAnnotationTasksCount && + new Intl.NumberFormat("en").format(totalAnnotationTasksCount)} + + :annotationChecked&&reviewChecked&&!supercheckChecked? + + Total Annotated Tasks + + + {annRev && + new Intl.NumberFormat("en").format(annRev)} + + :annotationChecked&&reviewChecked&&supercheckChecked? + + Total Annotated Tasks {totalTaskCount && new Intl.NumberFormat("en").format(totalTaskCount)} - - + :null} + + + + {annotationChecked&&reviewChecked&&!supercheckChecked? - Total Audio Files Annotated + Pending Review Tasks {totalAnnotationTasksCount && new Intl.NumberFormat("en").format(totalAnnotationTasksCount)} - - + :annotationChecked&&reviewChecked&&supercheckChecked? + + Pending Review Tasks + + + {totalAnnotationTasksCount && + new Intl.NumberFormat("en").format(totalAnnotationTasksCount)} + + :null} + + + + {annotationChecked&&reviewChecked&&!supercheckChecked? - Total quality/ reviewed audio files + Review Completed Task {totalReviewTasksCount && new Intl.NumberFormat("en").format(totalReviewTasksCount)} - +
:annotationChecked&&reviewChecked&&supercheckChecked? + + Pending Supercheck Tasks + + + {totalReviewTasksCount && + new Intl.NumberFormat("en").format(totalReviewTasksCount)} + + :null} + + + + {annotationChecked&&reviewChecked&&supercheckChecked? + + SuperCheck Completed Tasks + + + {totalSuperCheckTasksCount && + new Intl.NumberFormat("en").format(totalSuperCheckTasksCount)} + + :null} @@ -203,21 +309,84 @@ function AudioTaskAnalyticsChart(props) { content={} /> - ):annotationChecked&&reviewChecked&&supercheckChecked?():null} + + + + {reviewChecked&&!annotationChecked&&!supercheckChecked?( - ):annotationChecked&&reviewChecked&&!supercheckChecked?():annotationChecked&&reviewChecked&&supercheckChecked?():reviewChecked&&supercheckChecked&&!annotationChecked?():null} + + + {annotationChecked&&!reviewChecked&&!supercheckChecked?( + cursor="pointer" + />):annotationChecked&&reviewChecked&&!supercheckChecked?():annotationChecked&&reviewChecked&&supercheckChecked?():annotationChecked&&supercheckChecked&&!reviewChecked?():null} diff --git a/src/ui/pages/container/Progress/TaskAnalytics/TaskAnalytics.jsx b/src/ui/pages/container/Progress/TaskAnalytics/TaskAnalytics.jsx index f9651c8af..9abb62c56 100644 --- a/src/ui/pages/container/Progress/TaskAnalytics/TaskAnalytics.jsx +++ b/src/ui/pages/container/Progress/TaskAnalytics/TaskAnalytics.jsx @@ -1,6 +1,6 @@ import React, { useEffect, useState,useRef } from "react"; import { useDispatch, useSelector } from "react-redux"; -import { Grid, Button, FormControl, InputLabel, Select, MenuItem, Box, styled, Menu } from "@mui/material"; +import { Grid, Button, FormControl, InputLabel, Select, MenuItem, Box, styled, Menu,Checkbox ,FormControlLabel,IconButton} from "@mui/material"; import APITransport from "../../../../../redux/actions/apitransport/apitransport"; import TaskAnalyticsDataAPI from "../../../../../redux/actions/api/Progress/TaskAnalytics"; import AudioTaskAnalyticsChart from "./AudioTaskAnalyticsChart"; @@ -14,7 +14,7 @@ import { MenuProps } from "../../../../../utils/utils"; import exportFromJSON from 'export-from-json'; import jsPDF from 'jspdf'; import html2canvas from 'html2canvas'; -import { KeyboardArrowDown } from "@material-ui/icons"; +import { FilterList, KeyboardArrowDown } from "@material-ui/icons"; const StyledMenu = styled((props) => ( { const taskAnalyticsData = useSelector((state) => state.getTaskAnalyticsData.data); const taskAnalyticsDataJson = useSelector((state) => state.getTaskAnalyticsData.originalData); const [anchorEl, setAnchorEl] = useState(null); + const [annotationChecked, setAnnotationChecked] = useState(true); + const [reviewChecked, setReviewChecked] = useState(true); + const [supercheckChecked, setSupercheckChecked] = useState(false); + const [showFilterBox, setShowFilterBox] = useState(false); + const open = Boolean(anchorEl); @@ -174,37 +179,111 @@ const TaskAnalytics = (props) => { setAnchorEl(event.currentTarget); }; + const handleReviewChange = (e) => { + const isChecked = e.target.checked; + setReviewChecked(isChecked); + + if (isChecked) { + setAnnotationChecked(true); + } + else{ + setSupercheckChecked(false) + } + }; + + const handleSupercheckChange = (e) => { + const isChecked = e.target.checked; + setSupercheckChecked(isChecked); + + if (isChecked) { + setReviewChecked(true); + setAnnotationChecked(true); + } + }; + const handleApply = () => { + getTaskAnalyticsdata(); + setShowFilterBox(false); + }; + + const handleCancel = () => { + setSelectedType("ContextualTranslationEditing"); + setAnnotationChecked(true); + setReviewChecked(true); + setSupercheckChecked(true); + setShowFilterBox(false); + }; - return ( + const toggleFilterBox = () => { + setShowFilterBox(!showFilterBox); + }; return ( <> - - - - Project Type {" "} - - - - - - + + + + + + + + {showFilterBox && ( + + + {/* Project Type Dropdown */} + + Project Type + + + + + +
  • To View annotation count seperately.
  • +
  • To View combination of annotation and review counts.
  • +
  • To View combination of annotation, review, and supercheck counts.
  • + +} placement="top" + > + +
    + + } + label="Annotation" + /> + } + label="Review" + /> + } + label="Supercheck" + /> +
    + + + + + + +
    + )} {/* */} - - + {/* */} + { JSON - {/* */}
    @@ -234,7 +312,10 @@ const TaskAnalytics = (props) => { taskAnalyticsData.map((analyticsData, _index) => { if (analyticsData.length && ['AudioTranscription', 'AudioSegmentation', 'AudioTranscriptionEditing', 'AcousticNormalisedTranscriptionEditing'].includes(analyticsData[0].projectType)) { return ( - + ) } if (analyticsData.length && @@ -243,7 +324,10 @@ const TaskAnalytics = (props) => { ['OCRTranscriptionEditing','OCRSegmentCategorizationEditing'].includes(analyticsData[0].projectType)) ) { return - + } }) diff --git a/src/ui/pages/container/Progress/TaskAnalytics/TaskCountAnalyticsChart.jsx b/src/ui/pages/container/Progress/TaskAnalytics/TaskCountAnalyticsChart.jsx index c2d97cce4..2937d5de8 100644 --- a/src/ui/pages/container/Progress/TaskAnalytics/TaskCountAnalyticsChart.jsx +++ b/src/ui/pages/container/Progress/TaskAnalytics/TaskCountAnalyticsChart.jsx @@ -21,12 +21,14 @@ import ResponsiveChartContainer from "../../../component/common/ResponsiveChartC function TaskCountAnalyticsChart(props) { const classes = DatasetStyle(); const dispatch = useDispatch(); - const { analyticsData } = props; + const { analyticsData ,annotationChecked,reviewChecked,supercheckChecked} = props; const [totalTaskCount, setTotalTaskCount] = useState(); const [totalAnnotationTasksCount, setTotalAnnotationTasksCount] = useState(); const [totalReviewTasksCount, setTotalReviewTasksCount] = useState(); + const [totalSupercheckCount, setTotalSupercheckCount] = useState(); const [data, setData] = useState([]); + const [annRev,setAnnRev] = useState(); useEffect(() => { analyticsData?.sort( @@ -38,22 +40,27 @@ function TaskCountAnalyticsChart(props) { let allAnnotatorCumulativeTasksCount = 0; let allReviewCumulativeTasksCount = 0; + let allSuperCheckCumulativeTasksCount = 0; var languages; analyticsData?.map((element, index) => { allAnnotatorCumulativeTasksCount += element.annotation_cumulative_tasks_count; allReviewCumulativeTasksCount += element.review_cumulative_tasks_count; + allSuperCheckCumulativeTasksCount += element.sup_cumulative_tasks_count; languages = element.languages; }); setTotalAnnotationTasksCount(allAnnotatorCumulativeTasksCount); setTotalReviewTasksCount(allReviewCumulativeTasksCount); + setTotalSupercheckCount(allSuperCheckCumulativeTasksCount) setTotalTaskCount( - allAnnotatorCumulativeTasksCount + allReviewCumulativeTasksCount + allAnnotatorCumulativeTasksCount + allReviewCumulativeTasksCount+allSuperCheckCumulativeTasksCount ); + setAnnRev(allAnnotatorCumulativeTasksCount + allReviewCumulativeTasksCount) }, [analyticsData]); const CustomTooltip = ({ active, payload, label }) => { + if (active && payload && payload.length) { return (
    @@ -66,24 +73,71 @@ function TaskCountAnalyticsChart(props) { payload[0].payload.annotation_cumulative_tasks_count ) : 0 - }`} -

    + }`}

    + {annotationChecked&&!reviewChecked&&!supercheckChecked?(

    {`Annotation : ${ - payload[0].payload.diff_annotation_review + payload[0].payload.annotation_cumulative_tasks_count ? new Intl.NumberFormat("en").format( - payload[0].payload.diff_annotation_review + payload[0].payload.annotation_cumulative_tasks_count ) : 0 - }`} -

    {`Review : ${ + }`}

    ):annotationChecked&&reviewChecked&&!supercheckChecked?(

    + {`Annotation : ${ + payload[0].payload.diff_annotation_rev + ? new Intl.NumberFormat("en").format( + payload[0].payload.diff_annotation_rev + ) + : 0 + }`}

    ):annotationChecked&&reviewChecked&&supercheckChecked?(

    + {`Annotation : ${ + payload[0].payload.diff_annotation_rev_sup + ? new Intl.NumberFormat("en").format( + payload[0].payload.diff_annotation_rev_sup + ) + : 0 + }`}

    ):null} + + + + + {reviewChecked&&!annotationChecked&&!supercheckChecked?(

    {`Review : ${ + payload[0].payload.diff_rev + ? new Intl.NumberFormat("en").format( + payload[0].payload.diff_rev + ) + : 0 + }`}

    ):annotationChecked&&reviewChecked&&!supercheckChecked?(

    {`Review : ${ payload[0].payload.review_cumulative_tasks_count ? new Intl.NumberFormat("en").format( payload[0].payload.review_cumulative_tasks_count ) : 0 - }`}

    -

    -

    + }`}

    ):annotationChecked&&reviewChecked&&supercheckChecked?(

    {`Review : ${ + payload[0].payload.diff_rev + ? new Intl.NumberFormat("en").format( + payload[0].payload.diff_rev + ) + : 0 + }`}

    ):null} + + + + + + + {supercheckChecked&&!reviewChecked&&!annotationChecked?(

    {`SuperCheck : ${ + payload[0].payload.sup_cumulative_tasks_count + ? new Intl.NumberFormat("en").format( + payload[0].payload.sup_cumulative_tasks_count + ) + : 0 + }`}

    ):annotationChecked&&reviewChecked&&supercheckChecked?(

    {`SuperCheck : ${ + payload[0].payload.sup_cumulative_tasks_count + ? new Intl.NumberFormat("en").format( + payload[0].payload.sup_cumulative_tasks_count + ) + : 0 + }`}

    ):null}

    ); @@ -98,7 +152,7 @@ function TaskCountAnalyticsChart(props) { {`Tasks Dashboard - ${analyticsData[0].projectType}`} - Count of Annotated and Reviewed Data + Count of Annotated , Reviewed and SuperChecked Data @@ -114,33 +168,83 @@ function TaskCountAnalyticsChart(props) { Tasks Dashboard - - - Total Tasks Count + {annotationChecked? + + Total Annotated Tasks + + + {totalAnnotationTasksCount && + new Intl.NumberFormat("en").format(totalAnnotationTasksCount)} + + :annotationChecked&&reviewChecked&&!supercheckChecked? + + Total Annotated Tasks + + + {annRev && + new Intl.NumberFormat("en").format(annRev)} + + :annotationChecked&&reviewChecked&&supercheckChecked? + + Total Annotated Tasks {totalTaskCount && new Intl.NumberFormat("en").format(totalTaskCount)} - - + :null} + + + + {annotationChecked&&reviewChecked&&!supercheckChecked? - Total Sentence Pairs + Pending Review Tasks {totalAnnotationTasksCount && new Intl.NumberFormat("en").format(totalAnnotationTasksCount)} - - + :annotationChecked&&reviewChecked&&supercheckChecked? + + Pending Review Tasks + + + {totalAnnotationTasksCount && + new Intl.NumberFormat("en").format(totalAnnotationTasksCount)} + + :null} + + + + {annotationChecked&&reviewChecked&&!supercheckChecked? - Total Quality/Reviewed Sentence Pairs + Review Completed Task {totalReviewTasksCount && new Intl.NumberFormat("en").format(totalReviewTasksCount)} - + :annotationChecked&&reviewChecked&&supercheckChecked? + + Pending Supercheck Tasks + + + {totalReviewTasksCount && + new Intl.NumberFormat("en").format(totalReviewTasksCount)} + + :null} + + + + {annotationChecked&&reviewChecked&&supercheckChecked? + + SuperCheck Completed Tasks + + + {totalSupercheckCount && + new Intl.NumberFormat("en").format(totalSupercheckCount)} + + :null} @@ -203,21 +307,84 @@ function TaskCountAnalyticsChart(props) { content={} /> - ):annotationChecked&&reviewChecked&&supercheckChecked?():null} + + + + {reviewChecked&&!annotationChecked&&!supercheckChecked?( - ):annotationChecked&&reviewChecked&&!supercheckChecked?():annotationChecked&&reviewChecked&&supercheckChecked?():reviewChecked&&supercheckChecked&&!annotationChecked?():null} + + + {annotationChecked&&!reviewChecked&&!supercheckChecked?( + cursor="pointer" + />):annotationChecked&&reviewChecked&&!supercheckChecked?():annotationChecked&&reviewChecked&&supercheckChecked?():annotationChecked&&supercheckChecked&&!reviewChecked?():null} diff --git a/src/ui/pages/container/Progress/Workspace/MetaAnalytics.jsx b/src/ui/pages/container/Progress/Workspace/MetaAnalytics.jsx index afb58d31a..f005bd338 100644 --- a/src/ui/pages/container/Progress/Workspace/MetaAnalytics.jsx +++ b/src/ui/pages/container/Progress/Workspace/MetaAnalytics.jsx @@ -232,8 +232,8 @@ export default function MetaAnalytics(props) { ))} - - + + ( { const [loading, setLoading] = useState(true); const [projectTypes, setProjectTypes] = useState([]); const [selectedType, setSelectedType] = useState("ContextualTranslationEditing"); + const [annotationChecked, setAnnotationChecked] = useState(true); + const [reviewChecked, setReviewChecked] = useState(true); + const [supercheckChecked, setSupercheckChecked] = useState(false); + const [showFilterBox, setShowFilterBox] = useState(false); + const ProjectTypes = useSelector((state) => state.getProjectDomains.data); const workspaceDetails = useSelector((state) => state.getWorkspaceDetails.data); const taskAnalyticsData = useSelector( @@ -186,45 +191,112 @@ const TaskAnalytics = () => { }; + const handleReviewChange = (e) => { + const isChecked = e.target.checked; + setReviewChecked(isChecked); + + if (isChecked) { + setAnnotationChecked(true); + } + else{ + setSupercheckChecked(false) + } + }; + + const handleSupercheckChange = (e) => { + const isChecked = e.target.checked; + setSupercheckChecked(isChecked); + + if (isChecked) { + setReviewChecked(true); + setAnnotationChecked(true); + } + }; + const handleApply = () => { + getTaskAnalyticsdata(); + setShowFilterBox(false); + }; + + const handleCancel = () => { + setSelectedType("ContextualTranslationEditing"); + setAnnotationChecked(true); + setReviewChecked(true); + setSupercheckChecked(true); + setShowFilterBox(false); + }; - return ( + const toggleFilterBox = () => { + setShowFilterBox(!showFilterBox); + }; + return ( <> - {console.log(taskAnalyticsData[0])} - - - - - Project Type {" "} - { - - - - } - + + + + + + + - - - - + {showFilterBox && ( + + + {/* Project Type Dropdown */} + + Project Type + + + + + +
  • To View annotation count seperately.
  • +
  • To View combination of annotation and review counts.
  • +
  • To View combination of annotation, review, and supercheck counts.
  • + +} placement="top" + > + +
    + + } + label="Annotation" + /> + } + label="Review" + /> + } + label="Supercheck" + /> +
    + + + + + + +
    + )} + {/* */} + {/* */} + { JSON - {/* */}
    + {loading && } {taskAnalyticsData.length ? taskAnalyticsData.map((analyticsData,_index)=>{ if (analyticsData.length && audioProjectTypes.includes(analyticsData[0].projectType)){ return ( - + )} if(analyticsData.length && (translationProjectTypes.includes(analyticsData[0].projectType) || @@ -263,7 +338,10 @@ const TaskAnalytics = () => { ) ){ return - + } }) diff --git a/src/ui/styles/Dataset.js b/src/ui/styles/Dataset.js index 8ce09f681..d3bb752da 100644 --- a/src/ui/styles/Dataset.js +++ b/src/ui/styles/Dataset.js @@ -278,6 +278,7 @@ const DatasetStyle = makeStyles({ topBar: { display: "flex", alignItems: "center", + justifyContent:"space-around", backgroundColor: "#DEECFF", fontSize: "18px", }, @@ -287,10 +288,10 @@ const DatasetStyle = makeStyles({ display: "flex", flexDirection: "column", textAlign: "center", - boxShadow: "3px 0 2px -2px #00000029", + // boxShadow: "3px 0 2px -2px #00000029", }, toolTip: { - width: "200px", height: "180px", fontSize: "16px", backgroundColor: "white", color: "black", padding: "5px 10px 10px 10px", border: "1px solid gray" + width: "200px", height: "auto", fontSize: "16px", backgroundColor: "white", color: "black", padding: "5px 10px 10px 10px", border: "1px solid gray" }, toolTips: {