docs: show when condition in workflows reference (#12566)
This commit is contained in:
@@ -19,6 +19,7 @@ export type CodeBlockActionsProps = {
|
||||
onApiTesting?: React.Dispatch<React.SetStateAction<boolean>>
|
||||
noReport?: boolean
|
||||
noCopy?: boolean
|
||||
noAskAi?: boolean
|
||||
}
|
||||
|
||||
export const CodeBlockActions = ({
|
||||
@@ -32,6 +33,7 @@ export const CodeBlockActions = ({
|
||||
onApiTesting,
|
||||
noReport = false,
|
||||
noCopy = false,
|
||||
noAskAi = false,
|
||||
}: CodeBlockActionsProps) => {
|
||||
const iconClassName = [
|
||||
"text-medusa-contrast-fg-secondary",
|
||||
@@ -75,7 +77,9 @@ export const CodeBlockActions = ({
|
||||
]
|
||||
)}
|
||||
>
|
||||
<CodeBlockAskAiAction source={source} inHeader={inHeader} />
|
||||
{!noAskAi && (
|
||||
<CodeBlockAskAiAction source={source} inHeader={inHeader} />
|
||||
)}
|
||||
{canShowApiTesting && (
|
||||
<Tooltip
|
||||
text="Test API"
|
||||
|
||||
@@ -92,6 +92,7 @@ export const CodeBlock = ({
|
||||
style,
|
||||
forceNoTitle = false,
|
||||
animateTokenHighlights,
|
||||
noAskAi = false,
|
||||
...rest
|
||||
}: CodeBlockProps) => {
|
||||
if (!source && typeof children === "string") {
|
||||
@@ -306,6 +307,7 @@ export const CodeBlock = ({
|
||||
isCollapsed: collapsibleType !== undefined && collapsibleResult.collapsed,
|
||||
inInnerCode: hasInnerCodeBlock,
|
||||
showGradientBg: scrollable,
|
||||
noAskAi,
|
||||
}),
|
||||
[
|
||||
source,
|
||||
@@ -317,6 +319,7 @@ export const CodeBlock = ({
|
||||
collapsibleResult,
|
||||
hasInnerCodeBlock,
|
||||
scrollable,
|
||||
noAskAi,
|
||||
]
|
||||
)
|
||||
|
||||
@@ -457,7 +460,7 @@ export const CodeBlock = ({
|
||||
</code>
|
||||
</pre>
|
||||
{!hasInnerCodeBlock &&
|
||||
(!noCopy || !noReport || canShowApiTesting) && (
|
||||
(!noCopy || !noReport || canShowApiTesting || !noAskAi) && (
|
||||
<CodeBlockActions
|
||||
{...actionsProps}
|
||||
inHeader={false}
|
||||
|
||||
Reference in New Issue
Block a user