Skip to content

Feature/0.55.0 #3441

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 76 commits into from
Mar 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
29ce481
Fixed REST API: (organizations) verify DB operation outcome before se…
deligence-dharmendra Jan 30, 2018
1e716f7
Merge branch 'bugfix/rest-api-organizations-verify-db-operation-outco…
deligence-dharmendra Jan 30, 2018
3f38fc7
Change message type from warning to error
marla-singer Jan 30, 2018
9c8742d
Add Organization manager to API by using username #3344
marla-singer Jan 31, 2018
e7bd8e9
Add Authorized users to API by using username #3365
marla-singer Jan 31, 2018
a464cd3
Change the folder structure
marla-singer Jan 31, 2018
eab9c67
Fixed Create helper function for internationalized text sorting
deligence-dharmendra Jan 24, 2018
4390727
fixed travis ci issue
deligence-dharmendra Jan 29, 2018
3d6b089
Correct resolving the merge conflicts
marla-singer Feb 1, 2018
5d30dd6
Merge pull request #3343 from apinf/feature/create-helper-function-fo…
marla-singer Feb 1, 2018
db37da5
fixed missing letters issue
deligence-dharmendra Feb 2, 2018
9ae0c3e
Don't removed the uploaded file by clicking on Cancel #3378
marla-singer Feb 2, 2018
fd69cf7
Move file to related folder
marla-singer Feb 2, 2018
ebf0a47
Clean up
marla-singer Feb 2, 2018
d665641
Add Endpoints to manage Users roles
marla-singer Feb 2, 2018
db153bd
Merge pull request #3380 from apinf/bugfix/modal
matleppa Feb 5, 2018
9d033c4
Add the help text
marla-singer Feb 5, 2018
995485e
Rename title for Authorized user form
marla-singer Feb 5, 2018
3ba5526
UI Changes for Organization Managers
marla-singer Feb 5, 2018
5a8210d
Merge pull request #3369 from apinf/feature/add-manager-by-username
matleppa Feb 5, 2018
22adafc
Merge pull request #3371 from apinf/feature/add-authorized-user-by-us…
matleppa Feb 5, 2018
dec4003
Merge pull request #3364 from apinf/bugfix/rest-api-organizations-ver…
matleppa Feb 6, 2018
8775ecd
Add schema of addRole body parameter
marla-singer Feb 6, 2018
a23c368
Fix for anonym user case and log out on Organization profile #3383, #…
marla-singer Feb 6, 2018
c1a56cb
Rename path parameter "slug" to "orgSlug" for all related files
marla-singer Feb 6, 2018
f5097f0
Corrections to PUT /organizations and POST /organizations
matleppa Feb 6, 2018
3fe6507
Correction in error message in slug failure case
matleppa Feb 6, 2018
70f46e5
IE: Mail settings can't be saved as SMTP Port field doesn't recognize
deligence-dharmendra Feb 7, 2018
5ba492a
Merge pull request #3390 from apinf/bugfix/ie-mail-settings-cant-be-s…
marla-singer Feb 7, 2018
4a90860
Comment corrections
matleppa Feb 7, 2018
f3dc524
Fixed Open wanted tab in API view from url
deligence-dharmendra Feb 6, 2018
9b9988c
Merge pull request #3387 from apinf/bugfix/rest-api-check-new-organiz…
marla-singer Feb 7, 2018
013fac6
Merge pull request #3385 from apinf/feature/open-wanted-tab-in-api-vi…
marla-singer Feb 8, 2018
5d35d79
Change way to get userId
marla-singer Feb 8, 2018
9719535
Minor changes
marla-singer Feb 8, 2018
6265b6a
Merge pull request #3386 from apinf/bugfix/browser-error-organization
matleppa Feb 8, 2018
fdc9e81
Merge pull request #3379 from apinf/feature/rest-users-roles
matleppa Feb 8, 2018
7811be1
Update bundle.js file (Upgrade Swagger version)
marla-singer Feb 8, 2018
7bec1f1
Add style for Swagger UI
marla-singer Feb 8, 2018
e4176ad
Update Swagger settings
marla-singer Feb 8, 2018
aae398f
Added API name uniqueness check into PUT /apis
matleppa Feb 8, 2018
cdfbf10
lint correction
matleppa Feb 8, 2018
12ea3d3
Fixed IE: Inputs with number type doesn't recognize
deligence-dharmendra Feb 9, 2018
dacbd9a
Merge pull request #3393 from apinf/feature/update-swagger
matleppa Feb 9, 2018
6a4d4f7
Fixed changes suggested by marla
deligence-dharmendra Feb 9, 2018
29b7917
Simplified calls of error response function
matleppa Feb 9, 2018
d3a0031
Travis to use container image for faster test performance.
anarva Feb 9, 2018
5d3ee66
Make correction to Meteor installation script path.
anarva Feb 9, 2018
b374180
Merge pull request #3397 from apinf/bugfix/travis-ci-fix
matleppa Feb 9, 2018
af4b80a
Merge pull request #3396 from apinf/bugfix/ie-inputs-with-number-type…
marla-singer Feb 9, 2018
91b898d
Merge pull request #3395 from apinf/bugfix/rest-api-put-check-api-nam…
marla-singer Feb 12, 2018
398ff6d
Added documentation for User role management endpoints
matleppa Feb 12, 2018
9fd9294
Fix lint
matleppa Feb 12, 2018
d65c3c1
Merge pull request #3399 from apinf/feature/rest-api-users-documentat…
marla-singer Feb 13, 2018
f66ab08
Updating terms in add api and documentation upload
preriasusi Feb 20, 2018
1f1b6e5
Merge pull request #3405 from apinf/loc_improvements
preriasusi Feb 21, 2018
c27d734
Fixed forming the slug for an API or Organization in PUT and POST met…
deligence-dharmendra Feb 9, 2018
a61f014
Fixed Ask email confirmation when adding organisation manager
deligence-dharmendra Jan 31, 2018
3a9f1a3
Merge pull request #3398 from apinf/bugfix/ask-email-confirmation-whe…
marla-singer Feb 22, 2018
05fa298
Fixed Move API editor button behind development feature flag
deligence-dharmendra Feb 21, 2018
ec2c9ce
Merge branch 'develop' into feature/rest-api-slug-is-not-created-when…
deligence-dharmendra Feb 22, 2018
122d440
Merge pull request #3400 from apinf/feature/rest-api-slug-is-not-crea…
matleppa Feb 22, 2018
0425424
Merge pull request #3406 from apinf/feature/move-api-editor-button-be…
matleppa Feb 23, 2018
f7bcec4
Fixed UI: Main menu tab indication of selected page breaks after open…
deligence-dharmendra Feb 27, 2018
86f21d8
Merge pull request #3414 from apinf/bugfix/ui-main-menu-tab-indicatio…
matleppa Feb 27, 2018
9caa31a
Show API key instead of email in the table "Most frequent users"
marla-singer Mar 21, 2018
178dcbe
REST Dashboard: Change "Last 30 days" to 28 days
marla-singer Mar 21, 2018
dc0f5bd
Merge pull request #3433 from apinf/feature/change-to-28-days
matleppa Mar 22, 2018
72140a7
Add internationalization of date formatting for Dashboard charts
deligence-dharmendra Feb 5, 2018
e8be21d
Merge pull request #3430 from apinf/feature/use-api-key
matleppa Mar 22, 2018
a8aae59
Update package.json
preriasusi Mar 22, 2018
b784fb0
Merge pull request #3381 from apinf/feature/internationalize-date-for…
matleppa Mar 22, 2018
920053f
Changes in Organization manager management
matleppa Mar 22, 2018
8f421fc
Merge pull request #3438 from apinf/bugfix/prevent-add-org-manager-by…
Mar 22, 2018
7bdb13b
Merge pull request #3439 from apinf/develop
preriasusi Mar 22, 2018
adc8b7f
Update about.html
preriasusi Mar 23, 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
9 changes: 5 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
sudo: required
dist: trusty
group: deprecated-2017Q4
sudo: false

