From 5fb78cbb5b480164c3f24ca31d49b1e40f97822e Mon Sep 17 00:00:00 2001 From: olewandowski1 <109145288+olewandowski1@users.noreply.github.com> Date: Mon, 15 May 2023 11:55:53 +0200 Subject: [PATCH] OP-1437: Block saving/editing historical data (#33) * OP-1437: Block saving/editing historical data * OP-1437: Removal of console log --- src/components/PricelistForm.js | 3 ++- src/pages/ItemsPricelistDetailsPage.js | 2 +- src/pages/ServicesPricelistDetailsPage.js | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/PricelistForm.js b/src/components/PricelistForm.js index ab33b39..90b61b5 100644 --- a/src/components/PricelistForm.js +++ b/src/components/PricelistForm.js @@ -22,7 +22,8 @@ const PricelistForm = (props) => { isValid, clearMedicalPricelists, } = props; - const canSave = () => pricelist.name && pricelist.pricelistDate && isValid === true; + + const canSave = () => pricelist.name && pricelist.pricelistDate && !pricelist.validityTo && isValid === true; useEffect(() => { return () => { diff --git a/src/pages/ItemsPricelistDetailsPage.js b/src/pages/ItemsPricelistDetailsPage.js index 677251a..552f0d9 100644 --- a/src/pages/ItemsPricelistDetailsPage.js +++ b/src/pages/ItemsPricelistDetailsPage.js @@ -79,7 +79,7 @@ const ItemsPriceListDetailsPage = (props) => { }; return ( -
+
{!isFetching && ( diff --git a/src/pages/ServicesPricelistDetailsPage.js b/src/pages/ServicesPricelistDetailsPage.js index 76a1c75..935a74a 100644 --- a/src/pages/ServicesPricelistDetailsPage.js +++ b/src/pages/ServicesPricelistDetailsPage.js @@ -79,7 +79,7 @@ const ServicesPriceListDetailsPage = (props) => { }; return ( -
+
{!isFetching && (