Skip to content

Commit a98dfb0

Browse files
Merge pull request #3608 from apinf/develop
release 0.57.0
2 parents f9ad3c7 + c177d89 commit a98dfb0

File tree

95 files changed

+5365
-82
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+5365
-82
lines changed

apinf_packages/about/client/about.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ <h3>
3333
Apinf
3434
</dt>
3535
<dd>
36-
0.56.3
36+
0.57.0
3737
</dd>
3838
<dt>
3939
API Umbrella

apinf_packages/analytics/server/startup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,6 @@ Meteor.startup(() => {
6060

6161
if (proxies.length > 0 && proxyBackendsCount > 0) {
6262
// Restart all cron tasks are related to fetching Analytics Data
63-
Meteor.call('restartAnalyticsDataCron');
63+
// Meteor.call('restartAnalyticsDataCron');
6464
}
6565
});

apinf_packages/api_catalog/client/lib/router.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ FlowRouter.route('/apis', {
2525
}],
2626
name: 'apiCatalog',
2727
action: () => {
28-
BlazeLayout.render('masterLayout', { main: 'apiCatalog' });
28+
BlazeLayout.render('masterLayout', { bar: 'navbar', main: 'apiCatalog' });
2929
},
3030
});
3131

apinf_packages/api_docs/client/lib/router.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ import { FlowRouter } from 'meteor/kadira:flow-router';
1010
FlowRouter.route('/documentation/editor', {
1111
name: 'apiDocumentationEditor',
1212
action () {
13-
BlazeLayout.render('masterLayout', { main: 'apiDocumentationEditor' });
13+
BlazeLayout.render('masterLayout', { bar: 'navbar', main: 'apiDocumentationEditor' });
1414
},
1515
});

