Skip to content

Commit

Permalink
Merge pull request #3194 from apinf/develop
Browse files Browse the repository at this point in the history
0.52.0 release
  • Loading branch information
matleppa committed Dec 7, 2017
2 parents a511cf9 + 70587f6 commit 227962e
Show file tree
Hide file tree
Showing 170 changed files with 6,894 additions and 2,341 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"no-underscore-dangle": [
2,
{
"allow": ["_id", "__", "_initialized", "_config", "_debug"]
"allow": ["_id", "__", "_initialized", "_config", "_debug", "_schema"]
}
],
"no-negated-condition": [
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
.vscode/
config.json
docker/api-umbrella/config/api-umbrella.yml
docker/apinf/env
docker/ssl/env
docker/env.apinf
docker/env.ssl
mup.json
node_modules/
npm-debug.log*
Expand Down
4 changes: 2 additions & 2 deletions .meteor/packages
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ matb33:collection-hooks
meteor-base@1.1.0
meteorhacks:subs-manager
michalvalasek:autoform-bootstrap-colorpicker
mizzao:sharejs-ace
mizzao:sharejs@=0.9.0
mobile-experience@1.0.4
mongo@1.2.0
nimble:restivus@=0.8.11
Expand Down Expand Up @@ -95,3 +93,5 @@ useraccounts:core
useraccounts:flow-routing
vsivsi:file-collection
zimme:active-route
aldeed:autoform-select2
natestrauser:select2
40 changes: 20 additions & 20 deletions .meteor/versions
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ accounts-base@1.3.2
accounts-github@1.3.0
accounts-oauth@1.1.15
accounts-password@1.4.0
accounts-ui-unstyled@1.2.1
accounts-ui@1.1.9
accounts-ui-unstyled@1.2.1
alanning:roles@1.2.16
aldeed:autoform-bs-button-group-input@1.0.3
aldeed:autoform@5.8.1
aldeed:collection2-core@1.2.0
aldeed:autoform-bs-button-group-input@1.0.3
aldeed:autoform-select2@1.0.5
aldeed:collection2@2.10.0
aldeed:collection2-core@1.2.0
aldeed:schema-deny@1.1.0
aldeed:schema-index@1.1.1
aldeed:simple-schema@1.5.3
Expand All @@ -31,9 +32,9 @@ babel-runtime@1.0.1
base64@1.0.10
benmgreene:moment-range@2.10.6
binary-heap@1.0.10
blaze@2.3.2
blaze-html-templates@1.1.2
blaze-tools@1.0.10
blaze@2.3.2
boilerplate-generator@1.2.0
caching-compiler@1.1.9
caching-html-compiler@1.1.2
Expand All @@ -43,23 +44,23 @@ cfs:filesystem@0.1.2
cfs:http-methods@0.0.32
cfs:storage-adapter@0.2.3
check@1.2.5
coffeescript-compiler@1.12.7_1
coffeescript@1.12.7_1
coffeescript-compiler@1.12.7_1
dandv:jquery-rateit@1.0.22_2
dburles:collection-helpers@1.1.0
ddp@1.3.0
ddp-client@2.1.0
ddp-common@1.2.9
ddp-rate-limiter@1.0.7
ddp-server@2.0.0
ddp@1.3.0
deepwell:bootstrap-datepicker2@1.3.0
deps@1.0.12
diff-sequence@1.0.7
dynamic-import@0.1.1
ecmascript@0.8.2
ecmascript-runtime@0.4.1
ecmascript-runtime-client@0.4.3
ecmascript-runtime-server@0.4.1
ecmascript-runtime@0.4.1
ecmascript@0.8.2
ejson@1.0.14
email@1.2.3
es5-shim@4.6.15
Expand All @@ -78,13 +79,13 @@ htmljs@1.0.11
http@1.2.12
id-map@1.0.9
jquery@1.11.10
juliancwirko:s-alert-stackslide@3.1.3
juliancwirko:s-alert@3.2.0
juliancwirko:s-alert-stackslide@3.1.3
kadira:blaze-layout@2.3.0
kadira:dochead@1.5.0
kadira:flow-router@2.12.1
kurounin:pagination-blaze@1.0.2
kurounin:pagination@1.0.21
kurounin:pagination-blaze@1.0.2
launch-screen@1.1.1
less@2.7.9
livedata@1.0.18
Expand All @@ -93,30 +94,29 @@ logging@1.1.17
markdown@1.0.12
matb33:collection-hooks@0.8.4
mdg:validation-error@0.5.1
meteor-base@1.1.0
meteor@1.7.1
meteor-base@1.1.0
meteorhacks:subs-manager@1.6.4
meteorspark:util@0.2.0
michalvalasek:autoform-bootstrap-colorpicker@0.1.0
minifier-css@1.2.16
minifier-js@2.1.3
minimongo@1.3.0
mizzao:sharejs-ace@1.4.1
mizzao:sharejs@0.9.0
mobile-experience@1.0.4
mobile-status-bar@1.0.14
modules-runtime@0.8.0
modules@0.10.0
modules-runtime@0.8.0
momentjs:moment@2.18.1
mongo@1.2.0
mongo-dev-server@1.0.1
mongo-id@1.0.6
mongo-livedata@1.0.12
mongo@1.2.0
natestrauser:select2@4.0.3
nimble:restivus@0.8.11
npm-bcrypt@0.9.3
npm-mongo@2.2.30
oauth2@1.1.11
oauth@1.1.13
oauth2@1.1.11
observe-sequence@1.0.16
olragon:uri-js@1.13.1
ordered-dict@1.0.9
Expand Down Expand Up @@ -148,18 +148,18 @@ showdown@1.0.8
simple:json-routes@2.1.0
simple:reactive-method@1.0.2
softwarerero:accounts-t9n@1.3.11
spacebars-compiler@1.1.3
spacebars@1.0.15
spacebars-compiler@1.1.3
spiderable@1.0.14-release-testing.0
srp@1.0.10
standard-minifier-css@1.3.4
standard-minifier-js@2.1.1
tap:i18n-ui@0.8.0
tap:i18n@1.8.2
tap:i18n-ui@0.8.0
templating@1.3.2
templating-compiler@1.3.2
templating-runtime@1.3.2
templating-tools@1.1.2
templating@1.3.2
tmeasday:publish-counts@0.8.0
todda00:friendly-slugs@0.6.0
tracker@1.1.3
Expand All @@ -173,6 +173,6 @@ useraccounts:bootstrap@1.14.2
useraccounts:core@1.14.2
useraccounts:flow-routing@1.14.2
vsivsi:file-collection@1.3.8
webapp-hashing@1.0.9
webapp@1.3.18
webapp-hashing@1.0.9
zimme:active-route@2.3.2
4 changes: 2 additions & 2 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ Register a new admin account. The first user will become Admin.
## With Docker Compose
1. Create "docker-compose.yml" file on your server and copy content from [docker-compose.yml](https://github.com/apinf/platform/blob/develop/docker-compose.yml).
2. In the same folder create file "docker/api-umbrella/config/api-umbrella.yml" based on example "docker/api-umbrella/config/api-umbrella.yml.example". ATTENTION: replace "example.com" on YOUR_SITE_DOMAIN for keys "ssl_cert" and "ssl_cert_key".
3. Create file "docker/apinf/env" based on example "docker/apinf/env.example".
4. Create file "docker/ssl/env" based on example "docker/ssl/env.example".
3. Create file "docker/env.apinf" based on example "docker/env.apinf.example".
4. Create file "docker/env.ssl" based on example "docker/env.ssl.example".
5. Run ```docker-compose up -d```. The first launch of will be slow because (take couple of minutes) of the DH parameter computation and configure Let's Encrypt certificate.
6. Visit https://YOUR_SITE_DOMAIN:3002/signup/ and fill form for get API Key.
7. Visit https://YOUR_SITE_DOMAIN:3002/admin/ and click on 'My Account' link for find Admin API Token.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ See the [high definition video (with music) of Apinf Development Activity up to
You can preview our latest version at [nightly.apinf.io](http://nightly.apinf.io). Feel free to register an account and test things out.

# Contributing
Please review our [Contributor Guide](https://github.com/apinf/platform/blob/develop/CONTRIBUTING.md) for details on how to get involved with the project.
Please review our [Contributor Guide](https://github.com/apinf/platform/blob/develop/.github/CONTRIBUTING.md) for details on how to get involved with the project.

Please follow guidelines for community involvement in our [Code of Conduct](https://github.com/apinf/platform/blob/develop/CODE_OF_CONDUCT.md)
2 changes: 1 addition & 1 deletion apinf_packages/about/client/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ <h3>
Apinf
</dt>
<dd>
0.51.0
0.52.0
</dd>
<dt>
API Umbrella
Expand Down
43 changes: 42 additions & 1 deletion apinf_packages/api_catalog/client/api_catalog.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,39 @@ https://joinup.ec.europa.eu/community/eupl/og_page/european-union-public-licence

// Meteor packages imports
import { Meteor } from 'meteor/meteor';
import { TAPi18n } from 'meteor/tap:i18n';
import { Template } from 'meteor/templating';

// Meteor contributed packages imports
import { DocHead } from 'meteor/kadira:dochead';
import { FlowRouter } from 'meteor/kadira:flow-router';
import { Roles } from 'meteor/alanning:roles';
import { TAPi18n } from 'meteor/tap:i18n';

// Collection imports
import Apis from '/apinf_packages/apis/collection';
import ApiBookmarks from '/apinf_packages/bookmarks/collection';
import ApiDocs from '/apinf_packages/api_docs/collection';
import Branding from '/apinf_packages/branding/collection';

import 'locale-compare-polyfill';

// Npm packages imports
import _ from 'lodash';

Template.apiCatalog.onCreated(function () {
// Get reference to template instance
const instance = this;

instance.autorun(() => {
// Get Branding collection content
const branding = Branding.findOne();
// Check if Branding collection and siteTitle are available
if (branding && branding.siteTitle) {
// Set the page title
const pageTitle = TAPi18n.__('apiCatalogPage_title_apiCatalog');
DocHead.setTitle(`${branding.siteTitle} - ${pageTitle}`);
}
});
// Get user id
const userId = Meteor.userId();

Expand Down Expand Up @@ -57,6 +73,9 @@ Template.apiCatalog.onCreated(function () {
filters,
});

// Subscribe to apiDocs that contains either 'fileId' or 'remoteFileUrl'
instance.subscribe('apisDocuments');

// Subscribe to bookmarks of current user
instance.subscribe('userApiBookmarks');

Expand Down Expand Up @@ -156,6 +175,28 @@ Template.apiCatalog.onCreated(function () {
delete currentFilters.lifecycleStatus;
}

// Check URL parameter for apisWithDocumentation filter
const apisWithDocumentation = FlowRouter.getQueryParam('apisWithDocumentation');

// Checking if 'APIs with Documentation' filter is checked or not
if (apisWithDocumentation === 'true') {
// Fetching published ApiDocs
const apiDocs = ApiDocs.find().fetch();
// Creating array of ApiIds
let apiIds = _.map(apiDocs, 'apiId');

// checking if 'My Bookmarks' filter is checked or not
if (filterByParameter === 'my-bookmarks') {
// fetch bookmarked ApiIds
const bookmarkedApiIds = currentFilters._id.$in;
// find ApiIds that are bookmarked and that contains Api Documentation
apiIds = _.intersection(bookmarkedApiIds, apiIds);
}

// Set filter for filtering out apiIds that dont contain Api Documentation
currentFilters._id = { $in: apiIds };
}

instance.pagination.filters(currentFilters);
});
});
Expand Down
39 changes: 23 additions & 16 deletions apinf_packages/api_catalog/client/toolbar/toolbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,25 +50,32 @@
</div>
</form>
</div>

{{# if currentUser }}
<div class="nav navbar-nav">
<div class="btn-group navbar-btn filter-options-menu" role="group" aria-label="Filter options" data-toggle="buttons">
<label class="btn btn-default active" id="filterBy-all">
<input type="radio" name="filter-options" value="all" checked>
{{_ "catalog_toolbar_filterOptions_showAll" }}
</label>
<label class="btn btn-default" id="filterBy-my-apis">
<input type="radio" name="filter-options" value="my-apis">
{{_ "catalog_toolbar_filterOptions_myApis" }}
</label>
<label class="btn btn-default" id="filterBy-my-bookmarks">
<input type="radio" name="filter-options" value="my-bookmarks">
{{_ "catalog_toolbar_filterOptions_myBookmarks" }}
</label>
<div class="nav navbar-nav">
<div class="btn-group navbar-btn filter-options-menu" role="group" aria-label="Filter options" data-toggle="buttons">
<label class="btn btn-default active" id="filterBy-all">
<input type="radio" name="filter-options" value="all" checked>
{{_ "catalog_toolbar_filterOptions_showAll" }}
</label>
<label class="btn btn-default" id="filterBy-my-apis">
<input type="radio" name="filter-options" value="my-apis">
{{_ "catalog_toolbar_filterOptions_myApis" }}
</label>
<label class="btn btn-default" id="filterBy-my-bookmarks">
<input type="radio" name="filter-options" value="my-bookmarks">
{{_ "catalog_toolbar_filterOptions_myBookmarks" }}
</label>
</div>
<div class="btn-group" data-toggle="buttons">
<label class="btn btn-default" id="filterBy-with-docs">
<input type="checkbox" name="filter-api-documentation" value="with-docs">
{{_ "catalog_toolbar_filterOptions_apisWithDocumentation" }}
</label>
</div>
</div>
</div>
{{/ if }}

<div class="nav navbar-nav navbar-right">
<a href="/rss/apis" target="_blank" class="rss-feed fa fa-rss-square fa-3x btn" title="{{_ 'apisRssIcon_tooltipText_Rss'}}">
</a>
Expand Down
4 changes: 4 additions & 0 deletions apinf_packages/api_catalog/client/toolbar/toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ Template.apiCatalogToolbar.events({
// Set URL parameter
FlowRouter.setQueryParams({ filterBy: event.target.value });
},
'change [name=filter-api-documentation]': function (event) {
// Set URL parameter
FlowRouter.setQueryParams({ apisWithDocumentation: event.currentTarget.checked });
},
'change [name=view-mode]': function (event) {
// Set URL parameter
FlowRouter.setQueryParams({ viewMode: event.target.value });
Expand Down
33 changes: 32 additions & 1 deletion apinf_packages/api_docs/client/manage/autoform.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,44 @@ You may obtain a copy of the licence at
https://joinup.ec.europa.eu/community/eupl/og_page/european-union-public-licence-eupl-v11 */

// Meteor packages imports
import { Session } from 'meteor/session';

// Meteor contributed packages imports
import { AutoForm } from 'meteor/aldeed:autoform';
import { Modal } from 'meteor/peppelg:bootstrap-3-modal';
import { TAPi18n } from 'meteor/tap:i18n';
import { sAlert } from 'meteor/juliancwirko:s-alert';
import { Modal } from 'meteor/peppelg:bootstrap-3-modal';

AutoForm.hooks({
apiDocumentationForm: {
before: {
insert (doc) {
// Get ID of uploaded file
const fileId = Session.get('fileId');

// If selected option is File and File is uploaded
if (doc.type === 'file' && fileId) {
// Save ID
doc.fileId = fileId;
}

// Return data
return doc;
},
update (doc) {
// Get ID of uploaded file
const fileId = Session.get('fileId');

// If selected option is File and File is uploaded
if (doc.$set.type === 'file' && fileId) {
// Save ID
doc.$set.fileId = fileId;
}

// Return data
return doc;
},
},
onSuccess () {
Modal.hide('manageApiDocumentationModal');

Expand Down

0 comments on commit 227962e

Please sign in to comment.