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

Refactor Directory Names for Common, Components #8888

Merged
merged 4 commits into from
Oct 23, 2024
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .cursorrules
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ Care uses a custom useQuery hook to fetch data from the API. APIs are defined in
Here's an example of how to use the useQuery hook to fetch data from the API:

```
useQuery from "@/Common/hooks/useQuery";
useQuery from "@/common/hooks/useQuery";
const { data, loading, error } = useQuery(routes.getFacilityUsers, {
facility_id: "1",
});

request from "@/Common/utils/request";
request from "@/common/utils/request";
const { res } = await request(routes.partialUpdateAsset, {
pathParams: { external_id: assetId },
body: data,
Expand Down
153 changes: 152 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Suspense } from "react";
import Routers from "./Routers";
import Integrations from "./Integrations";
import Loading from "./Components/Common/Loading";
import Loading from "@/components/Common/Loading";
import HistoryAPIProvider from "./Providers/HistoryAPIProvider";
import AuthUserProvider from "./Providers/AuthUserProvider";
import PluginEngine from "./PluginEngine";
import { FeatureFlagsProvider } from "./Utils/featureFlags";
import { Toaster } from "./Components/ui/toaster";
import { Toaster } from "@/components/ui/toaster";

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

interface Props {
Expand Down
6 changes: 3 additions & 3 deletions src/CAREUI/display/PopupModal.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { ReactNode, useEffect, useRef, useState } from "react";
import { Cancel, Submit } from "../../Components/Common/components/ButtonV2";
import { Cancel, Submit } from "@/components/Common/components/ButtonV2";
import { classNames } from "../../Utils/utils";
import { useTranslation } from "react-i18next";
import useBreakpoints from "../../Common/hooks/useBreakpoints";
import DialogModal from "../../Components/Common/Dialog";
import useBreakpoints from "@/common/hooks/useBreakpoints";
import DialogModal from "@/components/Common/Dialog";

type Props = {
show: boolean;
Expand Down
2 changes: 1 addition & 1 deletion src/CAREUI/display/Timeline.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createContext, useContext } from "react";
import { useTranslation } from "react-i18next";
import { PerformedByModel } from "../../Components/HCX/misc";
import { PerformedByModel } from "@/components/HCX/misc";
import { classNames, formatName } from "../../Utils/utils";
import CareIcon, { IconName } from "../icons/CareIcon";
import RecordMeta from "./RecordMeta";
Expand Down
2 changes: 1 addition & 1 deletion src/CAREUI/icons/Index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React, { useState } from "react";
import CareIcon, { IconName } from "./CareIcon";
import iconPaths from "./UniconPaths.json";
import { t } from "i18next";
import PageTitle from "../../Components/Common/PageTitle";
import PageTitle from "@/components/Common/PageTitle";
import { useToast } from "@/hooks/use-toast";

const IconIndex: React.FC = () => {
Expand Down
4 changes: 2 additions & 2 deletions src/CAREUI/interactive/FiltersSlideover.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useTranslation } from "react-i18next";
import useFilters from "../../Common/hooks/useFilters";
import ButtonV2 from "../../Components/Common/components/ButtonV2";
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";
Expand Down
2 changes: 1 addition & 1 deletion src/CAREUI/interactive/HumanChart.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Fragment } from "react/jsx-runtime";
import { HumanBodyPaths, HumanBodyRegion } from "../../Common/constants";
import { HumanBodyPaths, HumanBodyRegion } from "@/common/constants";

type Props = {
regionColor: (region: HumanBodyRegion) => string;
Expand Down
2 changes: 1 addition & 1 deletion src/CAREUI/interactive/Zoom.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createContext, ReactNode, useContext, useState } from "react";
import ButtonV2 from "../../Components/Common/components/ButtonV2";
import ButtonV2 from "@/components/Common/components/ButtonV2";
import CareIcon from "../icons/CareIcon";

type ProviderValue = {
Expand Down
6 changes: 3 additions & 3 deletions src/CAREUI/misc/AuthorizedChild.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ReactNode } from "react";
import useAuthUser from "../../Common/hooks/useAuthUser";
import { useIsAuthorized } from "../../Common/hooks/useIsAuthorized";
import useSlug from "../../Common/hooks/useSlug";
import useAuthUser from "@/common/hooks/useAuthUser";
import { useIsAuthorized } from "@/common/hooks/useIsAuthorized";
import useSlug from "@/common/hooks/useSlug";
import { AuthorizedForCB } from "../../Utils/AuthorizeFor";

interface Props {
Expand Down
4 changes: 2 additions & 2 deletions src/CAREUI/misc/PaginatedList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { PaginatedResponse, QueryRoute } from "../../Utils/request/types";
import useQuery, { QueryOptions } from "../../Utils/request/useQuery";
import ButtonV2, {
CommonButtonProps,
} from "../../Components/Common/components/ButtonV2";
} from "@/components/Common/components/ButtonV2";
import CareIcon from "../icons/CareIcon";
import { classNames } from "../../Utils/utils";
import Pagination from "../../Components/Common/Pagination";
import Pagination from "@/components/Common/Pagination";

const DEFAULT_PER_PAGE_LIMIT = 14;

Expand Down
6 changes: 3 additions & 3 deletions src/CAREUI/misc/PrintPreview.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { ReactNode } from "react";
import ButtonV2 from "../../Components/Common/components/ButtonV2";
import ButtonV2 from "@/components/Common/components/ButtonV2";
import CareIcon from "../icons/CareIcon";
import { classNames } from "../../Utils/utils";
import Page from "../../Components/Common/components/Page";
import useBreakpoints from "../../Common/hooks/useBreakpoints";
import Page from "@/components/Common/components/Page";
import useBreakpoints from "@/common/hooks/useBreakpoints";
import { useTranslation } from "react-i18next";
import { ZoomControls, ZoomProvider, ZoomTransform } from "../interactive/Zoom";

Expand Down
2 changes: 1 addition & 1 deletion src/Integrations/Plausible.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useLocationChange } from "raviger";
import Script from "../Components/Common/Script";
import Script from "@/components/Common/Script";
import { useEffect } from "react";
import careConfig from "@careConfig";

Expand Down
6 changes: 3 additions & 3 deletions src/PluginEngine.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* eslint-disable i18next/no-literal-string */
import React, { Suspense } from "react";
import { CareAppsContext, useCareApps } from "./Common/hooks/useCareApps";
import { CareAppsContext, useCareApps } from "@/common/hooks/useCareApps";
import { pluginMap } from "./pluginTypes";
import { UserAssignedModel } from "./Components/Users/models";
import ErrorBoundary from "./Components/Common/ErrorBoundary";
import { UserAssignedModel } from "@/components/Users/models";
import ErrorBoundary from "@/components/Common/ErrorBoundary";

export default function PluginEngine({
children,
Expand Down
6 changes: 3 additions & 3 deletions src/Providers/AuthUserProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { useCallback, useEffect } from "react";
import { AuthUserContext } from "../Common/hooks/useAuthUser";
import Loading from "../Components/Common/Loading";
import { AuthUserContext } from "@/common/hooks/useAuthUser";
import Loading from "@/components/Common/Loading";
import routes from "../Redux/api";
import useQuery from "../Utils/request/useQuery";
import { LocalStorageKeys } from "../Common/constants";
import { LocalStorageKeys } from "@/common/constants";
import request from "../Utils/request/request";
import { navigate } from "raviger";
import careConfig from "@careConfig";
Expand Down
Loading
Loading