Fixed Upload Flows not showing up when folder is empty
This commit is contained in:
parent
48e3b96fd4
commit
ee3263e6f2
3 changed files with 29 additions and 28 deletions
|
|
@ -4,7 +4,9 @@ import { FormProvider, useForm, useWatch } from "react-hook-form";
|
||||||
import { Link, useLocation, useNavigate } from "react-router-dom";
|
import { Link, useLocation, useNavigate } from "react-router-dom";
|
||||||
import CollectionCardComponent from "../../../../components/cardComponent";
|
import CollectionCardComponent from "../../../../components/cardComponent";
|
||||||
import CardsWrapComponent from "../../../../components/cardsWrapComponent";
|
import CardsWrapComponent from "../../../../components/cardsWrapComponent";
|
||||||
import IconComponent from "../../../../components/genericIconComponent";
|
import IconComponent, {
|
||||||
|
ForwardedIconComponent,
|
||||||
|
} from "../../../../components/genericIconComponent";
|
||||||
import PaginatorComponent from "../../../../components/paginatorComponent";
|
import PaginatorComponent from "../../../../components/paginatorComponent";
|
||||||
import { SkeletonCardComponent } from "../../../../components/skeletonCardComponent";
|
import { SkeletonCardComponent } from "../../../../components/skeletonCardComponent";
|
||||||
import { Button } from "../../../../components/ui/button";
|
import { Button } from "../../../../components/ui/button";
|
||||||
|
|
@ -267,16 +269,29 @@ export default function ComponentsComponent({
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{allFlows?.length > 0 && (
|
<div className="flex w-full gap-4 pb-5">
|
||||||
<HeaderComponent
|
<Button
|
||||||
handleDelete={() => handleSelectOptionsChange("delete")}
|
variant="outline"
|
||||||
handleSelectAll={handleSelectAll}
|
size="sm"
|
||||||
handleDuplicate={() => handleSelectOptionsChange("duplicate")}
|
onClick={handleImport}
|
||||||
handleExport={() => handleSelectOptionsChange("export")}
|
className="flex-shrink-0 text-sm"
|
||||||
handleImport={() => handleImport()}
|
>
|
||||||
disableFunctions={!(selectedFlowsComponentsCards?.length > 0)}
|
<ForwardedIconComponent
|
||||||
/>
|
name="FileUp"
|
||||||
)}
|
className="h-5 w-5 text-primary"
|
||||||
|
/>
|
||||||
|
Upload Flow
|
||||||
|
</Button>
|
||||||
|
{allFlows?.length > 0 && (
|
||||||
|
<HeaderComponent
|
||||||
|
handleDelete={() => handleSelectOptionsChange("delete")}
|
||||||
|
handleSelectAll={handleSelectAll}
|
||||||
|
handleDuplicate={() => handleSelectOptionsChange("duplicate")}
|
||||||
|
handleExport={() => handleSelectOptionsChange("export")}
|
||||||
|
disableFunctions={!(selectedFlowsComponentsCards?.length > 0)}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
<CardsWrapComponent
|
<CardsWrapComponent
|
||||||
onFileDrop={handleFileDrop}
|
onFileDrop={handleFileDrop}
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ const EmptyComponent = ({}: EmptyComponentProps) => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="mt-6 flex w-full items-center justify-center text-center">
|
<div className="mt-2 flex w-full items-center justify-center text-center">
|
||||||
<div className="flex-max-width h-full flex-col">
|
<div className="flex-max-width h-full flex-col">
|
||||||
<div className="align-center flex w-full justify-center gap-1 ">
|
<div className="align-center flex w-full justify-center gap-1 ">
|
||||||
<span className="text-muted-foreground">
|
<span className="text-muted-foreground">
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@ type HeaderComponentProps = {
|
||||||
handleDelete: () => void;
|
handleDelete: () => void;
|
||||||
handleDuplicate: () => void;
|
handleDuplicate: () => void;
|
||||||
handleExport: () => void;
|
handleExport: () => void;
|
||||||
handleImport: () => void;
|
|
||||||
disableFunctions: boolean;
|
disableFunctions: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -21,7 +20,6 @@ const HeaderComponent = ({
|
||||||
handleDelete,
|
handleDelete,
|
||||||
handleDuplicate,
|
handleDuplicate,
|
||||||
handleExport,
|
handleExport,
|
||||||
handleImport,
|
|
||||||
disableFunctions,
|
disableFunctions,
|
||||||
}: HeaderComponentProps) => {
|
}: HeaderComponentProps) => {
|
||||||
const [shouldSelectAll, setShouldSelectAll] = useState(true);
|
const [shouldSelectAll, setShouldSelectAll] = useState(true);
|
||||||
|
|
@ -33,20 +31,8 @@ const HeaderComponent = ({
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="grid grid-cols-3 pb-5">
|
<div className="grid w-full grid-cols-3">
|
||||||
<div className="flex items-center gap-4 justify-self-start">
|
<div className="flex items-center justify-self-start">
|
||||||
<Button
|
|
||||||
variant="outline"
|
|
||||||
size="sm"
|
|
||||||
onClick={handleImport}
|
|
||||||
className="text-sm"
|
|
||||||
>
|
|
||||||
<ForwardedIconComponent
|
|
||||||
name="FileUp"
|
|
||||||
className="h-5 w-5 text-primary"
|
|
||||||
/>
|
|
||||||
Upload Flow
|
|
||||||
</Button>
|
|
||||||
<Button
|
<Button
|
||||||
variant="none"
|
variant="none"
|
||||||
size="none"
|
size="none"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue