From cfeb040d29d94046fc6a25ddaa54f532431adc56 Mon Sep 17 00:00:00 2001 From: Ayobami Akingbade Date: Sun, 11 Feb 2024 22:46:48 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8F=97=EF=B8=8F=20build(tsc):=20fix=20tsc?= =?UTF-8?q?=20issues?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/frontend/views/data/Details/DetailsView.tsx | 3 +++ src/frontend/views/data/Table/useTableColumns.tsx | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/frontend/views/data/Details/DetailsView.tsx b/src/frontend/views/data/Details/DetailsView.tsx index 7f399f578..44f06a52a 100644 --- a/src/frontend/views/data/Details/DetailsView.tsx +++ b/src/frontend/views/data/Details/DetailsView.tsx @@ -17,6 +17,7 @@ import { import { useEntityToOneReferenceFields } from "frontend/hooks/entity/entity.store"; import { DataStates } from "frontend/lib/data/types"; import styled from "styled-components"; +import { useEvaluateScriptContext } from "frontend/hooks/scripts"; import { useEntityViewStateMachine } from "../hooks/useEntityViewStateMachine"; import { viewSpecialDataTypes } from "../viewSpecialDataTypes"; import { evalutePresentationScript } from "../evaluatePresentationScript"; @@ -40,6 +41,7 @@ export function EntityDetailsView({ const entityCrudFields = useEntityCrudFields(entity, "details"); const defaultDateFormat = useAppConfiguration("default_date_format"); const getEntityFieldLabels = useEntityFieldLabels(entity); + const evaluateScriptContext = useEvaluateScriptContext(); const entityToOneReferenceFields = useEntityToOneReferenceFields(entity); const entityFieldSelections = useEntityFieldSelections(entity); const entityPresentationScript = useEntityConfiguration( @@ -98,6 +100,7 @@ export function EntityDetailsView({ from: "details", row: dataDetails?.data, value: value$1, + ...evaluateScriptContext, } ); diff --git a/src/frontend/views/data/Table/useTableColumns.tsx b/src/frontend/views/data/Table/useTableColumns.tsx index a3d9bebab..e4f861701 100644 --- a/src/frontend/views/data/Table/useTableColumns.tsx +++ b/src/frontend/views/data/Table/useTableColumns.tsx @@ -20,6 +20,7 @@ import { ellipsis } from "shared/lib/strings"; import { ITableColumn } from "frontend/design-system/components/Table/types"; import { ActionButtons } from "frontend/design-system/components/Button/ActionButtons"; import { TableFilterType } from "shared/types/data"; +import { useEvaluateScriptContext } from "frontend/hooks/scripts"; import { viewSpecialDataTypes } from "../viewSpecialDataTypes"; import { usePortalTableColumns } from "./portal"; import { evalutePresentationScript } from "../evaluatePresentationScript"; @@ -107,6 +108,7 @@ export const useTableColumns = ( const entityToOneReferenceFields = useEntityToOneReferenceFields(entity); const entityCrudFields = useEntityCrudFields(entity, "table"); const defaultDateFormat = useAppConfiguration("default_date_format"); + const evaluateScriptContext = useEvaluateScriptContext(); const entityPresentationScript = useEntityConfiguration( "entity_presentation_script", entity @@ -171,6 +173,7 @@ export const useTableColumns = ( from: "details", row: row.original, value: value$1, + ...evaluateScriptContext, } );