docs-util: add exception for workflow examples modification + show summary instead of comment (#10963)
* docs-util: add exception for workflow examples modification + show summary instead of comment * add currency and country code in example * add common IDs
This commit is contained in:
+5
-3
@@ -101,9 +101,11 @@ function getStep({
|
|||||||
return {
|
return {
|
||||||
type,
|
type,
|
||||||
name: document.name,
|
name: document.name,
|
||||||
description: associatedReflection?.comment
|
description: associatedReflection?.comment?.summary
|
||||||
? Handlebars.helpers.comments(associatedReflection.comment, true)
|
? Handlebars.helpers.comment(associatedReflection.comment.summary)
|
||||||
: "",
|
: associatedReflection?.comment
|
||||||
|
? Handlebars.helpers.comments(associatedReflection.comment, true)
|
||||||
|
: "",
|
||||||
link:
|
link:
|
||||||
type === "hook" || !associatedReflection?.url
|
type === "hook" || !associatedReflection?.url
|
||||||
? `#${document.name}`
|
? `#${document.name}`
|
||||||
|
|||||||
+4
-1
@@ -24,7 +24,10 @@ export default function () {
|
|||||||
} else {
|
} else {
|
||||||
exampleTags.forEach((exampleTag) => {
|
exampleTags.forEach((exampleTag) => {
|
||||||
exampleTag.content.forEach((part) => {
|
exampleTag.content.forEach((part) => {
|
||||||
if (part.kind !== "code") {
|
if (
|
||||||
|
part.kind !== "code" ||
|
||||||
|
part.text.startsWith("```ts workflow={false}")
|
||||||
|
) {
|
||||||
exampleStr.push(part.text)
|
exampleStr.push(part.text)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -266,10 +266,15 @@ export function getFakeStrValue({
|
|||||||
`id_${faker.string.alphanumeric({
|
`id_${faker.string.alphanumeric({
|
||||||
length: { min: 10, max: 20 },
|
length: { min: 10, max: 20 },
|
||||||
})}`,
|
})}`,
|
||||||
|
region_id: "reg_123",
|
||||||
|
product_id: "prod_123",
|
||||||
|
cart_id: "cart_123",
|
||||||
|
order_id: "order_123",
|
||||||
name: () => faker.person.firstName(),
|
name: () => faker.person.firstName(),
|
||||||
email: () => faker.internet.email(),
|
email: () => faker.internet.email(),
|
||||||
password: () => faker.internet.password({ length: 8 }),
|
password: () => faker.internet.password({ length: 8 }),
|
||||||
currency: () => faker.finance.currencyCode(),
|
currency_code: () => faker.finance.currencyCode().toLowerCase(),
|
||||||
|
country_code: () => faker.location.countryCode().toLowerCase(),
|
||||||
title: () => faker.lorem.word(),
|
title: () => faker.lorem.word(),
|
||||||
description: () => faker.lorem.sentence(),
|
description: () => faker.lorem.sentence(),
|
||||||
url: () => faker.internet.url(),
|
url: () => faker.internet.url(),
|
||||||
|
|||||||
Reference in New Issue
Block a user