-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Try-out button for Swagger file #1563
Conversation
@preriasusi Could you please review? |
This looks good, but is behaving very strangely. E.g. After uploading a Swagger document, the documentation viewer renders, but none of the sub sections will open when clicking show/hide or the endpoint name. I notice the following console errors:
|
I am also noticing multiple sAlerts when clicking the 'choose file' button:
Check the event handlers for the template to see if they are overlapping. |
@@ -34,6 +35,11 @@ Apis.schema = new SimpleSchema({ | |||
optional: true, | |||
regEx: SimpleSchema.RegEx.Url | |||
}, | |||
submit_methods: { | |||
type: [String], | |||
label: 'Allow try-out for following methods:', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to internationalize this label. It can be done via schema i18n. See, for example:
I suppose this error shows when npm packages installed/ran in the wrong order. If you delete folder 'node_modules' and reinstall packages it should work correctly |
@marla-singer is this ready for review? Please remember to toggle the 'ready for review' label, to make it clear when a PR is ready. I will go ahead and review, but wanted to make sure the PR is ready. |
@brylie Yes, PR is ready |
AutoForm.hooks({ | ||
apiDocumentationForm: { | ||
onSuccess () { | ||
sAlert.success(TAPi18n.__('manageApiDocumentationModal_LinkField_Updated_Message')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please separate this line into two parts:
// Get success message translation
const message = TAPi18n.__('manageApiDocumentationModal_LinkField_Updated_Message');
// Alert user of success
sAlert.success(message);
It is a bit 'cleaner' this way, and shortens the line length.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay
@@ -16,7 +16,7 @@ | |||
<div id="message-bar" class="swagger-ui-wrap message-success" data-sw-translate=""></div> | |||
{{#if dataFetched}} | |||
{{#if documentationValid}} | |||
{{>swaggerUiContent apiDocumentation=apiDocumentation}} | |||
{{>swaggerUiContent apiDoc=apiDoc api=api}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check the indentation on this file. It may be sufficient to use two space per nested level when indenting HTML files. This also matches our JS indentation convention.
I have done a review of the code. There are some 'lint/style' issues, but overall this is ready to merge soon. |
@brylie Done. Thanks for your recommendations! |
Closes #1490