-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #248 from colonial-heritage/object-list-frontend
Object lists in community page
- Loading branch information
Showing
33 changed files
with
948 additions
and
235 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
apps/researcher/src/app/[locale]/communities/[slug]/[listId]/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export default function Page() { | ||
return ( | ||
<div> | ||
<h1>This page is under construction</h1> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
apps/researcher/src/app/[locale]/communities/[slug]/object.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import heritageObjects from '@/lib/heritage-objects-instance'; | ||
|
||
interface Props { | ||
objectIri: string; | ||
} | ||
|
||
export default async function ObjectCard({objectIri}: Props) { | ||
const object = await heritageObjects.getById(objectIri); | ||
|
||
if (!object) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<div className="border border-blueGrey-200 text-blueGrey-800 bg-greenGrey-50 rounded-sm p-2 text-xs"> | ||
{object.name} | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
apps/researcher/src/components/add-object-list-form/actions.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
'use server'; | ||
|
||
import {getCommunityById} from '@/lib/community'; | ||
import {objectList} from '@colonial-collections/database'; | ||
import {revalidatePath} from 'next/cache'; | ||
|
||
interface List { | ||
communityId: string; | ||
createdBy: string; | ||
name: string; | ||
description?: string; | ||
} | ||
|
||
export async function addList(list: List) { | ||
await objectList.create(list); | ||
const community = await getCommunityById(list.communityId); | ||
revalidatePath(`/[locale]/communities/${community.slug}`, 'page'); | ||
} |
Oops, something went wrong.
ed0fadd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
colonial-collections-dataset-browser – ./apps/dataset-browser
colonial-collections-dataset-browser-git-main-colonial-heritage.vercel.app
colonial-collections-dataset-browser-colonial-heritage.vercel.app
colonial-collections-dataset-browser.vercel.app
datasets.colonialcollections.nl
ed0fadd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
colonial-collections-researcher – ./apps/researcher
colonial-collections-researcher.vercel.app
colonial-collections-researcher-git-main-colonial-heritage.vercel.app
colonial-collections-researcher-colonial-heritage.vercel.app
app.colonialcollections.nl