Skip to content

Commit

Permalink
refactor: remove unused timeline component and move the timeline comp…
Browse files Browse the repository at this point in the history
…onent
  • Loading branch information
mainawycliffe committed Sep 18, 2024
1 parent bfa2f55 commit 29278a2
Show file tree
Hide file tree
Showing 23 changed files with 28 additions and 170 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -219,5 +219,6 @@
},
"msw": {
"workerDirectory": "public"
}
},
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
2 changes: 1 addition & 1 deletion src/api/query-hooks/useConfigChangesHooks.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { configChangesDefaultDateFilter } from "@flanksource-ui/components/Configs/Changes/ConfigChangesFilters/ConfigChangesDateRangeFIlter";
import { useHideDeletedConfigChanges } from "@flanksource-ui/components/Configs/Changes/ConfigsRelatedChanges/FilterBar/ConfigChangesToggledDeletedItems";
import { useConfigChangesArbitraryFilters } from "@flanksource-ui/hooks/useConfigChangesArbitraryFilters";
import useTimeRangeParams from "@flanksource-ui/ui/TimeRangePicker/useTimeRangeParams";
import useTimeRangeParams from "@flanksource-ui/ui/Dates/TimeRangePicker/useTimeRangeParams";
import { UseQueryOptions, useQuery } from "@tanstack/react-query";
import { useMemo } from "react";
import { useParams, useSearchParams } from "react-router-dom";
Expand Down
2 changes: 1 addition & 1 deletion src/api/query-hooks/useJobsHistoryQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { durationOptions } from "@flanksource-ui/components/JobsHistory/Filters/
import { jobHistoryDefaultDateFilter } from "@flanksource-ui/components/JobsHistory/Filters/JobsHistoryFilters";
import { JobHistory } from "@flanksource-ui/components/JobsHistory/JobsHistoryTable";
import { resourceTypeMap } from "@flanksource-ui/components/SchemaResourcePage/SchemaResourceEditJobsTab";
import useTimeRangeParams from "@flanksource-ui/ui/TimeRangePicker/useTimeRangeParams";
import useTimeRangeParams from "@flanksource-ui/ui/Dates/TimeRangePicker/useTimeRangeParams";
import { useQuery, UseQueryOptions } from "@tanstack/react-query";
import { useMemo } from "react";
import { useSearchParams } from "react-router-dom";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { TimeRangePicker } from "@flanksource-ui/ui/TimeRangePicker";
import useTimeRangeParams from "@flanksource-ui/ui/TimeRangePicker/useTimeRangeParams";
import { TimeRangePicker } from "@flanksource-ui/ui/Dates/TimeRangePicker";
import useTimeRangeParams from "@flanksource-ui/ui/Dates/TimeRangePicker/useTimeRangeParams";
import { URLSearchParamsInit } from "react-router-dom";

