Skip to content

Commit

Permalink
Merge pull request #796 from wri/release/valiant-velvetseed
Browse files Browse the repository at this point in the history
[RELEASE] Valiant Velvetseed
  • Loading branch information
roguenet authored Jan 9, 2025
2 parents 04ea546 + 4708244 commit 84a70e2
Show file tree
Hide file tree
Showing 63 changed files with 1,131 additions and 213 deletions.
Binary file modified public/images/graphic-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/images/graphic-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ const indicatorDescription2 =
const noDataMap = (
<div className="absolute top-0 flex h-full w-full">
<div className="relative flex w-[23vw] flex-col gap-3 p-6">
<div className="absolute left-0 top-0 h-full w-full rounded-l-xl bg-white bg-opacity-20 backdrop-blur" />
<div className="absolute top-0 left-0 h-full w-full rounded-l-xl bg-white bg-opacity-20 backdrop-blur" />
<Text
variant={"text-14-semibold"}
className="z-10 w-fit border-b-2 border-white border-opacity-20 pb-1.5 text-white"
Expand All @@ -217,7 +217,7 @@ const noDataMap = (
</div>
<div className="w-full p-6">
<div className="relative flex h-full w-full flex-col items-center justify-center gap-2 rounded-xl border border-white">
<div className="absolute left-0 top-0 h-full w-full rounded-xl bg-white bg-opacity-20 backdrop-blur" />
<div className="absolute top-0 left-0 h-full w-full rounded-xl bg-white bg-opacity-20 backdrop-blur" />
<Text variant={"text-32-semibold"} className="z-10 text-white">
No Data to Display
</Text>
Expand Down Expand Up @@ -648,7 +648,7 @@ const DataCard = ({
</div>
</When>
<When condition={tabActive === 1}>
<div className="relative z-auto flex w-full gap-8 px-6 pb-6 pt-2">
<div className="relative z-auto flex w-full max-w-[calc(100vw-356px)] gap-8 px-6 pt-2 pb-6">
<Dropdown
containerClassName={classNames("absolute left-full -translate-x-full pr-6 z-[1] !h-8", {
hidden: selected.includes("6")
Expand All @@ -659,7 +659,7 @@ const DataCard = ({
defaultValue={["0"]}
onChange={option => setSelectedPolygonUuid(option[0])}
/>
<div className="sticky top-[77px] flex h-[calc(100vh-320px)] w-1/4 min-w-[25%] flex-col gap-3">
<div className="sticky top-[77px] flex h-[calc(100vh-320px)] w-1/4 min-w-[25%] max-w-[calc(25vw-356px)] flex-col gap-3">
<Text variant={"text-14-semibold"} className="w-fit text-blueCustom-900">
Indicator Description
</Text>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ const MonitoredCharts = ({

return (
<div
className={classNames("flex w-full flex-col gap-6", {
className={classNames("flex w-full max-w-[calc(75vw-356px)] flex-col gap-6 lg:max-w-[calc(75vw-395px)]", {
"relative z-10 bg-white": hasNoData
})}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ const StatusDisplay = ({
</Text>
<Text variant="text-12-bold" as="span">
{" "}
{titleStatus == AuditLogEntityEnum.Polygon ? record?.title : removeUnderscore(name)}.
{titleStatus == AuditLogEntityEnum.Polygon ? record?.title || record?.poly_name : removeUnderscore(name)}.
</Text>
</div>
);
Expand Down
8 changes: 1 addition & 7 deletions src/admin/components/ResourceTabs/PolygonReviewTab/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import { IconNames } from "@/components/extensive/Icon/Icon";
import ModalAdd from "@/components/extensive/Modal/ModalAdd";
import ModalConfirm from "@/components/extensive/Modal/ModalConfirm";
import { ModalId } from "@/components/extensive/Modal/ModalConst";
import { useLoading } from "@/context/loaderAdmin.provider";
import { useMapAreaContext } from "@/context/mapArea.provider";
import { useModalContext } from "@/context/modal.provider";
import { useMonitoredDataContext } from "@/context/monitoredData.provider";
Expand Down Expand Up @@ -153,7 +152,6 @@ const PolygonReviewTab: FC<IProps> = props => {
const [saveFlags, setSaveFlags] = useState<boolean>(false);
const [polygonFromMap, setPolygonFromMap] = useState<IpolygonFromMap>({ isOpen: false, uuid: "" });
const [errorMessage, setErrorMessage] = useState<string | null>(null);
const { showLoader, hideLoader } = useLoading();
const {
setSelectedPolygonsInCheckbox,
setPolygonCriteriaMap,
Expand Down Expand Up @@ -315,8 +313,7 @@ const PolygonReviewTab: FC<IProps> = props => {
}, [shouldRefetchValidation]);
const uploadFiles = async () => {
const uploadPromises = [];
showLoader();

closeModal(ModalId.ADD_POLYGON);
for (const file of files) {
const fileToUpload = file.rawFile as File;
const site_uuid = record.uuid;
Expand Down Expand Up @@ -351,10 +348,8 @@ const PolygonReviewTab: FC<IProps> = props => {
}
refetch();
refetchSiteBbox();
closeModal(ModalId.ADD_POLYGON);
setPolygonLoaded(false);
setSubmitPolygonLoaded(false);
hideLoader();
} catch (error) {
let errorMessage;

Expand All @@ -380,7 +375,6 @@ const PolygonReviewTab: FC<IProps> = props => {
errorMessage = t("An unknown error occurred");
}
openNotification("error", t("Error uploading file"), errorMessage || t("An unknown error occurred"));
hideLoader();
}
};

Expand Down
19 changes: 2 additions & 17 deletions src/admin/modules/sites/components/SiteShow.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { FC, useState } from "react";
import { FC } from "react";
import { Show, TabbedShowLayout } from "react-admin";

import ShowActions from "@/admin/components/Actions/ShowActions";
import DelayedJobsProgressAlert from "@/admin/components/Alerts/DelayedJobsProgressAlert";
import AuditLogTab from "@/admin/components/ResourceTabs/AuditLogTab/AuditLogTab";
import { AuditLogButtonStates } from "@/admin/components/ResourceTabs/AuditLogTab/constants/enum";
import ChangeRequestsTab from "@/admin/components/ResourceTabs/ChangeRequestsTab/ChangeRequestsTab";
Expand All @@ -16,9 +15,6 @@ import { RecordFrameworkProvider } from "@/context/framework.provider";
import { MapAreaProvider } from "@/context/mapArea.provider";

const SiteShow: FC = () => {
const [isLoadingDelayedJob, setIsLoadingDelayedJob] = useState(false);
const [alertTitle, setAlertTitle] = useState("");

return (
<Show
title={<ShowTitle moduleName="Site" getTitle={record => record?.name} />}
Expand All @@ -30,13 +26,7 @@ const SiteShow: FC = () => {
<InformationTab type="sites" />
<TabbedShowLayout.Tab label="Polygon Review">
<MapAreaProvider>
<PolygonReviewTab
label=""
type={"sites"}
setIsLoadingDelayedJob={setIsLoadingDelayedJob!}
isLoadingDelayedJob={isLoadingDelayedJob!}
setAlertTitle={setAlertTitle!}
/>
<PolygonReviewTab label="" type={"sites"} />
</MapAreaProvider>
</TabbedShowLayout.Tab>
<GalleryTab label="Site Gallery" entity="sites" />
Expand All @@ -46,11 +36,6 @@ const SiteShow: FC = () => {
<AuditLogTab entity={AuditLogButtonStates.SITE} />
</TabbedShowLayout>
</RecordFrameworkProvider>
<DelayedJobsProgressAlert
show={isLoadingDelayedJob}
title={alertTitle}
setIsLoadingDelayedJob={setIsLoadingDelayedJob!}
/>
</Show>
);
};
Expand Down
2 changes: 1 addition & 1 deletion src/admin/utils/forms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const setDefaultConditionalFieldsAnswers = (answers: any, steps: FormStep
steps.forEach(step => {
step.fields.forEach(field => {
if (field.type === FieldType.Conditional && typeof output[field.name] !== "boolean") {
output[field.name] = true;
output[field.name] = false;
}
});
});
Expand Down
16 changes: 16 additions & 0 deletions src/assets/icons/leaf-circle_pd.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions src/assets/icons/leaf-native-circle_pd.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions src/assets/icons/leaf-planted-circle_pd.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/icons/native-species.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions src/assets/icons/new-tag-tree-species-custom.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 84a70e2

Please sign in to comment.