Skip to content

Commit

Permalink
Merge pull request #64 from meshhq/taylorhalliday/fix
Browse files Browse the repository at this point in the history
Fixed image
  • Loading branch information
tayhalla authored Mar 12, 2020
2 parents 0020b61 + 78b6eec commit 82c888e
Show file tree
Hide file tree
Showing 14 changed files with 152 additions and 31 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ build-test: $(src_files)
@eval $(TSC)

test: build-test
NODE_ENV=test LOGGER_DISABLED=true ./node_modules/.bin/mocha --exit --bail --recursive --sort --full-trace ./dist/tests
NODE_ENV=test LOGGER_DISABLED=true ./node_modules/.bin/ts-mocha -p ./tsconfig.json --reporter dot --slow 100 --inline-diffs --exit --bail --recursive --sort ./src/tests/*.ts ./src/tests/**/*.ts ./src/tests/**/**/*.ts ./src/tests/**/**/**/*.ts ./src/tests/**/**/**/**/*.ts



Expand Down
29 changes: 15 additions & 14 deletions dist/clubs/dc-otto/mailer/index.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const core = require("club-hub-core");
const templates = require("./templates");
exports.buildEventEmails = (action, club, user, event) => __awaiter(this, void 0, void 0, function* () {
exports.buildEventEmails = (action, club, user, event) => __awaiter(void 0, void 0, void 0, function* () {
const methodName = '[buildEventEmails] -';
switch (action.type) {
case core.Action.Type.Reservation:
Expand All @@ -21,7 +22,7 @@ exports.buildEventEmails = (action, club, user, event) => __awaiter(this, void 0
throw new Error(`${methodName} received an unsupported message type: ${action.type}`);
}
});
exports.buildOnboardingEmail = (action, user, club, invitation) => __awaiter(this, void 0, void 0, function* () {
exports.buildOnboardingEmail = (action, user, club, invitation) => __awaiter(void 0, void 0, void 0, function* () {
const methodName = '[buildOnboardingEmail] -';
switch (action.type) {
case core.Action.Type.Welcome:
Expand All @@ -30,7 +31,7 @@ exports.buildOnboardingEmail = (action, user, club, invitation) => __awaiter(thi
throw new Error(`${methodName} received an unsupported message type: ${action.type}`);
}
});
exports.buildFormEmail = (action, club, form, event) => __awaiter(this, void 0, void 0, function* () {
exports.buildFormEmail = (action, club, form, event) => __awaiter(void 0, void 0, void 0, function* () {
const methodName = '[buildFormEmail] -';
switch (action.type) {
case core.Action.Type.Application:
Expand All @@ -47,7 +48,7 @@ exports.buildFormEmail = (action, club, form, event) => __awaiter(this, void 0,
throw new Error(`${methodName} received an unsupported message type: ${action.type}`);
}
});
exports.buildServiceEmails = (action, club, user, provider, event, reservation) => __awaiter(this, void 0, void 0, function* () {
exports.buildServiceEmails = (action, club, user, provider, event, reservation) => __awaiter(void 0, void 0, void 0, function* () {
const methodName = '[buildServiceEmails] -';
switch (action.type) {
case core.Action.Type.Reservation:
Expand All @@ -58,33 +59,33 @@ exports.buildServiceEmails = (action, club, user, provider, event, reservation)
throw new Error(`${methodName} received an unsupported message type: ${action.type}`);
}
});
exports.buildWelcomeEmail = (member, club, invitation) => __awaiter(this, void 0, void 0, function* () {
exports.buildWelcomeEmail = (member, club, invitation) => __awaiter(void 0, void 0, void 0, function* () {
return templates.WelcomeEmailTemplate(member, club, invitation);
});
exports.sendMembershipApplicationEmail = (memberInfo, club) => __awaiter(this, void 0, void 0, function* () {
exports.sendMembershipApplicationEmail = (memberInfo, club) => __awaiter(void 0, void 0, void 0, function* () {
return (club.name === core.Constants.Clubs.DRIVERS_CLUB) ?
templates.DcMembershipApplicationTemplate(memberInfo, club) :
templates.OttoMembershipApplicationTemplate(memberInfo, club);
});
exports.sendMembershipInquiryEmail = (memberInfo, club) => __awaiter(this, void 0, void 0, function* () {
exports.sendMembershipInquiryEmail = (memberInfo, club) => __awaiter(void 0, void 0, void 0, function* () {
return templates.MembershipInquiryTemplate(memberInfo, club);
});
exports.sendMembershipInquiryResponseEmail = (memberInfo, club) => __awaiter(this, void 0, void 0, function* () {
exports.sendMembershipInquiryResponseEmail = (memberInfo, club) => __awaiter(void 0, void 0, void 0, function* () {
return templates.MembershipInquiryResponseTemplate(memberInfo, club);
});
exports.buildServiceRequestEmail = (member, provider, event, reservation, club) => __awaiter(this, void 0, void 0, function* () {
exports.buildServiceRequestEmail = (member, provider, event, reservation, club) => __awaiter(void 0, void 0, void 0, function* () {
return templates.ServiceRequestTemplate(member, provider, event, reservation, club);
});
exports.sendProviderRequestEmail = (form, club) => __awaiter(this, void 0, void 0, function* () {
exports.sendProviderRequestEmail = (form, club) => __awaiter(void 0, void 0, void 0, function* () {
return templates.NewProviderTemplate(form, club);
});
exports.buildRSVPEmail = (member, event, club) => __awaiter(this, void 0, void 0, function* () {
exports.buildRSVPEmail = (member, event, club) => __awaiter(void 0, void 0, void 0, function* () {
return templates.RsvpTemplate(member, event, club);
});
exports.sendMemberUnRSVPEmail = (member, event, club) => __awaiter(this, void 0, void 0, function* () {
exports.sendMemberUnRSVPEmail = (member, event, club) => __awaiter(void 0, void 0, void 0, function* () {
const methodName = '[sendMemberUnRSVPEmail] -';
return templates.UnRsvpTemplate(member, event, club);
});
exports.sendPublicRSVPEmail = (event, form, club) => __awaiter(this, void 0, void 0, function* () {
exports.sendPublicRSVPEmail = (event, form, club) => __awaiter(void 0, void 0, void 0, function* () {
return templates.PublicRsvpTemplate(event, form, club);
});
9 changes: 5 additions & 4 deletions dist/services/ses/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Expand Down Expand Up @@ -31,7 +32,8 @@ class SESService {
return this._sharedInstance.sns;
}
}
SESService.sendEmail = (source, recipients, ccAddresses, subject, body) => __awaiter(this, void 0, void 0, function* () {
exports.default = SESService;
SESService.sendEmail = (source, recipients, ccAddresses, subject, body) => __awaiter(void 0, void 0, void 0, function* () {
const methodName = '[sendEmail] -';
if (source === '' || !recipients.length || subject === '' || body === '') {
const errMsg = 'failed to send email because of missing params';
Expand All @@ -45,7 +47,7 @@ SESService.sendEmail = (source, recipients, ccAddresses, subject, body) => __awa
}
return res;
});
SESService.sendHTMLEmail = (source, recipients, ccAddresses, bccAddresses, subject, html) => __awaiter(this, void 0, void 0, function* () {
SESService.sendHTMLEmail = (source, recipients, ccAddresses, bccAddresses, subject, html) => __awaiter(void 0, void 0, void 0, function* () {
const methodName = '[sendEmail] -';
if (source === '' || !recipients.length || subject === '' || html === '') {
const errMsg = 'failed to send email because of missing params';
Expand Down Expand Up @@ -102,4 +104,3 @@ SESService.createHTMLEmailParams = (source, recipients, ccAddresses, bccAddresse
Source: source
};
};
exports.default = SESService;
2 changes: 1 addition & 1 deletion dist/transform/transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ exports.BuildConfirmationContent = (reservation, event, group, club, url) => {
return confirmationInfo;
};
exports.BuildClubInfo = (club) => {
const clubImage = club.image || club.original;
const clubImage = ts_optchain_1.oc(club).image.md(undefined) || club.original;
const clubInfo = {
name: club.name,
website: club.baseURL,
Expand Down
128 changes: 122 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"@types/jsdom": "^12.2.3",
"@types/mocha": "^5.2.6",
"@types/mongoose": "^5.3.17",
"@types/node": "^13.9.0",
"@types/underscore": "^1.8.18",
"babel-core": "^6.3.26",
"babel-preset-es2015": "^6.3.13",
Expand Down Expand Up @@ -75,7 +76,8 @@
"panini": "^1.3.0",
"rimraf": "^2.3.3",
"siphon-media-query": "^1.0.0",
"typescript": "^3.3.3",
"ts-mocha": "^6.0.0",
"typescript": "^3.8.3",
"yargs": "^4.1.0"
},
"babel": {
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions tests/emails.ts → src/tests/emails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import { NewPostObj } from './factories/post'
import { NewClubObj } from './factories/club'

// Emails
import * as emails from '../src/index'
import * as emails from '../index'

// Service
import SESService from '../src/services/ses'
import SESService from '../services/ses'

// Set Environment Variables
dotenv.config()
Expand Down Expand Up @@ -42,7 +42,7 @@ describe('Emails', function () {
describe('InvalidEmail', function () {
it('should build an invalid email notification', async function () {
const club: core.Club.Model = NewClubObj()
const email: string = await emails.CompileInvalidEmailAdminNotification('Taylor', 'taylor@whodis.com', club)
const email: string = await emails.CompileInvalidEmailAdminNotification('taylor@whodis.com', club)
console.log(email)
assert(email)
emailToSend = email
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/transform/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export const BuildConfirmationContent = (reservation: core.Event.Reservation, ev
* @param club The club for the email.
*/
export const BuildClubInfo = (club: core.Club.Model): ClubInfo => {
const clubImage = club.image || (club as any).original
const clubImage = oc(club).image.md(undefined) || (club as any).original
const clubInfo: ClubInfo = {
name: club.name,
website: club.baseURL,
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"**/*.spec.ts",
"dist",
"src/clubs",
"src/tests"
],
"include": [
"./src"
Expand Down

0 comments on commit 82c888e

Please sign in to comment.