From 40d559ff62e398a0bff1a23a4417cbf1cfeac21f Mon Sep 17 00:00:00 2001 From: Leonardo <leomilho@gmail.com> Date: Mon, 10 Mar 2025 15:41:34 +0100 Subject: [PATCH] feat: date logic pills --- src/lib/components/DataTypeIcon/{index.tsx => index.ts} | 4 +--- .../panel/querysidepanel/QueryBuilderLogicPillsPanel.tsx | 6 ++++++ 2 files changed, 7 insertions(+), 3 deletions(-) rename src/lib/components/DataTypeIcon/{index.tsx => index.ts} (87%) diff --git a/src/lib/components/DataTypeIcon/index.tsx b/src/lib/components/DataTypeIcon/index.ts similarity index 87% rename from src/lib/components/DataTypeIcon/index.tsx rename to src/lib/components/DataTypeIcon/index.ts index 8f626b006..770ef1d7e 100644 --- a/src/lib/components/DataTypeIcon/index.tsx +++ b/src/lib/components/DataTypeIcon/index.ts @@ -15,8 +15,6 @@ const IconMap: Record<SchemaAttributeTypes, string> = { array: 'icon-[ic--baseline-data-array]', }; -function getDataTypeIcon(data_type?: SchemaAttributeTypes): string { +export function getDataTypeIcon(data_type?: SchemaAttributeTypes): string { return data_type && IconMap[data_type] ? IconMap[data_type] : 'icon-[carbon--undefined]'; } - -export { getDataTypeIcon }; diff --git a/src/lib/querybuilder/panel/querysidepanel/QueryBuilderLogicPillsPanel.tsx b/src/lib/querybuilder/panel/querysidepanel/QueryBuilderLogicPillsPanel.tsx index 93e5f2d2d..8fdc9db0e 100644 --- a/src/lib/querybuilder/panel/querysidepanel/QueryBuilderLogicPillsPanel.tsx +++ b/src/lib/querybuilder/panel/querysidepanel/QueryBuilderLogicPillsPanel.tsx @@ -26,6 +26,7 @@ export const QueryBuilderLogicPillsPanel = (props: { : ((props.connection?.params?.handleId ? toHandleData(props.connection.params.handleId).attributeType : null) as string); if (filterType === 'string') filterType = 'string'; else if (filterType === 'int' || filterType === 'float') filterType = 'number'; + else if (filterType === 'datetime') filterType = 'datetime'; const dataOps = [ { @@ -55,6 +56,11 @@ export const QueryBuilderLogicPillsPanel = (props: { description: 'Text', icon: 'icon-[ic--baseline-abc]', }, + { + title: 'datetime', + description: 'Date and Time', + icon: 'icon-[carbon--calendar]', + }, ].filter(item => !filterType || item.title === filterType); const onDragStart = (event: React.DragEvent, value: AllLogicDescriptions) => { -- GitLab