diff --git a/src/Hooks/useLoadSupportedLanguages.jsx b/src/Hooks/useLoadSupportedLanguages.jsx index 8cf937fdf..c630b1787 100644 --- a/src/Hooks/useLoadSupportedLanguages.jsx +++ b/src/Hooks/useLoadSupportedLanguages.jsx @@ -1,7 +1,9 @@ import { useEffect } from "react"; import { useDispatch, useSelector } from "react-redux"; + import axios from "axios"; import { loadLanguages } from "redux/reducers/languageSupportReducer"; + import { ROLES } from "../constants/roles"; const useLoadSupportedLanguage = () => { diff --git a/src/components/NavItems/Assistant/AssistantScrapeResults/AssistantLinkResult.jsx b/src/components/NavItems/Assistant/AssistantScrapeResults/AssistantLinkResult.jsx index ff9cd8007..fa07fb4d5 100644 --- a/src/components/NavItems/Assistant/AssistantScrapeResults/AssistantLinkResult.jsx +++ b/src/components/NavItems/Assistant/AssistantScrapeResults/AssistantLinkResult.jsx @@ -16,7 +16,6 @@ import Typography from "@mui/material/Typography"; import HelpOutlineOutlinedIcon from "@mui/icons-material/HelpOutlineOutlined"; import { DataGrid, getGridSingleSelectOperators } from "@mui/x-data-grid"; - import { i18nLoadNamespace } from "components/Shared/Languages/i18nLoadNamespace"; import useMyStyles from "../../../Shared/MaterialUiStyles/useMyStyles"; diff --git a/src/components/NavItems/Assistant/AssistantScrapeResults/AssistantTextSpanClassification.jsx b/src/components/NavItems/Assistant/AssistantScrapeResults/AssistantTextSpanClassification.jsx index 305ba9c9b..bd3e33c0d 100644 --- a/src/components/NavItems/Assistant/AssistantScrapeResults/AssistantTextSpanClassification.jsx +++ b/src/components/NavItems/Assistant/AssistantScrapeResults/AssistantTextSpanClassification.jsx @@ -15,7 +15,6 @@ import Typography from "@mui/material/Typography"; import HelpOutlineOutlinedIcon from "@mui/icons-material/HelpOutlineOutlined"; import { styled } from "@mui/system"; - import { i18nLoadNamespace } from "components/Shared/Languages/i18nLoadNamespace"; import { v4 as uuidv4 } from "uuid"; diff --git a/src/components/NavItems/Assistant/AssistantScrapeResults/TextFooter.jsx b/src/components/NavItems/Assistant/AssistantScrapeResults/TextFooter.jsx index c949d1796..475fb92f1 100644 --- a/src/components/NavItems/Assistant/AssistantScrapeResults/TextFooter.jsx +++ b/src/components/NavItems/Assistant/AssistantScrapeResults/TextFooter.jsx @@ -9,6 +9,8 @@ import Typography from "@mui/material/Typography"; import { ExpandLessOutlined, ExpandMoreOutlined } from "@mui/icons-material"; +import { i18nLoadNamespace } from "components/Shared/Languages/i18nLoadNamespace"; + import { TextCopy } from "../../../Shared/Utils/TextCopy"; import { Translate } from "../../../Shared/Utils/Translate"; import { getLanguageName } from "../../../Shared/Utils/languageUtils"; @@ -24,6 +26,7 @@ export default function TextFooter({ setExpanded, expanded, }) { + const keyword = i18nLoadNamespace("components/Shared/utils"); return ( @@ -41,12 +44,20 @@ export default function TextFooter({ {/* copy to clipboard */} - + +
+ +
+
{/* translate */} - + +
+ +
+
{/* expand/minimise text */} @@ -127,7 +138,7 @@ export function ExpandMinimise({ expanded, }) { return ( - + {displayExpander ? ( expanded ? ( { diff --git a/src/components/Shared/MaterialUiStyles/useMyStyles.jsx b/src/components/Shared/MaterialUiStyles/useMyStyles.jsx index 9a31198ec..ab3aca18a 100644 --- a/src/components/Shared/MaterialUiStyles/useMyStyles.jsx +++ b/src/components/Shared/MaterialUiStyles/useMyStyles.jsx @@ -1,4 +1,5 @@ import { green } from "@mui/material/colors"; + import useClasses from "./useClasses"; const drawerWidthOpen = 300; diff --git a/src/components/Shared/Utils/TextCopy.jsx b/src/components/Shared/Utils/TextCopy.jsx index b192a0d99..6e4b45c85 100644 --- a/src/components/Shared/Utils/TextCopy.jsx +++ b/src/components/Shared/Utils/TextCopy.jsx @@ -42,6 +42,11 @@ export const TextCopy = ({ text, index, type }) => { ) : ( { copyText(text); setTooltipIndex(index); diff --git a/src/components/Shared/Utils/Translate.jsx b/src/components/Shared/Utils/Translate.jsx index 11ebb3b2b..3b3034802 100644 --- a/src/components/Shared/Utils/Translate.jsx +++ b/src/components/Shared/Utils/Translate.jsx @@ -29,7 +29,14 @@ export const Translate = ({ text, type }) => { {keyword("translate")} ) : ( - googleTranslate(text)}> + googleTranslate(text)} + sx={{ + "&:hover": { + backgroundColor: "inherit", + }, + }} + > ); diff --git a/src/redux/sagas/assistantSaga.jsx b/src/redux/sagas/assistantSaga.jsx index fed1cb051..91fb5890c 100644 --- a/src/redux/sagas/assistantSaga.jsx +++ b/src/redux/sagas/assistantSaga.jsx @@ -1,6 +1,26 @@ -import uniqWith from "lodash/uniqWith"; import isEqual from "lodash/isEqual"; +import uniqWith from "lodash/uniqWith"; +import { + all, + call, + fork, + put, + select, + take, + takeLatest, +} from "redux-saga/effects"; +import assistantApiCalls from "../../components/NavItems/Assistant/AssistantApiHandlers/useAssistantApi"; +import DBKFApi from "../../components/NavItems/Assistant/AssistantApiHandlers/useDBKFApi"; +import { + CONTENT_TYPE, + KNOWN_LINKS, + KNOWN_LINK_PATTERNS, + NE_SUPPORTED_LANGS, + TYPE_PATTERNS, + matchPattern, + selectCorrectActions, +} from "../../components/NavItems/Assistant/AssistantRuleBook"; import { cleanAssistantState, setAssistantLoading, @@ -11,41 +31,20 @@ import { setImageVideoSelected, setInputSourceCredDetails, setInputUrl, + setMachineGeneratedTextDetails, setNeDetails, setNewsGenreDetails, setNewsTopicDetails, setPersuasionDetails, - setSubjectivityDetails, setPrevFactChecksDetails, - setMachineGeneratedTextDetails, setProcessUrl, setProcessUrlActions, setScrapedData, setSingleMediaPresent, + setSubjectivityDetails, setUrlMode, } from "../actions/tools/assistantActions"; -import { - all, - call, - fork, - put, - select, - take, - takeLatest, -} from "redux-saga/effects"; -import assistantApiCalls from "../../components/NavItems/Assistant/AssistantApiHandlers/useAssistantApi"; -import DBKFApi from "../../components/NavItems/Assistant/AssistantApiHandlers/useDBKFApi"; -import { - CONTENT_TYPE, - KNOWN_LINK_PATTERNS, - KNOWN_LINKS, - matchPattern, - NE_SUPPORTED_LANGS, - selectCorrectActions, - TYPE_PATTERNS, -} from "../../components/NavItems/Assistant/AssistantRuleBook"; - /** * APIs **/