Skip to content

Commit

Permalink
Merge pull request #746 from dpc-sdp/feature/R20-950-fv-recc-support
Browse files Browse the repository at this point in the history
[R20-950] Cleaned up table listing view
  • Loading branch information
jeffdowdle authored Aug 7, 2023
2 parents da021c8 + 811988f commit 9eaaa95
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 52 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
<template>
<RplTextLink :url="item.url[0]">
{{ item.title[0] }}
<RplTextLink :url="url">
{{ title }}
</RplTextLink>
</template>

<script setup lang="ts">
defineProps(['item'])
import { useSearchResult } from '#imports'
interface Props {
item: {
url: string
title: string
}
}
const props = defineProps<Props>()
const { title, url } = useSearchResult(props.item)
</script>

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup lang="ts">
import { computed } from 'vue'
import RplDataTableRow from './RplDataTableRow.vue'
import RplDataTableRow, { tableColumnConfig } from './RplDataTableRow.vue'
interface HeadingType {
horizontal: boolean
Expand All @@ -10,7 +10,7 @@ interface HeadingType {
interface Props {
caption?: string
footer?: string
columns: Array<string>
columns: tableColumnConfig[] | string[]
headingType?: HeadingType
items: Array<Record<string, unknown>[] | string[]>
offset?: number
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ import {
rplEventPayload
} from '../../composables/useRippleEvent'
type tableColumnConfig = {
export type tableColumnConfig = {
label: string
component?: string
props?: any
}
interface Props {
content: any
columns: tableColumnConfig[]
columns: tableColumnConfig[] | string[]
items: Array<string>
verticalHeader?: boolean
offset: number
Expand Down Expand Up @@ -75,15 +76,20 @@ const handleClick = () => {
:is="i === 0 && verticalHeader ? 'th' : 'td'"
v-for="(item, i) of items"
:key="i"
:data-label="columns[i]"
:data-label="
typeof columns[i] === 'string' ? columns[i] : (columns[i] as tableColumnConfig).label
"
>
<template
v-if="
typeof columns[i] === 'object' &&
columns[i].hasOwnProperty('component')
"
>
<component :is="columns[i].component" :item="item" />
<component
:is="(columns[i] as tableColumnConfig).component"
:item="item"
/>
</template>
<template v-else>
{{ item }}
Expand Down

0 comments on commit 9eaaa95

Please sign in to comment.