Skip to content

release 0.57.0 #3608

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 42 commits into from
Oct 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
8cd2cf6
Update style for .dropdown-toggle
marla-singer Mar 20, 2018
7d69818
Update Proxy form (emq part)
marla-singer Mar 20, 2018
f647a53
Update sAlert Configuration
marla-singer Mar 20, 2018
8db0a67
Add a new section to display MQTT Dashboard
marla-singer Mar 20, 2018
c6a308f
Create the StoredTopics collection
marla-singer Mar 20, 2018
37ae96a
Create ACL component
marla-singer Mar 20, 2018
56bb1e2
Create MQTT Dashboard component
marla-singer Mar 20, 2018
8d8b159
Create Topic component
marla-singer Mar 20, 2018
4086005
A new Settings field - supports GraphQL
marla-singer Mar 26, 2018
35eb2d7
Rate limit mode
marla-singer Mar 27, 2018
7cb2e0c
The Proxy tab should display only API Umbrella proxies
marla-singer Apr 9, 2018
8085a0c
Update text
marla-singer Apr 9, 2018
393767a
Add the option "Origin Header"
marla-singer Apr 25, 2018
e1b159d
Use lowerCase to requestPath when there is building request to ES
marla-singer May 8, 2018
ee85562
Update checking of uniqueness for Proxy Backend frontend prefix
marla-singer May 8, 2018
6d970ce
CSS Style fix for Dashboard
marla-singer May 8, 2018
695a3db
Add UI feature to run proxyBackendAnalyticsData
marla-singer May 8, 2018
33f81b7
Update Charts color
marla-singer May 10, 2018
17413e2
Create schema of collection
marla-singer May 10, 2018
f3a1d28
startup file
marla-singer May 10, 2018
4e5b22a
query for pre-aggregation
marla-singer May 10, 2018
8769865
Server functions for store data to MongoDB
marla-singer May 10, 2018
0dbd951
Commented Cron file
marla-singer May 10, 2018
3bb5b6f
Update store & startup
marla-singer May 10, 2018
b120e7f
Add 24 hours
marla-singer May 11, 2018
9412abc
Fix trend for topics table
marla-singer May 11, 2018
7f6d572
Remove console
marla-singer May 11, 2018
7170248
Rename field
marla-singer May 11, 2018
761340e
multi indexes
marla-singer May 16, 2018
f802e82
7 Days for Topics table
marla-singer May 17, 2018
c8220de
Multi search for Topic table page
marla-singer May 17, 2018
3a21983
MQtT Dashboard update
marla-singer May 18, 2018
a001ce0
Update fetching data
marla-singer May 21, 2018
b51f439
Using index for current date
marla-singer May 21, 2018
43823e4
Merge branch 'develop' into feature/mqtt-dashboard
ilarimikkonen Oct 24, 2018
98b4bf4
lint fixes
matleppa Oct 30, 2018
6b205fd
lint fixes
matleppa Oct 30, 2018
9c6a768
lint fix
matleppa Oct 30, 2018
e97abed
Merge pull request #3595 from apinf/feature/mqtt-dashboard
matleppa Oct 30, 2018
35e3881
Update package.json
ilarimikkonen Oct 30, 2018
da61c75
Update about.html
ilarimikkonen Oct 30, 2018
c177d89
Merge pull request #3607 from apinf/release/0.57.0
matleppa Oct 30, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.56.3
0.57.0
</dd>
<dt>
API Umbrella
Expand Down
2 changes: 1 addition & 1 deletion apinf_packages/analytics/server/startup.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@ Meteor.startup(() => {

if (proxies.length > 0 && proxyBackendsCount > 0) {
// Restart all cron tasks are related to fetching Analytics Data
Meteor.call('restartAnalyticsDataCron');
// Meteor.call('restartAnalyticsDataCron');
}
});
2 changes: 1 addition & 1 deletion apinf_packages/api_catalog/client/lib/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ FlowRouter.route('/apis', {
}],
name: 'apiCatalog',
action: () => {
BlazeLayout.render('masterLayout', { main: 'apiCatalog' });
BlazeLayout.render('masterLayout', { bar: 'navbar', main: 'apiCatalog' });
},
});

