Skip to content

Commit

Permalink
chore(ui): organise component directory structure (#15199)
Browse files Browse the repository at this point in the history
* chore(ui): organise component directory structure

* fix tests

* fix tests
  • Loading branch information
chirag-madlani authored Feb 16, 2024
1 parent 90b4933 commit 146ccc5
Show file tree
Hide file tree
Showing 869 changed files with 4,248 additions and 4,340 deletions.
14 changes: 7 additions & 7 deletions openmetadata-ui/src/main/resources/ui/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ import { I18nextProvider } from 'react-i18next';
import { Router } from 'react-router-dom';
import { ToastContainer } from 'react-toastify';
import 'react-toastify/dist/ReactToastify.min.css';
import ApplicationConfigProvider from './components/ApplicationConfigProvider/ApplicationConfigProvider';
import AppRouter from './components/AppRouter/AppRouter';
import { AuthProvider } from './components/Auth/AuthProviders/AuthProvider';
import DirectionProvider from './components/DirectionProvider/DirectionProvider';
import ErrorBoundary from './components/common/ErrorBoundary/ErrorBoundary';
import DomainProvider from './components/Domain/DomainProvider/DomainProvider';
import { EntityExportModalProvider } from './components/Entity/EntityExportModalProvider/EntityExportModalProvider.component';
import ErrorBoundary from './components/ErrorBoundary/ErrorBoundary';
import GlobalSearchProvider from './components/GlobalSearchProvider/GlobalSearchProvider';
import PermissionProvider from './components/PermissionProvider/PermissionProvider';
import TourProvider from './components/TourProvider/TourProvider';
import WebAnalyticsProvider from './components/WebAnalytics/WebAnalyticsProvider';
import WebSocketProvider from './components/WebSocketProvider/WebSocketProvider';
import { TOAST_OPTIONS } from './constants/Toasts.constants';
import ApplicationConfigProvider from './context/ApplicationConfigProvider/ApplicationConfigProvider';
import DirectionProvider from './context/DirectionProvider/DirectionProvider';
import GlobalSearchProvider from './context/GlobalSearchProvider/GlobalSearchProvider';
import PermissionProvider from './context/PermissionProvider/PermissionProvider';
import TourProvider from './context/TourProvider/TourProvider';
import WebSocketProvider from './context/WebSocketProvider/WebSocketProvider';
import { history } from './utils/HistoryUtils';
import i18n from './utils/i18next/LocalUtil';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ import { noop } from 'lodash';
import React, { useState } from 'react';
import { ReactComponent as ThreadIcon } from '../../../assets/svg/thread.svg';
import UserPopOverCard from '../../../components/common/PopOverCard/UserPopOverCard';
import Reactions from '../../../components/Reactions/Reactions';
import { ReactionOperation } from '../../../enums/reactions.enum';
import {
Post,
ReactionType,
Thread,
} from '../../../generated/entity/feed/thread';
import { useActivityFeedProvider } from '../ActivityFeedProvider/ActivityFeedProvider';
import Reactions from '../Reactions/Reactions';
import ActivityFeedActions from '../Shared/ActivityFeedActions';
import './activity-feed-card.style.less';
import FeedCardBodyV1 from './FeedCardBody/FeedCardBodyV1';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import {
MarkdownToHTMLConverter,
} from '../../../../utils/FeedUtils';
import RichTextEditorPreviewer from '../../../common/RichTextEditor/RichTextEditorPreviewer';
import Reactions from '../../../Reactions/Reactions';
import ActivityFeedEditor from '../../ActivityFeedEditor/ActivityFeedEditor';
import Reactions from '../../Reactions/Reactions';
import { FeedBodyProp } from '../ActivityFeedCard.interface';

const FeedCardBody: FC<FeedBodyProp> = ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jest.mock('../../../constants/reactions.constant', () => ({
],
}));

