Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 backlog/client/form/form.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ <h2 class="modal-title" id="apiBacklogFormModalLabel">
<div class="modal-body">
{{> afQuickField name="title" }}
{{> afQuickField name="details" }}
{{> afQuickField name="priority" }}
{{> afQuickField name="priority" firstOption=false }}
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary pull-right">
Expand Down
29 changes: 19 additions & 10 deletions backlog/collection/schema.js
Original file line number Diff line number Diff line change
@@ -1,36 +1,42 @@
import { Meteor } from 'meteor/meteor';
import { SimpleSchema } from 'meteor/aldeed:simple-schema';
import { TAPi18n } from 'meteor/tap:i18n';

import ApiBacklogItems from './';

ApiBacklogItems.schema = new SimpleSchema({
title: {
type: String,
label: 'Title',
max: 100,
autoform: {
placeholder: 'Title',
},
},
details: {
type: String,
label: 'Details',
max: 1000,
autoform: {
rows: 5,
placeholder: 'Description',
},
},
priority: {
type: Number,
label: 'Priority',
min: 0,
max: 2,
autoform: {
options: [
{ label: 'High', value: 2 },
{ label: 'Middle', value: 1 },
{ label: 'None', value: 0 },
{
// Return the translated label
label () { return TAPi18n.__('apiBacklogItems_priorityText_High'); },
value: 2,
},
{
// Return the translated label
label () { return TAPi18n.__('apiBacklogItems_priorityText_Middle'); },
value: 1,
},
{
// Return the translated label
label () { return TAPi18n.__('apiBacklogItems_priorityText_None'); },
value: 0,
},
],
},
},
Expand Down Expand Up @@ -70,5 +76,8 @@ ApiBacklogItems.schema = new SimpleSchema({
},
});

// Attach translation
ApiBacklogItems.schema.i18n('schemas.backlog');

// Attach schema to collection for validation, etc.
ApiBacklogItems.attachSchema(ApiBacklogItems.schema);
3 changes: 3 additions & 0 deletions core/lib/i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@
"apiBacklog_addBacklogItem_buttonText": "Add backlog item",
"apiBacklogList_noApiBacklogItemsFound": "No backlog items found for this API.",
"apiBacklog_mainTitle": "Backlog",
"apiBacklogItems_priorityText_High": "High",
"apiBacklogItems_priorityText_Middle": "Middle",
"apiBacklogItems_priorityText_None": "None",
"apiCard_labelText_private": "private",
"apiSettingsDelete_deleteButton": "Delete",
"apiDetails_baseUrl_headingText": "API URL",
Expand Down
12 changes: 5 additions & 7 deletions metadata/collection/permissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@ ApiMetadata.allow({
// Make sure there is only one document per API Backend ID
// TODO: refactor ApiMetadata schema to use 'apiId' field
if (ApiMetadata.find({ apiBackendId: apiId }).count() !== 0) {
return false;
} else {
// Find related API Backend, select only "managerIds" field
return false;
}
// Find related API Backend, select only "managerIds" field
const api = Apis.findOne(apiId, { fields: { managerIds: 1 } });

// Check if current user can edit API Backend
const userCanEdit = api.currentUserCanEdit();

return userCanEdit;
// Check if current user can edit API Backend
return api.currentUserCanEdit();
},
update (userId, metadata) {
// Get API Backend ID
Expand Down
2 changes: 1 addition & 1 deletion organizations/collection/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Organizations.schema = new SimpleSchema({
'contact.phone': {
type: String,
// all numbers (0-9) , + , - , space ,/ are allowed and can appear anywhere in the phone numbers
//e.g. 754-3010,(541) 754-3010,1-541-754-3010,1-541-754-3010,191 541 754 3010,(089) / 636-48018
// e.g. 754-3010,(541) 754-3010,1-541-754-3010,1-541-754-3010,191 541 754 3010,(089) / 636-48018
regEx: /^[0-9-+()/\s.]+$/,
optional: true,
},
Expand Down
6 changes: 3 additions & 3 deletions settings/server/methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ Meteor.methods({
} catch (error) {
// otherwise show an error
const message = `Update gitHub configuration: ${error}`;

}
console.log(message);
}
},
updateMailConfiguration () {
// Try if settings exist
Expand All @@ -103,7 +103,7 @@ Meteor.methods({
const message = `Update mail configuration: ${error}`;

// Show an error message

console.log(message);
}
},
});