docs: show the source code link in order models reference (#13398)
This commit is contained in:
@@ -192,6 +192,7 @@ You should only use the methods in this reference when implementing complex cust
|
||||
Functions: false,
|
||||
Methods: false,
|
||||
},
|
||||
internalType: "model-ref",
|
||||
},
|
||||
[`^modules/${snakeCaseModuleName}_models`]: {
|
||||
reflectionDescription: `This documentation provides a reference to the data models in the ${titleModuleName} Module`,
|
||||
@@ -207,6 +208,7 @@ You should only use the methods in this reference when implementing complex cust
|
||||
Variables: "Data Models",
|
||||
}
|
||||
: {},
|
||||
internalType: "model-ref",
|
||||
},
|
||||
} as FormattingOptionsType)
|
||||
}, {} as FormattingOptionsType),
|
||||
|
||||
@@ -180,7 +180,7 @@ export function registerHelpers(theme: MarkdownTheme) {
|
||||
shouldExpandPropertiesHelper(theme)
|
||||
shouldExpandDeclarationChildrenHelper(theme)
|
||||
startSectionsHelper(theme)
|
||||
ifDmlEntityHelper()
|
||||
ifDmlEntityHelper(theme)
|
||||
dmlPropertiesHelper()
|
||||
ifWorkflowStepHelper()
|
||||
stepInputHelper(theme)
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
import Handlebars from "handlebars"
|
||||
import { DeclarationReflection } from "typedoc"
|
||||
import { isDmlEntity } from "utils"
|
||||
import { MarkdownTheme } from "../../theme.js"
|
||||
|
||||
export default function () {
|
||||
export default function (theme: MarkdownTheme) {
|
||||
Handlebars.registerHelper(
|
||||
"ifDmlEntity",
|
||||
function (this: DeclarationReflection, options: Handlebars.HelperOptions) {
|
||||
return isDmlEntity(this) ? options.fn(this) : options.inverse(this)
|
||||
const { internalType } = theme.getFormattingOptionsForLocation()
|
||||
return isDmlEntity(this) || internalType === "model-ref"
|
||||
? options.fn(this)
|
||||
: options.inverse(this)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
@@ -115,10 +115,7 @@ export default function (theme: MarkdownTheme) {
|
||||
str += `Handlers consuming this hook accept the following input.\n\n`
|
||||
|
||||
str += Handlebars.helpers.parameterComponent.call(
|
||||
cleanUpHookInput(
|
||||
signatures[0].parameters,
|
||||
this.name === "addToCartWorkflow" && hook.name === "validate"
|
||||
),
|
||||
cleanUpHookInput(signatures[0].parameters),
|
||||
{
|
||||
hash: {
|
||||
sectionTitle: hook.name,
|
||||
|
||||
1
www/utils/packages/types/lib/index.d.ts
vendored
1
www/utils/packages/types/lib/index.d.ts
vendored
@@ -103,6 +103,7 @@ export type FormattingOptionType = {
|
||||
workflowDiagramComponent?: string
|
||||
isEventsReference?: boolean
|
||||
sortMembers?: boolean
|
||||
internalType?: string
|
||||
}
|
||||
|
||||
export type AllowedProjectDocumentsOption = {
|
||||
|
||||
@@ -41,15 +41,11 @@ export function getHookChildren(
|
||||
}
|
||||
|
||||
export function cleanUpHookInput(
|
||||
parameters: ParameterReflection[],
|
||||
debug = false
|
||||
parameters: ParameterReflection[]
|
||||
): (ParameterReflection | DeclarationReflection)[] {
|
||||
const hasInvokeParameter = parameters.some(
|
||||
(parameter) => parameter.name === "invoke"
|
||||
)
|
||||
if (debug) {
|
||||
console.log(parameters, hasInvokeParameter)
|
||||
}
|
||||
if (hasInvokeParameter) {
|
||||
return getHookInputFromInvoke(parameters)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user