Skip to content

Commit

Permalink
Merge pull request #11 from DemocraciaEnRed/1.7.1
Browse files Browse the repository at this point in the history
Ready for 1.7.1
  • Loading branch information
guillecro authored Feb 6, 2020
2 parents b4273c3 + 7529af7 commit 4cdb709
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 16 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# CHANGELOG

### 1.7.1

* Corregido el path de varios iconos que no apuntaban correctamente
* Corregido el error que habia que evitaba que se manden los siguientes correos: Nuevo comentario, Nueva respuesta, Comentario relevante, Comentario destacado, Comentario resuelto.
* Corregido un error visual de como se veia la card del proyecto cuando contenia una imagen en el template de proyecto cerrado.
* Cambiado el numero del telefono de diputados en el footer del email

Compatible con:
* `leyesabiertas-core:1.7.1`
* `leyesabiertas-web:1.7.1`


### 1.5.0

* Se hizo un FIX sobre un ID que provocaba que en algunos casos no se enviarán algunas notificaciones
Expand Down
5 changes: 4 additions & 1 deletion api/controllers/send-email.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const notification = require('../../core/notification-strategies')
exports.post = async (req, res) => {
try {
const { type, comment } = req.body
console.log(req.body)
let commentInfo = await mongo.getDB().collection('comments').aggregate([
{ $match: { _id: ObjectID(comment) } },
{
Expand Down Expand Up @@ -33,6 +34,8 @@ exports.post = async (req, res) => {
}
]).toArray()
// Prepare email props
console.log(commentInfo[0].document.id.toString())

let emailProps = {
author: {
id: commentInfo[0].user[0]._id,
Expand All @@ -41,7 +44,7 @@ exports.post = async (req, res) => {
email: commentInfo[0].user[0].email
},
document: {
id: commentInfo[0].document[0]._id,
id: commentInfo[0].document.toString(),
title: commentInfo[0].version[0].content.title
},
comment: {
Expand Down
30 changes: 25 additions & 5 deletions templates/comment-closed.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ const cardStyle = {
position: 'relative'
}

const cardImgStyle = {
width: '100%'
const noImageStyle = {
width: '100%',
height: '126px',
backgroundColor: '#1b95ba',
overflow: 'hidden'
}

const cardLabelStyle = {
Expand Down Expand Up @@ -60,6 +63,19 @@ const commentIconStyle = {
verticalAlign: 'middle'
}

function getImageStyle(imgUrl) {

return {
width: '100%',
height: '126px',
backgroundColor: '#1b95ba',
backgroundImage: `url(${imgUrl})`,
overflow: 'hidden',
backgroundSize: 'cover',
backgroundPosition: 'center'
}
}

const titleStyle = { fontSize: 24, fontWeight: 'bold', lineHeight: 'normal' }

const CommentClosed = (props) => {
Expand All @@ -69,14 +85,18 @@ const CommentClosed = (props) => {
<Content showName={false} style={{ width: '100%' }}>
<Item style={Style.itemStyle}>
<Span {...Style.defaultContentStyle}>
Finalizó el periodo para realizar aportes en el proyecto <b>{props.document.title}</b> en la que participó. Ingrese en <A href={ORGANIZATION_URL}>{ORGANIZATION_NAME}</A> para ver la versión final y los resultados del proceso de co-creación de normas.
Finalizó el periodo para realizar aportes en el proyecto <b>{props.document.title}</b> en la que participó. Ingrese en <A href={ORGANIZATION_URL}>{ORGANIZATION_NAME}</A> para ver la versión final y los resultados del proceso de co-creación de normas.
</Span>
</Item>
<Item style={Style.itemStyle}>
<A href={`${ORGANIZATION_URL}/propuesta?id=${props.document.id}`} textDecoration='none'>
<Box align='center' style={cardStyle}>
<Item>
<Image src={props.document.imageCover} style={cardImgStyle} />
{
props.document.imageCover ?
<Box style={getImageStyle(props.document.imageCover)} /> :
<Box style={noImageStyle} />
}
<Box style={cardLabelStyle}>
<Item>
<Span style={titleStyle}>{props.document.title}</Span>
Expand All @@ -91,7 +111,7 @@ const CommentClosed = (props) => {
</Item>
<Item style={commentsContainerStyle}>
<Span style={commentsLabelStyle}>
<Image src={`${ORGANIZATION_URL}/static/assets/emails/comment.png`} style={commentIconStyle} />
<Image src={`${ORGANIZATION_URL}/static/assets/email/comment-icon.png`} style={commentIconStyle} />
<b>{props.document.commentsCount}</b> COMENTARIOS
</Span>
</Item>
Expand Down
4 changes: 2 additions & 2 deletions templates/comment-contribution.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ const CommentContribution = (props) => {
</Item>
<Item style={Style.itemStyle}>
<Span {...Style.defaultContentStyle}>
Este fue tu comentario:
Este fue comentario:
</Span>
</Item>
<Item style={Style.itemStyle}>
<A href={`${ORGANIZATION_URL}/propuesta?id=${props.document.id}`} textDecoration='none'>
<Box align='center' style={CommentContainerStyle.cardStyle}>
<Item>
<div style={CommentContainerStyle.leftColumn} >
<Image src={`${ORGANIZATION_URL}/static/assets/emails/star.png`} style={CommentContainerStyle.cardIconImg} />
<Image src={`${ORGANIZATION_URL}/static/assets/email/star.png`} style={CommentContainerStyle.cardIconImg} />
</div>
<div style={CommentContainerStyle.cardContentStyle}>
<div style={CommentContainerStyle.userContainerStyle}>
Expand Down
4 changes: 2 additions & 2 deletions templates/comment-liked.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ const CommentLiked = (props) => {
</Item>
<Item style={Style.itemStyle}>
<Span {...Style.defaultContentStyle}>
Este fue tu comentario:
Este fue comentario:
</Span>
</Item>
<Item style={Style.itemStyle}>
<A href={`${ORGANIZATION_URL}/propuesta?id=${props.document.id}`} textDecoration='none'>
<Box align='center' style={CommentContainerStyle.cardStyle}>
<Item>
<div style={CommentContainerStyle.leftColumn} >
<Image src={`${ORGANIZATION_URL}/static/assets/emails/like.png`} style={CommentContainerStyle.cardIconImg} />
<Image src={`${ORGANIZATION_URL}/static/assets/email/like.png`} style={CommentContainerStyle.cardIconImg} />
</div>
<div style={CommentContainerStyle.cardContentStyle}>
<div style={CommentContainerStyle.userContainerStyle}>
Expand Down
4 changes: 2 additions & 2 deletions templates/comment-new.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const CommentRead = (props) => {
<Content name={props.author.name} style={{ width: '100%' }}>
<Item style={Style.itemStyle}>
<Span {...Style.defaultContentStyle}>
Hay un nuevo comentario en el proyecto <b>{props.document.title}</b> en <A href={`${ORGANIZATION_URL}/propuesta?id=${props.document.id.toString()}`}>{ORGANIZATION_NAME}</A>
Hay un nuevo comentario en el proyecto <b>{props.document.title}</b> en <A href={`${ORGANIZATION_URL}/propuesta?id=${props.document.id}`}>{ORGANIZATION_NAME}</A>
</Span>
</Item>
<Item style={Style.itemStyle}>
Expand All @@ -27,7 +27,7 @@ const CommentRead = (props) => {
<Box align='center' style={CommentContainerStyle.cardStyle}>
<Item>
<div style={CommentContainerStyle.leftColumn} >
<Image src={`${ORGANIZATION_URL}/static/assets/emails/check.png`} style={CommentContainerStyle.cardIconImg} />
<Image src={`${ORGANIZATION_URL}/static/assets/email/comment-icon.png`} style={CommentContainerStyle.cardIconImg} />
</div>
<div style={CommentContainerStyle.cardContentStyle}>
<div style={CommentContainerStyle.userContainerStyle}>
Expand Down
2 changes: 1 addition & 1 deletion templates/comment-replied.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const CommentRead = (props) => {
<Box align='center' style={CommentContainerStyle.cardStyle}>
<Item>
<div style={CommentContainerStyle.leftColumn} >
<Image src={`${ORGANIZATION_URL}/static/assets/emails/check.png`} style={CommentContainerStyle.cardIconImg} />
<Image src={`${ORGANIZATION_URL}/static/assets/email/comment-icon.png`} style={CommentContainerStyle.cardIconImg} />
</div>
<div style={CommentContainerStyle.cardContentStyle}>
<div style={CommentContainerStyle.userContainerStyle}>
Expand Down
4 changes: 2 additions & 2 deletions templates/comment-resolved.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ const CommentRead = (props) => {
</Item>
<Item style={Style.itemStyle}>
<Span {...Style.defaultContentStyle}>
Este fue tu comentario:
Este fue comentario:
</Span>
</Item>
<Item style={Style.itemStyle}>
<A href={`${ORGANIZATION_URL}/propuesta?id=${props.document.id}`} textDecoration='none'>
<Box align='center' style={CommentContainerStyle.cardStyle}>
<Item>
<div style={CommentContainerStyle.leftColumn} >
<Image src={`${ORGANIZATION_URL}/static/assets/emails/check.png`} style={CommentContainerStyle.cardIconImg} />
<Image src={`${ORGANIZATION_URL}/static/assets/email/check.png`} style={CommentContainerStyle.cardIconImg} />
</div>
<div style={CommentContainerStyle.cardContentStyle}>
<div style={CommentContainerStyle.userContainerStyle}>
Expand Down
2 changes: 1 addition & 1 deletion templates/footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const MailFooter = (props) => {
</Item>
<Item align='center'>
<Span {...Styles.textStyle}>
<b>Honorable Cámara de Diputados de la Nación Argentina</b> | Congreso de la Nación Argentina | Av. Rivadavia 1864 - Ciudad Autónoma de Bs. As. (C.P.C1033AAV) | (54-11) 4127-7100
<b>Honorable Cámara de Diputados de la Nación Argentina</b> | Congreso de la Nación Argentina | Av. Rivadavia 1864 - Ciudad Autónoma de Bs. As. (C.P.C1033AAV) | (+5411) 6075-7100
</Span>
</Item>
</Box>
Expand Down

0 comments on commit 4cdb709

Please sign in to comment.