Skip to content

Commit

Permalink
MAS-129 DailyEmail generation
Browse files Browse the repository at this point in the history
  • Loading branch information
d-lan1 committed Jan 16, 2020
1 parent 242f5e2 commit e2700db
Show file tree
Hide file tree
Showing 3 changed files with 150 additions and 90 deletions.
113 changes: 83 additions & 30 deletions lambda/MAS.Tests/Feeds/daily-items-2020-01-01.json
Original file line number Diff line number Diff line change
@@ -1,42 +1,95 @@
[
{
"_id": "5e208e42306e5d4f5ff39659",
"title": "Item 1",
"slug": "item-1",
"url": "https://www.abc.com",
"shortSummary": "This is some short summary",
"comment": "<p>This is some comment</p>",
"resourceLinks": "<p>https://www.abc.com</p>",
"staticPath": "item-1.html",
"source": {
"_id": "5e1ddf2a306e5d5250f3904a",
"title": "2020health"
},
"specialities": [
{
"_id": "5e1ddf2c306e5d0fa9f39611",
"key": "8f13726e-5635-471f-ad3c-fc910a6ac2b1",
"title": "Cancers",
"__v": 0
}
],
"evidenceType": {
"_id": "5e1ddf2c306e5d6eabf39641",
"title": "Evidence summary - Evidence summaries",
"key": "mas_evidence_types:Evidence%20summaries",
"broaderTitle": "Evidence summary"
},
"publicationDate": "2020-01-16T00:00:00.000Z",
"updatedAt": "2020-01-16T16:25:37.188Z",
"createdAt": "2020-01-16T16:24:34.985Z"
},
{
"_id": "5daf1aa18a34d4bb8405b5e0",
"slug": "testing-789",
"_id": "5e208f7f0348d6060f8d448c",
"title": "Item 2",
"slug": "item-2",
"url": "https://www.google.com",
"shortSummary": "Some short summary",
"comment": "<p>This is some comment</p>",
"resourceLinks": "<p><a href=\"https://www.google.com/\">https://www.google.com/</a></p>",
"staticPath": "item-2.html",
"source": {
"_id": "5de526fc43e373581b7810c8",
"oldEPiServerId": 2,
"title": "ACP Journal Club",
"__v": 0
"_id": "5e1ddf2a306e5da2b0f3904d",
"title": "ABL Health Ltd"
},
"shortSummary": "testing",
"resourceLinks": "http://localhost:3010/keystone/items",
"url": "https://www.nhs.uk/",
"title": "Wonder Drug",
"__v": 0,
"comment": "<p>A</p>",
"publicationDate": "2019-11-25T13:48:36.000Z",
"createdDate": "2019-10-22T15:05:05.927Z",
"specialities": [
{
"_id": "5e0e4331200a585f718e1ee5",
"key": "be1c2e2f-745e-4a82-b5aa-d4cef4d31a1b",
"title": "Anaesthesia and pain",
"__v": 0
},
{
"_id": "5e0e4331200a58dead8e1ee8",
"key": "53fc67a4-46d8-4171-9447-7fcf216c8749",
"title": "Complementary and alternative therapies",
"_id": "5e1ddf2c306e5d4e6cf39631",
"key": "d0ea592c-932a-462f-b206-cf454e40fa20",
"title": "Stroke",
"__v": 0
}
],
"evidenceType": {
"_id": "5df7abf383138898ee1f67ef",
"title": "Safety alerts",
"key": "mas_evidence_types:Safety%20alerts",
"oldEPiServerId": 778708,
"__v": 0
"_id": "5e1ddf2c306e5d6eabf39641",
"title": "Evidence summary - Evidence summaries",
"key": "mas_evidence_types:Evidence%20summaries",
"broaderTitle": "Evidence summary"
},
"isInitial": false
}
"publicationDate": "2020-01-16T00:00:00.000Z",
"updatedAt": "2020-01-16T16:31:11.333Z",
"createdAt": "2020-01-16T16:29:51.539Z"
},
{
"_id": "5e208fe00348d67ca08d448d",
"title": "Item 3",
"slug": "item-3",
"url": "https://www.google.com/",
"shortSummary": "Some short summary",
"comment": "<p>Some comment</p>",
"resourceLinks": "<p><a href=\"https://www.google.com/\">https://www.google.com/</a></p>\r\n<p><a href=\"https://www.google.com/\">https://www.google.com/</a></p>\r\n<p><a href=\"https://www.google.com/\">https://www.google.com/</a></p>",
"staticPath": "item-3.html",
"source": {
"_id": "5e1ddf2a306e5da2b0f3904d",
"title": "ABL Health Ltd"
},
"specialities": [
{
"_id": "5e1ddf2c306e5d7e78f3961f",
"key": "cb0faa85-1781-484e-a265-2715621c1be9",
"title": "Later life",
"__v": 0
}
],
"evidenceType": {
"_id": "5e1ddf2c306e5dcf61f39644",
"title": "Evidence summary - Eyes on evidence commentaries",
"key": "mas_evidence_types:Eyes%20on%20evidence%20commentaries",
"broaderTitle": "Evidence summary"
},
"publicationDate": "2020-01-16T00:00:00.000Z",
"updatedAt": "2020-01-16T16:32:02.535Z",
"createdAt": "2020-01-16T16:31:28.754Z"
}
]
120 changes: 60 additions & 60 deletions lambda/MAS/Views/DailyEmail.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
}


