File tree Expand file tree Collapse file tree 6 files changed +18
-2
lines changed
docusaurus-plugin-openapi-docs/src
docusaurus-theme-openapi-docs/src/theme/ApiDemoPanel/Request Expand file tree Collapse file tree 6 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,9 @@ custom_edit_url: null
28
28
{ {#frontMatter.proxy} }
29
29
proxy: { {{frontMatter.proxy} }}
30
30
{ {/frontMatter.proxy} }
31
+ { {#frontMatter.hide_send_button} }
32
+ hide_send_button: true
33
+ { {/frontMatter.hide_send_button} }
31
34
---
32
35
33
36
{ {{markdown} }}
Original file line number Diff line number Diff line change @@ -190,6 +190,9 @@ custom_edit_url: null
190
190
{{#frontMatter.proxy}}
191
191
proxy: {{{frontMatter.proxy}}}
192
192
{{/frontMatter.proxy}}
193
+ {{#frontMatter.hide_send_button}}
194
+ hide_send_button: true
195
+ {{/frontMatter.hide_send_button}}
193
196
---
194
197
195
198
{{{markdown}}}
Original file line number Diff line number Diff line change @@ -221,6 +221,9 @@ function createItems(
221
221
. replace ( / \s + $ / , "" )
222
222
: "" ,
223
223
...( options ?. proxy && { proxy : options . proxy } ) ,
224
+ ...( options ?. hideSendButton && {
225
+ hide_send_button : options . hideSendButton ,
226
+ } ) ,
224
227
} ,
225
228
api : {
226
229
...defaults ,
@@ -338,6 +341,9 @@ function createItems(
338
341
. replace ( / \s + $ / , "" )
339
342
: "" ,
340
343
...( options ?. proxy && { proxy : options . proxy } ) ,
344
+ ...( options ?. hideSendButton && {
345
+ hide_send_button : options . hideSendButton ,
346
+ } ) ,
341
347
} ,
342
348
api : {
343
349
...defaults ,
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ export const OptionsSchema = Joi.object({
27
27
outputDir : Joi . string ( ) . required ( ) ,
28
28
template : Joi . string ( ) ,
29
29
downloadUrl : Joi . string ( ) ,
30
+ hideSendButton : Joi . boolean ( ) ,
30
31
sidebarOptions : sidebarOptions ,
31
32
version : Joi . string ( ) . when ( "versions" , {
32
33
is : Joi . exist ( ) ,
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ export interface APIOptions {
33
33
outputDir : string ;
34
34
template ?: string ;
35
35
downloadUrl ?: string ;
36
+ hideSendButton ?: boolean ;
36
37
sidebarOptions ?: SidebarOptions ;
37
38
version ?: string ;
38
39
label ?: string ;
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ function Request({ item }: { item: NonNullable<ApiItem> }) {
25
25
const response = useTypedSelector ( ( state : any ) => state . response . value ) ;
26
26
const postman = new sdk . Request ( item . postman ) ;
27
27
const metadata = useDoc ( ) ;
28
- const { proxy } = metadata . frontMatter ;
28
+ const { proxy, hide_send_button } = metadata . frontMatter ;
29
29
30
30
const params = {
31
31
path : [ ] as ParameterObject [ ] ,
@@ -48,7 +48,9 @@ function Request({ item }: { item: NonNullable<ApiItem> }) {
48
48
< summary >
49
49
< div className = { `details__request-summary` } >
50
50
< h4 > Request</ h4 >
51
- { item . servers && < Execute postman = { postman } proxy = { proxy } /> }
51
+ { item . servers && ! hide_send_button && (
52
+ < Execute postman = { postman } proxy = { proxy } />
53
+ ) }
52
54
</ div >
53
55
</ summary >
54
56
< div className = { styles . optionsPanel } >
You can’t perform that action at this time.
0 commit comments