Skip to content

Commit

Permalink
Refactor import paths to use absolute paths
Browse files Browse the repository at this point in the history
  • Loading branch information
khavinshankar committed Nov 7, 2023
1 parent b6a9c73 commit e3c4c40
Show file tree
Hide file tree
Showing 357 changed files with 2,985 additions and 2,626 deletions.
11 changes: 6 additions & 5 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { Suspense } from "react";
import Routers from "./Routers";

import ThemedFavicon from "@/CAREUI/misc/ThemedFavicon";
import Loading from "@/Components/Common/Loading";
import Intergrations from "@/Integrations";
import {
AppConfigProvider,
AuthUserProvider,
HistoryAPIProvider,
} from "./Providers";
import ThemedFavicon from "./CAREUI/misc/ThemedFavicon";
import Intergrations from "./Integrations";
import Loading from "./Components/Common/Loading";
} from "@/Providers";
import Routers from "@/Routers";

const App = () => {
return (
Expand Down
6 changes: 3 additions & 3 deletions src/CAREUI/display/Chip.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import CareIcon, { IconName } from "../icons/CareIcon";
import { ButtonVariant } from "../../Components/Common/components/ButtonV2";
import { classNames } from "../../Utils/utils";
import CareIcon, { IconName } from "@/CAREUI/icons/CareIcon";
import { ButtonVariant } from "@/Components/Common/components/ButtonV2";
import { classNames } from "@/Utils/utils";

interface Props {
size?: "small" | "medium" | "large";
Expand Down
4 changes: 2 additions & 2 deletions src/CAREUI/display/Count.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { classNames } from "../../Utils/utils";
import CareIcon, { IconName } from "../icons/CareIcon";
import CareIcon, { IconName } from "@/CAREUI/icons/CareIcon";
import { classNames } from "@/Utils/utils";

interface Props {
count: number;
Expand Down
7 changes: 4 additions & 3 deletions src/CAREUI/display/RecordMeta.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import CareIcon from "../icons/CareIcon";
import { ReactNode } from "react";

import CareIcon from "@/CAREUI/icons/CareIcon";
import {
formatDateTime,
formatName,
isUserOnline,
relativeTime,
} from "../../Utils/utils";
import { ReactNode } from "react";
} from "@/Utils/utils";

interface Props {
time?: string;
Expand Down
5 changes: 3 additions & 2 deletions src/CAREUI/display/SubHeading.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ReactNode } from "react";
import CareIcon from "../icons/CareIcon";
import RecordMeta from "./RecordMeta";

import RecordMeta from "@/CAREUI/display/RecordMeta";
import CareIcon from "@/CAREUI/icons/CareIcon";

interface Props {
title: ReactNode;
Expand Down
9 changes: 5 additions & 4 deletions src/CAREUI/display/Timeline.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { createContext, useContext } from "react";
import { PerformedByModel } from "../../Components/HCX/misc";
import { classNames, formatName } from "../../Utils/utils";
import CareIcon, { IconName } from "../icons/CareIcon";
import RecordMeta from "./RecordMeta";

import RecordMeta from "@/CAREUI/display/RecordMeta";
import CareIcon, { IconName } from "@/CAREUI/icons/CareIcon";
import { PerformedByModel } from "@/Components/HCX/misc";
import { classNames, formatName } from "@/Utils/utils";

export interface TimelineEvent<TType = string> {
type: TType;
Expand Down
4 changes: 2 additions & 2 deletions src/CAREUI/icons/CareIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { transformIcons } from "./icon";
import { useEffect } from "react";

import iconData from "./UniconPaths.json";
import { transformIcons } from "@/CAREUI/icons/icon";
import iconData from "@/CAREUI/icons/UniconPaths.json";

export type IconName = keyof typeof iconData;

Expand Down
4 changes: 2 additions & 2 deletions src/CAREUI/icons/icon.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import "./icon.css";
import iconData from "./UniconPaths.json";
import "@/CAREUI/icons/icon.css";
import iconData from "@/CAREUI/icons/UniconPaths.json";

const xmlns = "http://www.w3.org/2000/svg";

Expand Down
11 changes: 6 additions & 5 deletions src/CAREUI/interactive/FiltersSlideover.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { useTranslation } from "react-i18next";
import useFilters from "../../Common/hooks/useFilters";
import ButtonV2 from "../../Components/Common/components/ButtonV2";
import CareIcon from "../icons/CareIcon";
import SlideOver from "./SlideOver";
import { ReactNode } from "react";
import { useTranslation } from "react-i18next";

import CareIcon from "@/CAREUI/icons/CareIcon";
import SlideOver from "@/CAREUI/interactive/SlideOver";
import useFilters from "@/Common/hooks/useFilters";
import ButtonV2 from "@/Components/Common/components/ButtonV2";

type AdvancedFilter = ReturnType<typeof useFilters>["advancedFilter"];

Expand Down
5 changes: 3 additions & 2 deletions src/CAREUI/interactive/LegendInput.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import CareIcon from "../icons/CareIcon";
import { classNames } from "../../Utils/utils";
import { RefObject, useRef, useState, useEffect } from "react";

import CareIcon from "@/CAREUI/icons/CareIcon";
import { classNames } from "@/Utils/utils";

type InputProps = {
id?: string;
name: string;
Expand Down
4 changes: 2 additions & 2 deletions src/CAREUI/interactive/ScrollOverlay.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import useVisibility from "../../Utils/useVisibility";
import { classNames } from "../../Utils/utils";
import useVisibility from "@/Utils/useVisibility";
import { classNames } from "@/Utils/utils";

interface Props {
className?: string;
Expand Down
5 changes: 3 additions & 2 deletions src/CAREUI/interactive/SlideOver.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Dialog, Transition } from "@headlessui/react";
import { Fragment } from "react";
import { classNames } from "../../Utils/utils";
import CareIcon from "../icons/CareIcon";

import CareIcon from "@/CAREUI/icons/CareIcon";
import { classNames } from "@/Utils/utils";

export type SlideFromEdges = "left" | "top" | "right" | "bottom";

Expand Down
2 changes: 1 addition & 1 deletion src/CAREUI/interactive/Switch.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { classNames } from "../../Utils/utils";
import { classNames } from "@/Utils/utils";

interface Props<T extends string> {
tabs: Record<T, string>;
Expand Down
4 changes: 2 additions & 2 deletions src/CAREUI/misc/AuthorizedChild.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useIsAuthorized } from "../../Common/hooks/useIsAuthorized";
import { AuthorizedForCB } from "../../Utils/AuthorizeFor";
import { useIsAuthorized } from "@/Common/hooks/useIsAuthorized";
import { AuthorizedForCB } from "@/Utils/AuthorizeFor";

interface Props {
children: (value: { isAuthorized: boolean }) => JSX.Element;
Expand Down
13 changes: 7 additions & 6 deletions src/CAREUI/misc/PaginatedList.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { createContext, useContext, useState } from "react";
import { PaginatedResponse, QueryRoute } from "../../Utils/request/types";
import useQuery, { QueryOptions } from "../../Utils/request/useQuery";

import CareIcon from "@/CAREUI/icons/CareIcon";
import ButtonV2, {
CommonButtonProps,
} from "../../Components/Common/components/ButtonV2";
import CareIcon from "../icons/CareIcon";
import { classNames } from "../../Utils/utils";
import Pagination from "../../Components/Common/Pagination";
} from "@/Components/Common/components/ButtonV2";
import Pagination from "@/Components/Common/Pagination";
import { PaginatedResponse, QueryRoute } from "@/Utils/request/types";
import useQuery, { QueryOptions } from "@/Utils/request/useQuery";
import { classNames } from "@/Utils/utils";

const DEFAULT_PER_PAGE_LIMIT = 14;

Expand Down
12 changes: 6 additions & 6 deletions src/Common/constants.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { IConfig } from "./hooks/useConfig";
import { PatientCategory } from "../Components/Facility/models";
import { SortOption } from "../Components/Common/SortDropdown";
import { dateQueryString } from "../Utils/utils";
import { IconName } from "../CAREUI/icons/CareIcon";
import { PhoneNumberValidator } from "../Components/Form/FieldValidators";
import { IconName } from "@/CAREUI/icons/CareIcon";
import { IConfig } from "@/Common/hooks/useConfig";
import { SortOption } from "@/Components/Common/SortDropdown";
import { PatientCategory } from "@/Components/Facility/models";
import { PhoneNumberValidator } from "@/Components/Form/FieldValidators";
import { dateQueryString } from "@/Utils/utils";

export const RESULTS_PER_PAGE_LIMIT = 14;
export const PAGINATION_LIMIT = 36;
Expand Down
3 changes: 2 additions & 1 deletion src/Common/hooks/useAppHistory.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { navigate } from "raviger";
import { useContext } from "react";

import {
HistoryContext,
ResetHistoryContext,
} from "../../Providers/HistoryAPIProvider";
} from "@/Providers/HistoryAPIProvider";

export default function useAppHistory() {
const history = useContext(HistoryContext);
Expand Down
3 changes: 2 additions & 1 deletion src/Common/hooks/useAuthUser.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { createContext, useContext } from "react";
import { UserModel } from "../../Components/Users/models";

import { UserModel } from "@/Components/Users/models";

export const AuthUserContext = createContext<UserModel | null>(null);

Expand Down
2 changes: 1 addition & 1 deletion src/Common/hooks/useBreakpoints.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import useWindowDimensions from "./useWindowDimensions";
import useWindowDimensions from "@/Common/hooks/useWindowDimensions";

type Breakpoints = "vs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl";

Expand Down
3 changes: 2 additions & 1 deletion src/Common/hooks/useExport.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import dayjs from "../../Utils/dayjs";
import { useState } from "react";
import { useDispatch } from "react-redux";

import dayjs from "@/Utils/dayjs";

export default function useExport() {
const dispatch: any = useDispatch();
const [isExporting, setIsExporting] = useState(false);
Expand Down
2 changes: 1 addition & 1 deletion src/Common/hooks/useFeedPTZ.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { operateAsset } from "../../Redux/actions";
import { operateAsset } from "@/Redux/actions";

export interface IAsset {
id: string;
Expand Down
9 changes: 5 additions & 4 deletions src/Common/hooks/useFilters.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { useQueryParams } from "raviger";
import { useState } from "react";
import { useTranslation } from "react-i18next";
import GenericFilterBadge from "../../CAREUI/display/FilterBadge";
import PaginationComponent from "../../Components/Common/Pagination";
import useConfig from "./useConfig";
import { classNames } from "../../Utils/utils";

import GenericFilterBadge from "@/CAREUI/display/FilterBadge";
import useConfig from "@/Common/hooks/useConfig";
import PaginationComponent from "@/Components/Common/Pagination";
import { classNames } from "@/Utils/utils";

export type FilterState = Record<string, unknown>;
export type FilterParamKeys = string | string[];
Expand Down
3 changes: 2 additions & 1 deletion src/Common/hooks/useHLSPlayer.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import ReactPlayer from "react-player";
import { IOptions } from "./useMSEplayer";

import { IOptions } from "@/Common/hooks/useMSEplayer";

export const useHLSPLayer = (ref: ReactPlayer | null) => {
const startStream = ({ onSuccess, onError }: IOptions = {}) => {
Expand Down
4 changes: 2 additions & 2 deletions src/Common/hooks/useIsAuthorized.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AuthorizedForCB } from "../../Utils/AuthorizeFor";
import useAuthUser from "./useAuthUser";
import useAuthUser from "@/Common/hooks/useAuthUser";
import { AuthorizedForCB } from "@/Utils/AuthorizeFor";

export const useIsAuthorized = (authorizeFor: AuthorizedForCB) => {
const authUser = useAuthUser();
Expand Down
2 changes: 1 addition & 1 deletion src/Common/hooks/useMSEplayer.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useEffect, useRef } from "react";
import axios from "axios";
import { useEffect, useRef } from "react";

export interface IAsset {
middlewareHostname: string;
Expand Down
3 changes: 2 additions & 1 deletion src/Common/utils.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* eslint-disable react-hooks/exhaustive-deps */
import { useEffect } from "react";
import { OptionsType } from "./constants";

import { OptionsType } from "@/Common/constants";

export interface statusType {
aborted?: boolean;
Expand Down
16 changes: 8 additions & 8 deletions src/Components/ABDM/ABHAProfileModal.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import * as Notify from "../../Utils/Notifications";

import { AbhaObject } from "../Patient/models";
import CareIcon from "../../CAREUI/icons/CareIcon";
import DialogModal from "../Common/Dialog";
import QRCode from "qrcode.react";
import { formatDateTime } from "../../Utils/utils";
import { useRef } from "react";
import request from "../../Utils/request/request";
import routes from "../../Redux/api";

import CareIcon from "@/CAREUI/icons/CareIcon";
import DialogModal from "@/Components/Common/Dialog";
import { AbhaObject } from "@/Components/Patient/models";
import routes from "@/Redux/api";
import * as Notify from "@/Utils/Notifications";
import request from "@/Utils/request/request";
import { formatDateTime } from "@/Utils/utils";

interface IProps {
patientId?: string;
Expand Down
19 changes: 10 additions & 9 deletions src/Components/ABDM/ConfigureHealthFacility.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { lazy, useReducer, useState } from "react";
import * as Notification from "../../Utils/Notifications.js";
import { navigate } from "raviger";
import { Cancel, Submit } from "../Common/components/ButtonV2";
import TextFormField from "../Form/FormFields/TextFormField";
import { classNames } from "../../Utils/utils";
import useQuery from "../../Utils/request/useQuery";
import routes from "../../Redux/api";
import request from "../../Utils/request/request";
import { FieldChangeEvent } from "../Form/FormFields/Utils.js";
import { lazy, useReducer, useState } from "react";

import { Cancel, Submit } from "@/Components/Common/components/ButtonV2";
import TextFormField from "@/Components/Form/FormFields/TextFormField";
import { FieldChangeEvent } from "@/Components/Form/FormFields/Utils.js";
import routes from "@/Redux/api";
import * as Notification from "@/Utils/Notifications.js";
import request from "@/Utils/request/request";
import useQuery from "@/Utils/request/useQuery";
import { classNames } from "@/Utils/utils";
const Loading = lazy(() => import("../Common/Loading"));

const initForm = {
Expand Down
25 changes: 12 additions & 13 deletions src/Components/ABDM/LinkABHANumberModal.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
import * as Notify from "../../Utils/Notifications";

import Dropdown, { DropdownItem } from "../Common/components/Menu";
import { useEffect, useState } from "react";

import ButtonV2 from "../Common/components/ButtonV2";
import CareIcon from "../../CAREUI/icons/CareIcon";
import CircularProgress from "../Common/components/CircularProgress";
import DialogModal from "../Common/Dialog";
import OtpFormField from "../Form/FormFields/OtpFormField";
import QRScanner from "../Common/QRScanner";
import TextFormField from "../Form/FormFields/TextFormField";
import { classNames } from "../../Utils/utils";
import request from "../../Utils/request/request";
import routes from "../../Redux/api";
import CareIcon from "@/CAREUI/icons/CareIcon";
import ButtonV2 from "@/Components/Common/components/ButtonV2";
import CircularProgress from "@/Components/Common/components/CircularProgress";
import Dropdown, { DropdownItem } from "@/Components/Common/components/Menu";
import DialogModal from "@/Components/Common/Dialog";
import QRScanner from "@/Components/Common/QRScanner";
import OtpFormField from "@/Components/Form/FormFields/OtpFormField";
import TextFormField from "@/Components/Form/FormFields/TextFormField";
import routes from "@/Redux/api";
import * as Notify from "@/Utils/Notifications";
import request from "@/Utils/request/request";
import { classNames } from "@/Utils/utils";

export const validateRule = (
condition: boolean,
Expand Down
19 changes: 10 additions & 9 deletions src/Components/ABDM/LinkCareContextModal.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import * as Notification from "../../Utils/Notifications.js";

import ButtonV2 from "../Common/components/ButtonV2";
import DateFormField from "../Form/FormFields/DateFormField";
import DialogModal from "../Common/Dialog";
import { PatientModel } from "../Patient/models";
import TextFormField from "../Form/FormFields/TextFormField";
import { useState } from "react";
import routes from "../../Redux/api.js";
import request from "../../Utils/request/request.js";

import ButtonV2 from "@/Components/Common/components/ButtonV2";
import DialogModal from "@/Components/Common/Dialog";
import DateFormField from "@/Components/Form/FormFields/DateFormField";
import TextFormField from "@/Components/Form/FormFields/TextFormField";
import { PatientModel } from "@/Components/Patient/models";
import * as Notification from "@/Utils/Notifications.js";
import request from "@/Utils/request/request.js";

import routes from "@/Redux/api.js";

interface IProps {
consultationId: string;
Expand Down
12 changes: 6 additions & 6 deletions src/Components/Assets/AssetConfigure.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Loading from "../Common/Loading";
import HL7Monitor from "./AssetType/HL7Monitor";
import ONVIFCamera from "./AssetType/ONVIFCamera";
import Page from "../Common/components/Page";
import useQuery from "../../Utils/request/useQuery";
import routes from "../../Redux/api";
import HL7Monitor from "@/Components/Assets/AssetType/HL7Monitor";
import ONVIFCamera from "@/Components/Assets/AssetType/ONVIFCamera";
import Page from "@/Components/Common/components/Page";
import Loading from "@/Components/Common/Loading";
import routes from "@/Redux/api";
import useQuery from "@/Utils/request/useQuery";

interface AssetConfigureProps {
assetId: string;
Expand Down
Loading

0 comments on commit e3c4c40

Please sign in to comment.