chore: Add CustomLoader component and integrate with loading states in Admin, Flow, and Main pages (#6047)
* feat: Add CustomLoader component and integrate with loading states in Admin, Flow, and Main pages * refactor: simplify CustomLoader component and remove conditional loading logic * feat: add configurable size to CustomLoader component
This commit is contained in:
parent
f9e41f93a0
commit
141e6736d6
5 changed files with 24 additions and 6 deletions
16
src/frontend/src/customization/components/custom-loader.tsx
Normal file
16
src/frontend/src/customization/components/custom-loader.tsx
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import LoadingComponent from "@/components/common/loadingComponent";
|
||||
import { ENABLE_DATASTAX_LANGFLOW } from "../feature-flags";
|
||||
|
||||
type CustomLoaderProps = {
|
||||
remSize?: number;
|
||||
};
|
||||
|
||||
const CustomLoader = ({ remSize = 30 }: CustomLoaderProps) => {
|
||||
return ENABLE_DATASTAX_LANGFLOW ? (
|
||||
<></>
|
||||
) : (
|
||||
<LoadingComponent remSize={remSize} />
|
||||
);
|
||||
};
|
||||
|
||||
export default CustomLoader;
|
||||
|
|
@ -45,6 +45,8 @@ export function getCurlRunCode({
|
|||
* @param {string} options.endpointName - The name of the webhook endpoint.
|
||||
* @returns {string} The cURL command.
|
||||
*/
|
||||
|
||||
// KEEP THIS FOR LFOSS
|
||||
export function getCurlWebhookCode({
|
||||
flowId,
|
||||
isAuth,
|
||||
|
|
|
|||
|
|
@ -5,10 +5,10 @@ import {
|
|||
useGetUsers,
|
||||
useUpdateUser,
|
||||
} from "@/controllers/API/queries/auth";
|
||||
import CustomLoader from "@/customization/components/custom-loader";
|
||||
import { cloneDeep } from "lodash";
|
||||
import { useContext, useEffect, useRef, useState } from "react";
|
||||
import IconComponent from "../../components/common/genericIconComponent";
|
||||
import LoadingComponent from "../../components/common/loadingComponent";
|
||||
import ShadTooltip from "../../components/common/shadTooltipComponent";
|
||||
import { Button } from "../../components/ui/button";
|
||||
import { CheckBoxDiv } from "../../components/ui/checkbox";
|
||||
|
|
@ -303,7 +303,7 @@ export default function AdminPage() {
|
|||
</div>
|
||||
{isPending || isIdle ? (
|
||||
<div className="flex h-full w-full items-center justify-center">
|
||||
<LoadingComponent remSize={12} />
|
||||
<CustomLoader remSize={12} />
|
||||
</div>
|
||||
) : userList.current.length === 0 && !isIdle ? (
|
||||
<>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ import { DefaultEdge } from "@/CustomEdges";
|
|||
import NoteNode from "@/CustomNodes/NoteNode";
|
||||
|
||||
import ForwardedIconComponent from "@/components/common/genericIconComponent";
|
||||
import LoadingComponent from "@/components/common/loadingComponent";
|
||||
import CanvasControls, {
|
||||
CustomControlButton,
|
||||
} from "@/components/core/canvasControlsComponent";
|
||||
|
|
@ -14,6 +13,7 @@ import {
|
|||
NOTE_NODE_MIN_WIDTH,
|
||||
} from "@/constants/constants";
|
||||
import { useGetBuildsQuery } from "@/controllers/API/queries/_builds";
|
||||
import CustomLoader from "@/customization/components/custom-loader";
|
||||
import { track } from "@/customization/utils/analytics";
|
||||
import useAutoSaveFlow from "@/hooks/flows/use-autosave-flow";
|
||||
import useUploadFlow from "@/hooks/flows/use-upload-flow";
|
||||
|
|
@ -638,7 +638,7 @@ export default function Page({ view }: { view?: boolean }): JSX.Element {
|
|||
</div>
|
||||
) : (
|
||||
<div className="flex h-full w-full items-center justify-center">
|
||||
<LoadingComponent remSize={30} />
|
||||
<CustomLoader remSize={30} />
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import LoadingComponent from "@/components/common/loadingComponent";
|
||||
import CardsWrapComponent from "@/components/core/cardsWrapComponent";
|
||||
import SideBarFoldersButtonsComponent from "@/components/core/folderSidebarComponent/components/sideBarFolderButtons";
|
||||
import { SidebarProvider } from "@/components/ui/sidebar";
|
||||
import { useDeleteFolders } from "@/controllers/API/queries/folders";
|
||||
import CustomLoader from "@/customization/components/custom-loader";
|
||||
import { useCustomNavigate } from "@/customization/hooks/use-custom-navigate";
|
||||
import useAlertStore from "@/stores/alertStore";
|
||||
import useFlowsManagerStore from "@/stores/flowsManagerStore";
|
||||
|
|
@ -90,7 +90,7 @@ export default function CollectionPage(): JSX.Element {
|
|||
</div>
|
||||
) : (
|
||||
<div className="flex h-full w-full items-center justify-center">
|
||||
<LoadingComponent remSize={30} />
|
||||
<CustomLoader remSize={30} />
|
||||
</div>
|
||||
)}
|
||||
</main>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue