diff --git a/src/components/selectRangeUsePlanPage/ExtensionColumn.js b/src/components/selectRangeUsePlanPage/ExtensionColumn.js
index e78a4859..2cd6cc07 100644
--- a/src/components/selectRangeUsePlanPage/ExtensionColumn.js
+++ b/src/components/selectRangeUsePlanPage/ExtensionColumn.js
@@ -149,6 +149,8 @@ export default function ExtensionColumn({ user, currentPage, agreement }) {
return
District Manager Rejected
;
case PLAN_EXTENSION_STATUS.REPLACEMENT_PLAN_CREATED:
return Replacement Plan Created
;
+ case PLAN_EXTENSION_STATUS.REPLACED_WITH_REPLACEMENT_PLAN:
+ return Replaced
;
case PLAN_EXTENSION_STATUS.REPLACEMENT_PLAN_ACTIVE:
return Active Replacement Plan
;
case PLAN_EXTENSION_STATUS.AWAITING_EXTENSION:
@@ -260,6 +262,8 @@ export default function ExtensionColumn({ user, currentPage, agreement }) {
return Awaiting Extension
;
case PLAN_EXTENSION_STATUS.REPLACEMENT_PLAN_CREATED:
return Replacement Plan Created
;
+ case PLAN_EXTENSION_STATUS.REPLACED_WITH_REPLACEMENT_PLAN:
+ return Replaced
;
case PLAN_EXTENSION_STATUS.REPLACEMENT_PLAN_ACTIVE:
return Active Replacement Plan
;
case PLAN_EXTENSION_STATUS.EXTENDED:
@@ -330,6 +334,8 @@ export default function ExtensionColumn({ user, currentPage, agreement }) {
return Awaiting Extension
;
case PLAN_EXTENSION_STATUS.REPLACEMENT_PLAN_CREATED:
return Replacement Plan Created
;
+ case PLAN_EXTENSION_STATUS.REPLACED_WITH_REPLACEMENT_PLAN:
+ return Replaced
;
case PLAN_EXTENSION_STATUS.REPLACEMENT_PLAN_ACTIVE:
return Active Replacement Plan
;
case PLAN_EXTENSION_STATUS.EXTENDED:
diff --git a/src/components/selectRangeUsePlanPage/PlanActions.js b/src/components/selectRangeUsePlanPage/PlanActions.js
index df4859d5..9ac3cdfe 100644
--- a/src/components/selectRangeUsePlanPage/PlanActions.js
+++ b/src/components/selectRangeUsePlanPage/PlanActions.js
@@ -82,9 +82,10 @@ export default function PlanActions({
].includes(agreement.plan?.extensionStatus) && (
)}
- {[PLAN_EXTENSION_STATUS.REPLACEMENT_PLAN_CREATED].includes(
- agreement.plan?.extensionStatus,
- ) && (
+ {[
+ PLAN_EXTENSION_STATUS.REPLACEMENT_PLAN_CREATED,
+ PLAN_EXTENSION_STATUS.REPLACED_WITH_REPLACEMENT_PLAN,
+ ].includes(agreement.plan?.extensionStatus) && (
{
const debouncedOrderBy = useDebounce(orderBy, 500);
const [order = 'asc', setOrder] = useQueryParam('order', StringParam);
const debouncedOrder = useDebounce(order, 500);
- const filterInfo = getDataFromLocalStorage("filter-info");
+ const filterInfo = getDataFromLocalStorage('filter-info');
const [filters = { agreementCheck: 'true' }, setFilters] = useQueryParam(
'filters',
NewObjectParam,
@@ -80,30 +80,32 @@ const SelectRangeUsePlanPage = ({ match, history }) => {
// startup
useEffect(() => {
// Set initial page info from localstorage
- const pageInfo = getDataFromLocalStorage("page-info");
+ const pageInfo = getDataFromLocalStorage('page-info');
if (pageInfo) {
if (pageInfo.pageNumber) setPage(pageInfo.pageNumber);
if (pageInfo.pageLimit) setLimit(pageInfo.pageLimit);
}
// Initialize filters
- setFilters({
+ setFilters({
...filterInfo,
agreementCheck: 'true',
});
- setFiltersInitialized(true); // Workaround flag for checkbox racing the filter initialization
+ setFiltersInitialized(true); // Workaround flag for checkbox racing the filter initialization
}, []);
- const [planCheck = filterInfo?.planCheck || false, setPlanCheck] = useQueryParam(
- 'planCheck',
- BooleanParam,
- );
- const [agreementCheck = filterInfo?.agreementCheck !== undefined ? filterInfo.agreementCheck : true, setAgreementCheck] = useQueryParam(
- 'agreementCheck',
- BooleanParam,
- );
- const [activeCheck = filterInfo?.activeCheck || false, setActiveCheck] = useQueryParam(
- 'activeCheck',
- BooleanParam,
- );
+ const [planCheck = filterInfo?.planCheck || false, setPlanCheck] =
+ useQueryParam('planCheck', BooleanParam);
+ const [
+ agreementCheck = filterInfo?.agreementCheck !== undefined
+ ? filterInfo.agreementCheck
+ : true,
+ setAgreementCheck,
+ ] = useQueryParam('agreementCheck', BooleanParam);
+ const [activeCheck = filterInfo?.activeCheck || false, setActiveCheck] =
+ useQueryParam('activeCheck', BooleanParam);
+ const [
+ showReplacedPlans = filterInfo?.showReplacedPlans || false,
+ setShowReplacedPlans,
+ ] = useQueryParam('showReplacedPlans', BooleanParam);
useEffect(() => {
if (filtersInitialized) addToFilters('planCheck', planCheck);
}, [planCheck]);
@@ -113,6 +115,10 @@ const SelectRangeUsePlanPage = ({ match, history }) => {
useEffect(() => {
if (filtersInitialized) addToFilters('activeCheck', activeCheck);
}, [activeCheck]);
+ useEffect(() => {
+ if (filtersInitialized)
+ addToFilters('showReplacedPlans', showReplacedPlans);
+ }, [showReplacedPlans]);
const { warningToast, removeToast, errorToast } = useToast();
@@ -155,38 +161,38 @@ const SelectRangeUsePlanPage = ({ match, history }) => {
const setPage = (page) => {
history.replace(`/home/${page}/${history.location.search}`);
- }
+ };
const setPageAndSave = (page) => {
history.replace(`/home/${page}/${history.location.search}`);
- const currPageInfo = getDataFromLocalStorage("page-info");
+ const currPageInfo = getDataFromLocalStorage('page-info');
const pageInfo = {
...currPageInfo,
- pageNumber: page
- }
- saveDataInLocalStorage("page-info", pageInfo);
- }
+ pageNumber: page,
+ };
+ saveDataInLocalStorage('page-info', pageInfo);
+ };
const setPageLimitAndSave = (limit) => {
- const currPageInfo = getDataFromLocalStorage("page-info");
+ const currPageInfo = getDataFromLocalStorage('page-info');
const pageInfo = {
...currPageInfo,
- pageLimit: limit
- }
- saveDataInLocalStorage("page-info", pageInfo);
+ pageLimit: limit,
+ };
+ saveDataInLocalStorage('page-info', pageInfo);
setLimit(limit);
- }
+ };
const setSaveFilterInfo = (filterCol, value) => {
if (!filtersInitialized) return; // Avoid empty update
- const currFilterInfo = getDataFromLocalStorage("filter-info");
+ const currFilterInfo = getDataFromLocalStorage('filter-info');
const filterInfo = {
- ...currFilterInfo
- }
+ ...currFilterInfo,
+ };
filterInfo[filterCol] = value;
- saveDataInLocalStorage("filter-info", filterInfo);
- }
+ saveDataInLocalStorage('filter-info', filterInfo);
+ };
const { agreements, totalPages, currentPage = page, totalItems } = data || {};
const classes = useStyles();
@@ -204,7 +210,7 @@ const SelectRangeUsePlanPage = ({ match, history }) => {
checked={planCheck}
onChange={() => {
setPlanCheck(!planCheck);
- setSaveFilterInfo("planCheck", !planCheck);
+ setSaveFilterInfo('planCheck', !planCheck);
}}
name="planCheck"
color="primary"
@@ -218,7 +224,7 @@ const SelectRangeUsePlanPage = ({ match, history }) => {
checked={agreementCheck}
onChange={() => {
setAgreementCheck(!agreementCheck);
- setSaveFilterInfo("agreementCheck", !agreementCheck);
+ setSaveFilterInfo('agreementCheck', !agreementCheck);
}}
name="agreementCheck"
color="primary"
@@ -232,7 +238,7 @@ const SelectRangeUsePlanPage = ({ match, history }) => {
checked={activeCheck}
onChange={() => {
setActiveCheck(!activeCheck);
- setSaveFilterInfo("activeCheck", !activeCheck);
+ setSaveFilterInfo('activeCheck', !activeCheck);
}}
name="activeCheck"
color="primary"
@@ -240,6 +246,20 @@ const SelectRangeUsePlanPage = ({ match, history }) => {
}
label="Active RUP"
/>
+ {
+ setShowReplacedPlans(!showReplacedPlans);
+ setSaveFilterInfo('showReplacedPlans', !showReplacedPlans);
+ }}
+ name="shwoReplacedPlans"
+ color="primary"
+ />
+ }
+ label="Replaced Plans"
+ />
{isUserAgrologist(user) && (
{
setSearchSelectedZones={setSearchSelectedZones}
/>
)}
- {(isUserAdmin(user)) && (
+ {isUserAdmin(user) && (