Skip to content

Commit fbb45c9

Browse files
authored
Merge pull request #175 from CivicDataLab/171-restructure-dashboard-to-reuse-organization-features-for-dataspace
171 restructure dashboard to reuse organization features for dataspace
2 parents 28a6455 + 1631b5b commit fbb45c9

File tree

2 files changed

+11
-15
lines changed

2 files changed

+11
-15
lines changed

app/[locale]/dashboard/[entityType]/[entitySlug]/dataset/page.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export default function DatasetPage({
7979
GraphQL(
8080
allDatasetsQueryDoc,
8181
{
82-
// Entity Headers if present
82+
[params.entityType]: params.entitySlug,
8383
},
8484
{
8585
filters: {
@@ -110,7 +110,7 @@ export default function DatasetPage({
110110
GraphQL(
111111
deleteDatasetMutationDoc,
112112
{
113-
// Entity Headers if present
113+
[params.entityType]: params.entitySlug,
114114
},
115115
{ datasetId: data.datasetId }
116116
),
@@ -131,7 +131,7 @@ export default function DatasetPage({
131131
GraphQL(
132132
createDatasetMutationDoc,
133133
{
134-
// Entity Headers if present
134+
[params.entityType]: params.entitySlug,
135135
},
136136
[]
137137
),

app/[locale]/dashboard/[entityType]/page.tsx

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,19 @@ const Page = () => {
1818

1919
const dataspacesList = [
2020
{
21-
title: 'Open Budgets India',
21+
name: 'Open Budgets India',
2222
slug: 'open-budgets-india',
2323
},
24-
{
25-
title: 'Open Contracting India',
26-
slug: 'open-contracting-india',
27-
},
2824
];
2925

3026
const organizationsList = [
3127
{
32-
title: 'CBGA',
33-
slug: 'cbga-india',
28+
name: 'CBGA',
29+
slug: 'civicdatalab',
3430
},
3531
{
36-
title: 'Assam Finance Department',
37-
slug: 'assam-finance-dept',
32+
name: 'Assam Finance Department',
33+
slug: 'civicdatalab',
3834
},
3935
];
4036

@@ -67,7 +63,7 @@ const Page = () => {
6763
...(params.entityType === 'organization'
6864
? organizationsList
6965
: dataspacesList),
70-
].map((orgItem) => (
66+
]?.map((orgItem) => (
7167
<div
7268
key={orgItem.slug}
7369
className="flex max-w-64 flex-col items-center gap-3 rounded-2 border-2 border-solid border-baseGraySlateSolid4 px-4 py-5 text-center"
@@ -97,14 +93,14 @@ const Page = () => {
9793
</LinkButton> */}
9894
</Link>
9995
<div>
100-
<Text variant="headingMd">{orgItem.title}</Text>
96+
<Text variant="headingMd">{orgItem.name}</Text>
10197
</div>
10298
</div>
10399
))}
104100
<div className="flex h-72 w-56 flex-col items-center justify-center gap-3 rounded-2 bg-baseGraySlateSolid6 p-4">
105101
<Icon source={Icons.plus} size={40} color="success" />
106102
<Text alignment="center" variant="headingMd">
107-
Add New Organization
103+
{`Add New ${params.entityType === 'organization' ? 'Organization' : 'Data Space'}`}
108104
</Text>
109105
</div>
110106
</div>

0 commit comments

Comments
 (0)