diff --git a/.meteor/packages b/.meteor/packages index 32d2a4ab4a..b9b3073748 100644 --- a/.meteor/packages +++ b/.meteor/packages @@ -90,3 +90,4 @@ peppelg:bootstrap-3-modal apinf:api-umbrella standard-minifier-css standard-minifier-js +vsivsi:file-collection diff --git a/.meteor/versions b/.meteor/versions index 0c06339990..89ac6bce97 100644 --- a/.meteor/versions +++ b/.meteor/versions @@ -92,7 +92,7 @@ iron:core@1.0.11 iron:dynamic-template@1.0.12 iron:layout@1.0.12 iron:location@1.0.11 -iron:middleware-stack@1.0.11 +iron:middleware-stack@1.1.0 iron:router@1.0.12 iron:url@1.0.11 jparker:crypto-core@0.1.0 @@ -186,6 +186,7 @@ url@1.0.9 useraccounts:bootstrap@1.14.2 useraccounts:core@1.14.2 useraccounts:iron-routing@1.14.2 +vsivsi:file-collection@1.3.5 webapp@1.2.8 webapp-hashing@1.0.9 yogiben:autoform-file@0.4.2 diff --git a/both/collections/apiDocs.js b/both/collections/apiDocs.js deleted file mode 100644 index 41bae588bb..0000000000 --- a/both/collections/apiDocs.js +++ /dev/null @@ -1,28 +0,0 @@ -ApiDocs = new Mongo.Collection('apiDocs'); - -ApiDocs.allow({ - insert: function () { - return true; - }, - update: function () { - return true; - }, - remove: function () { - return true; - } -}); - -ApiDocs.helpers({ - getApiBackendName: function () { - // Get API Backend ID - var apiBackendId = this.apiBackendId; - - // Get API Backend - var apiBackend = ApiBackends.findOne(apiBackendId); - - // Get API Backend name - var apiBackendName = apiBackend.name; - - return apiBackendName; - } -}); diff --git a/both/collections/apiDocumentation.js b/both/collections/apiDocumentation.js deleted file mode 100644 index 8134904751..0000000000 --- a/both/collections/apiDocumentation.js +++ /dev/null @@ -1,36 +0,0 @@ -/*jshint -W020 */ -ApiDocumentation = new FS.Collection("apiDocumentation", { - // TODO: Determine how to upload files within the project directory - // without hardcoding FS path - stores: [ - new FS.Store.GridFS("apiDocumentation") - ], -}); - -ApiDocumentation.filters({ - allow: { - // ~ 10Mbs. - maxSize: 10048567, - extensions: ['json', 'yaml', 'txt', 'swagger'] - }, - onInvalid: function (message) { - // Show error message if it doesn't pass filter settings - FlashMessages.sendError(message); - } -}); - -if (Meteor.isServer) { - ApiDocumentation.allow({ - insert: function (/*userId, doc*/) { - // allow insert by default - // TODO: determine proper upload/insert permisison - return true; - }, - update: function (/*userId, doc*/) { - return true; - }, - download: function(/*userId, fileObj*/) { - return true; - } - }); -} diff --git a/both/collections/backend.js b/both/collections/backend.js index a0c226d933..6fa7c150e1 100644 --- a/both/collections/backend.js +++ b/both/collections/backend.js @@ -31,6 +31,10 @@ Schemas.ApiBackendsSchema = new SimpleSchema({ type: String, optional: false }, + documentationFileId: { + type: String, + optional: true + }, documentation_link: { type: String, optional: true, diff --git a/both/collections/settings.js b/both/collections/settings.js index cc30220630..887fa2da74 100644 --- a/both/collections/settings.js +++ b/both/collections/settings.js @@ -18,15 +18,7 @@ Schemas.SettingsSchema = new SimpleSchema({ type: String, regEx: SimpleSchema.RegEx.Url, label: "Host", - optional: true, // Optional must be true for custom validation - custom: function () { // Custom validator logic - // get the value of apiDocumentationEditor.enabled field - let enabledFieldValue = this.field("apiDocumentationEditor.enabled").value; - // if enabled is true, host field is required - if (enabledFieldValue === true) { - return "required"; // host field is required - } - } + optional: false }, apiUmbrella: { type: Object, diff --git a/client/layouts/master_layout/sidebar/sidebar.html b/client/layouts/master_layout/sidebar/sidebar.html index 5f8ee7be8b..092e5c30a2 100644 --- a/client/layouts/master_layout/sidebar/sidebar.html +++ b/client/layouts/master_layout/sidebar/sidebar.html @@ -34,22 +34,6 @@ {{_ "masterLayout_sidebar_Catalogue"}} {{# if currentUser }} -
  • - - - {{_ "masterLayout_sidebar_Documentation"}} - - -
  • {{# if isInRole 'admin' }}
  • {{_ "masterLayout_sidebar_Users"}} diff --git a/client/views/api_backends/edit/form/editApiBackendForm.html b/client/views/api_backends/edit/form/editApiBackendForm.html index b5d8a513ac..0dd818e18f 100644 --- a/client/views/api_backends/edit/form/editApiBackendForm.html +++ b/client/views/api_backends/edit/form/editApiBackendForm.html @@ -29,18 +29,6 @@

    {{_ "apiBackends_Edit_API_Title"}}

    {{_ "apiBackends_Matching_Title_Help"}} {{>showHelp 'url_matches'}} {{> afQuickField name='url_matches'}} - -
    - {{>showHelp 'documentation_link'}} - {{> afQuickField name='documentation_link'}} - {{_ "apiBackends_Documentation_Link"}} - {{>showHelp 'importApiDocumentation'}} - {{> importApiDocumentation}} - Create new documentation - {{>showHelp 'apiDocumentationEditor'}} - Create API documentation - Create a new API documentation file -
    {{>showHelp 'append_query_string'}} diff --git a/client/views/api_backends/form_hints/form_hints.js b/client/views/api_backends/form_hints/form_hints.js index 9f21cadc3c..2228446a5d 100644 --- a/client/views/api_backends/form_hints/form_hints.js +++ b/client/views/api_backends/form_hints/form_hints.js @@ -41,24 +41,6 @@ var helpData = { placement: 'left' } }, - 'documentation_link': { - message: TAPi18n.__('editApi_hints_documentation_link'), - options: { - placement: 'left' - } - }, - 'apiDocumentationEditor': { - message: TAPi18n.__('editApi_hints_apiDocumentationEditor'), - options: { - placement: 'left' - } - }, - 'importApiDocumentation': { - message: TAPi18n.__('editApi_hints_importApiDocumentation'), - options: { - placement: 'left' - } - }, 'append_query_string': { message: TAPi18n.__('editApi_hints_append_query_string'), options: { diff --git a/client/views/api_backends/import_documentation/import.html b/client/views/api_backends/import_documentation/import.html index d2eb8b42ad..eda9255583 100644 --- a/client/views/api_backends/import_documentation/import.html +++ b/client/views/api_backends/import_documentation/import.html @@ -1,9 +1,6 @@