<table class="row article-border article-mec">
<table class="row article-border article-mec article-section-header">
<tbody>
<tr>
<th class="small-12 large-12 columns first last">
Expand All @@ -19,10 +19,10 @@
<p>
*|INTERESTED:Daily specialities of interest:@specialitiesAsString|*
Articles that match your chosen specialities today
*|ELSE|*
*|ELSE:|*
No articles match your chosen specialities today
*|END:INTERESTED|*
- <a href="#abc">Edit your subscription</a>
- <a class="subtle-link" href="*|UPDATE_PROFILE|*">Edit your subscription</a>
</p>
</th>
<th class="expander"></th>
Expand All @@ -39,20 +39,20 @@
{
var evidenceType = group.Key;

@:*|INTERESTED:Daily specialities of interest:specialitiesAsString|*
@:*|INTERESTED:Daily specialities of interest:@specialitiesAsString|*
<table class="spacer-heading">
<tbody>
<tr>
<td height="16px" style="font-size:16px;line-height:16px;">
<h3 class="article-heading">evidenceType</h3>
<h3 class="article-heading">@evidenceType</h3>
</td>
</tr>
</tbody>
</table>

@foreach (var item in group)
{
@:*|INTERESTED:Daily specialities of interest:specialitiesAsString|*
@:*|INTERESTED:Daily specialities of interest:@specialitiesAsString|*
<table class="row article-border">
<tbody>
<tr>
Expand Down Expand Up @@ -85,72 +85,72 @@
@:*|END:INTERESTED|*
}

*|INTERESTED:Send me everything from the Medicines Awareness Daily service:Send me everything|*
<table class="row article-border article-mec">
*|INTERESTED:Send me everything from Medicines Awareness Daily:Send me everything|*
<table class="row article-border article-mec article-section-header">
<tbody>
<tr>
<th class="small-12 large-12 columns first last">
<table>
<tbody>
<tr>
<th>
<p>
All articles from Medicines awareness services: Daily edition
</p>
</th>
<th class="expander"></th>
</tr>
</tbody>
</table>
</th>
</tr>
</tbody>
</table>

@foreach (var group in groupedItems)
{
var evidenceType = group.Key;

<table class="spacer-heading">
<tbody>
<tr>
<th class="small-12 large-12 columns first last">
<table>
<tbody>
<tr>
<th>
<p>
All articles from Medicines awareness services: Daily edition
</p>
</th>
<th class="expander"></th>
</tr>
</tbody>
</table>
</th>
<td height="16px" style="font-size:16px;line-height:16px;">
<h3 class="article-heading">@evidenceType</h3>
</td>
</tr>
</tbody>
</table>

@foreach (var group in groupedItems)
@foreach (var item in group)
{
var evidenceType = group.Key;

<table class="spacer-heading">
<table class="row article-border">
<tbody>
<tr>
<td height="16px" style="font-size:16px;line-height:16px;">
<h3 class="article-heading">evidenceType</h3>
</td>
<th class="small-12 large-12 columns first last">
<table>
<tbody>
<tr>
<th>
<h4 class="h4 article-title"><a class="article-link" href="#">@item.Title</a></h4>
<p class="article-description">@item.ShortSummary</p>
<p class="article-description"><a class="article-link-subtle standard-link" href="https://www.medicinesresources.nhs.uk/@item.Slug">Read SPS commentary</a></p>
<p class="article-tags">
<span class="source-tag">@item.Source.Title</span>
@foreach (var spec in item.Specialities)
{
<span class="specialism-tag">@spec.Title</span>
}
</p>
</th>
<th class="expander"></th>
</tr>
</tbody>
</table>
</th>
</tr>
</tbody>
</table>

@foreach (var item in group)
{
<table class="row article-border">
<tbody>
<tr>
<th class="small-12 large-12 columns first last">
<table>
<tbody>
<tr>
<th>
<h4 class="h4 article-title"><a class="article-link" href="#">@item.Title</a></h4>
<p class="article-description">@item.ShortSummary</p>
<p class="article-description"><a class="article-link-subtle standard-link" href="https://www.medicinesresources.nhs.uk/@item.Slug">Read SPS commentary</a></p>
<p class="article-tags">
<span class="source-tag">@item.Source.Title</span>
@foreach (var spec in item.Specialities)
{
<span class="specialism-tag">@spec.Title</span>
}
</p>
</th>
<th class="expander"></th>
</tr>
</tbody>
</table>
</th>
</tr>
</tbody>
</table>
}
}
}
*|END:INTERESTED|*

7 changes: 7 additions & 0 deletions mailchimp-templates/daily.html
Original file line number Diff line number Diff line change
Expand Up @@ -2398,6 +2398,13 @@
.standard-link{
color:#0000CD;
}
.subtle-link
color: inherit;
}
.article-section-header{
border-top: 1px solid black;
border-bottom: 1px solid black;
}
</style></head>
<body>
<!-- -->
Expand Down

