From df714b55f04142f0392ad90486b4a3f9e2230b7f Mon Sep 17 00:00:00 2001 From: marco Date: Tue, 18 Nov 2025 15:28:46 +0000 Subject: [PATCH 01/16] latest --- .../GuidedControls/TimestampKey/index.tsx | 24 ----------------- .../Presto/GuidedControls/index.module.css | 7 +---- .../Presto/GuidedControls/index.tsx | 2 -- .../Presto/TimeRangeFooter.module.css | 12 +++++++++ .../TimeRangeInput/Presto/TimeRangeFooter.tsx | 26 +++++++++++++++++++ .../TimestampKey/TimestampKeySelect.tsx | 0 .../Presto}/TimestampKey/sql.ts | 0 .../SearchControls/TimeRangeInput/index.tsx | 22 ++++++++++++++++ 8 files changed, 61 insertions(+), 32 deletions(-) delete mode 100644 components/webui/client/src/pages/SearchPage/SearchControls/Presto/GuidedControls/TimestampKey/index.tsx create mode 100644 components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/Presto/TimeRangeFooter.module.css create mode 100644 components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/Presto/TimeRangeFooter.tsx rename components/webui/client/src/pages/SearchPage/SearchControls/{Presto/GuidedControls => TimeRangeInput/Presto}/TimestampKey/TimestampKeySelect.tsx (100%) rename components/webui/client/src/pages/SearchPage/SearchControls/{Presto/GuidedControls => TimeRangeInput/Presto}/TimestampKey/sql.ts (100%) diff --git a/components/webui/client/src/pages/SearchPage/SearchControls/Presto/GuidedControls/TimestampKey/index.tsx b/components/webui/client/src/pages/SearchPage/SearchControls/Presto/GuidedControls/TimestampKey/index.tsx deleted file mode 100644 index ec909eed41..0000000000 --- a/components/webui/client/src/pages/SearchPage/SearchControls/Presto/GuidedControls/TimestampKey/index.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import InputLabel from "../../../../../../components/InputLabel"; -import guidedGrid from "../index.module.css"; -import TimestampKeySelect from "./TimestampKeySelect"; - - -/** - * Renders the timestamp key selector component. - * - * @return - */ -const TimestampKey = () => { - return ( -
- TIME KEY - -
- ); -}; - -export default TimestampKey; diff --git a/components/webui/client/src/pages/SearchPage/SearchControls/Presto/GuidedControls/index.module.css b/components/webui/client/src/pages/SearchPage/SearchControls/Presto/GuidedControls/index.module.css index 7b248cba1f..596d8086cb 100644 --- a/components/webui/client/src/pages/SearchPage/SearchControls/Presto/GuidedControls/index.module.css +++ b/components/webui/client/src/pages/SearchPage/SearchControls/Presto/GuidedControls/index.module.css @@ -11,12 +11,7 @@ } .from { - grid-column: span 1; - display: flex; -} - -.timestampKey { - grid-column: span 1; + grid-column: span 2; display: flex; } diff --git a/components/webui/client/src/pages/SearchPage/SearchControls/Presto/GuidedControls/index.tsx b/components/webui/client/src/pages/SearchPage/SearchControls/Presto/GuidedControls/index.tsx index fd08cf63c4..e8bd768dbc 100644 --- a/components/webui/client/src/pages/SearchPage/SearchControls/Presto/GuidedControls/index.tsx +++ b/components/webui/client/src/pages/SearchPage/SearchControls/Presto/GuidedControls/index.tsx @@ -7,7 +7,6 @@ import From from "./From"; import guidedGrid from "./index.module.css"; import OrderBy from "./OrderBy"; import Select from "./Select"; -import TimestampKey from "./TimestampKey"; import Where from "./Where"; @@ -21,7 +20,6 @@ const GuidedControls = () => (
+ + + +
+
+
-
- + ); +}; /** * Renders controls for selecting a time range for queries. By default, the component is @@ -86,20 +144,22 @@ const TimeRangeInput = () => { disabled={searchUiState === SEARCH_UI_STATE.QUERY_ID_PENDING || searchUiState === SEARCH_UI_STATE.QUERYING} onChange={handleSelectChange}/> - {timeRangeOption === TIME_RANGE_OPTION.CUSTOM && ( - { - handleRangePickerChange(dates); - }}/> - )} + { + handleRangePickerChange(dates); + }}/>
); }; From f59e33b9191ed731d3c9289ad245b603e15d942e Mon Sep 17 00:00:00 2001 From: marco Date: Mon, 24 Nov 2025 11:28:58 -0500 Subject: [PATCH 10/16] latest --- .../pages/SearchPage/SearchControls/TimeRangeInput/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/index.tsx b/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/index.tsx index 5883790875..63a0b8008f 100644 --- a/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/index.tsx +++ b/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/index.tsx @@ -68,7 +68,7 @@ const CustomDateInput = (props: CustomDateInputProps) => { const timeRangeOption = useSearchStore((state) => state.timeRangeOption); const isStartInput = dateRange === 'start'; - const displayText = timeRangeOption === TIME_RANGE_OPTION.CUSTOM + const displayText = timeRangeOption === TIME_RANGE_OPTION.CUSTOM ? (value || (isStartInput ? 'Start date' : 'End date')) : getTimeRangeDisplayText(timeRangeOption, isStartInput); From d789c35ab63e391e389777f7eb766563e34ed30e Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 26 Nov 2025 18:43:29 +0000 Subject: [PATCH 11/16] latest --- .../TimeRangeInput/TimeDateInput.tsx | 46 ++++++++++++++ .../TimeRangeInput/index.module.css | 11 ---- .../SearchControls/TimeRangeInput/index.tsx | 60 +------------------ .../SearchControls/TimeRangeInput/utils.tsx | 26 ++++++++ 4 files changed, 74 insertions(+), 69 deletions(-) create mode 100644 components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/TimeDateInput.tsx diff --git a/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/TimeDateInput.tsx b/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/TimeDateInput.tsx new file mode 100644 index 0000000000..9e9f1be0a2 --- /dev/null +++ b/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/TimeDateInput.tsx @@ -0,0 +1,46 @@ +import {theme} from "antd"; + +import useSearchStore from "../../SearchState/index"; +import { + getTimeRangeDisplayText, + TIME_RANGE_OPTION, +} from "./utils"; + + +interface TimeDateInputProps { + value: string; + 'date-range': 'start' | 'end'; + disabled?: boolean; +} + +/** + * Custom input component for DatePicker that displays custom text + */ +const TimeDateInput = (props: TimeDateInputProps) => { + const {value, 'date-range': dateRange, disabled} = props; + const timeRangeOption = useSearchStore((state) => state.timeRangeOption); + const {token} = theme.useToken(); + + const isStartInput = dateRange === 'start'; + const displayText = timeRangeOption === TIME_RANGE_OPTION.CUSTOM + ? (value || (isStartInput ? 'Start date' : 'End date')) + : getTimeRangeDisplayText(timeRangeOption, isStartInput); + + return ( + + ); +}; + + +export default TimeDateInput; diff --git a/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/index.module.css b/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/index.module.css index 8177e6114c..8ccdd156ea 100644 --- a/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/index.module.css +++ b/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/index.module.css @@ -17,14 +17,3 @@ border-bottom-left-radius: 0; width: 350px; } - -/* Improve visibility of disabled date picker */ -.rangePicker:global(.ant-picker-disabled) { - background-color: #f5f5f5; - cursor: not-allowed; -} - -.rangePicker:global(.ant-picker-disabled) input { - color: rgba(0, 0, 0, 0.65) !important; - cursor: not-allowed; -} diff --git a/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/index.tsx b/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/index.tsx index 57a7334853..c8effff4a6 100644 --- a/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/index.tsx +++ b/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/index.tsx @@ -12,6 +12,7 @@ import useSearchStore from "../../SearchState/index"; import usePrestoSearchState from "../../SearchState/Presto"; import {PRESTO_SQL_INTERFACE} from "../../SearchState/Presto/typings"; import {SEARCH_UI_STATE} from "../../SearchState/typings"; +import TimeDateInput from "./TimeDateInput"; import styles from "./index.module.css"; import TimeRangeFooter from "./Presto/TimeRangeFooter"; import { @@ -20,63 +21,6 @@ import { TIME_RANGE_OPTION_NAMES, } from "./utils"; -interface CustomDateInputProps { - value: string; - 'date-range': 'start' | 'end'; -} - -/** - * Gets display text for time range option - */ -const getTimeRangeDisplayText = (option: TIME_RANGE_OPTION, isStart: boolean): string => { - switch (option) { - case TIME_RANGE_OPTION.LAST_15_MINUTES: - return isStart ? "15 minutes ago" : "Now"; - case TIME_RANGE_OPTION.LAST_HOUR: - return isStart ? "1 hour ago" : "Now"; - case TIME_RANGE_OPTION.TODAY: - return isStart ? "Start of today" : "End of today"; - case TIME_RANGE_OPTION.YESTERDAY: - return isStart ? "Start of yesterday" : "End of yesterday"; - case TIME_RANGE_OPTION.LAST_7_DAYS: - return isStart ? "7 days ago" : "Now"; - case TIME_RANGE_OPTION.LAST_30_DAYS: - return isStart ? "30 days ago" : "Now"; - case TIME_RANGE_OPTION.LAST_12_MONTHS: - return isStart ? "12 months ago" : "Now"; - case TIME_RANGE_OPTION.MONTH_TO_DATE: - return isStart ? "Start of month" : "Now"; - case TIME_RANGE_OPTION.YEAR_TO_DATE: - return isStart ? "Start of year" : "Now"; - case TIME_RANGE_OPTION.ALL_TIME: - return isStart ? "Earliest" : "Latest"; - case TIME_RANGE_OPTION.CUSTOM: - default: - return isStart ? "Start date" : "End date"; - } -}; - -/** - * Custom input component for DatePicker that displays custom text - */ -const CustomDateInput = (props: CustomDateInputProps) => { - const {value, 'date-range': dateRange} = props; - const timeRangeOption = useSearchStore((state) => state.timeRangeOption); - - const isStartInput = dateRange === 'start'; - const displayText = timeRangeOption === TIME_RANGE_OPTION.CUSTOM - ? (value || (isStartInput ? 'Start date' : 'End date')) - : getTimeRangeDisplayText(timeRangeOption, isStartInput); - - return ( - - ); -}; - /** * Renders controls for selecting a time range for queries. By default, the component is * a select dropdown with a list of preset time ranges. If the user selects "Custom", @@ -146,7 +90,7 @@ const TimeRangeInput = () => { renderExtraFooter={renderFooter} showTime={true} components={{ - input: CustomDateInput, + input: TimeDateInput, }} size={"middle"} value={timeRange} diff --git a/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/utils.tsx b/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/utils.tsx index 1fd6f92b90..ac573400fc 100644 --- a/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/utils.tsx +++ b/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/utils.tsx @@ -122,10 +122,36 @@ const isValidDateRange = ( return null !== dates && null !== dates[0] && null !== dates[1]; }; +/** + * Map of time range options to their display text + */ +const TIME_RANGE_DISPLAY_TEXT_MAP: Record = { + [TIME_RANGE_OPTION.LAST_15_MINUTES]: {start: "15 minutes ago", end: "Now"}, + [TIME_RANGE_OPTION.LAST_HOUR]: {start: "1 hour ago", end: "Now"}, + [TIME_RANGE_OPTION.TODAY]: {start: "Start of today", end: "End of today"}, + [TIME_RANGE_OPTION.YESTERDAY]: {start: "Start of yesterday", end: "End of yesterday"}, + [TIME_RANGE_OPTION.LAST_7_DAYS]: {start: "7 days ago", end: "Now"}, + [TIME_RANGE_OPTION.LAST_30_DAYS]: {start: "30 days ago", end: "Now"}, + [TIME_RANGE_OPTION.LAST_12_MONTHS]: {start: "12 months ago", end: "Now"}, + [TIME_RANGE_OPTION.MONTH_TO_DATE]: {start: "Start of month", end: "Now"}, + [TIME_RANGE_OPTION.YEAR_TO_DATE]: {start: "Start of year", end: "Now"}, + [TIME_RANGE_OPTION.ALL_TIME]: {start: "Earliest", end: "Latest"}, + [TIME_RANGE_OPTION.CUSTOM]: {start: "Start date", end: "End date"}, +}; + +/** + * Gets display text for time range option + */ +const getTimeRangeDisplayText = (option: TIME_RANGE_OPTION, isStart: boolean): string => { + const displayText = TIME_RANGE_DISPLAY_TEXT_MAP[option]; + return isStart ? displayText.start : displayText.end; +}; + export { DEFAULT_TIME_RANGE, DEFAULT_TIME_RANGE_OPTION, + getTimeRangeDisplayText, isValidDateRange, TIME_RANGE_OPTION, TIME_RANGE_OPTION_DAYJS_MAP, From 06a194470d1b3103cc121e7910e423256a98cece Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 27 Nov 2025 15:14:15 +0000 Subject: [PATCH 12/16] latest --- .../TimeRangeInput/TimeDateInput.tsx | 28 +++---- .../TimeRangeInput/index.module.css | 4 +- .../SearchControls/TimeRangeInput/index.tsx | 43 ++++++---- .../SearchControls/TimeRangeInput/utils.tsx | 79 ++++++++++++++----- 4 files changed, 100 insertions(+), 54 deletions(-) diff --git a/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/TimeDateInput.tsx b/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/TimeDateInput.tsx index 9e9f1be0a2..e3ec9b11ff 100644 --- a/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/TimeDateInput.tsx +++ b/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/TimeDateInput.tsx @@ -1,43 +1,35 @@ -import {theme} from "antd"; - import useSearchStore from "../../SearchState/index"; import { - getTimeRangeDisplayText, + DATE_RANGE_POSITION, + TIME_RANGE_DISPLAY_TEXT_MAP, TIME_RANGE_OPTION, } from "./utils"; interface TimeDateInputProps { value: string; - 'date-range': 'start' | 'end'; - disabled?: boolean; + 'date-range': DATE_RANGE_POSITION; } /** - * Custom input component for DatePicker that displays custom text + * Input component for DatePicker that displays custom text for preset time ranges. + * + * @param props + * @return */ const TimeDateInput = (props: TimeDateInputProps) => { - const {value, 'date-range': dateRange, disabled} = props; + const {value, 'date-range': dateRange} = props; const timeRangeOption = useSearchStore((state) => state.timeRangeOption); - const {token} = theme.useToken(); - const isStartInput = dateRange === 'start'; const displayText = timeRangeOption === TIME_RANGE_OPTION.CUSTOM - ? (value || (isStartInput ? 'Start date' : 'End date')) - : getTimeRangeDisplayText(timeRangeOption, isStartInput); + ? value + : TIME_RANGE_DISPLAY_TEXT_MAP[timeRangeOption][dateRange]; return ( ); }; diff --git a/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/index.module.css b/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/index.module.css index 8ccdd156ea..27116fdc7d 100644 --- a/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/index.module.css +++ b/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/index.module.css @@ -3,7 +3,7 @@ } .timeRangeInputContainer :global(.ant-select) { - width: 160px; + min-width: 150px; } /* Makes border flush with range picker */ @@ -15,5 +15,5 @@ .rangePicker { border-top-left-radius: 0; border-bottom-left-radius: 0; - width: 350px; + min-width: 350px; } diff --git a/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/index.tsx b/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/index.tsx index c8effff4a6..76a42eed00 100644 --- a/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/index.tsx +++ b/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/index.tsx @@ -2,8 +2,10 @@ import {useCallback} from "react"; import {CLP_QUERY_ENGINES} from "@webui/common/config"; import { + ConfigProvider, DatePicker, Select, + theme, } from "antd"; import dayjs from "dayjs"; @@ -37,6 +39,8 @@ const TimeRangeInput = () => { searchUiState, } = useSearchStore(); + const {token} = theme.useToken(); + const sqlInterface = usePrestoSearchState((state) => state.sqlInterface); const isPrestoGuided = SETTINGS_QUERY_ENGINE === CLP_QUERY_ENGINES.PRESTO && sqlInterface === PRESTO_SQL_INTERFACE.GUIDED; @@ -84,22 +88,31 @@ const TimeRangeInput = () => { disabled={searchUiState === SEARCH_UI_STATE.QUERY_ID_PENDING || searchUiState === SEARCH_UI_STATE.QUERYING} onChange={handleSelectChange}/> - { - handleRangePickerChange(dates); - }}/> + > + { + handleRangePickerChange(dates); + }}/> + ); }; diff --git a/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/utils.tsx b/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/utils.tsx index ac573400fc..9c87a26ff1 100644 --- a/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/utils.tsx +++ b/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/utils.tsx @@ -32,6 +32,8 @@ enum TIME_RANGE_OPTION { CUSTOM = "Custom", } + + const DEFAULT_TIME_RANGE_OPTION = TIME_RANGE_OPTION.ALL_TIME; /* eslint-disable no-magic-numbers, @typescript-eslint/require-await */ @@ -123,36 +125,75 @@ const isValidDateRange = ( }; /** - * Map of time range options to their display text + * AntD date range position. */ -const TIME_RANGE_DISPLAY_TEXT_MAP: Record = { - [TIME_RANGE_OPTION.LAST_15_MINUTES]: {start: "15 minutes ago", end: "Now"}, - [TIME_RANGE_OPTION.LAST_HOUR]: {start: "1 hour ago", end: "Now"}, - [TIME_RANGE_OPTION.TODAY]: {start: "Start of today", end: "End of today"}, - [TIME_RANGE_OPTION.YESTERDAY]: {start: "Start of yesterday", end: "End of yesterday"}, - [TIME_RANGE_OPTION.LAST_7_DAYS]: {start: "7 days ago", end: "Now"}, - [TIME_RANGE_OPTION.LAST_30_DAYS]: {start: "30 days ago", end: "Now"}, - [TIME_RANGE_OPTION.LAST_12_MONTHS]: {start: "12 months ago", end: "Now"}, - [TIME_RANGE_OPTION.MONTH_TO_DATE]: {start: "Start of month", end: "Now"}, - [TIME_RANGE_OPTION.YEAR_TO_DATE]: {start: "Start of year", end: "Now"}, - [TIME_RANGE_OPTION.ALL_TIME]: {start: "Earliest", end: "Latest"}, - [TIME_RANGE_OPTION.CUSTOM]: {start: "Start date", end: "End date"}, -}; +enum DATE_RANGE_POSITION { + START = "start", + END = "end", +} /** - * Gets display text for time range option + * Map of time range options to their display text */ -const getTimeRangeDisplayText = (option: TIME_RANGE_OPTION, isStart: boolean): string => { - const displayText = TIME_RANGE_DISPLAY_TEXT_MAP[option]; - return isStart ? displayText.start : displayText.end; +const TIME_RANGE_DISPLAY_TEXT_MAP: Record< + TIME_RANGE_OPTION, + Record +> = { + [TIME_RANGE_OPTION.LAST_15_MINUTES]: { + [DATE_RANGE_POSITION.START]: "15 minutes ago", + [DATE_RANGE_POSITION.END]: "Now", + }, + [TIME_RANGE_OPTION.LAST_HOUR]: { + [DATE_RANGE_POSITION.START]: "1 hour ago", + [DATE_RANGE_POSITION.END]: "Now", + }, + [TIME_RANGE_OPTION.TODAY]: { + [DATE_RANGE_POSITION.START]: "Start of today", + [DATE_RANGE_POSITION.END]: "End of today", + }, + [TIME_RANGE_OPTION.YESTERDAY]: { + [DATE_RANGE_POSITION.START]: "Start of yesterday", + [DATE_RANGE_POSITION.END]: "End of yesterday", + }, + [TIME_RANGE_OPTION.LAST_7_DAYS]: { + [DATE_RANGE_POSITION.START]: "7 days ago", + [DATE_RANGE_POSITION.END]: "Now", + }, + [TIME_RANGE_OPTION.LAST_30_DAYS]: { + [DATE_RANGE_POSITION.START]: "30 days ago", + [DATE_RANGE_POSITION.END]: "Now", + }, + [TIME_RANGE_OPTION.LAST_12_MONTHS]: { + [DATE_RANGE_POSITION.START]: "12 months ago", + [DATE_RANGE_POSITION.END]: "Now", + }, + [TIME_RANGE_OPTION.MONTH_TO_DATE]: { + [DATE_RANGE_POSITION.START]: "Start of month", + [DATE_RANGE_POSITION.END]: "Now", + }, + [TIME_RANGE_OPTION.YEAR_TO_DATE]: { + [DATE_RANGE_POSITION.START]: "Start of year", + [DATE_RANGE_POSITION.END]: "Now", + }, + [TIME_RANGE_OPTION.ALL_TIME]: { + [DATE_RANGE_POSITION.START]: "First timestamp", + [DATE_RANGE_POSITION.END]: "Last timestamp", + }, + // Custom option is just a placeholder for typing purposes, its values should not + // be used. + [TIME_RANGE_OPTION.CUSTOM]: { + [DATE_RANGE_POSITION.START]: "Start date", + [DATE_RANGE_POSITION.END]: "End date", + }, }; export { + DATE_RANGE_POSITION, DEFAULT_TIME_RANGE, DEFAULT_TIME_RANGE_OPTION, - getTimeRangeDisplayText, isValidDateRange, + TIME_RANGE_DISPLAY_TEXT_MAP, TIME_RANGE_OPTION, TIME_RANGE_OPTION_DAYJS_MAP, TIME_RANGE_OPTION_NAMES, From 2786aea3880a67f836f850217312f4809e091d7a Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 27 Nov 2025 15:20:33 +0000 Subject: [PATCH 13/16] latest --- .../SearchControls/TimeRangeInput/TimeDateInput.tsx | 5 +++-- .../SearchPage/SearchControls/TimeRangeInput/index.tsx | 1 + .../SearchPage/SearchControls/TimeRangeInput/utils.tsx | 8 ++++++-- components/webui/server/.env | 4 ++-- tools/yscope-dev-utils | 2 +- 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/TimeDateInput.tsx b/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/TimeDateInput.tsx index e3ec9b11ff..bae6e62122 100644 --- a/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/TimeDateInput.tsx +++ b/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/TimeDateInput.tsx @@ -1,6 +1,7 @@ import useSearchStore from "../../SearchState/index"; import { DATE_RANGE_POSITION, + DATE_RANGE_PROP_KEY, TIME_RANGE_DISPLAY_TEXT_MAP, TIME_RANGE_OPTION, } from "./utils"; @@ -8,7 +9,7 @@ import { interface TimeDateInputProps { value: string; - 'date-range': DATE_RANGE_POSITION; + [DATE_RANGE_PROP_KEY]: DATE_RANGE_POSITION; } /** @@ -18,7 +19,7 @@ interface TimeDateInputProps { * @return */ const TimeDateInput = (props: TimeDateInputProps) => { - const {value, 'date-range': dateRange} = props; + const {value, [DATE_RANGE_PROP_KEY]: dateRange} = props; const timeRangeOption = useSearchStore((state) => state.timeRangeOption); const displayText = timeRangeOption === TIME_RANGE_OPTION.CUSTOM diff --git a/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/index.tsx b/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/index.tsx index 76a42eed00..c4df3ac286 100644 --- a/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/index.tsx +++ b/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/index.tsx @@ -23,6 +23,7 @@ import { TIME_RANGE_OPTION_NAMES, } from "./utils"; + /** * Renders controls for selecting a time range for queries. By default, the component is * a select dropdown with a list of preset time ranges. If the user selects "Custom", diff --git a/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/utils.tsx b/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/utils.tsx index 9c87a26ff1..a7ac81dfcc 100644 --- a/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/utils.tsx +++ b/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/utils.tsx @@ -32,8 +32,6 @@ enum TIME_RANGE_OPTION { CUSTOM = "Custom", } - - const DEFAULT_TIME_RANGE_OPTION = TIME_RANGE_OPTION.ALL_TIME; /* eslint-disable no-magic-numbers, @typescript-eslint/require-await */ @@ -132,6 +130,11 @@ enum DATE_RANGE_POSITION { END = "end", } +/** + * AntD RangePicker prop key for date range position. + */ +const DATE_RANGE_PROP_KEY = "date-range"; + /** * Map of time range options to their display text */ @@ -190,6 +193,7 @@ const TIME_RANGE_DISPLAY_TEXT_MAP: Record< export { DATE_RANGE_POSITION, + DATE_RANGE_PROP_KEY, DEFAULT_TIME_RANGE, DEFAULT_TIME_RANGE_OPTION, isValidDateRange, diff --git a/components/webui/server/.env b/components/webui/server/.env index 823c31b2df..b51df3a791 100644 --- a/components/webui/server/.env +++ b/components/webui/server/.env @@ -5,11 +5,11 @@ NODE_ENV=production # Network HOST=localhost -PORT=3005 +PORT=3000 # Database CLP_DB_USER=clp-user -CLP_DB_PASS=cSTpqglBCtY +CLP_DB_PASS= #Presto PRESTO_CATALOG=clp diff --git a/tools/yscope-dev-utils b/tools/yscope-dev-utils index 49e0749179..6eb62e9f97 160000 --- a/tools/yscope-dev-utils +++ b/tools/yscope-dev-utils @@ -1 +1 @@ -Subproject commit 49e07491790bb9a0adae10b1a125e9fd9b9eb487 +Subproject commit 6eb62e9f97ab699ae6e6055749b933750947cc52 From 11c45e8eb2565c6f5650280522c3ab602c88c6fa Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 27 Nov 2025 15:22:13 +0000 Subject: [PATCH 14/16] latest --- .../SearchControls/TimeRangeInput/TimeDateInput.tsx | 11 +++++------ .../SearchControls/TimeRangeInput/index.tsx | 6 +++--- .../SearchControls/TimeRangeInput/utils.tsx | 1 + 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/TimeDateInput.tsx b/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/TimeDateInput.tsx index bae6e62122..f90f1dd5e1 100644 --- a/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/TimeDateInput.tsx +++ b/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/TimeDateInput.tsx @@ -22,16 +22,15 @@ const TimeDateInput = (props: TimeDateInputProps) => { const {value, [DATE_RANGE_PROP_KEY]: dateRange} = props; const timeRangeOption = useSearchStore((state) => state.timeRangeOption); - const displayText = timeRangeOption === TIME_RANGE_OPTION.CUSTOM - ? value - : TIME_RANGE_DISPLAY_TEXT_MAP[timeRangeOption][dateRange]; + const displayText = timeRangeOption === TIME_RANGE_OPTION.CUSTOM ? + value : + TIME_RANGE_DISPLAY_TEXT_MAP[timeRangeOption][dateRange]; return ( + readOnly={true} + value={displayText}/> ); }; diff --git a/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/index.tsx b/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/index.tsx index c4df3ac286..c4920f3b7c 100644 --- a/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/index.tsx +++ b/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/index.tsx @@ -14,9 +14,9 @@ import useSearchStore from "../../SearchState/index"; import usePrestoSearchState from "../../SearchState/Presto"; import {PRESTO_SQL_INTERFACE} from "../../SearchState/Presto/typings"; import {SEARCH_UI_STATE} from "../../SearchState/typings"; -import TimeDateInput from "./TimeDateInput"; import styles from "./index.module.css"; import TimeRangeFooter from "./Presto/TimeRangeFooter"; +import TimeDateInput from "./TimeDateInput"; import { isValidDateRange, TIME_RANGE_OPTION, @@ -102,11 +102,11 @@ const TimeRangeInput = () => { className={styles["rangePicker"] || ""} renderExtraFooter={renderFooter} showTime={true} + size={"middle"} + value={timeRange} components={{ input: TimeDateInput, }} - size={"middle"} - value={timeRange} disabled={timeRangeOption !== TIME_RANGE_OPTION.CUSTOM || searchUiState === SEARCH_UI_STATE.QUERY_ID_PENDING || searchUiState === SEARCH_UI_STATE.QUERYING} diff --git a/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/utils.tsx b/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/utils.tsx index a7ac81dfcc..016e64ee2c 100644 --- a/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/utils.tsx +++ b/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/utils.tsx @@ -182,6 +182,7 @@ const TIME_RANGE_DISPLAY_TEXT_MAP: Record< [DATE_RANGE_POSITION.START]: "First timestamp", [DATE_RANGE_POSITION.END]: "Last timestamp", }, + // Custom option is just a placeholder for typing purposes, its values should not // be used. [TIME_RANGE_OPTION.CUSTOM]: { From 6289b4787721b8522e19e9c0d8d7c3d00ba52363 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 27 Nov 2025 15:26:32 +0000 Subject: [PATCH 15/16] latest --- .../SearchPage/SearchControls/TimeRangeInput/TimeDateInput.tsx | 3 ++- .../pages/SearchPage/SearchControls/TimeRangeInput/index.tsx | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/TimeDateInput.tsx b/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/TimeDateInput.tsx index f90f1dd5e1..44fe47c650 100644 --- a/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/TimeDateInput.tsx +++ b/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/TimeDateInput.tsx @@ -29,8 +29,9 @@ const TimeDateInput = (props: TimeDateInputProps) => { return ( + /> ); }; diff --git a/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/index.tsx b/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/index.tsx index c4920f3b7c..d66bbebd52 100644 --- a/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/index.tsx +++ b/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/index.tsx @@ -89,6 +89,7 @@ const TimeRangeInput = () => { disabled={searchUiState === SEARCH_UI_STATE.QUERY_ID_PENDING || searchUiState === SEARCH_UI_STATE.QUERYING} onChange={handleSelectChange}/> + {/* Customize disabled styling to make date strings easier to read */} Date: Thu, 27 Nov 2025 15:31:44 +0000 Subject: [PATCH 16/16] latest --- .../SearchPage/SearchControls/TimeRangeInput/TimeDateInput.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/TimeDateInput.tsx b/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/TimeDateInput.tsx index 44fe47c650..f90f1dd5e1 100644 --- a/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/TimeDateInput.tsx +++ b/components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/TimeDateInput.tsx @@ -29,9 +29,8 @@ const TimeDateInput = (props: TimeDateInputProps) => { return ( + value={displayText}/> ); };