diff --git a/ving/docs/change-log.md b/ving/docs/change-log.md index 84bf1110..09c20fa6 100644 --- a/ving/docs/change-log.md +++ b/ving/docs/change-log.md @@ -12,6 +12,7 @@ outline: deep * NOTE: User's describe() now exposes the link for the avatar in links.avatarImage.href instead of meta.avatarUrl. This is a breaking change. * Implemented: apis should use plurals #183 * NOTE: rest endpoints and pages use plurals like /users instead of /user now. This is a breaking change. Update your APIs and pages to use plurals. + * Implemented: page generator should link to parent objects in the statistics section #158 ### 2025-01-12 * Removed pulumi from the project. diff --git a/ving/generator/nuxtpages.mjs b/ving/generator/nuxtpages.mjs index fa9be1b9..0a3aa1e4 100644 --- a/ving/generator/nuxtpages.mjs +++ b/ving/generator/nuxtpages.mjs @@ -209,9 +209,16 @@ const viewProps = (schema) => { `; } else if (prop.type == 'id') { - out += ` -
${makeLabel(prop.name)}: {{${schema.kind.toLowerCase()}.props?.${prop.name}}}
- `; + if (prop.relation?.type == 'parent') { + out += ` +
${makeLabel(prop.name)}: {{${schema.kind.toLowerCase()}.props?.${prop.name}}}
+ `; + } + else { + out += ` +
${makeLabel(prop.name)}: {{${schema.kind.toLowerCase()}.props?.${prop.name}}}
+ `; + } } else if (prop.type != 'virtual') { out += ` @@ -312,9 +319,16 @@ const statProps = (schema) => { `; } else if (prop.type == 'id') { - out += ` -
${makeLabel(prop.name)}: {{${schema.kind.toLowerCase()}.props?.${prop.name}}}
- `; + if (prop.relation?.type == 'parent') { + out += ` +
${makeLabel(prop.name)}: {{${schema.kind.toLowerCase()}.props?.${prop.name}}}
+ `; + } + else { + out += ` +
${makeLabel(prop.name)}: {{${schema.kind.toLowerCase()}.props?.${prop.name}}}
+ `; + } } else if (prop.type != 'virtual') { out += `