6 comments on commit e2700db

@NICE-TeamCity
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TeamCity MAS / MAS Build 1.1.0.580-MAS-129_121__112_Dai outcome was FAILURE
Summary: Tests failed: 1, passed: 8; artifacts size 187.2 KB is 95% different from 3.6 MB in build #1.1.0.557-r893BC73 Build time: 00:00:50

Failed tests

api/items.test.js: items should return the found item as json with whitelist of fields: <no details avaliable>

@NICE-TeamCity
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TeamCity MAS / MAS Build 1.1.0.582-MAS-129_121__112_Dai outcome was FAILURE
Summary: Tests failed: 1, passed: 8; artifacts size 187.2 KB is 95% different from 3.6 MB in build #1.1.0.557-r893BC73 Build time: 00:00:40

Failed tests

api/items.test.js: items should return the found item as json with whitelist of fields: <no details avaliable>

@NICE-TeamCity
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TeamCity MAS / MAS Build 1.1.0.581-MAS-192-DailyEmail outcome was FAILURE
Summary: Tests failed: 2 (2 new), passed: 7; artifacts size 187.2 KB is 95% different from 3.6 MB in build #1.1.0.557-r893BC73 (new) Build time: 00:00:50

Failed tests

api/items.test.js: items should return the found item as json with whitelist of fields: <no details avaliable>

models/Weekly.test.js: Weekly should validate commentary title and body when summary is set: <no details avaliable>

@NICE-TeamCity
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TeamCity MAS / MAS Build 1.1.0.583-MAS-192-DailyEmail outcome was FAILURE
Summary: Tests failed: 1, passed: 8; artifacts size 187.2 KB is 95% different from 3.6 MB in build #1.1.0.557-r893BC73 Build time: 00:00:38

Failed tests

api/items.test.js: items should return the found item as json with whitelist of fields: <no details avaliable>

@NICE-TeamCity
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TeamCity MAS / MAS Build 1.1.0.725 outcome was FAILURE
Summary: Artifacts size 0 B is 100% different from 3.6 MB in build #1.1.0.722+r173814A; exit code 1 (Step: Set build number (Command Line)) (new) Build time: 00:00:11

@NICE-TeamCity
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TeamCity MAS / MAS Build 1.1.0.730 outcome was FAILURE
Summary: Artifacts size 0 B is 100% different from 3.6 MB in build #1.1.0.722+r173814A; exit code 1 (Step: Set build number (Command Line)) Build time: 00:00:10

Please sign in to comment.