diff --git a/README.md b/README.md index 6f5bd45..c94a5ec 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ # bowfolios -Portfolios and networking for the University of Hawaii commnity. +Portfolios and networking for the University of Hawaii community. diff --git a/app/imports/api/profile/ProfileCollection.js b/app/imports/api/profile/ProfileCollection.js index 5b40f1a..6888af0 100644 --- a/app/imports/api/profile/ProfileCollection.js +++ b/app/imports/api/profile/ProfileCollection.js @@ -27,6 +27,7 @@ class ProfileCollection extends BaseCollection { interests: { type: Array, optional: true }, 'interests.$': { type: String }, title: { type: String, optional: true }, + location: { type: String, optional: true }, picture: { type: SimpleSchema.RegEx.Url, optional: true }, github: { type: SimpleSchema.RegEx.Url, optional: true }, facebook: { type: SimpleSchema.RegEx.Url, optional: true }, @@ -43,6 +44,7 @@ class ProfileCollection extends BaseCollection { * bio: 'I have been a professor of computer science at UH since 1990.', * interests: ['Application Development', 'Software Engineering', 'Databases'], * title: 'Professor of Information and Computer Sciences', + * location: 'Honolulu', * picture: 'http://philipmjohnson.org/headshot.jpg', * github: 'https://github.com/philipmjohnson', * facebook: 'https://facebook.com/philipmjohnson', @@ -56,11 +58,11 @@ class ProfileCollection extends BaseCollection { * @returns The newly created docID. */ define({ firstName = '', lastName = '', username, bio = '', interests = [], picture = '', title = '', github = '', - facebook = '', instagram = '' }) { + facebook = '', instagram = '', location }) { // make sure required fields are OK. const checkPattern = { firstName: String, lastName: String, username: String, bio: String, picture: String, - title: String }; - check({ firstName, lastName, username, bio, picture, title }, checkPattern); + title: String, location: String }; + check({ firstName, lastName, username, bio, picture, title, location }, checkPattern); if (this.find({ username }).count() > 0) { throw new Meteor.Error(`${username} is previously defined in another Profile`); @@ -75,7 +77,7 @@ class ProfileCollection extends BaseCollection { } return this._collection.insert({ firstName, lastName, username, bio, interests, picture, title, github, - facebook, instagram }); + facebook, instagram, location }); } /** @@ -95,7 +97,8 @@ class ProfileCollection extends BaseCollection { const github = doc.github; const facebook = doc.facebook; const instagram = doc.instagram; - return { firstName, lastName, username, bio, interests, picture, title, github, facebook, instagram }; + const location = doc.location; + return { firstName, lastName, username, bio, interests, picture, title, github, facebook, instagram, location }; } } diff --git a/app/imports/api/profile/ProfileCollection.test.js b/app/imports/api/profile/ProfileCollection.test.js index 5db7356..cc93db2 100644 --- a/app/imports/api/profile/ProfileCollection.test.js +++ b/app/imports/api/profile/ProfileCollection.test.js @@ -18,10 +18,12 @@ if (Meteor.isServer) { const interests = [interestName]; const picture = 'http://philipmjohnson.org/headshot.jpg'; const title = 'Professor Computer Science'; + const location = 'Honolulu, HI'; const github = 'http://github.com/philipjohnson'; const facebook = 'http://github.com/philipjohnson'; const instagram = 'http://github.com/philipjohnson'; - const defineObject = { firstName, lastName, username, bio, interests, picture, title, github, facebook, instagram }; + const defineObject = { firstName, lastName, username, bio, interests, picture, title, github, facebook, instagram, + location }; before(function setup() { removeAllEntities(); @@ -48,6 +50,7 @@ if (Meteor.isServer) { expect(doc.github).to.equal(github); expect(doc.facebook).to.equal(facebook); expect(doc.instagram).to.equal(instagram); + expect(doc.location).to.equal(location); // Check that multiple definitions with the same email address fail expect(function foo() { Profiles.define(defineObject); }).to.throw(Error); // Check that we can dump and restore a Profile. diff --git a/app/imports/ui/components/directory/directory-profile.html b/app/imports/ui/components/directory/directory-profile.html index 94cae71..5c88eb4 100644 --- a/app/imports/ui/components/directory/directory-profile.html +++ b/app/imports/ui/components/directory/directory-profile.html @@ -9,6 +9,9 @@
+