Skip to content

Commit

Permalink
Merge branch 'develop' into feature/drop-regex-field
Browse files Browse the repository at this point in the history
  • Loading branch information
marla-singer committed May 3, 2017
2 parents 6fdf756 + 02f7453 commit c5f1bd8
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 19 deletions.
2 changes: 1 addition & 1 deletion 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.43.0
0.44.0
</dd>
<dt>
API Umbrella
Expand Down
3 changes: 3 additions & 0 deletions branding/collection/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ Branding.schema = new SimpleSchema({
footerCode: {
type: String,
optional: true,
autoform: {
rows: 5,
},
},
});

Expand Down
26 changes: 26 additions & 0 deletions core/client/footer/footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,33 @@

// Meteor packages imports
import { Template } from 'meteor/templating';

// Meteor contributed packages imports
import { Modal } from 'meteor/peppelg:bootstrap-3-modal';
import { FlowRouter } from 'meteor/kadira:flow-router';

Template.footer.onCreated(function () {
this.autorun(() => {
// Get branding document
const branding = Template.currentData().branding;

// Make sure footer code exists
if (branding && branding.footerCode) {
//
FlowRouter.watchPathChange();
// Get previously and current route
const oldRoute = FlowRouter.current().oldRoute;
const currentRoute = FlowRouter.current().route;

// Make sure route was changed
if (oldRoute && oldRoute.pathDef !== currentRoute.pathDef) {
// Run analytic script
// eslint-disable-next-line
eval(branding.footerCode);
}
}
});
});

Template.footer.events({
'click #about-button': function () {
Expand Down
27 changes: 10 additions & 17 deletions organizations/client/profile/profile.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* Copyright 2017 Apinf Oy
This file is covered by the EUPL license.
You may obtain a copy of the licence at
https://joinup.ec.europa.eu/community/eupl/og_page/european-union-public-licence-eupl-v11 */
This file is covered by the EUPL license.
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 { Template } from 'meteor/templating';
Expand All @@ -16,20 +16,13 @@ Template.organizationProfile.onCreated(function () {
// Get reference to template instance
const instance = this;

instance.autorun(() => {
// Get the Organization slug from the route
const organizationSlug = FlowRouter.getParam('slug');

// Make sure organizationSlug exists,
// fixes bug when changing route to navigate to different page
if (organizationSlug) {
// Reactively subscribe to a single Organization composite
// Makes sure proper data is available when editing organization name
instance.subscribe('organizationComposite', organizationSlug);
// Subscribe to OrganizationAPIs link documents
instance.subscribe('organizationApiLinksByOrganizationSlug', organizationSlug);
}
});
// Get the Organization slug from the route
const organizationSlug = FlowRouter.getParam('slug');

// Subscribe to Organization document
instance.subscribe('organizationComposite', organizationSlug);
// Subscribe to OrganizationAPIs link documents
instance.subscribe('organizationApiLinksByOrganizationSlug', organizationSlug);
});

Template.organizationProfile.helpers({
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "apinf",
"version": "0.43.0",
"version": "0.44.0",
"description": "API management portal and proxy.",
"main": "index.js",
"directories": {
Expand Down

0 comments on commit c5f1bd8

Please sign in to comment.