Conversation
…ion-tab # Conflicts: # .gitignore
…api-umbrella-dashboard into feature/documentation-upload-meteor-autoform-file
| @@ -0,0 +1,16 @@ | |||
| import { DocumentationFiles } from '/documentation/collection/collection'; | |||
|
|
|||
| DocumentationFiles.allow({ | |||
There was a problem hiding this comment.
Please add permissions check here.
There was a problem hiding this comment.
We should at least check for a Meteor.userId in the allow rule.
|
We still need an s-alert for the AutoForm onSuccess. E.g. when changing the documentation URL. Cing @Nazarah |
|
When no documentation link is available, display the following text:
|
| } | ||
| // Get the id from documentation file object | ||
| const documentationFileId = file.uniqueIdentifier; | ||
|
|
There was a problem hiding this comment.
Since there is no build-in check for file type/extension, we can at least provide minimal check for expected file types eg. ['yaml', 'yml', 'json'].
file.file.name - contains filename with extension (e.g. swagger.json)
file.file.type - provides filetype (e.g. application/json)
There was a problem hiding this comment.
There is similar method written for "import api backend" feature:
Method:
// function attached to template instance checks file extension
instance.endsWith = function (filename, suffixList) {
// variable that keeps state of is this filename contains provided extensions - false by default
var state = false;
// iterating through extensions passed into suffixList array
for (var i=0; i <suffixList.length; i++){
// parses line to check if filename contains current suffix
var endsWith = filename.indexOf(suffixList[i], filename.length - suffixList[i].length) !== -1;
// if current extension found in filename then change the state variable
if (endsWith) state = true;
}
return state;
};Reuse:
const acceptedExtensions = ["yaml", "yml", "txt", "json"];
if (instance.endsWith(file.name, acceptedExtensions)) {
// proceed with file upload
}…feature/documentation-tab
|
Reviewing |
| {{#if documentationLink }} | ||
| <div class="documentation-link"> | ||
| <i class="fa fa-external-link"></i> | ||
| <a href="#">{{ documentationLink }}</a> |
There was a problem hiding this comment.
This href is not working as expected. It should provide a link to the documentation file, but currently has only a hash.

Closes #929
Closes #1006
Closes #871
Closes #663
Closes #948
Closes #887
Closes #938
Closes #367
Closes #465
Closes #1042