language: node_js
node_js:
Expand Down Expand Up @@ -30,8 +28,11 @@ services:
- docker

before_install:
- pwd
- ls -la
# Install meteor locally on CI
- if [ ! -e "$HOME/.meteor/meteor" ]; then cat $HOME/.travis_install_meteor | sed s/--progress-bar/-sL/g | /bin/sh; fi
- if [ ! -e "$HOME/.meteor/meteor" ]; then cat .travis_install_meteor | sed s/--progress-bar/-sL/g | /bin/sh; fi


before_script:
- yarn
Expand Down
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.54.0
0.55.0
</dd>
<dt>
API Umbrella
Expand Down
8 changes: 5 additions & 3 deletions apinf_packages/api_catalog/client/api_catalog.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ import 'locale-compare-polyfill';
// Npm packages imports
import _ from 'lodash';

// APInf imports
import localisedSorting from '/apinf_packages/core/helper_functions/string_utils';

Template.apiCatalog.onCreated(function () {
// Get reference to template instance
const instance = this;
Expand Down Expand Up @@ -213,15 +216,14 @@ Template.apiCatalog.helpers({
apis () {
// Get apis collection via Pagination
const apis = Template.instance().pagination.getPage();
// Get the language
const language = TAPi18n.getLanguage();

// Get the sort via Pagination
const sort = Template.instance().pagination.sort();
// When sorted by name
if (sort.name) {
// use custom sort function with i18n support
apis.sort((a, b) => {
return a.name.localeCompare(b.name, language) * sort.name;
return localisedSorting(a.name, b.name, sort.name);
});
}
return apis;
Expand Down
17 changes: 11 additions & 6 deletions apinf_packages/api_docs/client/manage/manage.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,18 @@ Template.manageApiDocumentationModal.events({
Modal.hide('manageApiDocumentationModal');
},
'click #cancel-button': function (event, templateInstance) {
// Get fileId value
const fileId = Session.get('fileId');
const apiDocs = ApiDocs.findOne();

// If file is uploaded and a user clicks on "Cancel" button
if (fileId) {
// Remove uploaded file from collection
templateInstance.removeDocumentationFile(fileId);
// Make sure File isn't uploaded
if (!apiDocs || !apiDocs.fileId) {
// Get fileId value
const fileId = Session.get('fileId');

// If file is uploaded and a user clicks on "Cancel" button
if (fileId) {
// Remove uploaded file from collection
templateInstance.removeDocumentationFile(fileId);
}
}
},
'click #add-link': function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ Template.swaggerUiContent.onRendered(function () {
const ui = SwaggerUIBundle({
url: api.documentationUrl(),
dom_id: '#swagger-ui',
defaultModelsExpandDepth: 0,
// Provides custom configs for Swagger
configs: this.configs,
presets: [
Expand Down
12 changes: 7 additions & 5 deletions apinf_packages/api_docs/client/view/documentation.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@
{{_ "apiDocumentation_buttonText_closeEditor" }}
</button>
{{ else }}
<button
class="btn btn-xs btn-info editor">
<i class="fa fa-file-text-o"></i>&nbsp;
{{_ "apiDocumentation_buttonText_openEditor" }}
</button>
{{# if developmentFeatures }}
<button
class="btn btn-xs btn-info editor">
<i class="fa fa-file-text-o"></i>&nbsp;
{{_ "apiDocumentation_buttonText_openEditor" }}
</button>
{{/ if }}
{{/ if }}
<button
id="manage-api-documentation"
Expand Down
2 changes: 2 additions & 0 deletions apinf_packages/api_docs/client/view/documentation.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ Template.apiDocumentation.onCreated(function () {

// Subscribe to code generator settings
instance.subscribe('singleSetting', 'sdkCodeGenerator');
// Subscribe to development Features settings
instance.subscribe('singleSetting', 'developmentFeatures');
});

Template.apiDocumentation.onRendered(() => {
Expand Down
41 changes: 41 additions & 0 deletions apinf_packages/apis/client/authorized_user/form/autoform.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/* 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 contributed packages imports
import { AutoForm } from 'meteor/aldeed:autoform';
import { TAPi18n } from 'meteor/tap:i18n';
import { sAlert } from 'meteor/juliancwirko:s-alert';

AutoForm.hooks({
authorizedUserForm: {
onSuccess () {
// Get success message translation
const message = TAPi18n.__('authorizedUserForm_success_message');

// Alert user of success
sAlert.success(message);
},
onError (formType, error) {
// Get error type string from error object
const errorType = error.error;

if (errorType === 'user-not-registered') {
// Get error message translation
const message = TAPi18n.__('authorizedUserForm_errorText_userNotRegistered');

// Display error
sAlert.error(message, { timeout: 'none' });
}

if (errorType === 'user-already-exist') {
// Get error message translation
const message = TAPi18n.__('authorizedUserForm_errorText_alreadyAuthorized');

// Display error
sAlert.error(message, { timeout: 'none' });
}
},
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,16 @@ <h4>
{{# autoForm
schema=emailSchema
id="authorizedUserForm"
class="form-inline" }}
class="form-inline"
type="method"
meteormethod="addAuthorizedUser"
}}
<fieldset>
{{> afQuickField name='email' }}
{{> afQuickField name='apiId' value=apiId type="hidden" }}
<p>
{{_ "apiUserAuthorizationForm_helpText_usernameEmail" }}
</p>
{{> afQuickField name='user' }}
{{> afQuickField name='apiId' value=api._id type="hidden" }}
</fieldset>

<button type="submit" class="btn btn-primary">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,7 @@ import { Template } from 'meteor/templating';
import emailSchema from './schema';

Template.apiUserAuthorizationForm.helpers({
apiId () {
// Get API ID
const apiId = Template.instance().data.api._id;

return apiId;
},
emailSchema () {
return emailSchema;
},
});

Template.apiUserAuthorizationForm.events({
'submit #authorizedUserForm': function (event) {
// Prevent form from reloading page
event.preventDefault();
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ const emailSchema = new SimpleSchema({
type: String,
regEx: SimpleSchema.RegEx.Id,
},
email: {
user: {
type: String,
regEx: SimpleSchema.RegEx.Email,
},
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { Template } from 'meteor/templating';
import { Modal } from 'meteor/peppelg:bootstrap-3-modal';

// Collection imports
import Apis from '/apinf_packages/apis/collection';
import Apis from '/apinf_packages/apis/collection/index';

Template.apiRemoveAuthorizedUser.events({
'click #confirm-remove': function (event, templateInstance) {
Expand Down
2 changes: 1 addition & 1 deletion apinf_packages/apis/client/profile/header/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ <h1 id="api-header">
{{# if api.organization }}
<p class="view-api-meta-details">
<i class="fa fa-address-card" aria-hidden="true"></i>
<a href="{{ pathFor 'organizationProfile' slug=api.organization.slug }}">
<a href="{{ pathFor 'organizationProfile' orgSlug=api.organization.slug }}">
{{ api.organization.name }}
</a>
</p>
Expand Down
18 changes: 18 additions & 0 deletions apinf_packages/apis/client/profile/header/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ import { Template } from 'meteor/templating';
// Collection imports
import Apis from '/apinf_packages/apis/collection';

Template.viewApiPageHeader.onRendered(() => {
// Get current url hash value
const hashTabValue = location.hash.substr(1);

// If url contain hash value
if (hashTabValue) {
// Show tab
$(`.nav-tabs a[href='#${hashTabValue}']`).tab('show');
}
});

Template.viewApiPageHeader.helpers({
userShouldSeeBacklogTab () {
// Get API id
Expand Down Expand Up @@ -40,3 +51,10 @@ Template.viewApiPageHeader.helpers({
return false;
},
});

Template.viewApiPageHeader.events({
'click #api-navigation-tabs li > a': (event) => {
// Show hash value in url
window.location = `${event.currentTarget.hash}`;
},
});
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 @@ -17,7 +17,7 @@
</div> <!-- /api-backend-details -->

<div id="api-documentation" class="tab-pane fade">
{{> apiDocumentation api=api apiDoc=apiDoc }}
{{> apiDocumentation api=api apiDoc=apiDoc developmentFeatures=developmentFeatures }}
</div> <!-- /api-documentation -->

<div id="api-metadata" class="tab-pane fade">
Expand Down
7 changes: 7 additions & 0 deletions apinf_packages/apis/client/profile/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import Apis from '/apinf_packages/apis/collection';
import Branding from '/apinf_packages/branding/collection';
import Feedback from '/apinf_packages/feedback/collection';
import ProxyBackends from '/apinf_packages/proxy_backends/collection';
import Settings from '/apinf_packages/settings/collection';

Template.viewApi.onCreated(function () {
// Get reference to template instance
Expand Down Expand Up @@ -140,4 +141,10 @@ Template.viewApi.helpers({
}
return false;
},
developmentFeatures () {
// Get settings
const settings = Settings.findOne();

return settings.developmentFeatures;
},
});
34 changes: 29 additions & 5 deletions apinf_packages/apis/server/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,9 +404,8 @@ CatalogV1.addCollection(Apis, {
const duplicateApi = Apis.findOne({ name: bodyParams.name });

if (duplicateApi) {
const detailLine = 'Duplicate: API with same name exists.';
const idValue = `${duplicateApi._id}`;
return errorMessagePayload(400, detailLine, 'id', idValue);
const detailLine = 'Duplicate: API with same name already exists.';
return errorMessagePayload(400, detailLine, 'id', duplicateApi._id);
}

// Description must not exceed field length in DB
Expand Down Expand Up @@ -467,8 +466,10 @@ CatalogV1.addCollection(Apis, {
}
}

// Add manager IDs list into
const apiData = Object.assign({ managerIds: [userId] }, bodyParams);
// Get formed slug
const slugData = Meteor.call('formSlugFromApiName', bodyParams.name);
// Add manager IDs list into and slug
const apiData = Object.assign({ managerIds: [userId] }, bodyParams, slugData);

// Insert API data into collection
const apiId = Apis.insert(apiData);
Expand Down Expand Up @@ -586,6 +587,16 @@ CatalogV1.addCollection(Apis, {
return errorMessagePayload(403, 'You do not have permission for editing this API.');
}

// If API name given, check if API with same name already exists
if (bodyParams.name) {
const duplicateApi = Apis.findOne({ name: bodyParams.name });

if (duplicateApi) {
const detailLine = 'Duplicate: API with same name already exists.';
return errorMessagePayload(400, detailLine, 'id', duplicateApi._id);
}
}

// validate values
const validateFields = {
description: bodyParams.description,
Expand Down Expand Up @@ -695,6 +706,19 @@ CatalogV1.addCollection(Apis, {
// Note! Meteor.userId is not available!
bodyParams.updated_by = userId;

// If API name given
if (bodyParams.name) {
// Get Formed slug
const slugData = Meteor.call('formSlugFromApiName', bodyParams.name);
// Check slugData
if (slugData) {
// Include slug
bodyParams.slug = slugData.slug;
// Include friendlySlugs
bodyParams.friendlySlugs = slugData.friendlySlugs;
}
}

// Update API document
const result = Apis.update(apiId, { $set: bodyParams });
// Check if API update failed
Expand Down
Loading