diff --git a/app/[locale]/(user)/components/Datasets.tsx b/app/[locale]/(user)/components/Datasets.tsx index 07854011..8fe06185 100644 --- a/app/[locale]/(user)/components/Datasets.tsx +++ b/app/[locale]/(user)/components/Datasets.tsx @@ -88,76 +88,87 @@ const Datasets = () => { {isLoading ? ( ) : ( - facets?.results?.map((item: any) => ( - - {' '} - 0 - ? item.geographies.join(', ') - : 'Not specified', - }, - ]} - tag={item.tags} - formats={item.formats} - footerContent={[ - { - icon: `/Sectors/${item.sectors[0]}.svg`, - label: 'Sectors', - }, - { - icon: item.is_individual_dataset - ? item?.user?.profile_picture - ? `${process.env.NEXT_PUBLIC_BACKEND_URL}/${item.user.profile_picture}` - : '/profile.png' - : item?.organization?.logo - ? `${process.env.NEXT_PUBLIC_BACKEND_URL}/${item.organization.logo}` - : '/org.png', - label: 'Published by', - }, - ]} - variation={'collapsed'} - iconColor="metadata" - href={`/datasets/${item.id}`} - // type={[ - // { - // label: 'Dataset', - // fillColor: '#fff', - // borderColor: '#000', - // }, - // ]} - /> - - )) + facets?.results?.map((item: any) => { + const geographies = + Array.isArray(item.geographies) && item.geographies.length > 0 + ? item.geographies + .map((geo: any) => + typeof geo === 'string' ? geo : geo?.name + ) + .filter(Boolean) + : []; + + return ( + + {' '} + 0 + ? geographies.join(', ') + : 'Not specified', + }, + ]} + tag={item.tags} + formats={item.formats} + footerContent={[ + { + icon: `/Sectors/${item.sectors[0]}.svg`, + label: 'Sectors', + }, + { + icon: item.is_individual_dataset + ? item?.user?.profile_picture + ? `${process.env.NEXT_PUBLIC_BACKEND_URL}/${item.user.profile_picture}` + : '/profile.png' + : item?.organization?.logo + ? `${process.env.NEXT_PUBLIC_BACKEND_URL}/${item.organization.logo}` + : '/org.png', + label: 'Published by', + }, + ]} + variation={'collapsed'} + iconColor="metadata" + href={`/datasets/${item.id}`} + // type={[ + // { + // label: 'Dataset', + // fillColor: '#fff', + // borderColor: '#000', + // }, + // ]} + /> + + ); + }) )} diff --git a/app/[locale]/(user)/components/datasets.module.scss b/app/[locale]/(user)/components/datasets.module.scss index 134c5d2e..822bd270 100644 --- a/app/[locale]/(user)/components/datasets.module.scss +++ b/app/[locale]/(user)/components/datasets.module.scss @@ -1,23 +1,23 @@ .List { > * { - min-height: 320px; + min-height: 280px; max-height: fit-content; @media screen and (max-width: 1280px) { - min-height: 380px; + min-height: 300px; max-height: fit-content; } @media screen and (max-width: 1100px) { - min-height: 400px; + min-height: 300px; max-height: fit-content; } } } .UseCaseList { > * { - min-height: 500px; + min-height: 400px; max-height: fit-content; @media screen and (max-width: 1120px) { - min-height: 520px; + min-height: 420px; max-height: fit-content; } } diff --git a/app/[locale]/(user)/datasets/[datasetIdentifier]/components/SimilarDatasets/index.tsx b/app/[locale]/(user)/datasets/[datasetIdentifier]/components/SimilarDatasets/index.tsx index 63a69f98..cd6b3cbf 100644 --- a/app/[locale]/(user)/datasets/[datasetIdentifier]/components/SimilarDatasets/index.tsx +++ b/app/[locale]/(user)/datasets/[datasetIdentifier]/components/SimilarDatasets/index.tsx @@ -113,59 +113,76 @@ const SimilarDatasets: React.FC = () => { {SimilatDatasetdetails?.data?.getDataset && SimilatDatasetdetails?.data?.getDataset.similarDatasets.map( - (item: any) => ( - - {' '} - - - ) + (item: any) => { + const geographies = + Array.isArray(item.geographies) && + item.geographies.length > 0 + ? item.geographies + .map((geo: any) => + typeof geo === 'string' ? geo : geo?.name + ) + .filter(Boolean) + : null; + + const metadataContent: any[] = [ + { + icon: Icons.calendar as any, + label: 'Date', + value: '19 July 2024', + }, + { + icon: Icons.download as any, + label: 'Download', + value: item.downloadCount.toString(), + }, + ]; + + if (geographies && geographies.length > 0) { + metadataContent.push({ + icon: Icons.globe as any, + label: 'Geography', + value: geographies.join(', '), + }); + } + + return ( + + {' '} + + + ); + } )} diff --git a/app/[locale]/(user)/datasets/[datasetIdentifier]/components/SimilarDatasets/similarDatasets.module.scss b/app/[locale]/(user)/datasets/[datasetIdentifier]/components/SimilarDatasets/similarDatasets.module.scss index 11f07ac1..96bb4cc4 100644 --- a/app/[locale]/(user)/datasets/[datasetIdentifier]/components/SimilarDatasets/similarDatasets.module.scss +++ b/app/[locale]/(user)/datasets/[datasetIdentifier]/components/SimilarDatasets/similarDatasets.module.scss @@ -1,9 +1,9 @@ .List { > * { - min-height: 320px; + min-height: 280px; max-height: fit-content; @media screen and (max-width: 1280px) { - min-height: 400px; + min-height: 280px; max-height: fit-content; } } diff --git a/app/[locale]/dashboard/[entityType]/[entitySlug]/aimodels/edit/[id]/details/page.tsx b/app/[locale]/dashboard/[entityType]/[entitySlug]/aimodels/edit/[id]/details/page.tsx index 5aceb7e1..d2f51616 100644 --- a/app/[locale]/dashboard/[entityType]/[entitySlug]/aimodels/edit/[id]/details/page.tsx +++ b/app/[locale]/dashboard/[entityType]/[entitySlug]/aimodels/edit/[id]/details/page.tsx @@ -469,7 +469,7 @@ export default function AIModelDetailsPage() { onChange={(value) => handleInputChange('description', value)} onBlur={() => handleSave()} placeholder="Enter model description with rich formatting..." - helpText={`Character limit: ${formData?.description?.length || 0}/10000`} + helpText={`Character limit: ${formData?.description?.length || 0}/1000`} /> {/* Target Users & Intended Use - side by side */} diff --git a/app/[locale]/dashboard/[entityType]/[entitySlug]/aimodels/edit/[id]/publish/page.tsx b/app/[locale]/dashboard/[entityType]/[entitySlug]/aimodels/edit/[id]/publish/page.tsx index 1d38d131..93c041c8 100644 --- a/app/[locale]/dashboard/[entityType]/[entitySlug]/aimodels/edit/[id]/publish/page.tsx +++ b/app/[locale]/dashboard/[entityType]/[entitySlug]/aimodels/edit/[id]/publish/page.tsx @@ -350,7 +350,7 @@ export default function PublishPage() { value={`item-${index}`} className="border-none" > - +
{item.name} @@ -362,7 +362,9 @@ export default function PublishPage() { color="critical" size={24} /> - {item.error} + + {item.error} +
)} diff --git a/app/[locale]/dashboard/[entityType]/[entitySlug]/aimodels/page.tsx b/app/[locale]/dashboard/[entityType]/[entitySlug]/aimodels/page.tsx index 5c3ab74d..118f1821 100644 --- a/app/[locale]/dashboard/[entityType]/[entitySlug]/aimodels/page.tsx +++ b/app/[locale]/dashboard/[entityType]/[entitySlug]/aimodels/page.tsx @@ -1,18 +1,18 @@ 'use client'; +import { use, useEffect } from 'react'; +import { useRouter } from 'next/navigation'; import { graphql } from '@/gql'; import { useMutation, useQuery } from '@tanstack/react-query'; -import { useRouter } from 'next/navigation'; import { parseAsString, useQueryState } from 'nuqs'; import { Button, DataTable, Icon, IconButton, Text, toast } from 'opub-ui'; -import { use, useEffect } from 'react'; import { twMerge } from 'tailwind-merge'; +import { GraphQL } from '@/lib/api'; +import { formatDate } from '@/lib/utils'; import { Icons } from '@/components/icons'; import { LinkButton } from '@/components/Link'; import { Loading } from '@/components/loading'; -import { GraphQL } from '@/lib/api'; -import { formatDate } from '@/lib/utils'; import { ActionBar } from '../dataset/components/action-bar'; import { Navigation } from '../dataset/components/navigate-org-datasets'; @@ -192,15 +192,15 @@ export default function AIModelsPage({ ), }, - { - accessorKey: 'name', - header: 'Model Name', - cell: ({ row }: any) => ( - - {row.original.name} - - ), - }, + // { + // accessorKey: 'name', + // header: 'Model Name', + // cell: ({ row }: any) => ( + // + // {row.original.name} + // + // ), + // }, { accessorKey: 'modelType', header: 'Type', @@ -297,9 +297,7 @@ export default function AIModelsPage({ You have not added any AI models yet. - + diff --git a/app/[locale]/dashboard/[entityType]/[entitySlug]/collaboratives/edit/[id]/publish/page.tsx b/app/[locale]/dashboard/[entityType]/[entitySlug]/collaboratives/edit/[id]/publish/page.tsx index 366b8bf6..df5b595f 100644 --- a/app/[locale]/dashboard/[entityType]/[entitySlug]/collaboratives/edit/[id]/publish/page.tsx +++ b/app/[locale]/dashboard/[entityType]/[entitySlug]/collaboratives/edit/[id]/publish/page.tsx @@ -128,33 +128,39 @@ const Publish = () => { entitySlug: string; id: string; }>(); - const CollaborativeData: { data: any; isLoading: boolean; refetch: any } = useQuery( - [`fetch_CollaborativeDetails`], - () => - GraphQL( - CollaborativeDetails, - { - [params.entityType]: params.entitySlug, - }, - { - filters: { - id: params.id, + const CollaborativeData: { data: any; isLoading: boolean; refetch: any } = + useQuery( + [`fetch_CollaborativeDetails`], + () => + GraphQL( + CollaborativeDetails, + { + [params.entityType]: params.entitySlug, }, - } - ), - { - refetchOnMount: true, - refetchOnReconnect: true, - } - ); + { + filters: { + id: params.id, + }, + } + ), + { + refetchOnMount: true, + refetchOnReconnect: true, + } + ); const router = useRouter(); const PUBLISH_SUCCESS_TOAST_ID = 'collaborative-publish-success'; const PUBLISH_ERROR_TOAST_ID = 'collaborative-publish-error'; const { mutate, isLoading: mutationLoading } = useMutation( - () => GraphQL(publishCollaborativeMutation, { - [params.entityType]: params.entitySlug, - }, { collaborativeId: params.id }), + () => + GraphQL( + publishCollaborativeMutation, + { + [params.entityType]: params.entitySlug, + }, + { collaborativeId: params.id } + ), { onSuccess: (data: any) => { toast('Collaborative Published Successfully', { @@ -191,7 +197,8 @@ const Publish = () => { name: 'Datasets', data: CollaborativeData?.data?.collaboratives[0]?.datasets, error: - CollaborativeData.data && CollaborativeData.data?.collaboratives[0]?.datasets.length === 0 + CollaborativeData.data && + CollaborativeData.data?.collaboratives[0]?.datasets.length === 0 ? 'No datasets assigned. Please assign to continue.' : '', }, @@ -254,7 +261,7 @@ const Publish = () => { value={`item-${index}`} className=" border-none" > - +
{item.name} @@ -266,7 +273,9 @@ const Publish = () => { color="critical" size={24} /> - {item.error} + + {item.error} +
)} @@ -296,7 +305,9 @@ const Publish = () => {