Skip to content

Commit

Permalink
Using celery task for neuro cognates -- #1182
Browse files Browse the repository at this point in the history
  • Loading branch information
vmonakhov committed Feb 17, 2025
1 parent 9577137 commit f2bd590
Show file tree
Hide file tree
Showing 9 changed files with 291 additions and 184 deletions.
2 changes: 2 additions & 0 deletions src/Layout/Routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import Organizations from "pages/Organizations";
import Perspective from "pages/Perspective";
import Requests from "pages/Requests";
import Search from "pages/Search";
import Suggestions from "pages/Suggestions";
import SupportRoute from "pages/SupportRoute";
import ToolsRoute from "pages/ToolsRoute";
import TopSectionSelector from "pages/TopSectionSelector";
Expand Down Expand Up @@ -65,6 +66,7 @@ const AppRoutes = () => (
<Route path="/import_corpora" element={<CorpImport />} />
<Route path="/import_dialeqt" element={<DialeqtImport />} />
<Route path="/dictionary/:pcid/:poid/perspective/:cid/:oid/*" element={<Perspective />} />
<Route path="/suggestions/:sugg" element={<Suggestions />} />
<Route path="/files" element={<Files />} />
<Route path="/edit_translations" element={<EditTranslations />} />
<Route path="/organizations" element={<Organizations />} />
Expand Down
4 changes: 2 additions & 2 deletions src/Layout/TasksSidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const Wrapper = styled.div`

const onClearTasks = (tasks, remove) => {
tasks.forEach(task => {
if (task.current_stage == task.total_stages && task.progress === 100) {
if (task.current_stage == task.total_stages && task.progress === 100 || task.progress < 0) {
remove(task.id);
}
});
Expand Down Expand Up @@ -60,7 +60,7 @@ const TasksSidebar = ({ visible, tasks, toggle, remove, set, err }) => {
{(tasks && tasks.length && (
<Button
onClick={() => onClearTasks(tasks, remove)}
disabled={!tasks.some(task => task.current_stage == task.total_stages && task.progress === 100)}
disabled={!tasks.some(task => task.current_stage == task.total_stages && task.progress === 100 || task.progress < 0)}
className="lingvo-button-violet-dashed"
>
{getTranslation("Clear completed")}
Expand Down
5 changes: 5 additions & 0 deletions src/api/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,9 @@ export const stringsToTranslate = [
"Naumova Alexandra Vladimirovna",
"negation, negative",
"Neologism",
"Neuro cognate multi-language suggestions",
"Neuro cognate suggestions",
"Neuro cognates computation",
"neuter",
"New organization",
"New password",
Expand Down Expand Up @@ -892,6 +895,8 @@ export const stringsToTranslate = [
"Started dictionary update. Please check out tasks for details.",
"Statistics",
"Stop",
"Stopped manually",
"Stopping",
"Storage",
"Sub string",
"Subject",
Expand Down
Loading

0 comments on commit f2bd590

Please sign in to comment.