Skip to content

Commit ce183d0

Browse files
Merge branch 'dev' into aimodel
2 parents 89ecda6 + 746f444 commit ce183d0

File tree

77 files changed

+14990
-8442
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+14990
-8442
lines changed

.eslintrc.js

Lines changed: 0 additions & 20 deletions
This file was deleted.

.eslintrc.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

app/[locale]/(user)/collaboratives/CollaborativesListingClient.tsx

Lines changed: 127 additions & 121 deletions
Large diffs are not rendered by default.

app/[locale]/(user)/collaboratives/[collaborativeSlug]/CollaborativeDetailsClient.tsx

Lines changed: 191 additions & 158 deletions
Large diffs are not rendered by default.

app/[locale]/(user)/collaboratives/[collaborativeSlug]/page.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,15 @@ const CollaborativeInfoQuery = graphql(`
2626
export async function generateMetadata({
2727
params,
2828
}: {
29-
params: { collaborativeSlug: string };
29+
params: Promise<{ collaborativeSlug: string }>;
3030
}): Promise<Metadata> {
31+
const { collaborativeSlug } = await params;
3132
try {
32-
const data = await GraphQLPublic(CollaborativeInfoQuery, {}, { pk: params.collaborativeSlug });
33+
const data = await GraphQLPublic(
34+
CollaborativeInfoQuery,
35+
{},
36+
{ pk: collaborativeSlug }
37+
);
3338
const Collaborative = data?.collaborative;
3439

3540
return generatePageMetadata({
@@ -41,7 +46,7 @@ export async function generateMetadata({
4146
openGraph: {
4247
type: 'article',
4348
locale: 'en_US',
44-
url: `${process.env.NEXT_PUBLIC_PLATFORM_URL}/collaboratives/${params.collaborativeSlug}`,
49+
url: `${process.env.NEXT_PUBLIC_PLATFORM_URL}/collaboratives/${collaborativeSlug}`,
4550
title: `${Collaborative?.title} | Collaborative Data | CivicDataSpace`,
4651
description:
4752
Collaborative?.summary ||
@@ -59,7 +64,7 @@ export async function generateMetadata({
5964
openGraph: {
6065
type: 'article',
6166
locale: 'en_US',
62-
url: `${process.env.NEXT_PUBLIC_PLATFORM_URL}/collaboratives/${params.collaborativeSlug}`,
67+
url: `${process.env.NEXT_PUBLIC_PLATFORM_URL}/collaboratives/${collaborativeSlug}`,
6368
title: `Collaborative Details | CivicDataSpace`,
6469
description: `Explore open data and curated datasets in this collaborative.`,
6570
siteName: 'CivicDataSpace',

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { SearchInput, Spinner, Tag, Text } from 'opub-ui';
1010
import { GraphQL } from '@/lib/api';
1111
import { cn } from '@/lib/utils';
1212
import Styles from '../page.module.scss';
13+
import { useTourTrigger } from '@/hooks/use-tour-trigger';
1314

1415
const statsInfo: any = graphql(`
1516
query StatsList {
@@ -34,6 +35,10 @@ const statsInfo: any = graphql(`
3435

3536
export const Content = () => {
3637
const router = useRouter();
38+
39+
// Enable tour for first-time users
40+
useTourTrigger(true, 1500);
41+
3742
const Stats: { data: any; isLoading: any } = useQuery([`statsDetails`], () =>
3843
GraphQL(statsInfo, {}, [])
3944
);
@@ -104,7 +109,11 @@ export const Content = () => {
104109
) : (
105110
<div className="flex flex-wrap items-center gap-4 md:gap-0 lg:gap-0 ">
106111
{Metrics.map((item, index) => (
107-
<Link key={`${item.label}_${index}`} href={item.link}>
112+
<Link
113+
key={`${item.label}_${index}`}
114+
href={item.link}
115+
data-tour={index === 0 ? 'datasets-link' : index === 1 ? 'usecases-link' : index === 2 ? 'publishers-link' : undefined}
116+
>
108117
<div
109118
key={index}
110119
className="flex flex-col border-x-[1px] border-solid border-tertiaryAccent px-4"
@@ -123,7 +132,7 @@ export const Content = () => {
123132
))}
124133
</div>
125134
)}
126-
<div className="w-full">
135+
<div className="w-full" data-tour="search-bar">
127136
<SearchInput
128137
className={cn(Styles.Search)}
129138
onSubmit={handleSearch}

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

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {
1818
import { cn } from '@/lib/utils';
1919
import { Icons } from '@/components/icons';
2020
import Styles from './datasets.module.scss';
21+
import { DatasetListingSkeleton } from '@/components/loading';
2122

2223
interface Bucket {
2324
key: string;
@@ -81,9 +82,10 @@ const Datasets = () => {
8182

8283
<CarouselContent className="p-4">
8384
{isLoading ? (
84-
<div className="p-8">
85-
<Spinner />
86-
</div>
85+
<DatasetListingSkeleton
86+
cardCount={3}
87+
cardsOnly={true}
88+
/>
8789
) : (
8890
facets &&
8991
facets.results.map((item: any) => (
@@ -100,25 +102,29 @@ const Datasets = () => {
100102
description={item.description}
101103
metadataContent={[
102104
{
103-
icon: Icons.calendar,
105+
icon: Icons.calendar as any,
104106
label: 'Date',
105-
value: new Date(item.modified).toLocaleDateString('en-US', {
106-
day: 'numeric',
107-
month: 'long',
108-
year: 'numeric',
109-
}),
107+
value: new Date(item.modified).toLocaleDateString(
108+
'en-US',
109+
{
110+
day: 'numeric',
111+
month: 'long',
112+
year: 'numeric',
113+
}
114+
),
110115
},
111116
{
112-
icon: Icons.download,
117+
icon: Icons.download as any,
113118
label: 'Download',
114119
value: item.download_count.toString(),
115120
},
116121
{
117122
icon: Icons.globe,
118123
label: 'Geography',
119-
value: item.geographies?.length > 0
120-
? item.geographies.join(', ')
121-
: 'Not specified',
124+
value:
125+
item.geographies?.length > 0
126+
? item.geographies.join(', ')
127+
: 'Not specified',
122128
},
123129
]}
124130
tag={item.tags}

0 commit comments

Comments
 (0)