From 2b9acd178709d91e4958391a9c1cb106a93048aa Mon Sep 17 00:00:00 2001 From: Abhishekfm Date: Thu, 5 Mar 2026 16:35:46 +0530 Subject: [PATCH] Tour guide disabled, card length, geographiesobject fixed, Accordian fixed --- app/[locale]/(user)/components/Datasets.tsx | 151 +- .../(user)/components/datasets.module.scss | 10 +- .../components/SimilarDatasets/index.tsx | 123 +- .../similarDatasets.module.scss | 4 +- .../components/UnifiedListingComponent.tsx | 140 +- .../aimodels/edit/[id]/details/page.tsx | 2 +- .../aimodels/edit/[id]/publish/page.tsx | 6 +- .../[entitySlug]/aimodels/page.tsx | 30 +- .../collaboratives/edit/[id]/publish/page.tsx | 61 +- .../[id]/edit/components/EditMetadata.tsx | 24 +- .../dataset/[id]/edit/publish/page.tsx | 99 +- .../usecases/edit/[id]/publish/page.tsx | 21 +- components/provider.tsx | 10 +- package-lock.json | 2462 +++++++++-------- package.json | 2 +- 15 files changed, 1730 insertions(+), 1415 deletions(-) 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]/(user)/search/components/UnifiedListingComponent.tsx b/app/[locale]/(user)/search/components/UnifiedListingComponent.tsx index 4724467b..2a25ca86 100644 --- a/app/[locale]/(user)/search/components/UnifiedListingComponent.tsx +++ b/app/[locale]/(user)/search/components/UnifiedListingComponent.tsx @@ -1,8 +1,9 @@ 'use client'; -import GraphqlPagination from '@/app/[locale]/dashboard/components/GraphqlPagination/graphqlPagination'; +import React, { useEffect, useReducer, useRef, useState } from 'react'; import Link from 'next/link'; import { useRouter } from 'next/navigation'; +import GraphqlPagination from '@/app/[locale]/dashboard/components/GraphqlPagination/graphqlPagination'; import { Button, ButtonGroup, @@ -14,12 +15,11 @@ import { Text, Tray, } from 'opub-ui'; -import React, { useEffect, useReducer, useRef, useState } from 'react'; +import { cn, formatDate } from '@/lib/utils'; import BreadCrumbs from '@/components/BreadCrumbs'; import { Icons } from '@/components/icons'; import { Loading } from '@/components/loading'; -import { cn, formatDate } from '@/lib/utils'; import Filter from '../../datasets/components/FIlter/Filter'; import Styles from '../../datasets/dataset.module.scss'; @@ -455,11 +455,16 @@ const UnifiedListingComponent: React.FC = ({
+
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 = () => {