+
{sectors.name}
diff --git a/app/[locale]/dashboard/[entityType]/[entitySlug]/dataset/page.tsx b/app/[locale]/dashboard/[entityType]/[entitySlug]/dataset/page.tsx
index 1723fb91..680d67b5 100644
--- a/app/[locale]/dashboard/[entityType]/[entitySlug]/dataset/page.tsx
+++ b/app/[locale]/dashboard/[entityType]/[entitySlug]/dataset/page.tsx
@@ -5,7 +5,7 @@ import { useRouter } from 'next/navigation';
import { graphql } from '@/gql';
import { useMutation, useQuery } from '@tanstack/react-query';
import { parseAsString, useQueryState } from 'next-usequerystate';
-import { DataTable, IconButton, toast } from 'opub-ui';
+import { Button, DataTable, IconButton, toast } from 'opub-ui';
import { GraphQL } from '@/lib/api';
import { Icons } from '@/components/icons';
@@ -50,6 +50,19 @@ const deleteDatasetMutationDoc: any = graphql(`
}
`);
+const unPublishDataset: any = graphql(`
+ mutation unPublishDatasetMutation($datasetId: UUID!) {
+ unPublishDataset(datasetId: $datasetId) {
+ __typename
+ ... on TypeDataset {
+ id
+ title
+ created
+ }
+ }
+ }
+`);
+
export default function DatasetPage({
params,
}: {
@@ -72,6 +85,7 @@ export default function DatasetPage({
},
];
+
const AllDatasetsQuery: { data: any; isLoading: boolean; refetch: any } =
useQuery(
[`fetch_datasets_org_dashboard`],
@@ -124,7 +138,6 @@ export default function DatasetPage({
},
}
);
-
const CreateDatasetMutation: { mutate: any; isLoading: boolean; error: any } =
useMutation(
() =>
@@ -146,6 +159,30 @@ export default function DatasetPage({
},
}
);
+ const UnpublishDatasetMutation: {
+ mutate: any;
+ isLoading: boolean;
+ error: any;
+ } = useMutation(
+ [`unpublish_dataset`],
+ (data: { datasetId: string }) =>
+ GraphQL(
+ unPublishDataset,
+ {
+ [params.entityType]: params.entitySlug,
+ },
+ { datasetId: data.datasetId }
+ ),
+ {
+ onSuccess: () => {
+ toast(`Unpublished dataset successfully`);
+ AllDatasetsQuery.refetch();
+ },
+ onError: (err: any) => {
+ toast('Error: ' + err.message.split(':')[0]);
+ },
+ }
+ );
const datasetsListColumns = [
{
@@ -166,20 +203,33 @@ export default function DatasetPage({
{
accessorKey: 'delete',
header: 'Delete',
- cell: ({ row }: any) => (
-
{
- DeleteDatasetMutation.mutate({
- datasetId: row.original?.id,
- });
- }}
- >
- Delete
-
- ),
+ cell: ({ row }: any) =>
+ navigationTab === 'published' ? (
+
+ ) : (
+
{
+ DeleteDatasetMutation.mutate({
+ datasetId: row.original?.id,
+ });
+ }}
+ >
+ Delete
+
+ ),
},
];
diff --git a/public/Sectors/Budgets.svg b/public/Sectors/Budgets.svg
new file mode 100644
index 00000000..c6f7dfbc
--- /dev/null
+++ b/public/Sectors/Budgets.svg
@@ -0,0 +1,8 @@
+
diff --git a/public/Sectors/Child Rights.svg b/public/Sectors/Child Rights.svg
new file mode 100644
index 00000000..55ce6613
--- /dev/null
+++ b/public/Sectors/Child Rights.svg
@@ -0,0 +1,9 @@
+
diff --git a/public/Sectors/Climate Finance.svg b/public/Sectors/Climate Finance.svg
new file mode 100644
index 00000000..b3b0521b
--- /dev/null
+++ b/public/Sectors/Climate Finance.svg
@@ -0,0 +1,8 @@
+
diff --git a/public/Sectors/Disaster Risk Reduction.svg b/public/Sectors/Disaster Risk Reduction.svg
new file mode 100644
index 00000000..fda5e50d
--- /dev/null
+++ b/public/Sectors/Disaster Risk Reduction.svg
@@ -0,0 +1,6 @@
+
diff --git a/public/Sectors/Law & Justice.svg b/public/Sectors/Law & Justice.svg
new file mode 100644
index 00000000..d3dc06da
--- /dev/null
+++ b/public/Sectors/Law & Justice.svg
@@ -0,0 +1,7 @@
+
diff --git a/public/Sectors/Urban Development.svg b/public/Sectors/Urban Development.svg
new file mode 100644
index 00000000..49a1a7fc
--- /dev/null
+++ b/public/Sectors/Urban Development.svg
@@ -0,0 +1,8 @@
+
diff --git a/public/homepage_illustartion.png b/public/homepage_illustartion.png
new file mode 100644
index 00000000..acf6500e
Binary files /dev/null and b/public/homepage_illustartion.png differ