Skip to content

Commit

Permalink
Merge pull request #1100 from AI4Bharat/revert-1097-mas-ef
Browse files Browse the repository at this point in the history
Revert "analytics api integration effciency and download button ui changes"
  • Loading branch information
ishvindersethi22 authored Sep 11, 2024
2 parents b33eb9d + 6cce684 commit 8d901ec
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 33 deletions.
9 changes: 0 additions & 9 deletions src/ui/pages/component/common/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ import CustomizedSnackbars from "../common/Snackbar";
import userRole from "../../../../utils/UserMappedByRole/Roles";
import NotificationAPI from "../../../../redux/actions/api/Notification/Notification";
import UpdateUIPrefsAPI from "../../../../redux/actions/api/UserManagement/UpdateUIPrefs";
import TaskAnalyticsDataAPI from "../../../../redux/actions/api/Progress/TaskAnalytics";
import MetaAnalyticsDataAPI from "../../../../redux/actions/api/Progress/MetaAnalytics";

const Header = () => {
const [anchorElUser, setAnchorElUser] = useState(null);
Expand Down Expand Up @@ -171,14 +169,7 @@ const Header = () => {
getLoggedInUserData();

}, []);
useEffect(() => {
const userObj = new TaskAnalyticsDataAPI('ContextualTranslationEditing');
dispatch(APITransport(userObj));
const userObj1 = new MetaAnalyticsDataAPI(1,'ContextualTranslationEditing');
dispatch(APITransport(userObj1));


}, []);

/* useEffect(()=>{
if(loggedInUserData?.prefer_cl_ui !== undefined){
Expand Down
16 changes: 4 additions & 12 deletions src/ui/pages/container/Progress/MetaAnalytics/MetaAnalytics.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,8 @@ export default function MetaAnalytics(props) {
}, []);

useEffect(() => {
const handler = setTimeout(() => {
if(!metaAnalyticsData.length){
getMetaAnalyticsdata();
}
}, 500);
return () => {
clearTimeout(handler);
};
}, []);

getMetaAnalyticsdata();
}, []);
const handleSubmit = async () => {
getMetaAnalyticsdata();
}
Expand Down Expand Up @@ -239,8 +231,8 @@ export default function MetaAnalytics(props) {
</Select>
</FormControl>
{/* <Grid item xs={12} sm={12} md={12} lg={12} xl={12} container justifyContent="space-between" alignItems="center"> */}
<CustomButton label="Submit" sx={{ width: { xs: "100px", md: "120px" }, height: "40px" }} onClick={handleSubmit} />
<Box display="flex" sx={{ width: { xs: "100px", md: "120px" }, height: "40px", marginRight: 1 }}alignItems="center">
<CustomButton label="Submit" sx={{ width: "120px" }} onClick={handleSubmit} disabled={loading} />
<Box display="flex" alignItems="center">
<CustomButton
onClick={handleClick}
disabled={loading}
Expand Down
17 changes: 5 additions & 12 deletions src/ui/pages/container/Progress/TaskAnalytics/TaskAnalytics.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,10 @@ const TaskAnalytics = (props) => {
setProjectTypes(types);
}, []);

useEffect(() => {
const handler = setTimeout(() => {
if(!taskAnalyticsData.length){
getTaskAnalyticsdata();
}
}, 500);
return () => {
clearTimeout(handler);
};
}, []);

useEffect(() => {
getTaskAnalyticsdata();
}, []);

useEffect(() => {
if (taskAnalyticsData.length > 0) {
Expand Down Expand Up @@ -210,8 +203,8 @@ const TaskAnalytics = (props) => {
</Select>
</FormControl>
{/* <Grid item xs={12} sm={12} md={12} lg={12} xl={12} container justifyContent="space-between" alignItems="center"> */}
<CustomButton label="Submit" sx={{ width: { xs: "100px", md: "120px" }, height: "40px" }} onClick={handleSubmit} />
<Box display="flex" sx={{ width: { xs: "100px", md: "120px" }, height: "40px", marginRight: 1 }}alignItems="center">
<CustomButton label="Submit" sx={{ width: "120px" }} onClick={handleSubmit} disabled={loading} />
<Box display="flex" alignItems="center">
<CustomButton
onClick={handleClick}
disabled={loading}
Expand Down

0 comments on commit 8d901ec

Please sign in to comment.