Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking β€œSign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upcoming: [DI-23083] - Migrated CloudPulseTimeRangeSelect to DateTimeRangePicker #11573

Merged
merged 44 commits into from
Feb 6, 2025
Merged
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
0e31ff6
upcoming: [DI-20931] - Replaced CloudPulseTimeRange with date time ra…
nikhagra-akamai Dec 27, 2024
0ef704c
upcoming: [DI-20931] - Added preference capability to date time range…
nikhagra-akamai Dec 31, 2024
cb4526d
upcoming: [DI-20931] - Added date range picker support in contextual …
nikhagra-akamai Jan 8, 2025
ee9f80f
upcoming: [DI-20931] - Updated test cases
nikhagra-akamai Jan 9, 2025
b913190
upcoming: [DI-20933] - Added default timezone value
nikhagra-akamai Jan 10, 2025
da2444d
upcoming: [DI-20933] - Added disabled state for timezone
nikhagra-akamai Jan 10, 2025
b8d5c47
upcoming: [DI-20933] - Added relative time duration in metric request…
nikhagra-akamai Jan 13, 2025
6ba5ea5
upcoming: [DI-20933] - Removed widget time duration from metric request
nikhagra-akamai Jan 15, 2025
eb55e17
upcoming: [DI-20933] - Updated value to be saved in preferences
nikhagra-akamai Jan 16, 2025
6477dfd
upcoming: [DI-20933] - Updated ifelse ladder to switch statement
nikhagra-akamai Jan 16, 2025
6cd1789
upcoming: [DI-20933] - Updated contextual view
nikhagra-akamai Jan 16, 2025
ea5228a
upcoming: [DI-20933] - Moved common methods to utils file
nikhagra-akamai Jan 16, 2025
799e43b
upcoming: [DI-20933] - Renamed type name
nikhagra-akamai Jan 16, 2025
e49cc12
upcoming: [DI-20933] - Renamed disabledTimeZone to disableTimeZone
nikhagra-akamai Jan 16, 2025
83569d4
upcoming: [DI-20933] - Code refactoring
nikhagra-akamai Jan 21, 2025
e3d039d
upcoming: [DI-20933] - Removed unused variabled
nikhagra-akamai Jan 21, 2025
51110e3
upcoming: [DI-20933] - Updatef failing test cases
nikhagra-akamai Jan 21, 2025
38bff82
upcoming: [DI-20931] - Updated logic to retain date time value for pr…
nikhagra-akamai Jan 21, 2025
ef53c8c
upcoming: [DI-20931] - Updated metrics call logic
nikhagra-akamai Jan 21, 2025
e93ac51
upcoming: [DI-20933] - Removed unused variable
nikhagra-akamai Jan 21, 2025
4f17486
upcoming: [DI-20933] - Added 1 hour in preset
nikhagra-akamai Jan 21, 2025
7556662
upcoming: [DI-20933] - bug fix for 1 hour preset
nikhagra-akamai Jan 22, 2025
ed19fe9
upcoming: [DI-20933] - Updated failing test cases
nikhagra-akamai Jan 22, 2025
8202028
upcoming: [DI-20932] - Made input readonly for time range picker
nikhagra-akamai Jan 22, 2025
b7525a6
upcoming: [DI-20932] - Added qa id
nikhagra-akamai Jan 22, 2025
fa27b71
upcoiming: [DI-20931] - Added default start & end date for undefined …
nikhagra-akamai Jan 22, 2025
3b6b0fb
upcoming: [DI-23187] - Changed end date for this month preset option
nikhagra-akamai Jan 24, 2025
1010f58
upcoming: [DI-23186] - Changed format of date in date picker
nikhagra-akamai Jan 24, 2025
53c0d76
upcoming: [DI-20931] - Set 0 seconds to selected date
nikhagra-akamai Jan 27, 2025
b7e5f5d
upcoming: [DI-20931] - Set seconds value to 0 in default value
nikhagra-akamai Jan 27, 2025
b731e14
upcoming: [DI-20931] - Set seconds value to 0 in default value
nikhagra-akamai Jan 27, 2025
eff2b61
upcoming: [DI-20931] - Updated test cases
nikhagra-akamai Jan 27, 2025
f3fa4d3
upcoming: [DI-20931] - Updated logic to set 0 seconds
nikhagra-akamai Jan 27, 2025
91e8be1
upcoming: [DI-20931] - updated logic to set 0 for seconds
nikhagra-akamai Jan 28, 2025
594ddff
upcoming: [DI-20931] - Added support for multiple screen resolution
nikhagra-akamai Jan 28, 2025
fb3fcb5
upcoming: [DI-23083] - Added changeset
nikhagra-akamai Jan 28, 2025
d034eb6
upcoming: [DI-20931] - Added test cases
nikhagra-akamai Jan 28, 2025
e8bc56b
Merge branch 'develop' of github.com:linode/manager into date-range-p…
nikhagra-akamai Jan 29, 2025
bd982f0
upcoming: [DI-23083
nikhagra-akamai Feb 4, 2025
b6880fe
upcoming: [DI-23083] - Added styling for MuiOutlinedInput in light & …
nikhagra-akamai Feb 4, 2025
9c541ce
added changeset
nikhagra-akamai Feb 4, 2025
c3395bb
Merge branch 'develop' of github.com:linode/manager into date-range-p…
nikhagra-akamai Feb 5, 2025
c596759
upcoming: [DI-23083] - Update function parameters
nikhagra-akamai Feb 5, 2025
a6c0f28
upcoming: [DI-23083] - Updated timezone value in date picker input field
nikhagra-akamai Feb 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
upcoming: [DI-20933] - Renamed disabledTimeZone to disableTimeZone
nikhagra-akamai committed Jan 28, 2025
commit e49cc123603e47276e2e1afcc11f9343395f32c5
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ import type { DateTime } from 'luxon';
export interface DateTimePickerProps {
/** Additional props for the DateCalendar */
dateCalendarProps?: Partial<DateCalendarProps<DateTime>>;
disabledTimeZone?: boolean;
disableTimeZone?: boolean;
/** Error text for the date picker field */
errorText?: string;
/** Format for displaying the date-time */
@@ -64,7 +64,7 @@ export interface DateTimePickerProps {

export const DateTimePicker = ({
dateCalendarProps = {},
disabledTimeZone = false,
disableTimeZone = false,
errorText = '',
format = 'yyyy-MM-dd HH:mm',
label = 'Select Date and Time',
@@ -235,8 +235,7 @@ export const DateTimePicker = ({
<Grid item xs={4}>
<TimePicker
minTime={
minDate &&
minDate.toISODate() === selectedDateTime?.toISODate()
minDate?.toISODate() === selectedDateTime?.toISODate()
? minDate
: undefined
}
@@ -278,7 +277,7 @@ export const DateTimePicker = ({
{showTimeZone && (
<Grid item xs={7}>
<TimeZoneSelect
disabled={disabledTimeZone}
disable={disableTimeZone}
label={timeZoneSelectProps?.label || 'Timezone'}
noMarginTop
onChange={handleTimeZoneChange}
Original file line number Diff line number Diff line change
@@ -8,9 +8,14 @@ import { DateTimePicker } from './DateTimePicker';

import type { SxProps, Theme } from '@mui/material/styles';

interface PresetType {
label: string;
value: string;
}

export interface DateTimeRangePickerProps {
/** If true, disable the timezone drop down */
disabledTimeZone?: boolean;
disableTimeZone?: boolean;

/** If true, shows the date presets field instead of the date pickers */
enablePresets?: boolean;
@@ -94,7 +99,7 @@ const presetsOptions: { label: string; value: DatePresetType }[] = [

export const DateTimeRangePicker = (props: DateTimeRangePickerProps) => {
const {
disabledTimeZone = false,
disableTimeZone = false,

enablePresets = false,

@@ -128,13 +133,7 @@ export const DateTimeRangePicker = (props: DateTimeRangePickerProps) => {
const [endDateTime, setEndDateTime] = useState<DateTime | null>(
endDateTimeValue
);
const [presetValue, setPresetValue] = useState<
| {
label: string;
value: string;
}
| undefined
>(
const [presetValue, setPresetValue] = useState<PresetType | undefined>(
presetsOptions.find((option) => option.value === presetsDefaultValue) ??
presetsOptions[0]
);
@@ -279,7 +278,7 @@ export const DateTimeRangePicker = (props: DateTimeRangePickerProps) => {
onChange: (value) => setStartTimeZone(value),
value: startTimeZone,
}}
disabledTimeZone={disabledTimeZone}
disableTimeZone={disableTimeZone}
errorText={startDateError ?? undefined}
format={format}
label={startLabel}
@@ -293,7 +292,7 @@ export const DateTimeRangePicker = (props: DateTimeRangePickerProps) => {
timeZoneSelectProps={{
value: startTimeZone,
}}
disabledTimeZone={disabledTimeZone}
disableTimeZone={disableTimeZone}
format={format}
label={endLabel}
minDate={startDateTime || undefined}
4 changes: 2 additions & 2 deletions packages/manager/src/components/DatePicker/TimeZoneSelect.tsx
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ import { timezones } from 'src/assets/timezones/timezones';
type Timezone = typeof timezones[number];

interface TimeZoneSelectProps {
disabled?: boolean;
disable?: boolean;
errorText?: string;
label?: string;
noMarginTop?: boolean;
@@ -39,7 +39,7 @@ const getTimezoneOptions = () => {
const timezoneOptions = getTimezoneOptions();

export const TimeZoneSelect = ({
disabled = false,
disable: disabled = false,
errorText,
label = 'Timezone',
noMarginTop = false,
Original file line number Diff line number Diff line change
@@ -74,7 +74,7 @@ export const CloudPulseDateTimeRangePicker = React.memo(
sx={{
minWidth: '226px',
}}
disabledTimeZone
disableTimeZone
enablePresets
onChange={handleDateChange}
/>