jest.mock('../../Reactions/Reaction', () => {
jest.mock('../Reactions/Reaction', () => {
return jest.fn().mockReturnValue(<div data-testid="reaction">Reaction</div>);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { ReactionOperation } from '../../../enums/reactions.enum';
import { Post } from '../../../generated/entity/feed/thread';
import { ReactionType } from '../../../generated/type/reaction';
import { useAuthContext } from '../../Auth/AuthProviders/AuthProvider';
import Reaction from '../../Reactions/Reaction';
import Reaction from '../Reactions/Reaction';
import { ConfirmState } from './ActivityFeedCard.interface';

interface Props {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import { Col, Drawer, Row } from 'antd';
import classNames from 'classnames';
import React, { FC } from 'react';
import { useTranslation } from 'react-i18next';
import Loader from '../../../components/Loader/Loader';
import { ThreadType } from '../../../generated/api/feed/createThread';
import { Thread } from '../../../generated/entity/feed/thread';
import Loader from '../../common/Loader/Loader';
import ActivityFeedEditor from '../ActivityFeedEditor/ActivityFeedEditor';
import FeedPanelBodyV1 from '../ActivityFeedPanel/FeedPanelBodyV1';
import FeedPanelHeader from '../ActivityFeedPanel/FeedPanelHeader';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jest.mock('../../../utils/FeedUtils', () => ({
HTMLToMarkdown: jest.fn().mockReturnValue({ turndown: jest.fn() }),
}));

jest.mock('../../FeedEditor/FeedEditor', () => ({
jest.mock('../FeedEditor/FeedEditor', () => ({
__esModule: true,
FeedEditor: forwardRef(
jest.fn().mockImplementation(({ onChangeHandler, onSave }, ref) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import classNames from 'classnames';
import React, { FC, HTMLAttributes, useRef, useState } from 'react';
import { getBackendFormat, HTMLToMarkdown } from '../../../utils/FeedUtils';
import { FeedEditor } from '../../FeedEditor/FeedEditor';
import { FeedEditor } from '../FeedEditor/FeedEditor';
import { KeyHelp } from './KeyHelp';
import { SendButton } from './SendButton';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ import { isEmpty } from 'lodash';
import React, { ReactNode, useEffect, useState } from 'react';
import { ReactComponent as FeedEmptyIcon } from '../../../assets/svg/activity-feed-no-data-placeholder.svg';
import ErrorPlaceHolder from '../../../components/common/ErrorWithPlaceholder/ErrorPlaceHolder';
import Loader from '../../../components/Loader/Loader';
import { ERROR_PLACEHOLDER_TYPE, SIZE } from '../../../enums/common.enum';
import { Thread } from '../../../generated/entity/feed/thread';
import { getFeedListWithRelativeDays } from '../../../utils/FeedUtils';
import Loader from '../../common/Loader/Loader';
import FeedPanelBodyV1 from '../ActivityFeedPanel/FeedPanelBodyV1';
import './activity-feed-list.less';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ import {
} from '../../../utils/EntityUtils';
import { showErrorToast } from '../../../utils/ToastUtils';
import { useAuthContext } from '../../Auth/AuthProviders/AuthProvider';
import Loader from '../../Loader/Loader';
import { TaskTab } from '../../Task/TaskTab/TaskTab.component';
import '../../Widgets/FeedsWidget/feeds-widget.less';
import Loader from '../../common/Loader/Loader';
import { TaskTab } from '../../Entity/Task/TaskTab/TaskTab.component';
import '../../MyData/Widgets/FeedsWidget/feeds-widget.less';
import ActivityFeedEditor from '../ActivityFeedEditor/ActivityFeedEditor';
import ActivityFeedListV1 from '../ActivityFeedList/ActivityFeedListV1.component';
import FeedPanelBodyV1 from '../ActivityFeedPanel/FeedPanelBodyV1';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { getAllFeeds } from '../../../rest/feedsAPI';
import { showErrorToast } from '../../../utils/ToastUtils';
import { useAuthContext } from '../../Auth/AuthProviders/AuthProvider';
import ErrorPlaceHolder from '../../common/ErrorWithPlaceholder/ErrorPlaceHolder';
import Loader from '../../Loader/Loader';
import Loader from '../../common/Loader/Loader';
import ConfirmationModal from '../../Modals/ConfirmationModal/ConfirmationModal';
import { ConfirmState } from '../ActivityFeedCard/ActivityFeedCard.interface';
import ActivityFeedEditor from '../ActivityFeedEditor/ActivityFeedEditor';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jest.mock('react-quill', () => {
};
});

jest.mock('../../utils/QuillLink/QuillLink', () => {
jest.mock('../../../utils/QuillLink/QuillLink', () => {
return jest.fn();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,23 @@ import React, {
import ReactDOMServer from 'react-dom/server';
import { useTranslation } from 'react-i18next';
import ReactQuill, { Quill } from 'react-quill';
import { BORDER_COLOR } from '../../constants/constants';
import { BORDER_COLOR } from '../../../constants/constants';
import {
MENTION_ALLOWED_CHARS,
MENTION_DENOTATION_CHARS,
TOOLBAR_ITEMS,
} from '../../constants/Feeds.constants';
import { getUserByName } from '../../rest/userAPI';
} from '../../../constants/Feeds.constants';
import { useApplicationConfigContext } from '../../../context/ApplicationConfigProvider/ApplicationConfigProvider';
import { getUserByName } from '../../../rest/userAPI';
import {
HTMLToMarkdown,
suggestions,
userMentionItemWithAvatar,
} from '../../utils/FeedUtils';
import { LinkBlot } from '../../utils/QuillLink/QuillLink';
import { insertMention, insertRef } from '../../utils/QuillUtils';
import { getEntityIcon } from '../../utils/TableUtils';
import { useApplicationConfigContext } from '../ApplicationConfigProvider/ApplicationConfigProvider';
import { editorRef } from '../common/RichTextEditor/RichTextEditor.interface';
} from '../../../utils/FeedUtils';
import { LinkBlot } from '../../../utils/QuillLink/QuillLink';
import { insertMention, insertRef } from '../../../utils/QuillUtils';
import { getEntityIcon } from '../../../utils/TableUtils';
import { editorRef } from '../../common/RichTextEditor/RichTextEditor.interface';
import './feed-editor.less';
import { FeedEditorProp, MentionSuggestionsItem } from './FeedEditor.interface';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

import { fireEvent, render } from '@testing-library/react';
import React from 'react';
import { User } from '../../generated/entity/teams/user';
import { ReactionType } from '../../generated/type/reaction';
import { User } from '../../../generated/entity/teams/user';
import { ReactionType } from '../../../generated/type/reaction';
import Emoji from './Emoji';

const onReactionSelect = jest.fn();
Expand All @@ -24,11 +24,11 @@ const mockUserData: User = {
id: '2e424734-761a-443f-bf2a-a5b361823c80',
};

jest.mock('../../hooks/useImage', () =>
jest.mock('../../../hooks/useImage', () =>
jest.fn().mockReturnValue({ image: null })
);

jest.mock('../Auth/AuthProviders/AuthProvider', () => ({
jest.mock('../../Auth/AuthProviders/AuthProvider', () => ({
useAuthContext: jest.fn(() => ({
currentUser: mockUserData,
})),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ import { Button, Popover } from 'antd';
import classNames from 'classnames';
import React, { FC, useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { REACTION_LIST } from '../../constants/reactions.constant';
import { ReactionOperation } from '../../enums/reactions.enum';
import { Reaction, ReactionType } from '../../generated/type/reaction';
import useImage from '../../hooks/useImage';
import { useAuthContext } from '../Auth/AuthProviders/AuthProvider';
import { REACTION_LIST } from '../../../constants/reactions.constant';
import { ReactionOperation } from '../../../enums/reactions.enum';
import { Reaction, ReactionType } from '../../../generated/type/reaction';
import useImage from '../../../hooks/useImage';
import { useAuthContext } from '../../Auth/AuthProviders/AuthProvider';

interface EmojiProps {
reaction: ReactionType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@

import { fireEvent, render } from '@testing-library/react';
import React from 'react';
import { ReactionType } from '../../generated/type/reaction';
import { ReactionType } from '../../../generated/type/reaction';
import Reaction from './Reaction';

const onReactionSelect = jest.fn();
const onHide = jest.fn();

jest.mock('../../hooks/useImage', () =>
jest.mock('../../../hooks/useImage', () =>
jest.fn().mockReturnValue({ image: null })
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import { Button } from 'antd';
import classNames from 'classnames';
import { uniqueId } from 'lodash';
import React, { FC } from 'react';
import { ReactionOperation } from '../../enums/reactions.enum';
import { ReactionType } from '../../generated/type/reaction';
import useImage from '../../hooks/useImage';
import { ReactionOperation } from '../../../enums/reactions.enum';
import { ReactionType } from '../../../generated/type/reaction';
import useImage from '../../../hooks/useImage';

interface ReactionProps {
reaction: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

import { fireEvent, render } from '@testing-library/react';
import React from 'react';
import { ReactionType } from '../../generated/type/reaction';
import { ReactionType } from '../../../generated/type/reaction';
import Reactions from './Reactions';

jest.mock('./Emoji', () =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ import { Button, Popover } from 'antd';
import { groupBy, uniqueId } from 'lodash';
import React, { FC, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { ReactComponent as AddReactionIcon } from '../../assets/svg/ic-reaction.svg';
import { ReactComponent as AddReactionIcon } from '../../../assets/svg/ic-reaction.svg';
import {
REACTION_LIST,
REACTION_TYPE_LIST,
} from '../../constants/reactions.constant';
import { ReactionOperation } from '../../enums/reactions.enum';
} from '../../../constants/reactions.constant';
import { ReactionOperation } from '../../../enums/reactions.enum';
import {
Reaction as ReactionProp,
ReactionType,
} from '../../generated/type/reaction';
import { useAuthContext } from '../Auth/AuthProviders/AuthProvider';
} from '../../../generated/type/reaction';
import { useAuthContext } from '../../Auth/AuthProviders/AuthProvider';
import Emoji from './Emoji';
import Reaction from './Reaction';
import './reactions.less';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@import url('../../styles/variables.less');
@import url('../../../styles/variables.less');

/* Reaction CSS Start */
.ant-btn-add-reactions:hover,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import { ReactComponent as IconEdit } from '../../../assets/svg/ic-edit.svg';
import { ReactComponent as IconReaction } from '../../../assets/svg/ic-reaction.svg';
import { ReactComponent as IconReply } from '../../../assets/svg/ic-reply.svg';
import ConfirmationModal from '../../../components/Modals/ConfirmationModal/ConfirmationModal';
import Reaction from '../../../components/Reactions/Reaction';
import { REACTION_LIST } from '../../../constants/reactions.constant';
import { ReactionOperation } from '../../../enums/reactions.enum';
import {
Expand All @@ -31,6 +30,7 @@ import {
} from '../../../generated/entity/feed/thread';
import { useAuthContext } from '../../Auth/AuthProviders/AuthProvider';
import { useActivityFeedProvider } from '../ActivityFeedProvider/ActivityFeedProvider';
import Reaction from '../Reactions/Reaction';
import './activity-feed-actions.less';

interface ActivityFeedActionsProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ import { ReactComponent as IconTour } from '../../assets/svg/icon-tour.svg';
import { ReactComponent as IconSlackGrey } from '../../assets/svg/slack-grey.svg';
import { ReactComponent as IconVersionBlack } from '../../assets/svg/version-black.svg';
import { ReactComponent as IconWhatsNew } from '../../assets/svg/whats-new.svg';
import { useGlobalSearchProvider } from '../../components/GlobalSearchProvider/GlobalSearchProvider';
import { useTourProvider } from '../../components/TourProvider/TourProvider';
import {
getExplorePath,
ROUTES,
Expand All @@ -39,6 +37,8 @@ import {
urlGithubRepo,
urlJoinSlack,
} from '../../constants/URL.constants';
import { useGlobalSearchProvider } from '../../context/GlobalSearchProvider/GlobalSearchProvider';
import { useTourProvider } from '../../context/TourProvider/TourProvider';
import { CurrentTourPageType } from '../../enums/tour.enum';
import { getVersion } from '../../rest/miscAPI';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,21 @@ import { AxiosError } from 'axios';
import { isEmpty } from 'lodash';
import React, { useCallback, useEffect, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
import Loader from '../../components/Loader/Loader';
import { PAGE_SIZE_BASE } from '../../constants/constants';
import {
DashboardSource,
DataProductSource,
GlossarySource,
MlModelSource,
Option,
PipelineSource,
SearchIndexSource,
SearchSuggestions,
TableSource,
TagSource,
TopicSource,
} from '../../context/GlobalSearchProvider/GlobalSearchSuggestions/GlobalSearchSuggestions.interface';
import { useTourProvider } from '../../context/TourProvider/TourProvider';
import { SearchIndex } from '../../enums/search.enum';
import {
ContainerSearchSource,
Expand All @@ -33,20 +46,7 @@ import {
getSuggestionElement,
} from '../../utils/SearchUtils';
import { showErrorToast } from '../../utils/ToastUtils';
import {
DashboardSource,
DataProductSource,
GlossarySource,
MlModelSource,
Option,
PipelineSource,
SearchIndexSource,
SearchSuggestions,
TableSource,
TagSource,
TopicSource,
} from '../GlobalSearchProvider/GlobalSearchSuggestions/GlobalSearchSuggestions.interface';
import { useTourProvider } from '../TourProvider/TourProvider';
import Loader from '../common/Loader/Loader';

type SuggestionProp = {
searchText: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import SamlCallback from '../../pages/SamlCallback';
import AccountActivationConfirmation from '../../pages/SignUp/account-activation-confirmation.component';
import { isProtectedRoute } from '../../utils/AuthProvider.util';
import { useAuthContext } from '../Auth/AuthProviders/AuthProvider';
import Loader from '../Loader/Loader';
import Loader from '../common/Loader/Loader';
import withSuspenseFallback from './withSuspenseFallback';

const SigninPage = withSuspenseFallback(
Expand Down
Loading

0 comments on commit 146ccc5

Please sign in to comment.