{"action":"created","comment":{"url":"https://api.github.com/repos/apinf/platform/pulls/comments/146200211","pull_request_review_id":71105910,"id":146200211,"diff_hunk":"@@ -6,144 +6,100 @@ https://joinup.ec.europa.eu/community/eupl/og_page/european-union-public-licence\n // Meteor packages imports\n import { Meteor } from 'meteor/meteor';\n import { Template } from 'meteor/templating';\n+import { ReactiveVar } from 'meteor/reactive-var';\n \n // Meteor contributed packages imports\n-import { FS } from 'meteor/cfs:filesystem';\n import { FlowRouter } from 'meteor/kadira:flow-router';\n import { TAPi18n } from 'meteor/tap:i18n';\n-import { ace } from 'meteor/mizzao:sharejs-ace';\n import { sAlert } from 'meteor/juliancwirko:s-alert';\n \n // Npm packages imports\n import jsyaml from 'js-yaml';\n \n-Template.importApiConfiguration.onRendered(function () {\n-  // keep current template instance\n-  const instance = this;\n+Template.importApiConfiguration.onCreated(() => {\n+  // Create the apiConfiguration variable\n+  Template.instance().data.apiConfiguration = new ReactiveVar();\n+});\n \n-  // initialises ace editor\n-  instance.editor = ace.edit('editor');\n+Template.importApiConfiguration.helpers({\n+  // Get apiConfiguration value\n+  apiConfiguration: () => {\n+    return Template.instance().data.apiConfiguration.get();\n+  },\n+});\n \n-  // theme for editor\n-  instance.editor.setTheme('ace/theme/idle_fingers');\n+Template.importApiConfiguration.events({\n+  'change #import-api': (event, templateInstance) => {\n+    // File in input\n+    const file = event.target.files[0];\n+\n+    // Check file extension\n+    const acceptedExtensions = ['json', 'yml', 'yaml', 'txt'];\n+    const fileNameArray = file.name.split('.');\n+    if (acceptedExtensions.indexOf(fileNameArray[fileNameArray.length - 1]) === -1) {","path":"apinf_packages/apis/client/import/import.js","position":43,"original_position":43,"commit_id":"547138a76a03e52eca06bb60a9250e40da177e44","original_commit_id":"547138a76a03e52eca06bb60a9250e40da177e44","user":{"login":"marla-singer","id":20643403,"avatar_url":"https://avatars0.githubusercontent.com/u/20643403?v=4","gravatar_id":"","url":"https://api.github.com/users/marla-singer","html_url":"https://github.com/marla-singer","followers_url":"https://api.github.com/users/marla-singer/followers","following_url":"https://api.github.com/users/marla-singer/following{/other_user}","gists_url":"https://api.github.com/users/marla-singer/gists{/gist_id}","starred_url":"https://api.github.com/users/marla-singer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marla-singer/subscriptions","organizations_url":"https://api.github.com/users/marla-singer/orgs","repos_url":"https://api.github.com/users/marla-singer/repos","events_url":"https://api.github.com/users/marla-singer/events{/privacy}","received_events_url":"https://api.github.com/users/marla-singer/received_events","type":"User","site_admin":false},"body":"Forr checking extensions we have a special function for that\r\nhttps://github.com/apinf/platform/blob/5dcd5459d6c16c084d8b59575d3cbd056000b84d/apinf_packages/core/helper_functions/file_name_ends_with.js#L11\r\nRe-make checking extensions using the existed function","created_at":"2017-10-23T08:46:13Z","updated_at":"2017-10-23T08:48:11Z","html_url":"https://github.com/apinf/platform/pull/2973#discussion_r146200211","pull_request_url":"https://api.github.com/repos/apinf/platform/pulls/2973","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/apinf/platform/pulls/comments/146200211"},"html":{"href":"https://github.com/apinf/platform/pull/2973#discussion_r146200211"},"pull_request":{"href":"https://api.github.com/repos/apinf/platform/pulls/2973"}}},"pull_request":{"url":"https://api.github.com/repos/apinf/platform/pulls/2973","id":142766271,"html_url":"https://github.com/apinf/platform/pull/2973","diff_url":"https://github.com/apinf/platform/pull/2973.diff","patch_url":"https://github.com/apinf/platform/pull/2973.patch","issue_url":"https://api.github.com/repos/apinf/platform/issues/2973","number":2973,"state":"open","locked":false,"title":"API Import remake","user":{"login":"Vellames","id":9345433,"avatar_url":"https://avatars0.githubusercontent.com/u/9345433?v=4","gravatar_id":"","url":"https://api.github.com/users/Vellames","html_url":"https://github.com/Vellames","followers_url":"https://api.github.com/users/Vellames/followers","following_url":"https://api.github.com/users/Vellames/following{/other_user}","gists_url":"https://api.github.com/users/Vellames/gists{/gist_id}","starred_url":"https://api.github.com/users/Vellames/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vellames/subscriptions","organizations_url":"https://api.github.com/users/Vellames/orgs","repos_url":"https://api.github.com/users/Vellames/repos","events_url":"https://api.github.com/users/Vellames/events{/privacy}","received_events_url":"https://api.github.com/users/Vellames/received_events","type":"User","site_admin":false},"body":"Closes #2945, #2943, #2912\r\n\r\n- [x] Change front-end import\r\n- [x] Do the import flow without ShareJS (Ace editor)\r\n- [x] Remove ShareJS for project\r\n- [x] Fix API import error\r\n- [x] Validate unique names and valid urls\r\n- [x] Fix redirect after import successful \r\n\r\nWIP","created_at":"2017-09-24T19:02:57Z","updated_at":"2017-10-23T08:48:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2980a369ce4784b71e632f4743899be9c1bcdabe","assignee":{"login":"bajiat","id":11626388,"avatar_url":"https://avatars0.githubusercontent.com/u/11626388?v=4","gravatar_id":"","url":"https://api.github.com/users/bajiat","html_url":"https://github.com/bajiat","followers_url":"https://api.github.com/users/bajiat/followers","following_url":"https://api.github.com/users/bajiat/following{/other_user}","gists_url":"https://api.github.com/users/bajiat/gists{/gist_id}","starred_url":"https://api.github.com/users/bajiat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bajiat/subscriptions","organizations_url":"https://api.github.com/users/bajiat/orgs","repos_url":"https://api.github.com/users/bajiat/repos","events_url":"https://api.github.com/users/bajiat/events{/privacy}","received_events_url":"https://api.github.com/users/bajiat/received_events","type":"User","site_admin":false},"assignees":[{"login":"Vellames","id":9345433,"avatar_url":"https://avatars0.githubusercontent.com/u/9345433?v=4","gravatar_id":"","url":"https://api.github.com/users/Vellames","html_url":"https://github.com/Vellames","followers_url":"https://api.github.com/users/Vellames/followers","following_url":"https://api.github.com/users/Vellames/following{/other_user}","gists_url":"https://api.github.com/users/Vellames/gists{/gist_id}","starred_url":"https://api.github.com/users/Vellames/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vellames/subscriptions","organizations_url":"https://api.github.com/users/Vellames/orgs","repos_url":"https://api.github.com/users/Vellames/repos","events_url":"https://api.github.com/users/Vellames/events{/privacy}","received_events_url":"https://api.github.com/users/Vellames/received_events","type":"User","site_admin":false},{"login":"bajiat","id":11626388,"avatar_url":"https://avatars0.githubusercontent.com/u/11626388?v=4","gravatar_id":"","url":"https://api.github.com/users/bajiat","html_url":"https://github.com/bajiat","followers_url":"https://api.github.com/users/bajiat/followers","following_url":"https://api.github.com/users/bajiat/following{/other_user}","gists_url":"https://api.github.com/users/bajiat/gists{/gist_id}","starred_url":"https://api.github.com/users/bajiat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bajiat/subscriptions","organizations_url":"https://api.github.com/users/bajiat/orgs","repos_url":"https://api.github.com/users/bajiat/repos","events_url":"https://api.github.com/users/bajiat/events{/privacy}","received_events_url":"https://api.github.com/users/bajiat/received_events","type":"User","site_admin":false},{"login":"marla-singer","id":20643403,"avatar_url":"https://avatars0.githubusercontent.com/u/20643403?v=4","gravatar_id":"","url":"https://api.github.com/users/marla-singer","html_url":"https://github.com/marla-singer","followers_url":"https://api.github.com/users/marla-singer/followers","following_url":"https://api.github.com/users/marla-singer/following{/other_user}","gists_url":"https://api.github.com/users/marla-singer/gists{/gist_id}","starred_url":"https://api.github.com/users/marla-singer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marla-singer/subscriptions","organizations_url":"https://api.github.com/users/marla-singer/orgs","repos_url":"https://api.github.com/users/marla-singer/repos","events_url":"https://api.github.com/users/marla-singer/events{/privacy}","received_events_url":"https://api.github.com/users/marla-singer/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/apinf/platform/pulls/2973/commits","review_comments_url":"https://api.github.com/repos/apinf/platform/pulls/2973/comments","review_comment_url":"https://api.github.com/repos/apinf/platform/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apinf/platform/issues/2973/comments","statuses_url":"https://api.github.com/repos/apinf/platform/statuses/547138a76a03e52eca06bb60a9250e40da177e44","head":{"label":"apinf:feature/api-import","ref":"feature/api-import","sha":"547138a76a03e52eca06bb60a9250e40da177e44","user":{"login":"apinf","id":9882661,"avatar_url":"https://avatars0.githubusercontent.com/u/9882661?v=4","gravatar_id":"","url":"https://api.github.com/users/apinf","html_url":"https://github.com/apinf","followers_url":"https://api.github.com/users/apinf/followers","following_url":"https://api.github.com/users/apinf/following{/other_user}","gists_url":"https://api.github.com/users/apinf/gists{/gist_id}","starred_url":"https://api.github.com/users/apinf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apinf/subscriptions","organizations_url":"https://api.github.com/users/apinf/orgs","repos_url":"https://api.github.com/users/apinf/repos","events_url":"https://api.github.com/users/apinf/events{/privacy}","received_events_url":"https://api.github.com/users/apinf/received_events","type":"Organization","site_admin":false},"repo":{"id":31646449,"name":"platform","full_name":"apinf/platform","owner":{"login":"apinf","id":9882661,"avatar_url":"https://avatars0.githubusercontent.com/u/9882661?v=4","gravatar_id":"","url":"https://api.github.com/users/apinf","html_url":"https://github.com/apinf","followers_url":"https://api.github.com/users/apinf/followers","following_url":"https://api.github.com/users/apinf/following{/other_user}","gists_url":"https://api.github.com/users/apinf/gists{/gist_id}","starred_url":"https://api.github.com/users/apinf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apinf/subscriptions","organizations_url":"https://api.github.com/users/apinf/orgs","repos_url":"https://api.github.com/users/apinf/repos","events_url":"https://api.github.com/users/apinf/events{/privacy}","received_events_url":"https://api.github.com/users/apinf/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apinf/platform","description":"APInf - Open source API management platform with multi proxy and protocol support","fork":false,"url":"https://api.github.com/repos/apinf/platform","forks_url":"https://api.github.com/repos/apinf/platform/forks","keys_url":"https://api.github.com/repos/apinf/platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apinf/platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apinf/platform/teams","hooks_url":"https://api.github.com/repos/apinf/platform/hooks","issue_events_url":"https://api.github.com/repos/apinf/platform/issues/events{/number}","events_url":"https://api.github.com/repos/apinf/platform/events","assignees_url":"https://api.github.com/repos/apinf/platform/assignees{/user}","branches_url":"https://api.github.com/repos/apinf/platform/branches{/branch}","tags_url":"https://api.github.com/repos/apinf/platform/tags","blobs_url":"https://api.github.com/repos/apinf/platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apinf/platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apinf/platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/apinf/platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apinf/platform/statuses/{sha}","languages_url":"https://api.github.com/repos/apinf/platform/languages","stargazers_url":"https://api.github.com/repos/apinf/platform/stargazers","contributors_url":"https://api.github.com/repos/apinf/platform/contributors","subscribers_url":"https://api.github.com/repos/apinf/platform/subscribers","subscription_url":"https://api.github.com/repos/apinf/platform/subscription","commits_url":"https://api.github.com/repos/apinf/platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/apinf/platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/apinf/platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/apinf/platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/apinf/platform/contents/{+path}","compare_url":"https://api.github.com/repos/apinf/platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apinf/platform/merges","archive_url":"https://api.github.com/repos/apinf/platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apinf/platform/downloads","issues_url":"https://api.github.com/repos/apinf/platform/issues{/number}","pulls_url":"https://api.github.com/repos/apinf/platform/pulls{/number}","milestones_url":"https://api.github.com/repos/apinf/platform/milestones{/number}","notifications_url":"https://api.github.com/repos/apinf/platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apinf/platform/labels{/name}","releases_url":"https://api.github.com/repos/apinf/platform/releases{/id}","deployments_url":"https://api.github.com/repos/apinf/platform/deployments","created_at":"2015-03-04T08:33:18Z","updated_at":"2017-10-20T08:07:57Z","pushed_at":"2017-10-23T08:37:05Z","git_url":"git://github.com/apinf/platform.git","ssh_url":"git@github.com:apinf/platform.git","clone_url":"https://github.com/apinf/platform.git","svn_url":"https://github.com/apinf/platform","homepage":"http://apinf.com/","size":27108,"stargazers_count":40,"watchers_count":40,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":20,"mirror_url":null,"archived":false,"open_issues_count":523,"forks":20,"open_issues":523,"watchers":40,"default_branch":"develop"}},"base":{"label":"apinf:develop","ref":"develop","sha":"f0918d804678b1eab9bb3f1c748502478d6355df","user":{"login":"apinf","id":9882661,"avatar_url":"https://avatars0.githubusercontent.com/u/9882661?v=4","gravatar_id":"","url":"https://api.github.com/users/apinf","html_url":"https://github.com/apinf","followers_url":"https://api.github.com/users/apinf/followers","following_url":"https://api.github.com/users/apinf/following{/other_user}","gists_url":"https://api.github.com/users/apinf/gists{/gist_id}","starred_url":"https://api.github.com/users/apinf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apinf/subscriptions","organizations_url":"https://api.github.com/users/apinf/orgs","repos_url":"https://api.github.com/users/apinf/repos","events_url":"https://api.github.com/users/apinf/events{/privacy}","received_events_url":"https://api.github.com/users/apinf/received_events","type":"Organization","site_admin":false},"repo":{"id":31646449,"name":"platform","full_name":"apinf/platform","owner":{"login":"apinf","id":9882661,"avatar_url":"https://avatars0.githubusercontent.com/u/9882661?v=4","gravatar_id":"","url":"https://api.github.com/users/apinf","html_url":"https://github.com/apinf","followers_url":"https://api.github.com/users/apinf/followers","following_url":"https://api.github.com/users/apinf/following{/other_user}","gists_url":"https://api.github.com/users/apinf/gists{/gist_id}","starred_url":"https://api.github.com/users/apinf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apinf/subscriptions","organizations_url":"https://api.github.com/users/apinf/orgs","repos_url":"https://api.github.com/users/apinf/repos","events_url":"https://api.github.com/users/apinf/events{/privacy}","received_events_url":"https://api.github.com/users/apinf/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apinf/platform","description":"APInf - Open source API management platform with multi proxy and protocol support","fork":false,"url":"https://api.github.com/repos/apinf/platform","forks_url":"https://api.github.com/repos/apinf/platform/forks","keys_url":"https://api.github.com/repos/apinf/platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apinf/platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apinf/platform/teams","hooks_url":"https://api.github.com/repos/apinf/platform/hooks","issue_events_url":"https://api.github.com/repos/apinf/platform/issues/events{/number}","events_url":"https://api.github.com/repos/apinf/platform/events","assignees_url":"https://api.github.com/repos/apinf/platform/assignees{/user}","branches_url":"https://api.github.com/repos/apinf/platform/branches{/branch}","tags_url":"https://api.github.com/repos/apinf/platform/tags","blobs_url":"https://api.github.com/repos/apinf/platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apinf/platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apinf/platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/apinf/platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apinf/platform/statuses/{sha}","languages_url":"https://api.github.com/repos/apinf/platform/languages","stargazers_url":"https://api.github.com/repos/apinf/platform/stargazers","contributors_url":"https://api.github.com/repos/apinf/platform/contributors","subscribers_url":"https://api.github.com/repos/apinf/platform/subscribers","subscription_url":"https://api.github.com/repos/apinf/platform/subscription","commits_url":"https://api.github.com/repos/apinf/platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/apinf/platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/apinf/platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/apinf/platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/apinf/platform/contents/{+path}","compare_url":"https://api.github.com/repos/apinf/platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apinf/platform/merges","archive_url":"https://api.github.com/repos/apinf/platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apinf/platform/downloads","issues_url":"https://api.github.com/repos/apinf/platform/issues{/number}","pulls_url":"https://api.github.com/repos/apinf/platform/pulls{/number}","milestones_url":"https://api.github.com/repos/apinf/platform/milestones{/number}","notifications_url":"https://api.github.com/repos/apinf/platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apinf/platform/labels{/name}","releases_url":"https://api.github.com/repos/apinf/platform/releases{/id}","deployments_url":"https://api.github.com/repos/apinf/platform/deployments","created_at":"2015-03-04T08:33:18Z","updated_at":"2017-10-20T08:07:57Z","pushed_at":"2017-10-23T08:37:05Z","git_url":"git://github.com/apinf/platform.git","ssh_url":"git@github.com:apinf/platform.git","clone_url":"https://github.com/apinf/platform.git","svn_url":"https://github.com/apinf/platform","homepage":"http://apinf.com/","size":27108,"stargazers_count":40,"watchers_count":40,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":20,"mirror_url":null,"archived":false,"open_issues_count":523,"forks":20,"open_issues":523,"watchers":40,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/apinf/platform/pulls/2973"},"html":{"href":"https://github.com/apinf/platform/pull/2973"},"issue":{"href":"https://api.github.com/repos/apinf/platform/issues/2973"},"comments":{"href":"https://api.github.com/repos/apinf/platform/issues/2973/comments"},"review_comments":{"href":"https://api.github.com/repos/apinf/platform/pulls/2973/comments"},"review_comment":{"href":"https://api.github.com/repos/apinf/platform/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apinf/platform/pulls/2973/commits"},"statuses":{"href":"https://api.github.com/repos/apinf/platform/statuses/547138a76a03e52eca06bb60a9250e40da177e44"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"marla-singer"}}