Skip to content

Commit 42d0bca

Browse files
authored
Merge branch 'dev' into 94-add-file-resource-schema
2 parents 1234308 + 4a58620 commit 42d0bca

24 files changed

Lines changed: 422 additions & 376 deletions

File tree

app/[locale]/(user)/datasets/components/DatasetCards/index.tsx

Lines changed: 0 additions & 39 deletions
This file was deleted.

app/[locale]/(user)/datasets/page.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ import {
1515

1616
import { cn } from '@/lib/utils';
1717
import BreadCrumbs from '@/components/BreadCrumbs';
18-
import DatasetCards from './components/DatasetCards';
18+
import GraphqlPagination from '../../dashboard/components/GraphqlPagination/graphqlPagination';
19+
import Card from './components/Card';
1920
import Filter from './components/FIlter/Filter';
2021
import Styles from './dataset.module.scss';
2122

@@ -313,14 +314,17 @@ const DatasetsListing = () => {
313314

314315
<div className="flex flex-col gap-6">
315316
{facets && datasetDetails?.length > 0 && (
316-
<DatasetCards
317-
data={datasetDetails}
318-
totalCount={count}
317+
<GraphqlPagination
318+
totalRows={count}
319319
pageSize={queryParams.pageSize}
320320
currentPage={queryParams.currentPage}
321321
onPageChange={handlePageChange}
322322
onPageSizeChange={handlePageSizeChange}
323-
/>
323+
>
324+
{datasetDetails.map((item: any, index: any) => (
325+
<Card key={index} data={item} />
326+
))}
327+
</GraphqlPagination>
324328
)}
325329
</div>
326330
</div>

app/[locale]/dashboard/components/GraphqlTable/footer.tsx renamed to app/[locale]/dashboard/components/GraphqlPagination/footer.tsx

File renamed without changes.

app/[locale]/dashboard/components/GraphqlTable/graphqlTable.tsx renamed to app/[locale]/dashboard/components/GraphqlPagination/graphqlPagination.tsx

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,27 @@
11
import React from 'react';
2-
import { DataTable, Text } from 'opub-ui';
32

43
import Footer from './footer';
54

65
interface GraphqlTableProps {
7-
table: {
8-
columns: any[];
9-
rows: any[];
10-
};
116
totalRows: number;
127
pageSize: number;
138
currentPage: number;
149
onPageChange: (newPage: number) => void;
1510
onPageSizeChange: (newSize: number) => void;
11+
children: React.ReactNode;
1612
}
1713

18-
const GraphqlTable: React.FC<GraphqlTableProps> = ({
19-
table,
14+
const GraphqlPagination: React.FC<GraphqlTableProps> = ({
2015
totalRows,
2116
pageSize,
2217
currentPage,
2318
onPageChange,
2419
onPageSizeChange,
20+
children,
2521
}) => {
2622
return (
2723
<div>
28-
<DataTable
29-
columns={table.columns}
30-
rows={table.rows}
31-
hideFooter={true}
32-
hideSelection={true}
33-
defaultRowCount={100}
34-
/>
24+
{children}
3525
<Footer
3626
totalRows={totalRows}
3727
pageSize={pageSize}
@@ -43,4 +33,4 @@ const GraphqlTable: React.FC<GraphqlTableProps> = ({
4333
);
4434
};
4535

46-
export default GraphqlTable;
36+
export default GraphqlPagination;

app/[locale]/dashboard/organization/[organizationId]/dataset/[id]/edit/components/EditLayout.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {
1717
TabList,
1818
Tabs,
1919
Text,
20+
toast,
2021
} from 'opub-ui';
2122

2223
import { GraphQL } from '@/lib/api';
@@ -56,7 +57,7 @@ interface LayoutProps {
5657
params: { id: string };
5758
}
5859

59-
const layoutList = ['metadata', 'access', 'distribution', 'publish'];
60+
const layoutList = ['metadata', 'access', 'resources', 'publish'];
6061

6162
export function EditLayout({ children, params }: LayoutProps) {
6263
// const { data } = useQuery([`dataset_layout_${params.id}`], () =>
@@ -93,7 +94,7 @@ export function EditLayout({ children, params }: LayoutProps) {
9394
getDatasetTitleRes.refetch();
9495
},
9596
onError: (err: any) => {
96-
console.log('Error ::: ', err);
97+
toast(err.message.split(':')[0]);
9798
},
9899
}
99100
);
@@ -229,11 +230,11 @@ const Navigation = ({
229230
pathItem: string;
230231
organization: string;
231232
}) => {
232-
const links = [
233+
let links = [
233234
{
234-
label: 'Distributions',
235-
url: `/dashboard/organization/${organization}/dataset/${id}/edit/distribution`,
236-
selected: pathItem === 'distribution',
235+
label: 'Resources',
236+
url: `/dashboard/organization/${organization}/dataset/${id}/edit/resources`,
237+
selected: pathItem === 'resources',
237238
},
238239
{
239240
label: 'Access Models',
@@ -248,7 +249,6 @@ const Navigation = ({
248249
{
249250
label: 'Publish',
250251
url: `/dashboard/organization/${organization}/dataset/${id}/edit/publish`,
251-
disabled: true,
252252
selected: pathItem === 'publish',
253253
},
254254
];

0 commit comments

Comments
 (0)