Skip to content

Commit

Permalink
OP-1437: Block saving/editing historical data (#33)
Browse files Browse the repository at this point in the history
* OP-1437: Block saving/editing historical data

* OP-1437: Removal of console log
  • Loading branch information
olewandowski1 authored May 15, 2023
1 parent 8bbc5ba commit 5fb78cb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/components/PricelistForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/ItemsPricelistDetailsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const ItemsPriceListDetailsPage = (props) => {
};

return (
<div className={clsx(classes.page, { [classes.locked]: isLocked })}>
<div className={clsx(classes.page, pricelist.validityTo && classes.locked)}>
<ErrorBoundary>
<ProgressOrError progress={isFetching} error={error} />
{!isFetching && (
Expand Down
2 changes: 1 addition & 1 deletion src/pages/ServicesPricelistDetailsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const ServicesPriceListDetailsPage = (props) => {
};

return (
<div className={clsx(classes.page, { [classes.locked]: isLocked })}>
<div className={clsx(classes.page, pricelist.validityTo && classes.locked)}>
<ErrorBoundary>
<ProgressOrError progress={isFetching} error={error} />
{!isFetching && (
Expand Down

0 comments on commit 5fb78cb

Please sign in to comment.