mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2024-12-31 21:38:19 +03:00
Renamed file containing date range and date interval utils
This commit is contained in:
parent
d2ebc880a0
commit
e5185f2099
22 changed files with 22 additions and 24 deletions
|
@ -1,7 +1,7 @@
|
|||
import { createSlice, PayloadAction, PrepareAction } from '@reduxjs/toolkit';
|
||||
import { mergeDeepRight } from 'ramda';
|
||||
import { Theme } from '../../utils/theme';
|
||||
import { DateInterval } from '../../utils/dates/types';
|
||||
import { DateInterval } from '../../utils/helpers/dateIntervals';
|
||||
import { TagsOrder } from '../../tags/data/TagsListChildrenProps';
|
||||
import { ShortUrlsOrder } from '../../short-urls/data';
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ import classNames from 'classnames';
|
|||
import { SearchField } from '../utils/SearchField';
|
||||
import { DateRangeSelector } from '../utils/dates/DateRangeSelector';
|
||||
import { formatIsoDate } from '../utils/helpers/date';
|
||||
import { DateRange, datesToDateRange } from '../utils/dates/types';
|
||||
import { DateRange, datesToDateRange } from '../utils/helpers/dateIntervals';
|
||||
import { supportsAllTagsFiltering } from '../utils/helpers/features';
|
||||
import { SelectedServer } from '../servers/data';
|
||||
import { OrderDir } from '../utils/helpers/ordering';
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { DropdownItem } from 'reactstrap';
|
||||
import { FC } from 'react';
|
||||
import { DATE_INTERVALS, DateInterval, rangeOrIntervalToString } from './types';
|
||||
import { DATE_INTERVALS, DateInterval, rangeOrIntervalToString } from '../helpers/dateIntervals';
|
||||
|
||||
export interface DateIntervalDropdownProps {
|
||||
active?: DateInterval;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { FC } from 'react';
|
||||
import { DropdownBtn } from '../DropdownBtn';
|
||||
import { rangeOrIntervalToString } from './types';
|
||||
import { rangeOrIntervalToString } from '../helpers/dateIntervals';
|
||||
import { DateIntervalDropdownItems, DateIntervalDropdownProps } from './DateIntervalDropdownItems';
|
||||
|
||||
export const DateIntervalSelector: FC<DateIntervalDropdownProps> = ({ onChange, active, allText }) => (
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { endOfDay } from 'date-fns';
|
||||
import { DateInput } from './DateInput';
|
||||
import { DateRange } from './types';
|
||||
import { DateRange } from '../helpers/dateIntervals';
|
||||
|
||||
interface DateRangeRowProps extends DateRange {
|
||||
onStartDateChange: (date: Date | null) => void;
|
||||
|
|
|
@ -9,7 +9,7 @@ import {
|
|||
intervalToDateRange,
|
||||
rangeIsInterval,
|
||||
dateRangeIsEmpty,
|
||||
} from './types';
|
||||
} from '../helpers/dateIntervals';
|
||||
import { DateRangeRow } from './DateRangeRow';
|
||||
import { DateIntervalDropdownItems } from './DateIntervalDropdownItems';
|
||||
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
import { subDays, startOfDay, endOfDay } from 'date-fns';
|
||||
import { cond, filter, isEmpty, T } from 'ramda';
|
||||
import { dateOrNull, DateOrString, formatInternational, isBeforeOrEqual, parseISO } from '../../helpers/date';
|
||||
|
||||
// TODO Rename this to src/utils/helpers/dateIntervals.ts
|
||||
import { dateOrNull, DateOrString, formatInternational, isBeforeOrEqual, parseISO } from './date';
|
||||
|
||||
export interface DateRange {
|
||||
startDate?: Date | null;
|
|
@ -27,7 +27,7 @@ import { DoughnutChartCard } from './charts/DoughnutChartCard';
|
|||
import { SortableBarChartCard } from './charts/SortableBarChartCard';
|
||||
import { VisitsInfo } from './reducers/types';
|
||||
import { useVisitsQuery } from './helpers/hooks';
|
||||
import { DateInterval, DateRange, toDateRange } from '../utils/dates/types';
|
||||
import { DateInterval, DateRange, toDateRange } from '../utils/helpers/dateIntervals';
|
||||
|
||||
export type VisitsStatsProps = PropsWithChildren<{
|
||||
getVisits: (params: VisitsParams, doIntervalFallback?: boolean) => void;
|
||||
|
|
|
@ -2,7 +2,7 @@ import { DeepPartial } from '@reduxjs/toolkit';
|
|||
import { useLocation, useNavigate } from 'react-router-dom';
|
||||
import { useMemo } from 'react';
|
||||
import { isEmpty, mergeDeepRight, pipe } from 'ramda';
|
||||
import { DateRange, datesToDateRange } from '../../utils/dates/types';
|
||||
import { DateRange, datesToDateRange } from '../../utils/helpers/dateIntervals';
|
||||
import { OrphanVisitType, VisitsFilter } from '../types';
|
||||
import { parseQuery, stringifyQuery } from '../../utils/helpers/query';
|
||||
import { formatIsoDate } from '../../utils/helpers/date';
|
||||
|
|
|
@ -2,7 +2,7 @@ import { flatten, prop, range, splitEvery } from 'ramda';
|
|||
import { createAction, createSlice } from '@reduxjs/toolkit';
|
||||
import { ShlinkPaginator, ShlinkVisits, ShlinkVisitsParams } from '../../api/types';
|
||||
import { CreateVisit, Visit } from '../types';
|
||||
import { DateInterval, dateToMatchingInterval } from '../../utils/dates/types';
|
||||
import { DateInterval, dateToMatchingInterval } from '../../utils/helpers/dateIntervals';
|
||||
import { LoadVisits, VisitsInfo, VisitsLoaded } from './types';
|
||||
import { createAsyncThunk } from '../../utils/helpers/redux';
|
||||
import { ShlinkState } from '../../container/types';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { ShlinkVisitsParams } from '../../../api/types';
|
||||
import { DateInterval } from '../../../utils/dates/types';
|
||||
import { DateInterval } from '../../../utils/helpers/dateIntervals';
|
||||
import { ProblemDetailsError } from '../../../api/types/errors';
|
||||
import { Visit } from '../../types';
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { ShortUrl } from '../../short-urls/data';
|
||||
import { DateRange } from '../../utils/dates/types';
|
||||
import { DateRange } from '../../utils/helpers/dateIntervals';
|
||||
|
||||
export type OrphanVisitType = 'base_url' | 'invalid_short_url' | 'regular_404';
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ import { endOfDay, formatISO, startOfDay } from 'date-fns';
|
|||
import { MemoryRouter, useLocation, useNavigate } from 'react-router-dom';
|
||||
import { ShortUrlsFilteringBar as filteringBarCreator } from '../../src/short-urls/ShortUrlsFilteringBar';
|
||||
import { ReachableServer, SelectedServer } from '../../src/servers/data';
|
||||
import { DateRange } from '../../src/utils/dates/types';
|
||||
import { DateRange } from '../../src/utils/helpers/dateIntervals';
|
||||
import { formatDate } from '../../src/utils/helpers/date';
|
||||
import { renderWithEvents } from '../__helpers__/setUpTest';
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { screen, waitFor } from '@testing-library/react';
|
||||
import { DateIntervalDropdownItems } from '../../../src/utils/dates/DateIntervalDropdownItems';
|
||||
import { DATE_INTERVALS, DateInterval, rangeOrIntervalToString } from '../../../src/utils/dates/types';
|
||||
import { DATE_INTERVALS, DateInterval, rangeOrIntervalToString } from '../../../src/utils/helpers/dateIntervals';
|
||||
import { DropdownBtn } from '../../../src/utils/DropdownBtn';
|
||||
import { renderWithEvents } from '../../__helpers__/setUpTest';
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { screen, waitFor } from '@testing-library/react';
|
||||
import { DateInterval, rangeOrIntervalToString } from '../../../src/utils/dates/types';
|
||||
import { DateInterval, rangeOrIntervalToString } from '../../../src/utils/helpers/dateIntervals';
|
||||
import { DateIntervalSelector } from '../../../src/utils/dates/DateIntervalSelector';
|
||||
import { renderWithEvents } from '../../__helpers__/setUpTest';
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { screen, waitFor } from '@testing-library/react';
|
||||
import { Mock } from 'ts-mockery';
|
||||
import { DateRangeSelector, DateRangeSelectorProps } from '../../../src/utils/dates/DateRangeSelector';
|
||||
import { DateInterval } from '../../../src/utils/dates/types';
|
||||
import { DateInterval } from '../../../src/utils/helpers/dateIntervals';
|
||||
import { renderWithEvents } from '../../__helpers__/setUpTest';
|
||||
|
||||
describe('<DateRangeSelector />', () => {
|
||||
|
|
|
@ -6,7 +6,7 @@ import {
|
|||
intervalToDateRange,
|
||||
rangeIsInterval,
|
||||
rangeOrIntervalToString,
|
||||
} from '../../../../src/utils/dates/types';
|
||||
} from '../../../../src/utils/helpers/dateIntervals';
|
||||
import { parseDate } from '../../../../src/utils/helpers/date';
|
||||
|
||||
describe('date-types', () => {
|
||||
|
|
|
@ -12,7 +12,7 @@ import { ShlinkVisits } from '../../../src/api/types';
|
|||
import { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient';
|
||||
import { ShlinkState } from '../../../src/container/types';
|
||||
import { formatIsoDate } from '../../../src/utils/helpers/date';
|
||||
import { DateInterval } from '../../../src/utils/dates/types';
|
||||
import { DateInterval } from '../../../src/utils/helpers/dateIntervals';
|
||||
import { ShortUrl } from '../../../src/short-urls/data';
|
||||
import { createNewVisits } from '../../../src/visits/reducers/visitCreation';
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ import { ShlinkVisits } from '../../../src/api/types';
|
|||
import { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient';
|
||||
import { ShlinkState } from '../../../src/container/types';
|
||||
import { formatIsoDate } from '../../../src/utils/helpers/date';
|
||||
import { DateInterval } from '../../../src/utils/dates/types';
|
||||
import { DateInterval } from '../../../src/utils/helpers/dateIntervals';
|
||||
import { createNewVisits } from '../../../src/visits/reducers/visitCreation';
|
||||
import { VisitsInfo } from '../../../src/visits/reducers/types';
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ import { ShlinkVisits } from '../../../src/api/types';
|
|||
import { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient';
|
||||
import { ShlinkState } from '../../../src/container/types';
|
||||
import { formatIsoDate } from '../../../src/utils/helpers/date';
|
||||
import { DateInterval } from '../../../src/utils/dates/types';
|
||||
import { DateInterval } from '../../../src/utils/helpers/dateIntervals';
|
||||
import { createNewVisits } from '../../../src/visits/reducers/visitCreation';
|
||||
import { VisitsInfo } from '../../../src/visits/reducers/types';
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ import { ShlinkVisits } from '../../../src/api/types';
|
|||
import { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient';
|
||||
import { ShlinkState } from '../../../src/container/types';
|
||||
import { formatIsoDate } from '../../../src/utils/helpers/date';
|
||||
import { DateInterval } from '../../../src/utils/dates/types';
|
||||
import { DateInterval } from '../../../src/utils/helpers/dateIntervals';
|
||||
import { createNewVisits } from '../../../src/visits/reducers/visitCreation';
|
||||
|
||||
describe('shortUrlVisitsReducer', () => {
|
||||
|
|
|
@ -11,7 +11,7 @@ import { ShlinkVisits } from '../../../src/api/types';
|
|||
import { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient';
|
||||
import { ShlinkState } from '../../../src/container/types';
|
||||
import { formatIsoDate } from '../../../src/utils/helpers/date';
|
||||
import { DateInterval } from '../../../src/utils/dates/types';
|
||||
import { DateInterval } from '../../../src/utils/helpers/dateIntervals';
|
||||
import { createNewVisits } from '../../../src/visits/reducers/visitCreation';
|
||||
|
||||
describe('tagVisitsReducer', () => {
|
||||
|
|
Loading…
Reference in a new issue