From f046ba18ada8b2286c1f666011d0f97c5e707d75 Mon Sep 17 00:00:00 2001 From: indigane Date: Tue, 7 May 2024 13:31:46 +0300 Subject: [PATCH] frontend: Change condition of sale delete button to be always visible --- .../apartment/ApartmentConditionsOfSalePage.tsx | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/frontend/src/features/apartment/ApartmentConditionsOfSalePage.tsx b/frontend/src/features/apartment/ApartmentConditionsOfSalePage.tsx index 77aec4bb1..7888e33bb 100644 --- a/frontend/src/features/apartment/ApartmentConditionsOfSalePage.tsx +++ b/frontend/src/features/apartment/ApartmentConditionsOfSalePage.tsx @@ -7,7 +7,7 @@ import {useFieldArray, useForm, useFormContext} from "react-hook-form"; import {DeleteButton, GenericActionModal, Heading, NavigateBackButton, SaveButton} from "../../common/components"; import {FormProviderForm, RelatedModelInput, SaveFormButton} from "../../common/components/forms"; import {getConditionOfSaleGracePeriodLabel} from "../../common/localisation"; -import {IApartmentConditionOfSale, IApartmentDetails, IOwner, IOwnership} from "../../common/schemas"; +import {IApartmentConditionOfSale, IOwner, IOwnership} from "../../common/schemas"; import { useCreateConditionOfSaleMutation, useDeleteConditionOfSaleMutation, @@ -325,7 +325,7 @@ const DeleteConditionOfSaleButton = ({conditionOfSale}: {conditionOfSale: IApart ); }; -const getConditionsOfSaleTableColumns = (apartment: IApartmentDetails) => { +const getConditionsOfSaleTableColumns = () => { return [ { key: "stair", @@ -392,12 +392,7 @@ const getConditionsOfSaleTableColumns = (apartment: IApartmentDetails) => { { key: "delete", headerName: "", - transform: (obj) => - !apartment.ownerships.find((ownership) => ownership.owner.id === obj.owner.id) && !obj.fulfilled ? ( - - ) : ( - "" - ), + transform: (obj) => , }, ]; }; @@ -413,7 +408,7 @@ const LoadedConditionsOfSalePage = () => { {apartment.conditions_of_sale.length ? (