Skip to content

Commit

Permalink
Merge pull request #160 from RDFLib/jamie/next/storybook-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiefeiss authored Apr 8, 2024
2 parents d437626 + 20bc837 commit 91cbc41
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 22 deletions.
4 changes: 2 additions & 2 deletions prez-components/src/components/PrezUIConcept.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<script lang="ts" setup>
import { ref } from "vue";
import type { Concept } from "prez-lib";
import Button from "primevue/button";
import type { PrezUIConceptProps } from "../types";
import PrezUINode from "./PrezUINode.vue";
const props = defineProps<Concept>();
const props = defineProps<PrezUIConceptProps>();
const open = ref(false);
Expand Down
4 changes: 2 additions & 2 deletions prez-components/src/components/PrezUIObjectTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ const placeholderProperties = [
<template #body="slotProps">
<Skeleton v-if="props.loading" width="30rem" class="mb-2"></Skeleton>
<template v-else>
<template v-if="slotProps.data.predicate.value === 'https://prez.dev/concepts'">
<template v-if="props.data?.concepts && slotProps.data.predicate.value === 'https://prez.dev/concepts'">
<PrezUIConceptHierarchy :concepts="slotProps.data.objects" />
</template>
<template v-else-if="slotProps.data.predicate.value === 'https://prez.dev/members'">
<template v-else-if="props.data?.members && slotProps.data.predicate.value === 'https://prez.dev/members'">
<RouterLink v-for="member in slotProps.data.objects" :to="member.value">
<Button size="small" outlined>Members</Button>
</RouterLink>
Expand Down
5 changes: 3 additions & 2 deletions prez-components/src/stories/PrezUIItemList.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ const meta = {
component: PrezUIItemList,
tags: ["autodocs"],
argTypes: {
items: { description: "The list of items" },
data: { description: "The list of items" },
loading: { description: "Loading state" },
},
} satisfies Meta<typeof PrezUIItemList>;

Expand Down Expand Up @@ -38,7 +39,7 @@ const publisher = node({

export const Default: Story = {
args: {
items: [
data: [
{
focusNode: {
...node({
Expand Down
35 changes: 19 additions & 16 deletions prez-components/src/stories/PrezUIObjectTable.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ const meta = {
component: PrezUIObjectTable,
tags: ["autodocs"],
argTypes: {
properties: { description: "The list of properties" },
members: { description: "A list of member links" }
data: { description: "The list of properties" },
hideHidden: { description: "Hides hidden properties" },
loading: { description: "Loading state" },
},
} satisfies Meta<typeof PrezUIObjectTable>;

Expand Down Expand Up @@ -39,20 +40,22 @@ const publisher = node({

export const Default: Story = {
args: {
properties: {
[creator.value]: {
predicate: creator,
objects: [literal("object 1")]
},
[issued.value]: {
predicate: issued,
objects: [literal("object 2")]
},
[publisher.value]: {
predicate: publisher,
objects: [literal("object 3")]
},
// some blank node data to show nested tables
data: {
properties: {
[creator.value]: {
predicate: creator,
objects: [literal("object 1")]
},
[issued.value]: {
predicate: issued,
objects: [literal("object 2")]
},
[publisher.value]: {
predicate: publisher,
objects: [literal("object 3")]
},
// some blank node data to show nested tables
}
}
},
}
Expand Down
2 changes: 2 additions & 0 deletions prez-components/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,5 @@ export interface PrezUIObjectTableProps {
// items: PrezItem[];
// headers?: PrezNode[];
// };

export interface PrezUIConceptProps extends Concept {};

0 comments on commit 91cbc41

Please sign in to comment.