type Props = {
Expand Down
4 changes: 2 additions & 2 deletions src/components/Forms/Formik/FormikDurationPicker.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {
rangeOptionsCategories,
TimeRangeOption
} from "@flanksource-ui/ui/TimeRangePicker/rangeOptions";
import { TimeRangePicker } from "@flanksource-ui/ui/TimeRangePicker/TimeRangePicker";
} from "@flanksource-ui/ui/Dates/TimeRangePicker/rangeOptions";
import { TimeRangePicker } from "@flanksource-ui/ui/Dates/TimeRangePicker/TimeRangePicker";
import dayjs from "dayjs";
import { useFormikContext } from "formik";
import { useMemo } from "react";
Expand Down
4 changes: 2 additions & 2 deletions src/components/JobsHistory/Filters/JobsHistoryFilters.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import FormikFilterForm from "@flanksource-ui/components/Forms/FormikFilterForm";
import { TimeRangePicker } from "@flanksource-ui/ui/TimeRangePicker";
import useTimeRangeParams from "@flanksource-ui/ui/TimeRangePicker/useTimeRangeParams";
import { TimeRangePicker } from "@flanksource-ui/ui/Dates/TimeRangePicker";
import useTimeRangeParams from "@flanksource-ui/ui/Dates/TimeRangePicker/useTimeRangeParams";
import { URLSearchParamsInit } from "react-router-dom";
import JobHistoryDurationDropdown from "./JobHistoryDurationDropdown";
import JobHistoryNamesDropdown from "./JobHistoryNames";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import FormikFilterForm from "@flanksource-ui/components/Forms/FormikFilterForm"
import { AuthorizationAccessCheck } from "@flanksource-ui/components/Permissions/AuthorizationAccessCheck";
import { tables } from "@flanksource-ui/context/UserAccessContext/permissions";
import { Button } from "@flanksource-ui/ui/Buttons/Button";
import { TimeRangePicker } from "@flanksource-ui/ui/TimeRangePicker";
import useTimeRangeParams from "@flanksource-ui/ui/TimeRangePicker/useTimeRangeParams";
import { TimeRangePicker } from "@flanksource-ui/ui/Dates/TimeRangePicker";
import useTimeRangeParams from "@flanksource-ui/ui/Dates/TimeRangePicker/useTimeRangeParams";
import { useState } from "react";
import { FaEdit } from "react-icons/fa";
import { URLSearchParamsInit } from "react-router-dom";
Expand Down
2 changes: 1 addition & 1 deletion src/pages/playbooks/PlaybookRunsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import {
BreadcrumbNav,
BreadcrumbRoot
} from "@flanksource-ui/ui/BreadcrumbNav";
import useTimeRangeParams from "@flanksource-ui/ui/Dates/TimeRangePicker/useTimeRangeParams";
import { Head } from "@flanksource-ui/ui/Head";
import TabbedLinks from "@flanksource-ui/ui/Tabs/TabbedLinks";
import useTimeRangeParams from "@flanksource-ui/ui/TimeRangePicker/useTimeRangeParams";
import { useQuery } from "@tanstack/react-query";
import { useMemo, useState } from "react";
import { FaHome } from "react-icons/fa";
Expand Down
20 changes: 0 additions & 20 deletions src/ui/Dates/DateTimeRangerPicker.stories.tsx

This file was deleted.

91 changes: 0 additions & 91 deletions src/ui/Dates/DateTimeRangerPicker.tsx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { formatTimeRange } from "../../utils/date";
import { formatTimeRange } from "../../../utils/date";
import { TimeRangeAbsoluteOption, TimeRangeOption } from "./rangeOptions";

type RecentlyRangesProps = {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
import { ComponentMeta, ComponentStory } from "@storybook/react";
import { useState } from "react";
import { TimeRangePicker } from "./index";
import { TimeRangeOption } from "./rangeOptions";

const TimeRangePickerContainer = () => {
const [value, setValue] = useState<TimeRangeOption | undefined>();

const onChange = (range: TimeRangeOption) => {
console.log("range", range);
setValue(range);
};
return <TimeRangePicker style={{ width: "450px" }} onChange={onChange} />;
return (
<TimeRangePicker
style={{ width: "450px" }}
onChange={onChange}
value={value}
/>
);
};

export default {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useAtom } from "jotai";
import { atomWithStorage } from "jotai/utils";
import { useCallback, useEffect, useState } from "react";
import { useSearchParams } from "react-router-dom";
import { formatTimeRange, isValidDate } from "../../utils/date";
import { formatTimeRange, isValidDate } from "../../../utils/date";
import { RecentlyRanges } from "./RecentlyRanges";
import { TimePickerCalendar } from "./TimePickerCalendar";
import { TimePickerInput } from "./TimePickerInput";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import {
formatISODate,
isValidDate,
subtractDateFromNow
} from "../../utils/date";
import { getLocalItem, setLocalItem } from "../../utils/storage";
} from "../../../utils/date";
import { getLocalItem, setLocalItem } from "../../../utils/storage";

export const getIntervalData = (interval: string): [number, string] => {
if (interval === "now") {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
42 changes: 0 additions & 42 deletions src/ui/Dates/__tests__/DateTimeRangerPicker.unit.test.tsx

This file was deleted.

0 comments on commit 29278a2

Please sign in to comment.