Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
151 changes: 81 additions & 70 deletions app/[locale]/(user)/components/Datasets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,76 +88,87 @@ const Datasets = () => {
{isLoading ? (
<DatasetListingSkeleton cardCount={3} cardsOnly={true} />
) : (
facets?.results?.map((item: any) => (
<CarouselItem
key={item.id}
className={cn(
'h-2/4 basis-full pl-4 sm:basis-1/2 lg:basis-1/3',
Styles.List
)}
>
{' '}
<Card
title={item.title}
description={stripMarkdown(item.description)}
metadataContent={[
{
icon: Icons.calendar as any,
label: 'Date',
value: new Date(item.modified).toLocaleDateString(
'en-US',
{
day: 'numeric',
month: 'long',
year: 'numeric',
}
),
},
{
icon: Icons.download as any,
label: 'Download',
value: item.download_count.toString(),
},
{
icon: Icons.globe,
label: 'Geography',
value:
item.geographies?.length > 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',
// },
// ]}
/>
</CarouselItem>
))
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 (
<CarouselItem
key={item.id}
className={cn(
'h-2/4 basis-full pl-4 sm:basis-1/2 lg:basis-1/3',
Styles.List
)}
>
{' '}
<Card
title={item.title}
description={stripMarkdown(item.description)}
metadataContent={[
{
icon: Icons.calendar as any,
label: 'Date',
value: new Date(item.modified).toLocaleDateString(
'en-US',
{
day: 'numeric',
month: 'long',
year: 'numeric',
}
),
},
{
icon: Icons.download as any,
label: 'Download',
value: item.download_count.toString(),
},
{
icon: Icons.globe,
label: 'Geography',
value:
geographies.length > 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',
// },
// ]}
/>
</CarouselItem>
);
})
)}
</CarouselContent>
<CarouselNext />
Expand Down
10 changes: 5 additions & 5 deletions app/[locale]/(user)/components/datasets.module.scss
Original file line number Diff line number Diff line change
@@ -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;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,59 +113,76 @@ const SimilarDatasets: React.FC = () => {
<CarouselContent className="p-4">
{SimilatDatasetdetails?.data?.getDataset &&
SimilatDatasetdetails?.data?.getDataset.similarDatasets.map(
(item: any) => (
<CarouselItem
key={item.id}
className={cn(
'h-2/4 basis-full pl-4 sm:basis-1/2 lg:basis-1/2',
Styles.List
)}
>
{' '}
<Card
title={item.title}
description={stripMarkdown(item.description || '')}
metadataContent={[
{
icon: Icons.calendar as any,
label: 'Date',
value: '19 July 2024',
},
{
icon: Icons.download as any,
label: 'Download',
value: item.downloadCount.toString(),
},
{
icon: Icons.globe as any,
label: 'Geography',
value: item.geographies.join(', '),
},
]}
tag={item.tags}
formats={item.formats}
footerContent={[
{
icon: `/Sectors/${item.sectors[0]?.name}.svg` as any,
label: 'Sectors',
},
{
icon: item.isIndividualDataset
? (item?.user?.profilePicture as any)
? `${process.env.NEXT_PUBLIC_BACKEND_URL}/${item.user.profilePicture.url}`
: ('/profile.png' as any)
: (item?.organization?.logo as any)
? `${process.env.NEXT_PUBLIC_BACKEND_URL}/${item.organization.logo.url}`
: ('/org.png' as any),
label: 'Published by',
},
]}
variation={'collapsed'}
iconColor="warning"
href={`/datasets/${item.id}`}
/>
</CarouselItem>
)
(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 (
<CarouselItem
key={item.id}
className={cn(
'h-2/4 basis-full pl-4 sm:basis-1/2 lg:basis-1/2',
Styles.List
)}
>
{' '}
<Card
title={item.title}
description={stripMarkdown(item.description || '')}
metadataContent={metadataContent}
tag={item.tags}
formats={item.formats}
footerContent={[
{
icon: `/Sectors/${item.sectors[0]?.name}.svg` as any,
label: 'Sectors',
},
{
icon: item.isIndividualDataset
? (item?.user?.profilePicture as any)
? `${process.env.NEXT_PUBLIC_BACKEND_URL}/${item.user.profilePicture.url}`
: ('/profile.png' as any)
: (item?.organization?.logo as any)
? `${process.env.NEXT_PUBLIC_BACKEND_URL}/${item.organization.logo.url}`
: ('/org.png' as any),
label: 'Published by',
},
]}
variation={'collapsed'}
iconColor="warning"
href={`/datasets/${item.id}`}
/>
</CarouselItem>
);
}
)}
</CarouselContent>
<CarouselNext />
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 */}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ export default function PublishPage() {
value={`item-${index}`}
className="border-none"
>
<AccordionTrigger className="flex w-full flex-wrap items-center gap-2 rounded-1 bg-baseBlueSolid3 p-4 hover:no-underline">
<AccordionTrigger className="flex w-full items-center gap-2 rounded-1 bg-baseBlueSolid3 p-4 hover:no-underline">
<div className="flex flex-wrap items-center justify-start gap-2">
<Text className="w-48 text-justify font-semi-bold">
{item.name}
Expand All @@ -362,7 +362,9 @@ export default function PublishPage() {
color="critical"
size={24}
/>
<Text variant="bodyMd">{item.error}</Text>
<Text variant="bodyMd" className="text-justify">
{item.error}
</Text>
</div>
)}
</div>
Expand Down
Loading