Skip to content

Feature/documentation tab#967

Merged
frenchbread merged 111 commits intodevelopfrom
feature/documentation-tab
Jun 6, 2016
Merged

Feature/documentation tab#967
frenchbread merged 111 commits intodevelopfrom
feature/documentation-tab

Conversation

@55
Copy link
Copy Markdown
Contributor

@55 55 commented May 25, 2016

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

@55 55 added the WIP label May 25, 2016
@55 55 added this to the Sprint 23 milestone May 25, 2016
@55 55 added the in progress label May 25, 2016
@55
Copy link
Copy Markdown
Contributor Author

55 commented May 26, 2016

Current look of the documentation view:

  • added panels

screencapture-localhost-3000-api-6dfzp7w2lsojl3ktp-1464261228742

@@ -0,0 +1,16 @@
import { DocumentationFiles } from '/documentation/collection/collection';

DocumentationFiles.allow({
Copy link
Copy Markdown
Contributor

@frenchbread frenchbread Jun 6, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add permissions check here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should at least check for a Meteor.userId in the allow rule.

@brylie
Copy link
Copy Markdown
Contributor

brylie commented Jun 6, 2016

We still need an s-alert for the AutoForm onSuccess. E.g. when changing the documentation URL. Cing @Nazarah

@brylie
Copy link
Copy Markdown
Contributor

brylie commented Jun 6, 2016

When no documentation link is available, display the following text:

No documentation link is available. You can add one using Manage API feature.

}
// Get the id from documentation file object
const documentationFileId = file.uniqueIdentifier;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
}

@55 55 removed the WIP label Jun 6, 2016
@frenchbread
Copy link
Copy Markdown
Contributor

Reviewing

@frenchbread frenchbread merged commit 0222d39 into develop Jun 6, 2016
@frenchbread frenchbread deleted the feature/documentation-tab branch June 6, 2016 13:46
{{#if documentationLink }}
<div class="documentation-link">
<i class="fa fa-external-link"></i>&nbsp;
<a href="#">{{ documentationLink }}</a>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This href is not working as expected. It should provide a link to the documentation file, but currently has only a hash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants