Skip to content
This repository has been archived by the owner on Nov 1, 2024. It is now read-only.

Commit

Permalink
fix: show tags on search result card
Browse files Browse the repository at this point in the history
  • Loading branch information
erikvatt committed Nov 21, 2023
1 parent ee5a615 commit 87dbbeb
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
6 changes: 6 additions & 0 deletions components/search/resultList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@ type ResultListInterface = {
__typename?: 'Story'
id: string
name: string
keywords?: string[]
owner?: { __typename?: 'Owner'; group: string } | null | undefined
}[]
quartoStories?: {
__typename?: 'QuartoStory'
id: string
name: string
group: string
keywords?: string[]
teamkatalogenURL?: string | null | undefined
description?: string
}[]
Expand Down Expand Up @@ -94,6 +96,8 @@ const ResultList = ({
variables: { q: '' },
})

console.log("hallooooo")

const po = useProductAreasQuery()
const [deleteQuartoQuery] = useDeleteQuartoStoryMutation()
const userInfo= useContext(UserState)
Expand Down Expand Up @@ -240,6 +244,7 @@ const ResultList = ({
link={`/quarto/${s.id}`}
teamkatalogen={tk.data}
productAreas={po.data}
keywords={s.keywords}
editable = {true}
description= {s.description}
deleteResource = {deleteQuarto}
Expand All @@ -250,6 +255,7 @@ const ResultList = ({
key={idx}
group={s.owner}
name={s.name}
keywords={s.keywords}
link={`/story/${s.id}`}
teamkatalogen={tk.data}
productAreas={po.data}
Expand Down
15 changes: 15 additions & 0 deletions components/search/searchResultLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { useState } from 'react'
import { useRouter } from 'next/router'
import { USER_INFO } from '../../lib/queries/userInfo/userInfo'
import { GET_PRODUCT_AREAS } from '../../lib/queries/productAreas/productAreas'
import TagPill from '../lib/tagPill'

export interface SearchResultProps {
resourceType?: string
Expand Down Expand Up @@ -41,6 +42,7 @@ export const SearchResultLink = ({
link,
id,
type,
keywords,
name,
innsiktsproduktType,
group,
Expand Down Expand Up @@ -150,6 +152,19 @@ export const SearchResultLink = ({
</div>
)}
</div>
{keywords && keywords?.length > 0 &&
keywords.map((k, i) => {
return (
<TagPill
key={i}
keyword={k}
horizontal={true}
>
{k}
</TagPill>
)
})
}
</div>
</Link>
</div>
Expand Down

0 comments on commit 87dbbeb

Please sign in to comment.