Skip to content

Commit

Permalink
Regression: Broken components on Federation and Engagement dashboards (
Browse files Browse the repository at this point in the history
…#25653)

* Fix odd typechecking issues with JSON modules

* Avoid `data` as directory for modules

* rename other `data` folder

Co-authored-by: gabriellsh <gabriel.henriques@rocket.chat>
  • Loading branch information
2 people authored and carlosrodrigues94 committed May 30, 2022
1 parent 9302ea7 commit e9e10da
Show file tree
Hide file tree
Showing 33 changed files with 39 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Box, Skeleton } from '@rocket.chat/fuselage';
import { useTranslation } from '@rocket.chat/ui-contexts';
import React, { ReactElement, useMemo } from 'react';

import CounterSet from '../../../components/data/CounterSet';
import CounterSet from '../../../components/dataView/CounterSet';
import { AsyncStatePhase } from '../../../hooks/useAsyncState';
import { usePolledMethodData } from '../../../hooks/usePolledMethodData';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { useTranslation } from '@rocket.chat/ui-contexts';
import moment from 'moment';
import React, { ReactElement, useMemo, useState } from 'react';

import Growth from '../../../../../../client/components/data/Growth';
import Growth from '../../../../../../client/components/dataView/Growth';
import Section from '../Section';
import DownloadDataButton from '../data/DownloadDataButton';
import PeriodSelector from '../data/PeriodSelector';
import { usePeriodSelectorState } from '../data/usePeriodSelectorState';
import DownloadDataButton from '../dataView/DownloadDataButton';
import PeriodSelector from '../dataView/PeriodSelector';
import { usePeriodSelectorState } from '../dataView/usePeriodSelectorState';
import { useChannelsList } from './useChannelsList';

const ChannelsTab = (): ReactElement => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useQuery } from 'react-query';

import { getFromRestApi } from '../../../../lib/getFromRestApi';
import { getPeriodRange, Period } from '../data/periods';
import { getPeriodRange, Period } from '../dataView/periods';

type UseChannelsListOptions = {
period: Period['key'];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { Box, ActionButton } from '@rocket.chat/fuselage';
import { useToastMessageDispatch, useTranslation } from '@rocket.chat/ui-contexts';
import React, { ComponentProps, ReactElement } from 'react';

import { useToastMessageDispatch } from '@rocket.chat/ui-contexts';
import { useTranslation } from '@rocket.chat/ui-contexts'
import { downloadCsvAs } from '../../../../../../client/lib/download';

type RowFor<THeaders extends readonly string[]> = readonly unknown[] & {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Select } from '@rocket.chat/fuselage';
import { useTranslation } from '@rocket.chat/ui-contexts';
import React, { ReactElement, useMemo } from 'react';

import { useTranslation } from '@rocket.chat/ui-contexts'
import { getPeriod, Period } from './periods';

type PeriodSelectorProps<TPeriod extends Period['key']> = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { TranslationKey } from '@rocket.chat/ui-contexts';
import moment from 'moment';

import { TranslationKey } from '@rocket.chat/ui-contexts'

const label = (
translationKey: TranslationKey,
...replacements: unknown[]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useTranslation } from '@rocket.chat/ui-contexts';
import { useMemo } from 'react';

import { useTranslation } from '@rocket.chat/ui-contexts'
import { getPeriod, Period } from './periods';

export const usePeriodLabel = (period: Period['key']): string => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import { useTranslation } from '@rocket.chat/ui-contexts';
import React, { ReactElement, useMemo } from 'react';

import Section from '../Section';
import DownloadDataButton from '../data/DownloadDataButton';
import LegendSymbol from '../data/LegendSymbol';
import PeriodSelector from '../data/PeriodSelector';
import { usePeriodSelectorState } from '../data/usePeriodSelectorState';
import DownloadDataButton from '../dataView/DownloadDataButton';
import LegendSymbol from '../dataView/LegendSymbol';
import PeriodSelector from '../dataView/PeriodSelector';
import { usePeriodSelectorState } from '../dataView/usePeriodSelectorState';
import { useMessageOrigins } from './useMessageOrigins';
import { useTopFivePopularChannels } from './useTopFivePopularChannels';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import { useTranslation } from '@rocket.chat/ui-contexts';
import moment from 'moment';
import React, { ReactElement, useMemo } from 'react';

import CounterSet from '../../../../../../client/components/data/CounterSet';
import CounterSet from '../../../../../../client/components/dataView/CounterSet';
import Section from '../Section';
import DownloadDataButton from '../data/DownloadDataButton';
import PeriodSelector from '../data/PeriodSelector';
import { usePeriodLabel } from '../data/usePeriodLabel';
import { usePeriodSelectorState } from '../data/usePeriodSelectorState';
import DownloadDataButton from '../dataView/DownloadDataButton';
import PeriodSelector from '../dataView/PeriodSelector';
import { usePeriodLabel } from '../dataView/usePeriodLabel';
import { usePeriodSelectorState } from '../dataView/usePeriodSelectorState';
import { useMessagesSent } from './useMessagesSent';

const MessagesSentSection = (): ReactElement => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useQuery } from 'react-query';