apinf_packages/apis/client/lib/router.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ FlowRouter.route('/apis/new', {
1717
// Check if API exists
1818
Meteor.call('currentUserCanAddApi', (error, canAdd) => {
1919
if (canAdd) {
20-
BlazeLayout.render('masterLayout', { main: 'addApi' });
20+
BlazeLayout.render('masterLayout', { bar: 'navbar', main: 'addApi' });
2121
} else {
2222
FlowRouter.go('forbidden');
2323
}
@@ -60,7 +60,7 @@ FlowRouter.route('/apis/:slug/', {
6060
// Ensure current user has permissions to view backend
6161
Meteor.call('currentUserCanViewApi', slug, (canViewError, userCanViewApi) => {
6262
if (userCanViewApi) {
63-
BlazeLayout.render('masterLayout', { main: 'viewApi' });
63+
BlazeLayout.render('masterLayout', { bar: 'navbar', main: 'viewApi' });
6464
} else {
6565
// User is not allowed to view API
6666
FlowRouter.go('forbidden');
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<!-- Copyright 2017 Apinf Oy
2+
This file is covered by the EUPL license.
3+
You may obtain a copy of the licence at
4+
https://joinup.ec.europa.eu/community/eupl/og_page/european-union-public-licence-eupl-v11 -->
5+
6+
<template name="apiSettingsAnalytics">
7+
<div class="panel panel-default">
8+
<div class="panel-heading">
9+
<h2 class="panel-title">
10+
<i class="fa fa-bar-chart" aria-hidden="true"></i>
11+
API Analytics
12+
</h2>
13+
</div>
14+
<div class="panel-body">
15+
{{# autoForm id="updateApiAnalytics" type="normal" schema=updateAnalyitcsSchema }}
16+
<fieldset>
17+
{{> afQuickField type="hidden" name='proxyBackendId' value=proxyBackend._id }}
18+
{{> afQuickField type="hidden" name='lastDay' value='today' }}
19+
{{> afQuickField name='daysCount' }}
20+
</fieldset>
21+
<button type="submit" class="btn btn-success">
22+
Update
23+
</button>
24+
{{/ autoForm }}
25+
</div>
26+
</div>
27+
</template>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/* Copyright 2017 Apinf Oy
2+
This file is covered by the EUPL license.
3+
You may obtain a copy of the licence at
4+
https://joinup.ec.europa.eu/community/eupl/og_page/european-union-public-licence-eupl-v11 */
5+
6+
import { Template } from 'meteor/templating';
7+
8+
// Meteor contributed packages imports
9+
import { SimpleSchema } from 'meteor/aldeed:simple-schema';
10+
11+
Template.apiSettingsAnalytics.helpers({
12+
// Schema for SDK Code Generator form
13+
updateAnalyitcsSchema () {
14+
// Create simple schema for sdk modal
15+
return new SimpleSchema({
16+
proxyBackendId: {
17+
type: String,
18+
optional: false,
19+
},
20+
lastDay: {
21+
type: String,
22+
optional: false,
23+
},
24+
daysCount: {
25+
label: 'Days Count',
26+
type: Number,
27+
optional: false,
28+
},
29+
});
30+
},
31+
});
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/* Copyright 2017 Apinf Oy
2+
This file is covered by the EUPL license.
3+
You may obtain a copy of the licence at
4+
https://joinup.ec.europa.eu/community/eupl/og_page/european-union-public-licence-eupl-v11 */
5+
6+
import { Meteor } from 'meteor/meteor';
7+
// Meteor packages imports
8+
import { AutoForm } from 'meteor/aldeed:autoform';
9+
import { TAPi18n } from 'meteor/tap:i18n';
10+
import { sAlert } from 'meteor/juliancwirko:s-alert';
11+
12+
AutoForm.addHooks('updateApiAnalytics', {
13+
onSubmit (formValues) {
14+
// Get reference to form
15+
const form = this;
16+
17+
// Prevent form from submitting
18+
form.event.preventDefault();
19+
20+
if (formValues.daysCount < 1) {
21+
// The value has to be more than 0. Display error
22+
// Get error message translation
23+
const message = TAPi18n.__('sdkCodeGeneratorModal_errorTextInvalidHost');
24+
25+
// Alert user of error
26+
sAlert.error(message, { timeout: 'none' });
27+
28+
form.done(new Error(message));
29+
} else {
30+
Meteor.call('proxyBackendAnalyticsData',
31+
formValues.proxyBackendId, formValues.daysCount, formValues.lastDay, (error) => {
32+
if (error) {
33+
// The value has to be more than 0. Display error
34+
// Get error message translation
35+
const message = TAPi18n.__('sdkCodeGeneratorModal_errorTextInvalidHost');
36+
37+
// Alert user of error
38+
sAlert.error(message, { timeout: 'none' });
39+
40+
form.done(new Error(message));
41+
}
42+
// The value has to be more than 0. Display error
43+
// Get error message translation
44+
const message = TAPi18n.__('sdkCodeGeneratorModal_errorTextInvalidHost');
45+
46+
// Alert user of error
47+
sAlert.success(message);
48+
49+
form.done();
50+
});
51+
}
52+
},
53+
});

apinf_packages/apis/client/profile/settings/settings.html

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- Copyright 2017 Apinf Oy
1+
<!-- Copyright 2018 Apinf Oy
22
This file is covered by the EUPL license.
33
You may obtain a copy of the licence at
44
https://joinup.ec.europa.eu/community/eupl/og_page/european-union-public-licence-eupl-v11 -->
@@ -10,5 +10,12 @@
1010

1111
{{> apiSettingsVisibility api=api }}
1212

13+
<!--- from feature/mqtt-dashboard -->
14+
{{> apiMonitoring api=api }}
15+
16+
{{# if displayAnalyticsSettings }}
17+
{{> apiSettingsAnalytics proxyBackend=proxyBackend }}
18+
{{/ if }}
19+
1320
{{> apiSettingsDelete api=api }}
1421
</template>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/* Copyright 2017 Apinf Oy
2+
This file is covered by the EUPL license.
3+
You may obtain a copy of the licence at
4+
https://joinup.ec.europa.eu/community/eupl/og_page/european-union-public-licence-eupl-v11 */
5+
6+
// Meteor packages imports
7+
import { Template } from 'meteor/templating';
8+
9+
// Collections import
10+
import Settings from '/apinf_packages/settings/collection';
11+
12+
13+
Template.apiSettings.helpers({
14+
displayAnalyticsSettings () {
15+
const proxyBackend = Template.currentData().proxyBackend;
16+
const settings = Settings.findOne();
17+
18+
// Display block if "Development Features" is enablemd and API is connected to Proxy
19+
return settings && settings.developmentFeatures && proxyBackend;
20+
},
21+
});

0 commit comments

Comments
 (0)