Expand Down
2 changes: 1 addition & 1 deletion apinf_packages/api_docs/client/lib/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ import { FlowRouter } from 'meteor/kadira:flow-router';
FlowRouter.route('/documentation/editor', {
name: 'apiDocumentationEditor',
action () {
BlazeLayout.render('masterLayout', { main: 'apiDocumentationEditor' });
BlazeLayout.render('masterLayout', { bar: 'navbar', main: 'apiDocumentationEditor' });
},
});
4 changes: 2 additions & 2 deletions apinf_packages/apis/client/lib/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ FlowRouter.route('/apis/new', {
// Check if API exists
Meteor.call('currentUserCanAddApi', (error, canAdd) => {
if (canAdd) {
BlazeLayout.render('masterLayout', { main: 'addApi' });
BlazeLayout.render('masterLayout', { bar: 'navbar', main: 'addApi' });
} else {
FlowRouter.go('forbidden');
}
Expand Down Expand Up @@ -60,7 +60,7 @@ FlowRouter.route('/apis/:slug/', {
// Ensure current user has permissions to view backend
Meteor.call('currentUserCanViewApi', slug, (canViewError, userCanViewApi) => {
if (userCanViewApi) {
BlazeLayout.render('masterLayout', { main: 'viewApi' });
BlazeLayout.render('masterLayout', { bar: 'navbar', main: 'viewApi' });
} else {
// User is not allowed to view API
FlowRouter.go('forbidden');
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!-- 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 -->

<template name="apiSettingsAnalytics">
<div class="panel panel-default">
<div class="panel-heading">
<h2 class="panel-title">
<i class="fa fa-bar-chart" aria-hidden="true"></i>
API Analytics
</h2>
</div>
<div class="panel-body">
{{# autoForm id="updateApiAnalytics" type="normal" schema=updateAnalyitcsSchema }}
<fieldset>
{{> afQuickField type="hidden" name='proxyBackendId' value=proxyBackend._id }}
{{> afQuickField type="hidden" name='lastDay' value='today' }}
{{> afQuickField name='daysCount' }}
</fieldset>
<button type="submit" class="btn btn-success">
Update
</button>
{{/ autoForm }}
</div>
</div>
</template>
31 changes: 31 additions & 0 deletions apinf_packages/apis/client/profile/settings/analytics/analytics.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/* 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 */

import { Template } from 'meteor/templating';

// Meteor contributed packages imports
import { SimpleSchema } from 'meteor/aldeed:simple-schema';

Template.apiSettingsAnalytics.helpers({
// Schema for SDK Code Generator form
updateAnalyitcsSchema () {
// Create simple schema for sdk modal
return new SimpleSchema({
proxyBackendId: {
type: String,
optional: false,
},
lastDay: {
type: String,
optional: false,
},
daysCount: {
label: 'Days Count',
type: Number,
optional: false,
},
});
},
});
53 changes: 53 additions & 0 deletions apinf_packages/apis/client/profile/settings/analytics/autoform.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/* 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 */

import { Meteor } from 'meteor/meteor';
// Meteor packages imports
import { AutoForm } from 'meteor/aldeed:autoform';
import { TAPi18n } from 'meteor/tap:i18n';
import { sAlert } from 'meteor/juliancwirko:s-alert';

AutoForm.addHooks('updateApiAnalytics', {
onSubmit (formValues) {
// Get reference to form
const form = this;

// Prevent form from submitting
form.event.preventDefault();

if (formValues.daysCount < 1) {
// The value has to be more than 0. Display error
// Get error message translation
const message = TAPi18n.__('sdkCodeGeneratorModal_errorTextInvalidHost');

// Alert user of error
sAlert.error(message, { timeout: 'none' });

form.done(new Error(message));
} else {
Meteor.call('proxyBackendAnalyticsData',
formValues.proxyBackendId, formValues.daysCount, formValues.lastDay, (error) => {
if (error) {
// The value has to be more than 0. Display error
// Get error message translation
const message = TAPi18n.__('sdkCodeGeneratorModal_errorTextInvalidHost');

// Alert user of error
sAlert.error(message, { timeout: 'none' });

form.done(new Error(message));
}
// The value has to be more than 0. Display error
// Get error message translation
const message = TAPi18n.__('sdkCodeGeneratorModal_errorTextInvalidHost');

// Alert user of error
sAlert.success(message);

form.done();
});
}
},
});
9 changes: 8 additions & 1 deletion apinf_packages/apis/client/profile/settings/settings.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- Copyright 2017 Apinf Oy
<!-- Copyright 2018 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 -->
Expand All @@ -10,5 +10,12 @@

{{> apiSettingsVisibility api=api }}

<!--- from feature/mqtt-dashboard -->
{{> apiMonitoring api=api }}

{{# if displayAnalyticsSettings }}
{{> apiSettingsAnalytics proxyBackend=proxyBackend }}
{{/ if }}

{{> apiSettingsDelete api=api }}
</template>
21 changes: 21 additions & 0 deletions apinf_packages/apis/client/profile/settings/settings.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/* 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 */

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

// Collections import
import Settings from '/apinf_packages/settings/collection';


Template.apiSettings.helpers({
displayAnalyticsSettings () {
const proxyBackend = Template.currentData().proxyBackend;
const settings = Settings.findOne();

// Display block if "Development Features" is enablemd and API is connected to Proxy
return settings && settings.developmentFeatures && proxyBackend;
},
});
2 changes: 1 addition & 1 deletion apinf_packages/apis/client/profile/view.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
{{/ if }}

<div id="api-settings" class="tab-pane fade">
{{> apiSettings api=api }}
{{> apiSettings api=api proxyBackend=proxyBackend }}
</div>
{{/ if }}
{{/ if }}
Expand Down
8 changes: 6 additions & 2 deletions apinf_packages/apis/client/profile/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,12 @@ Template.viewApi.onCreated(function () {

// Subscribe to public proxy details
templateInstance.subscribe('proxyCount');
// Subscribe to public proxy details for proxy form
templateInstance.subscribe('publicProxyDetails');
// Subscribe to public proxy details (particular type)
templateInstance.subscribe('publicProxyDetails', 'apiUmbrella');
// Subscribe to Settings "supportsGraphql"
templateInstance.subscribe('singleSetting', 'supportsGraphql');
// Subscribe to development Features settings
templateInstance.subscribe('singleSetting', 'developmentFeatures');

// Using to get updated subscription
templateInstance.autorun(() => {
Expand Down
6 changes: 3 additions & 3 deletions apinf_packages/branding/client/lib/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ import signedIn from '/apinf_packages/core/client/lib/router';
signedIn.route('/settings/branding', {
name: 'branding',
action () {
BlazeLayout.render('masterLayout', { main: 'branding' });
BlazeLayout.render('masterLayout', { bar: 'navbar', main: 'branding' });
},
});

FlowRouter.route('/privacy-policy', {
name: 'privacyPolicy',
action () {
BlazeLayout.render('masterLayout', { main: 'privacyPolicy' });
BlazeLayout.render('masterLayout', { bar: 'navbar', main: 'privacyPolicy' });
},
});

FlowRouter.route('/terms-of-use', {
name: 'termsOfUse',
action () {
BlazeLayout.render('masterLayout', { main: 'termsOfUse' });
BlazeLayout.render('masterLayout', { bar: 'navbar', main: 'termsOfUse' });
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
}

.dropdown-toggle {
background-color: {{ mostReadableBackground }} !important;
color: {{ primaryColorText }} !important;
background-color: {{ mostReadableBackground }};
color: {{ primaryColorText }};
}

.project-name-link {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{{> customStylesheet }}
{{# if Template.subscriptionsReady }}
<div class="master-layout">
{{> navbar branding=branding }}
{{> Template.dynamic template=bar data=branding }}
<div class="content-wrapper">
{{> Template.dynamic template=main }}
{{> sAlert }}
Expand Down
6 changes: 3 additions & 3 deletions apinf_packages/core/client/lib/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,22 @@ const signedIn = FlowRouter.group({
FlowRouter.route('/not-authorized', {
name: 'notAuthorized',
action () {
BlazeLayout.render('masterLayout', { main: 'notAuthorized' });
BlazeLayout.render('masterLayout', { bar: 'navbar', main: 'notAuthorized' });
},
});

// Define 403 route
FlowRouter.route('/forbidden', {
name: 'forbidden',
action () {
BlazeLayout.render('masterLayout', { main: 'forbidden' });
BlazeLayout.render('masterLayout', { bar: 'navbar', main: 'forbidden' });
},
});

// Define 404 route
FlowRouter.notFound = {
action () {
BlazeLayout.render('masterLayout', { main: 'notFound' });
BlazeLayout.render('masterLayout', { bar: 'navbar', main: 'notFound' });
},
};

Expand Down
8 changes: 8 additions & 0 deletions apinf_packages/core/client/navbar/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@
{{/ if }}
{{/ if }}
{{/ if }}
{{# if userCanViewMqttDashboard }}
<li>
<a href="{{ pathFor 'mqtt' }}">
<i class="fa fa-area-chart" aria-hidden="true"></i>
{{_ "navbar_mqttDashboard" }}
</a>
</li>
{{/ if }}
<li class="{{ isActiveRoute 'apiCatalog' }}">
<a href="{{ pathFor 'apiCatalog' }}" id="apis-button">
<i class="fa fa-book" aria-hidden="true"></i>
Expand Down
13 changes: 13 additions & 0 deletions apinf_packages/core/client/navbar/navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Template.navbar.onCreated(function () {
// Subscribe to project logo
templateInstance.subscribe('projectLogo');
templateInstance.subscribe('proxyCount');
templateInstance.subscribe('emqProxyCount');

templateInstance.autorun(() => {
// Check if user is logged in
Expand Down Expand Up @@ -158,6 +159,18 @@ Template.navbar.helpers({
// By default allowing all user to add an API
return true;
},
userCanViewMqttDashboard () {
// Get current user Id
const userId = Meteor.userId();
// User is admin
const userIsAdmin = Roles.userIsInRole(userId, ['admin']);

// Get count of EMQ Proxies
const proxyCount = Counts.get('emqProxyCount');

// Can view if he is Admin and Emq Proxy is defined
return userIsAdmin && proxyCount > 0;
},
});

Template.navbar.events({
Expand Down
Loading