import { getFromRestApi } from '../../../../lib/getFromRestApi';
import { getPeriodRange, Period } from '../data/periods';
import { getPeriodRange, Period } from '../dataView/periods';

type UseMessageOriginsOptions = { period: Period['key'] };

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useQuery } from 'react-query';

import { getFromRestApi } from '../../../../lib/getFromRestApi';
import { getPeriodRange, Period } from '../data/periods';
import { getPeriodRange, Period } from '../dataView/periods';

type UseMessagesSentOptions = { period: Period['key'] };

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useQuery } from 'react-query';

import { getFromRestApi } from '../../../../lib/getFromRestApi';
import { getPeriodRange, Period } from '../data/periods';
import { getPeriodRange, Period } from '../dataView/periods';

type UseTopFivePopularChannelsOptions = { period: Period['key'] };

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import { useTranslation } from '@rocket.chat/ui-contexts';
import moment from 'moment';
import React, { ReactElement, useMemo } from 'react';

import CounterSet from '../../../../../../client/components/data/CounterSet';
import CounterSet from '../../../../../../client/components/dataView/CounterSet';
import { useFormatDate } from '../../../../../../client/hooks/useFormatDate';
import Section from '../Section';
import DownloadDataButton from '../data/DownloadDataButton';
import LegendSymbol from '../data/LegendSymbol';
import DownloadDataButton from '../dataView/DownloadDataButton';
import LegendSymbol from '../dataView/LegendSymbol';
import { useActiveUsers } from './useActiveUsers';

type ActiveUsersSectionProps = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import { useTranslation } from '@rocket.chat/ui-contexts';
import moment from 'moment';
import React, { ReactElement, useMemo } from 'react';

import CounterSet from '../../../../../../client/components/data/CounterSet';
import CounterSet from '../../../../../../client/components/dataView/CounterSet';
import { useFormatDate } from '../../../../../../client/hooks/useFormatDate';
import Section from '../Section';
import DownloadDataButton from '../data/DownloadDataButton';
import PeriodSelector from '../data/PeriodSelector';
import { usePeriodLabel } from '../data/usePeriodLabel';
import { usePeriodSelectorState } from '../data/usePeriodSelectorState';
import DownloadDataButton from '../dataView/DownloadDataButton';
import PeriodSelector from '../dataView/PeriodSelector';
import { usePeriodLabel } from '../dataView/usePeriodLabel';
import { usePeriodSelectorState } from '../dataView/usePeriodSelectorState';
import { useNewUsers } from './useNewUsers';

const TICK_WIDTH = 45;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import moment from 'moment';
import React, { ReactElement, useMemo } from 'react';

import Section from '../Section';
import DownloadDataButton from '../data/DownloadDataButton';
import PeriodSelector from '../data/PeriodSelector';
import { usePeriodSelectorState } from '../data/usePeriodSelectorState';
import DownloadDataButton from '../dataView/DownloadDataButton';
import PeriodSelector from '../dataView/PeriodSelector';
import { usePeriodSelectorState } from '../dataView/usePeriodSelectorState';
import { useUsersByTimeOfTheDay } from './useUsersByTimeOfTheDay';

type UsersByTimeOfTheDaySectionProps = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import moment from 'moment';
import { useQuery } from 'react-query';

import { getFromRestApi } from '../../../../lib/getFromRestApi';
import { getPeriodRange } from '../data/periods';
import { getPeriodRange } from '../dataView/periods';

type UseActiveUsersOptions = { utc: boolean };

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useQuery } from 'react-query';

import { getFromRestApi } from '../../../../lib/getFromRestApi';
import { getPeriodRange, Period } from '../data/periods';
import { getPeriodRange, Period } from '../dataView/periods';

type UseNewUsersOptions = { period: Period['key']; utc: boolean };

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useQuery } from 'react-query';

import { getFromRestApi } from '../../../../lib/getFromRestApi';
import { getPeriodRange, Period } from '../data/periods';
import { getPeriodRange, Period } from '../dataView/periods';

type UseUsersByTimeOfTheDayOptions = { period: Period['key']; utc: boolean };

Expand Down
4 changes: 3 additions & 1 deletion packages/ui-contexts/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"rootDir": "./src",
"outDir": "./dist"
"outDir": "./dist",
"resolveJsonModule": true,
"esModuleInterop": true,
},
"include": ["./src/**/*"]
}

0 comments on commit e9e10da

Please sign in to comment.