Skip to content

Commit c6bbba0

Browse files
authored
Merge pull request #376 from CivicDataLab/fix/quill
Tour guide disabled, card length, geographies object fixed, Accordian
2 parents 491a4fc + e9ac988 commit c6bbba0

14 files changed

Lines changed: 1634 additions & 1371 deletions

File tree

app/[locale]/(user)/components/Datasets.tsx

Lines changed: 81 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -88,76 +88,87 @@ const Datasets = () => {
8888
{isLoading ? (
8989
<DatasetListingSkeleton cardCount={3} cardsOnly={true} />
9090
) : (
91-
facets?.results?.map((item: any) => (
92-
<CarouselItem
93-
key={item.id}
94-
className={cn(
95-
'h-2/4 basis-full pl-4 sm:basis-1/2 lg:basis-1/3',
96-
Styles.List
97-
)}
98-
>
99-
{' '}
100-
<Card
101-
title={item.title}
102-
description={stripMarkdown(item.description)}
103-
metadataContent={[
104-
{
105-
icon: Icons.calendar as any,
106-
label: 'Date',
107-
value: new Date(item.modified).toLocaleDateString(
108-
'en-US',
109-
{
110-
day: 'numeric',
111-
month: 'long',
112-
year: 'numeric',
113-
}
114-
),
115-
},
116-
{
117-
icon: Icons.download as any,
118-
label: 'Download',
119-
value: item.download_count.toString(),
120-
},
121-
{
122-
icon: Icons.globe,
123-
label: 'Geography',
124-
value:
125-
item.geographies?.length > 0
126-
? item.geographies.join(', ')
127-
: 'Not specified',
128-
},
129-
]}
130-
tag={item.tags}
131-
formats={item.formats}
132-
footerContent={[
133-
{
134-
icon: `/Sectors/${item.sectors[0]}.svg`,
135-
label: 'Sectors',
136-
},
137-
{
138-
icon: item.is_individual_dataset
139-
? item?.user?.profile_picture
140-
? `${process.env.NEXT_PUBLIC_BACKEND_URL}/${item.user.profile_picture}`
141-
: '/profile.png'
142-
: item?.organization?.logo
143-
? `${process.env.NEXT_PUBLIC_BACKEND_URL}/${item.organization.logo}`
144-
: '/org.png',
145-
label: 'Published by',
146-
},
147-
]}
148-
variation={'collapsed'}
149-
iconColor="metadata"
150-
href={`/datasets/${item.id}`}
151-
// type={[
152-
// {
153-
// label: 'Dataset',
154-
// fillColor: '#fff',
155-
// borderColor: '#000',
156-
// },
157-
// ]}
158-
/>
159-
</CarouselItem>
160-
))
91+
facets?.results?.map((item: any) => {
92+
const geographies =
93+
Array.isArray(item.geographies) && item.geographies.length > 0
94+
? item.geographies
95+
.map((geo: any) =>
96+
typeof geo === 'string' ? geo : geo?.name
97+
)
98+
.filter(Boolean)
99+
: [];
100+
101+
return (
102+
<CarouselItem
103+
key={item.id}
104+
className={cn(
105+
'h-2/4 basis-full pl-4 sm:basis-1/2 lg:basis-1/3',
106+
Styles.List
107+
)}
108+
>
109+
{' '}
110+
<Card
111+
title={item.title}
112+
description={stripMarkdown(item.description)}
113+
metadataContent={[
114+
{
115+
icon: Icons.calendar as any,
116+
label: 'Date',
117+
value: new Date(item.modified).toLocaleDateString(
118+
'en-US',
119+
{
120+
day: 'numeric',
121+
month: 'long',
122+
year: 'numeric',
123+
}
124+
),
125+
},
126+
{
127+
icon: Icons.download as any,
128+
label: 'Download',
129+
value: item.download_count.toString(),
130+
},
131+
{
132+
icon: Icons.globe,
133+
label: 'Geography',
134+
value:
135+
geographies.length > 0
136+
? geographies.join(', ')
137+
: 'Not specified',
138+
},
139+
]}
140+
tag={item.tags}
141+
formats={item.formats}
142+
footerContent={[
143+
{
144+
icon: `/Sectors/${item.sectors[0]}.svg`,
145+
label: 'Sectors',
146+
},
147+
{
148+
icon: item.is_individual_dataset
149+
? item?.user?.profile_picture
150+
? `${process.env.NEXT_PUBLIC_BACKEND_URL}/${item.user.profile_picture}`
151+
: '/profile.png'
152+
: item?.organization?.logo
153+
? `${process.env.NEXT_PUBLIC_BACKEND_URL}/${item.organization.logo}`
154+
: '/org.png',
155+
label: 'Published by',
156+
},
157+
]}
158+
variation={'collapsed'}
159+
iconColor="metadata"
160+
href={`/datasets/${item.id}`}
161+
// type={[
162+
// {
163+
// label: 'Dataset',
164+
// fillColor: '#fff',
165+
// borderColor: '#000',
166+
// },
167+
// ]}
168+
/>
169+
</CarouselItem>
170+
);
171+
})
161172
)}
162173
</CarouselContent>
163174
<CarouselNext />

app/[locale]/(user)/components/datasets.module.scss

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
.List {
22
> * {
3-
min-height: 320px;
3+
min-height: 280px;
44
max-height: fit-content;
55
@media screen and (max-width: 1280px) {
6-
min-height: 380px;
6+
min-height: 300px;
77
max-height: fit-content;
88
}
99
@media screen and (max-width: 1100px) {
10-
min-height: 400px;
10+
min-height: 300px;
1111
max-height: fit-content;
1212
}
1313
}
1414
}
1515
.UseCaseList {
1616
> * {
17-
min-height: 500px;
17+
min-height: 400px;
1818
max-height: fit-content;
1919
@media screen and (max-width: 1120px) {
20-
min-height: 520px;
20+
min-height: 420px;
2121
max-height: fit-content;
2222
}
2323
}

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

Lines changed: 70 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -113,59 +113,76 @@ const SimilarDatasets: React.FC = () => {
113113
<CarouselContent className="p-4">
114114
{SimilatDatasetdetails?.data?.getDataset &&
115115
SimilatDatasetdetails?.data?.getDataset.similarDatasets.map(
116-
(item: any) => (
117-
<CarouselItem
118-
key={item.id}
119-
className={cn(
120-
'h-2/4 basis-full pl-4 sm:basis-1/2 lg:basis-1/2',
121-
Styles.List
122-
)}
123-
>
124-
{' '}
125-
<Card
126-
title={item.title}
127-
description={stripMarkdown(item.description || '')}
128-
metadataContent={[
129-
{
130-
icon: Icons.calendar as any,
131-
label: 'Date',
132-
value: '19 July 2024',
133-
},
134-
{
135-
icon: Icons.download as any,
136-
label: 'Download',
137-
value: item.downloadCount.toString(),
138-
},
139-
{
140-
icon: Icons.globe as any,
141-
label: 'Geography',
142-
value: item.geographies.join(', '),
143-
},
144-
]}
145-
tag={item.tags}
146-
formats={item.formats}
147-
footerContent={[
148-
{
149-
icon: `/Sectors/${item.sectors[0]?.name}.svg` as any,
150-
label: 'Sectors',
151-
},
152-
{
153-
icon: item.isIndividualDataset
154-
? (item?.user?.profilePicture as any)
155-
? `${process.env.NEXT_PUBLIC_BACKEND_URL}/${item.user.profilePicture.url}`
156-
: ('/profile.png' as any)
157-
: (item?.organization?.logo as any)
158-
? `${process.env.NEXT_PUBLIC_BACKEND_URL}/${item.organization.logo.url}`
159-
: ('/org.png' as any),
160-
label: 'Published by',
161-
},
162-
]}
163-
variation={'collapsed'}
164-
iconColor="warning"
165-
href={`/datasets/${item.id}`}
166-
/>
167-
</CarouselItem>
168-
)
116+
(item: any) => {
117+
const geographies =
118+
Array.isArray(item.geographies) &&
119+
item.geographies.length > 0
120+
? item.geographies
121+
.map((geo: any) =>
122+
typeof geo === 'string' ? geo : geo?.name
123+
)
124+
.filter(Boolean)
125+
: null;
126+
127+
const metadataContent: any[] = [
128+
{
129+
icon: Icons.calendar as any,
130+
label: 'Date',
131+
value: '19 July 2024',
132+
},
133+
{
134+
icon: Icons.download as any,
135+
label: 'Download',
136+
value: item.downloadCount.toString(),
137+
},
138+
];
139+
140+
if (geographies && geographies.length > 0) {
141+
metadataContent.push({
142+
icon: Icons.globe as any,
143+
label: 'Geography',
144+
value: geographies.join(', '),
145+
});
146+
}
147+
148+
return (
149+
<CarouselItem
150+
key={item.id}
151+
className={cn(
152+
'h-2/4 basis-full pl-4 sm:basis-1/2 lg:basis-1/2',
153+
Styles.List
154+
)}
155+
>
156+
{' '}
157+
<Card
158+
title={item.title}
159+
description={stripMarkdown(item.description || '')}
160+
metadataContent={metadataContent}
161+
tag={item.tags}
162+
formats={item.formats}
163+
footerContent={[
164+
{
165+
icon: `/Sectors/${item.sectors[0]?.name}.svg` as any,
166+
label: 'Sectors',
167+
},
168+
{
169+
icon: item.isIndividualDataset
170+
? (item?.user?.profilePicture as any)
171+
? `${process.env.NEXT_PUBLIC_BACKEND_URL}/${item.user.profilePicture.url}`
172+
: ('/profile.png' as any)
173+
: (item?.organization?.logo as any)
174+
? `${process.env.NEXT_PUBLIC_BACKEND_URL}/${item.organization.logo.url}`
175+
: ('/org.png' as any),
176+
label: 'Published by',
177+
},
178+
]}
179+
variation={'collapsed'}
180+
iconColor="warning"
181+
href={`/datasets/${item.id}`}
182+
/>
183+
</CarouselItem>
184+
);
185+
}
169186
)}
170187
</CarouselContent>
171188
<CarouselNext />

app/[locale]/(user)/datasets/[datasetIdentifier]/components/SimilarDatasets/similarDatasets.module.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
.List {
22
> * {
3-
min-height: 320px;
3+
min-height: 280px;
44
max-height: fit-content;
55
@media screen and (max-width: 1280px) {
6-
min-height: 400px;
6+
min-height: 280px;
77
max-height: fit-content;
88
}
99
}

app/[locale]/dashboard/[entityType]/[entitySlug]/aimodels/edit/[id]/details/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ export default function AIModelDetailsPage() {
469469
onChange={(value) => handleInputChange('description', value)}
470470
onBlur={() => handleSave()}
471471
placeholder="Enter model description with rich formatting..."
472-
helpText={`Character limit: ${formData?.description?.length || 0}/10000`}
472+
helpText={`Character limit: ${formData?.description?.length || 0}/1000`}
473473
/>
474474

475475
{/* Target Users & Intended Use - side by side */}

app/[locale]/dashboard/[entityType]/[entitySlug]/aimodels/edit/[id]/publish/page.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ export default function PublishPage() {
350350
value={`item-${index}`}
351351
className="border-none"
352352
>
353-
<AccordionTrigger className="flex w-full flex-wrap items-center gap-2 rounded-1 bg-baseBlueSolid3 p-4 hover:no-underline">
353+
<AccordionTrigger className="flex w-full items-center gap-2 rounded-1 bg-baseBlueSolid3 p-4 hover:no-underline">
354354
<div className="flex flex-wrap items-center justify-start gap-2">
355355
<Text className="w-48 text-justify font-semi-bold">
356356
{item.name}
@@ -362,7 +362,9 @@ export default function PublishPage() {
362362
color="critical"
363363
size={24}
364364
/>
365-
<Text variant="bodyMd">{item.error}</Text>
365+
<Text variant="bodyMd" className="text-justify">
366+
{item.error}
367+
</Text>
366368
</div>
367369
)}
368370
</div>

0 commit comments

Comments
 (0)