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

Regression: Broken components on Federation and Engagement dashboards #25653

Merged
merged 3 commits into from
May 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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/**/*"]
}