Skip to content

Commit

Permalink
[TM-1398] Merge remote-tracking branch 'origin/staging' into epic/TM-…
Browse files Browse the repository at this point in the history
…1398-tree-species

# Conflicts:
#	src/components/elements/Inputs/TreeSpeciesInput/__snapshots__/TreeSpeciesInput.stories.storyshot
#	src/components/extensive/Icon/Icon.tsx
  • Loading branch information
roguenet committed Dec 13, 2024
2 parents 2250727 + 030be0c commit 448211f
Show file tree
Hide file tree
Showing 70 changed files with 2,348 additions and 1,111 deletions.
14 changes: 7 additions & 7 deletions src/admin/components/Alerts/DelayedJobsProgressAlert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ type DelayedJobsProgressAlertProps = {
const DelayedJobsProgressAlert: FC<DelayedJobsProgressAlertProps> = ({ show, title, setIsLoadingDelayedJob }) => {
const [delayedJobProcessing, setDelayedJobProcessing] = useState<number>(0);
const [delayedJobTotal, setDalayedJobTotal] = useState<number>(0);
const [proccessMessage, setProccessMessage] = useState<string>("Running 0 out of 0 polygons (0%)");
const [progressMessage, setProgressMessage] = useState<string>("Running 0 out of 0 polygons (0%)");

const store = useStore<AppStore>();
useEffect(() => {
let intervalId: any;
if (show) {
intervalId = setInterval(() => {
const { total_content, processed_content, proccess_message } = store.getState().api;
const { total_content, processed_content, progress_message } = store.getState().api;
setDalayedJobTotal(total_content);
setDelayedJobProcessing(processed_content);
if (proccess_message != "") {
setProccessMessage(proccess_message);
if (progress_message != "") {
setProgressMessage(progress_message);
}
}, 1000);
}
Expand All @@ -34,7 +34,7 @@ const DelayedJobsProgressAlert: FC<DelayedJobsProgressAlertProps> = ({ show, tit
if (intervalId) {
setDelayedJobProcessing(0);
setDalayedJobTotal(0);
setProccessMessage("Running 0 out of 0 polygons (0%)");
setProgressMessage("Running 0 out of 0 polygons (0%)");
clearInterval(intervalId);
}
};
Expand Down Expand Up @@ -64,14 +64,14 @@ const DelayedJobsProgressAlert: FC<DelayedJobsProgressAlertProps> = ({ show, tit
action={
<button
onClick={abortDelayedJob}
className="hover:bg-red-300 ml-2 rounded px-2 py-1 text-sm font-medium text-red-200"
className="ml-2 rounded px-2 py-1 text-sm font-medium text-red-200 hover:bg-red-300"
>
Cancel
</button>
}
>
<AlertTitle>{title}</AlertTitle>
{proccessMessage ?? "Running 0 out of 0 polygons (0%)"}
{progressMessage ?? "Running 0 out of 0 polygons (0%)"}
</Alert>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
import { FC } from "react";
import { TabbedShowLayout, TabProps } from "react-admin";

import { EntityName } from "@/types/common";

import DataCard from "./components/DataCard";
import HeaderMonitoredTab from "./components/HeaderMonitoredTab";

interface IProps extends Omit<TabProps, "label" | "children"> {
label?: string;
type: EntityName;
}

const MonitoredTab: FC<IProps> = ({ label, ...rest }) => {
const MonitoredTab: FC<IProps> = ({ label, type, ...rest }) => {
return (
<TabbedShowLayout.Tab label={label ?? "Monitored Data"} {...rest}>
<div className="flex w-full flex-col gap-4 p-3">
<HeaderMonitoredTab />
<DataCard />
<HeaderMonitoredTab type={type} />
<DataCard type={type} />
</div>
</TabbedShowLayout.Tab>
);
Expand Down
Loading

0 comments on commit 448211f

Please sign in to comment.