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

chore: Add CustomLoader component and integrate with loading states in Admin, Flow, and Main pages #6047

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
5 changes: 5 additions & 0 deletions src/frontend/src/customization/components/custom-loader.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const CustomLoader = () => {
return <></>;
};

export default CustomLoader;
2 changes: 2 additions & 0 deletions src/frontend/src/modals/apiModal/utils/get-curl-code.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 7 additions & 1 deletion src/frontend/src/pages/AdminPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import {
useGetUsers,
useUpdateUser,
} from "@/controllers/API/queries/auth";
import CustomLoader from "@/customization/components/custom-loader";
import { ENABLE_DATASTAX_LANGFLOW } from "@/customization/feature-flags";
import { cloneDeep } from "lodash";
import { useContext, useEffect, useRef, useState } from "react";
import IconComponent from "../../components/common/genericIconComponent";
Expand Down Expand Up @@ -303,7 +305,11 @@ export default function AdminPage() {
</div>
{isPending || isIdle ? (
<div className="flex h-full w-full items-center justify-center">
<LoadingComponent remSize={12} />
{ENABLE_DATASTAX_LANGFLOW ? (
<CustomLoader />
) : (
<LoadingComponent remSize={12} />
)}
</div>
) : userList.current.length === 0 && !isIdle ? (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import {
NOTE_NODE_MIN_WIDTH,
} from "@/constants/constants";
import { useGetBuildsQuery } from "@/controllers/API/queries/_builds";
import CustomLoader from "@/customization/components/custom-loader";
import { ENABLE_DATASTAX_LANGFLOW } from "@/customization/feature-flags";
import { track } from "@/customization/utils/analytics";
import useAutoSaveFlow from "@/hooks/flows/use-autosave-flow";
import useUploadFlow from "@/hooks/flows/use-upload-flow";
Expand Down Expand Up @@ -637,7 +639,11 @@ export default function Page({ view }: { view?: boolean }): JSX.Element {
</div>
) : (
<div className="flex h-full w-full items-center justify-center">
<LoadingComponent remSize={30} />
{ENABLE_DATASTAX_LANGFLOW ? (
<CustomLoader />
) : (
<LoadingComponent remSize={30} />
)}
</div>
)}
</div>
Expand Down
8 changes: 7 additions & 1 deletion src/frontend/src/pages/MainPage/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ 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 { ENABLE_DATASTAX_LANGFLOW } from "@/customization/feature-flags";
import { useCustomNavigate } from "@/customization/hooks/use-custom-navigate";
import useAlertStore from "@/stores/alertStore";
import useFlowsManagerStore from "@/stores/flowsManagerStore";
Expand Down Expand Up @@ -90,7 +92,11 @@ export default function CollectionPage(): JSX.Element {
</div>
) : (
<div className="flex h-full w-full items-center justify-center">
<LoadingComponent remSize={30} />
{ENABLE_DATASTAX_LANGFLOW ? (
<CustomLoader />
) : (
<LoadingComponent remSize={30} />
)}
</div>
)}
</main>
Expand Down
Loading