Skip to content

Commit

Permalink
Merge branch 'activepieces:main' into apitraffic/main
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonfill authored Jan 28, 2025
2 parents 1ec539a + 798c945 commit 6d7475d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
28 changes: 19 additions & 9 deletions packages/react-ui/src/app/routes/settings/pieces/index.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
import { ColumnDef } from '@tanstack/react-table';
import { t } from 'i18next';
import { CheckIcon, Trash } from 'lucide-react';
import { useMemo } from 'react';
import { useSearchParams } from 'react-router-dom';

import LockedFeatureGuard from '@/app/components/locked-feature-guard';
import { ConfirmationDeleteDialog } from '@/components/delete-dialog';
import { Button } from '@/components/ui/button';
import { DataTable, RowDataWithActions } from '@/components/ui/data-table';
import {
BulkAction,
DataTable,
RowDataWithActions,
} from '@/components/ui/data-table';
import { DataTableColumnHeader } from '@/components/ui/data-table/data-table-column-header';
import { PieceIcon } from '@/features/pieces/components/piece-icon';
import { piecesApi } from '@/features/pieces/lib/pieces-api';
Expand Down Expand Up @@ -108,6 +113,17 @@ const ProjectPiecesPage = () => {
searchQuery,
});

const bulkActions: BulkAction<PieceMetadataModelSummary>[] = useMemo(
() => [
{
render: () => {
return <ManagePiecesDialog onSuccess={() => refetch()} />;
},
},
],
[refetch],
);

return (
<LockedFeatureGuard
featureKey="PIECES"
Expand All @@ -120,14 +136,7 @@ const ProjectPiecesPage = () => {
>
<div className="flex w-full flex-col items-center justify-center gap-4">
<div className="mx-auto w-full flex-col">
<div className="mb-4 flex">
<TableTitle>{t('Pieces')}</TableTitle>
</div>
<div className="flex justify-end">
{platform.managePiecesEnabled && (
<ManagePiecesDialog onSuccess={() => refetch()} />
)}
</div>
<TableTitle>{t('Pieces')}</TableTitle>
<DataTable
columns={columns}
filters={[
Expand All @@ -146,6 +155,7 @@ const ProjectPiecesPage = () => {
}}
isLoading={isLoading}
hidePagination={true}
bulkActions={platform.managePiecesEnabled ? bulkActions : []}
/>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export function DataTableFacetedFilter<TData, TValue>({

switch (type) {
case 'input': {
const filterValue = (column?.getFilterValue() || '') as string;
const filterValue = searchParams.get(column?.id as string) || '';
return (
<DataTableInputPopover
title={title}
Expand Down

0 comments on commit 6d7475d

Please sign in to comment.